Skip to content

Commit

Permalink
chore: fix permission boundary (#454)
Browse files Browse the repository at this point in the history
* chore: fix permission

* fix: lint

* chore: lint
  • Loading branch information
stanleyyconsensys authored Dec 6, 2024
1 parent bc1b207 commit 46770ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/starknet-snap/src/utils/permission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export enum RpcMethod {
GetAddressByStarkName = 'starkNet_getAddrFromStarkName',
ReadContract = 'starkNet_getValue',
GetStoredErc20Tokens = 'starkNet_getStoredErc20Tokens',
Ping = 'ping',
}
// RpcMethod that are allowed to be called by any origin
const publicPermissions = [
Expand All @@ -51,6 +52,7 @@ const publicPermissions = [
RpcMethod.GetTransactionStatus,
RpcMethod.EstimateFee,
RpcMethod.VerifySignedMessage,
RpcMethod.Ping,
];
// RpcMethod that are restricted to be called by wallet UI origins
const walletUIDappPermissions = publicPermissions.concat([
Expand All @@ -59,6 +61,7 @@ const walletUIDappPermissions = publicPermissions.concat([
RpcMethod.GetTransactions,
RpcMethod.UpgradeAccContract,
RpcMethod.GetStarkName,
RpcMethod.GetAddressByStarkName,
RpcMethod.ReadContract,
RpcMethod.GetStoredErc20Tokens,
]);
Expand Down

0 comments on commit 46770ee

Please sign in to comment.