Skip to content

Commit

Permalink
Merge pull request #229 from tabaktoni/wallet-spec-update
Browse files Browse the repository at this point in the history
fix: spec update
  • Loading branch information
naorye2 authored Apr 25, 2024
2 parents d682201 + 34691f4 commit 48d0158
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"test": "vitest"
},
"dependencies": {
"starknet-types": "^0.0.4"
"starknet-types": "^0.7.1"
},
"devDependencies": {
"c8": "^7.12.0",
Expand Down
10 changes: 4 additions & 6 deletions packages/core/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ export type {
StarknetWindowObject,
AddDeclareTransactionParameters,
AddDeclareTransactionResult,
AddDeployAccountTransactionParameters,
AddDeployAccountTransactionResult,
AddInvokeTransactionParameters,
AddInvokeTransactionResult,
AddStarknetChainParameters,
RequestAccountsParameters,
SwitchStarknetChainParameters,
GetDeploymentDataResult,
AccountDeploymentData,
WatchAssetParameters,
TypedData,
RequestFn,
Expand All @@ -33,7 +31,7 @@ export type {
WalletEvents,
} from "starknet-types"

export { StarknetChainId, Permission } from "starknet-types"
export { Permission } from "starknet-types"

export { scanObjectForWallets } from "./wallet/scan"
export { isWalletObj } from "./wallet/isWalletObject"
Expand Down Expand Up @@ -118,12 +116,12 @@ export function getStarknet(
await wallet.request({
type: "wallet_requestAccounts",
params: {
silentMode: options?.silentMode,
silent_mode: options?.silent_mode,
},
})

// check for permissions
const permissions = await wallet.request({
const permissions: Permission[] = await wallet.request({
type: "wallet_getPermissions",
})
if (!permissions?.includes(Permission.Accounts)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/wallet/filter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const filterByAuthorized = async (
wallets.map((w) =>
w
.request({ type: "wallet_getPermissions" })
.then((result) => result.includes(Permission.Accounts))
.then((result: Permission[]) => result.includes(Permission.Accounts))
.catch(() => false),
),
)
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 48d0158

Please sign in to comment.