From d35fcc176ef5c5574c32e646087eaa7a92df9207 Mon Sep 17 00:00:00 2001 From: Paul Myburgh Date: Mon, 15 Aug 2022 13:05:11 +0200 Subject: [PATCH] [meteor] update to new version of SDK. clean up module and add async sign-out. --- package.json | 2 +- .../meteor-wallet/src/lib/meteor-wallet.ts | 2 +- .../meteor-wallet/src/lib/utils/basic_utils.ts | 18 ------------------ yarn.lock | 9 ++++----- 4 files changed, 6 insertions(+), 25 deletions(-) delete mode 100644 packages/meteor-wallet/src/lib/utils/basic_utils.ts diff --git a/package.json b/package.json index 6a6fae772..ade4be279 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@jscutlery/semver": "^2.25.2", "@ledgerhq/hw-transport": "^6.27.1", "@ledgerhq/hw-transport-webhid": "^6.27.1", - "@meteorwallet/sdk": "^0.0.9", + "@meteorwallet/sdk": "0.3.0", "@nightlylabs/connect": "0.0.23", "@walletconnect/qrcode-modal": "2.0.0-alpha.20", "@walletconnect/sign-client": "^2.0.0-beta.102", diff --git a/packages/meteor-wallet/src/lib/meteor-wallet.ts b/packages/meteor-wallet/src/lib/meteor-wallet.ts index c01f57f24..2af0daca5 100644 --- a/packages/meteor-wallet/src/lib/meteor-wallet.ts +++ b/packages/meteor-wallet/src/lib/meteor-wallet.ts @@ -137,7 +137,7 @@ const createMeteorWalletInjected: WalletBehaviourFactory< async signOut() { if (_state.wallet.isSignedIn()) { - _state.wallet.signOut(); + await _state.wallet.signOut(); } cleanup(); diff --git a/packages/meteor-wallet/src/lib/utils/basic_utils.ts b/packages/meteor-wallet/src/lib/utils/basic_utils.ts deleted file mode 100644 index c10daafb7..000000000 --- a/packages/meteor-wallet/src/lib/utils/basic_utils.ts +++ /dev/null @@ -1,18 +0,0 @@ -const isArrayLike = (item: unknown | null | undefined): item is Array => { - return ( - Array.isArray(item) || - (!!item && - typeof item === "object" && - "length" in item && - typeof (item as Array).length === "number" && - ((item as Array).length === 0 || - ((item as Array).length > 0 && - (item as Array).length - 1 in item))) - ); -}; - -export const notNullEmptyArray = ( - array: Array | undefined | null -): array is Array => { - return array != null && isArrayLike(array) && array.length > 0; -}; diff --git a/yarn.lock b/yarn.lock index d36b09bb0..7f15cddf6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2295,12 +2295,11 @@ resolved "https://registry.yarnpkg.com/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz#b2ac626d6cb9c8718ab459166d4bb405b8ffa78b" integrity sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A== -"@meteorwallet/sdk@^0.0.9": - version "0.0.9" - resolved "https://registry.yarnpkg.com/@meteorwallet/sdk/-/sdk-0.0.9.tgz#731ce3a000e27d8722c6b661b17c002395209292" - integrity sha512-1pfTNWfZl7iiOyEvOAFY4kxZ4SWQx1FgLpk7CiIv5yVks23aPoCYMDvz0rf2ox26vyiIV4MlwSNdj+Qh/CeU6Q== +"@meteorwallet/sdk@0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@meteorwallet/sdk/-/sdk-0.3.0.tgz#d8f17d780c646caa3b96d08142705160dcaa29b2" + integrity sha512-eoMcLItP7pabA7E5tNY265fypQAwcjn/Ev6l/8Ag3hyJ5L8rkS5A+WPCVnWZCaE5HmXZyuiXhp5HTtjlR8u8mg== dependencies: - borsh "^0.7.0" is-mobile "^3.1.1" near-api-js "^0.44.2"