@wagmi/connectors 5.0.2 → 5.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/dist/esm/coinbaseWallet.js.map +1 -1
- package/dist/esm/safe.js +6 -2
- package/dist/esm/safe.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/coinbaseWallet.d.ts +2 -3
- package/dist/types/coinbaseWallet.d.ts.map +1 -1
- package/dist/types/safe.d.ts +7 -0
- package/dist/types/safe.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/coinbaseWallet.ts +6 -3
- package/src/safe.ts +13 -2
- package/src/version.ts +1 -1
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '5.0.
|
|
1
|
+
export const version = '5.0.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CoinbaseWalletSDK, ProviderInterface } from '@coinbase/wallet-sdk';
|
|
1
|
+
import type { CoinbaseWalletSDK, Preference, ProviderInterface } from '@coinbase/wallet-sdk';
|
|
2
2
|
import type { Evaluate, Mutable, Omit } from '@wagmi/core/internal';
|
|
3
3
|
import type { CoinbaseWalletProvider as CBW_Provider, CoinbaseWalletSDK as CBW_SDK } from 'cbw-sdk';
|
|
4
4
|
type Version = '3' | '4';
|
|
@@ -27,8 +27,7 @@ type Version4Parameters = Mutable<Omit<ConstructorParameters<typeof CoinbaseWall
|
|
|
27
27
|
* Preference for the type of wallet to display.
|
|
28
28
|
* @default 'all'
|
|
29
29
|
*/
|
|
30
|
-
preference?: '
|
|
31
|
-
keysUrl?: string | undefined;
|
|
30
|
+
preference?: Preference['options'] | undefined;
|
|
32
31
|
}>;
|
|
33
32
|
declare function version4(parameters: Version4Parameters): import("@wagmi/core").CreateConnectorFn<ProviderInterface & {
|
|
34
33
|
close?(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinbaseWallet.d.ts","sourceRoot":"","sources":["../../src/coinbaseWallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"coinbaseWallet.d.ts","sourceRoot":"","sources":["../../src/coinbaseWallet.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,UAAU,EACV,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAM7B,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACnE,OAAO,KAAK,EACV,sBAAsB,IAAI,YAAY,EACtC,iBAAiB,IAAI,OAAO,EAC7B,MAAM,SAAS,CAAA;AAUhB,KAAK,OAAO,GAAG,GAAG,GAAG,GAAG,CAAA;AAExB,MAAM,MAAM,wBAAwB,CAAC,OAAO,SAAS,OAAO,GAAG,GAAG,IAChE,OAAO,SAAS,GAAG,GACf,QAAQ,CACN;IACE,YAAY,CAAC,EAAE,KAAK,GAAG,SAAS,CAAA;IAChC,kCAAkC;IAClC,OAAO,CAAC,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAAA;CACpC,GAAG,kBAAkB,CACvB,GACD,QAAQ,CACN;IACE;;OAEG;IACH,YAAY,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC/B;;;;OAIG;IACH,OAAO,CAAC,EAAE,OAAO,GAAG,GAAG,GAAG,SAAS,CAAA;CACpC,GAAG,kBAAkB,CACvB,CAAA;AAGP,wBAAgB,cAAc,CAAC,OAAO,SAAS,OAAO,EACpD,UAAU,GAAE,wBAAwB,CAAC,OAAO,CAAa,GACxD,OAAO,SAAS,GAAG,GAClB,UAAU,CAAC,OAAO,QAAQ,CAAC,GAC3B,UAAU,CAAC,OAAO,QAAQ,CAAC,CAI9B;yBARe,cAAc;;;AAU9B,KAAK,kBAAkB,GAAG,OAAO,CAC/B,IAAI,CACF,qBAAqB,CAAC,OAAO,iBAAiB,CAAC,CAAC,CAAC,CAAC,EAClD,aAAa,CACd,GAAG;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,GAAG,SAAS,CAAA;CAC/C,CACF,CAAA;AAED,iBAAS,QAAQ,CAAC,UAAU,EAAE,kBAAkB;cAGlC,IAAI;WAmNjB;AAED,KAAK,kBAAkB,GAAG,OAAO,CAC/B,IAAI,CACF,qBAAqB,CAAC,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC,EACxC,oBAAoB,CACrB,CACF,GAAG;IACF;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC/B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CACzC,CAAA;AAED,iBAAS,QAAQ,CAAC,UAAU,EAAE,kBAAkB,iEAuN/C"}
|
package/dist/types/safe.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export type SafeParameters = Evaluate<Opts & {
|
|
|
11
11
|
* @default false
|
|
12
12
|
*/
|
|
13
13
|
shimDisconnect?: boolean | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* Timeout in milliseconds for `getInfo` (from the Safe SDK) to resolve.
|
|
16
|
+
*
|
|
17
|
+
* `getInfo` does not resolve when not used in Safe App iFrame. This allows the connector to force a timeout.
|
|
18
|
+
* @default 10
|
|
19
|
+
*/
|
|
20
|
+
unstable_getInfoTimeout?: number | undefined;
|
|
14
21
|
}>;
|
|
15
22
|
export declare function safe(parameters?: SafeParameters): import("@wagmi/core").CreateConnectorFn<SafeAppProvider | undefined, {}, {
|
|
16
23
|
'safe.disconnected': true;
|
package/dist/types/safe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAMtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAGpD,MAAM,MAAM,cAAc,GAAG,QAAQ,CACnC,IAAI,GAAG;IACL;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["../../src/safe.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAA;AACtE,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAA;AAMtD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAGpD,MAAM,MAAM,cAAc,GAAG,QAAQ,CACnC,IAAI,GAAG;IACL;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;IACpC;;;;;OAKG;IACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;CAC7C,CACF,CAAA;AAGD,wBAAgB,IAAI,CAAC,UAAU,GAAE,cAAmB;yBAKR,IAAI;GA4G/C;yBAjHe,IAAI"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "5.0.
|
|
1
|
+
export declare const version = "5.0.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wagmi/connectors",
|
|
3
3
|
"description": "Collection of connectors for Wagmi",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.4",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"typescript": ">=5.0.4",
|
|
32
32
|
"viem": "2.x",
|
|
33
|
-
"@wagmi/core": "2.10.
|
|
33
|
+
"@wagmi/core": "2.10.3"
|
|
34
34
|
},
|
|
35
35
|
"peerDependenciesMeta": {
|
|
36
36
|
"typescript": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@coinbase/wallet-sdk": "4.0.
|
|
41
|
+
"@coinbase/wallet-sdk": "4.0.2",
|
|
42
42
|
"@metamask/sdk": "0.20.3",
|
|
43
43
|
"@safe-global/safe-apps-provider": "0.18.1",
|
|
44
44
|
"@safe-global/safe-apps-sdk": "8.1.0",
|
package/src/coinbaseWallet.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
CoinbaseWalletSDK,
|
|
3
|
+
Preference,
|
|
4
|
+
ProviderInterface,
|
|
5
|
+
} from '@coinbase/wallet-sdk'
|
|
2
6
|
import {
|
|
3
7
|
ChainNotConfiguredError,
|
|
4
8
|
type Connector,
|
|
@@ -64,8 +68,7 @@ type Version4Parameters = Mutable<
|
|
|
64
68
|
* Preference for the type of wallet to display.
|
|
65
69
|
* @default 'all'
|
|
66
70
|
*/
|
|
67
|
-
preference?: '
|
|
68
|
-
keysUrl?: string | undefined
|
|
71
|
+
preference?: Preference['options'] | undefined
|
|
69
72
|
}
|
|
70
73
|
>
|
|
71
74
|
|
package/src/safe.ts
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createConnector,
|
|
7
7
|
} from '@wagmi/core'
|
|
8
8
|
import type { Evaluate } from '@wagmi/core/internal'
|
|
9
|
-
import { getAddress } from 'viem'
|
|
9
|
+
import { getAddress, withTimeout } from 'viem'
|
|
10
10
|
|
|
11
11
|
export type SafeParameters = Evaluate<
|
|
12
12
|
Opts & {
|
|
@@ -19,6 +19,13 @@ export type SafeParameters = Evaluate<
|
|
|
19
19
|
* @default false
|
|
20
20
|
*/
|
|
21
21
|
shimDisconnect?: boolean | undefined
|
|
22
|
+
/**
|
|
23
|
+
* Timeout in milliseconds for `getInfo` (from the Safe SDK) to resolve.
|
|
24
|
+
*
|
|
25
|
+
* `getInfo` does not resolve when not used in Safe App iFrame. This allows the connector to force a timeout.
|
|
26
|
+
* @default 10
|
|
27
|
+
*/
|
|
28
|
+
unstable_getInfoTimeout?: number | undefined
|
|
22
29
|
}
|
|
23
30
|
>
|
|
24
31
|
|
|
@@ -94,7 +101,11 @@ export function safe(parameters: SafeParameters = {}) {
|
|
|
94
101
|
else SDK = SafeAppsSDK as unknown as typeof SafeAppsSDK.default
|
|
95
102
|
const sdk = new SDK(parameters)
|
|
96
103
|
|
|
97
|
-
|
|
104
|
+
// `getInfo` hangs when not used in Safe App iFrame
|
|
105
|
+
// https://github.com/safe-global/safe-apps-sdk/issues/263#issuecomment-1029835840
|
|
106
|
+
const safe = await withTimeout(() => sdk.safe.getInfo(), {
|
|
107
|
+
timeout: parameters.unstable_getInfoTimeout ?? 10,
|
|
108
|
+
})
|
|
98
109
|
if (!safe) throw new Error('Could not load Safe information')
|
|
99
110
|
const { SafeAppProvider } = await import(
|
|
100
111
|
'@safe-global/safe-apps-provider'
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.0.
|
|
1
|
+
export const version = '5.0.4'
|