From 46770eebef4e88e3a4280c67ac5fea1be7d0f4d3 Mon Sep 17 00:00:00 2001 From: Stanley Yuen <102275989+stanleyyconsensys@users.noreply.github.com> Date: Fri, 6 Dec 2024 21:13:19 +0800 Subject: [PATCH] chore: fix permission boundary (#454) * chore: fix permission * fix: lint * chore: lint --- packages/starknet-snap/src/utils/permission.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/starknet-snap/src/utils/permission.ts b/packages/starknet-snap/src/utils/permission.ts index 0a264b1c..79277a60 100644 --- a/packages/starknet-snap/src/utils/permission.ts +++ b/packages/starknet-snap/src/utils/permission.ts @@ -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 = [ @@ -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([ @@ -59,6 +61,7 @@ const walletUIDappPermissions = publicPermissions.concat([ RpcMethod.GetTransactions, RpcMethod.UpgradeAccContract, RpcMethod.GetStarkName, + RpcMethod.GetAddressByStarkName, RpcMethod.ReadContract, RpcMethod.GetStoredErc20Tokens, ]);