@0xsequence/provider 1.1.12 → 1.1.14

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.
@@ -69,6 +69,8 @@ let InitState = /*#__PURE__*/function (InitState) {
69
69
  * you can use the camel case version of the name in the wallet settings.
70
70
  * For example: "Blue Dark" on wallet UI can be passed as "blueDark" */
71
71
 
72
+ // | 'large'
73
+
72
74
  class ProviderError extends Error {
73
75
  constructor(message) {
74
76
  super(message);
@@ -3509,6 +3511,54 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
3509
3511
  }
3510
3512
  }
3511
3513
 
3514
+ var packageJson = {
3515
+ name: "@0xsequence/provider",
3516
+ version: "1.1.14",
3517
+ description: "provider sub-package for Sequence",
3518
+ repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
3519
+ source: "src/index.ts",
3520
+ main: "dist/0xsequence-provider.cjs.js",
3521
+ module: "dist/0xsequence-provider.esm.js",
3522
+ author: "Horizon Blockchain Games",
3523
+ license: "Apache-2.0",
3524
+ scripts: {
3525
+ test: "pnpm test:concurrently 'pnpm test:run'",
3526
+ "test:run": "pnpm test:file tests/**/*.spec.ts",
3527
+ "test:file": "NODE_OPTIONS='--loader tsx' mocha --timeout 30000",
3528
+ typecheck: "tsc --noEmit",
3529
+ "test:concurrently": "concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'",
3530
+ "start:hardhat1": "pnpm start:hardhat1:verbose > /dev/null 2>&1",
3531
+ "start:hardhat2": "pnpm start:hardhat2:verbose > /dev/null 2>&1",
3532
+ "start:hardhat1:verbose": "hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595",
3533
+ "start:hardhat2:verbose": "hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"
3534
+ },
3535
+ dependencies: {
3536
+ "@0xsequence/abi": "workspace:*",
3537
+ "@0xsequence/account": "workspace:*",
3538
+ "@0xsequence/auth": "workspace:*",
3539
+ "@0xsequence/core": "workspace:*",
3540
+ "@0xsequence/migration": "workspace:*",
3541
+ "@0xsequence/network": "workspace:*",
3542
+ "@0xsequence/relayer": "workspace:*",
3543
+ "@0xsequence/utils": "workspace:*",
3544
+ "@0xsequence/wallet": "workspace:*",
3545
+ eventemitter2: "^6.4.5",
3546
+ "webextension-polyfill": "^0.10.0"
3547
+ },
3548
+ peerDependencies: {
3549
+ ethers: ">=5.5 < 6"
3550
+ },
3551
+ devDependencies: {
3552
+ "@types/webextension-polyfill": "^0.10.0",
3553
+ hardhat: "^2.12.2",
3554
+ ethers: "^5.7.2"
3555
+ },
3556
+ files: [
3557
+ "src",
3558
+ "dist"
3559
+ ]
3560
+ };
3561
+
3512
3562
  /**
3513
3563
  * This session class is meant to persist the state of the wallet connection
3514
3564
  * whitin the dapp. This enables the client to retain the wallet address (and some more)
@@ -3746,7 +3796,8 @@ class SequenceClient {
3746
3796
  await this.openWallet(undefined, {
3747
3797
  type: 'connect',
3748
3798
  options: _extends({}, options, {
3749
- networkId: this.getChainId()
3799
+ networkId: this.getChainId(),
3800
+ clientVersion: packageJson.version
3750
3801
  })
3751
3802
  });
3752
3803
  const connectDetails = await this.transport.waitUntilConnected().catch(error => {
@@ -69,6 +69,8 @@ let InitState = /*#__PURE__*/function (InitState) {
69
69
  * you can use the camel case version of the name in the wallet settings.
70
70
  * For example: "Blue Dark" on wallet UI can be passed as "blueDark" */
71
71
 
72
+ // | 'large'
73
+
72
74
  class ProviderError extends Error {
73
75
  constructor(message) {
74
76
  super(message);
@@ -3509,6 +3511,54 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
3509
3511
  }
3510
3512
  }
3511
3513
 
3514
+ var packageJson = {
3515
+ name: "@0xsequence/provider",
3516
+ version: "1.1.14",
3517
+ description: "provider sub-package for Sequence",
3518
+ repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
3519
+ source: "src/index.ts",
3520
+ main: "dist/0xsequence-provider.cjs.js",
3521
+ module: "dist/0xsequence-provider.esm.js",
3522
+ author: "Horizon Blockchain Games",
3523
+ license: "Apache-2.0",
3524
+ scripts: {
3525
+ test: "pnpm test:concurrently 'pnpm test:run'",
3526
+ "test:run": "pnpm test:file tests/**/*.spec.ts",
3527
+ "test:file": "NODE_OPTIONS='--loader tsx' mocha --timeout 30000",
3528
+ typecheck: "tsc --noEmit",
3529
+ "test:concurrently": "concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'",
3530
+ "start:hardhat1": "pnpm start:hardhat1:verbose > /dev/null 2>&1",
3531
+ "start:hardhat2": "pnpm start:hardhat2:verbose > /dev/null 2>&1",
3532
+ "start:hardhat1:verbose": "hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595",
3533
+ "start:hardhat2:verbose": "hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"
3534
+ },
3535
+ dependencies: {
3536
+ "@0xsequence/abi": "workspace:*",
3537
+ "@0xsequence/account": "workspace:*",
3538
+ "@0xsequence/auth": "workspace:*",
3539
+ "@0xsequence/core": "workspace:*",
3540
+ "@0xsequence/migration": "workspace:*",
3541
+ "@0xsequence/network": "workspace:*",
3542
+ "@0xsequence/relayer": "workspace:*",
3543
+ "@0xsequence/utils": "workspace:*",
3544
+ "@0xsequence/wallet": "workspace:*",
3545
+ eventemitter2: "^6.4.5",
3546
+ "webextension-polyfill": "^0.10.0"
3547
+ },
3548
+ peerDependencies: {
3549
+ ethers: ">=5.5 < 6"
3550
+ },
3551
+ devDependencies: {
3552
+ "@types/webextension-polyfill": "^0.10.0",
3553
+ hardhat: "^2.12.2",
3554
+ ethers: "^5.7.2"
3555
+ },
3556
+ files: [
3557
+ "src",
3558
+ "dist"
3559
+ ]
3560
+ };
3561
+
3512
3562
  /**
3513
3563
  * This session class is meant to persist the state of the wallet connection
3514
3564
  * whitin the dapp. This enables the client to retain the wallet address (and some more)
@@ -3746,7 +3796,8 @@ class SequenceClient {
3746
3796
  await this.openWallet(undefined, {
3747
3797
  type: 'connect',
3748
3798
  options: _extends({}, options, {
3749
- networkId: this.getChainId()
3799
+ networkId: this.getChainId(),
3800
+ clientVersion: packageJson.version
3750
3801
  })
3751
3802
  });
3752
3803
  const connectDetails = await this.transport.waitUntilConnected().catch(error => {
@@ -65,6 +65,8 @@ let InitState = /*#__PURE__*/function (InitState) {
65
65
  * you can use the camel case version of the name in the wallet settings.
66
66
  * For example: "Blue Dark" on wallet UI can be passed as "blueDark" */
67
67
 
68
+ // | 'large'
69
+
68
70
  class ProviderError extends Error {
69
71
  constructor(message) {
70
72
  super(message);
@@ -3505,6 +3507,54 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
3505
3507
  }
3506
3508
  }
3507
3509
 
3510
+ var packageJson = {
3511
+ name: "@0xsequence/provider",
3512
+ version: "1.1.14",
3513
+ description: "provider sub-package for Sequence",
3514
+ repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
3515
+ source: "src/index.ts",
3516
+ main: "dist/0xsequence-provider.cjs.js",
3517
+ module: "dist/0xsequence-provider.esm.js",
3518
+ author: "Horizon Blockchain Games",
3519
+ license: "Apache-2.0",
3520
+ scripts: {
3521
+ test: "pnpm test:concurrently 'pnpm test:run'",
3522
+ "test:run": "pnpm test:file tests/**/*.spec.ts",
3523
+ "test:file": "NODE_OPTIONS='--loader tsx' mocha --timeout 30000",
3524
+ typecheck: "tsc --noEmit",
3525
+ "test:concurrently": "concurrently -k --success first 'pnpm start:hardhat1' 'pnpm start:hardhat2'",
3526
+ "start:hardhat1": "pnpm start:hardhat1:verbose > /dev/null 2>&1",
3527
+ "start:hardhat2": "pnpm start:hardhat2:verbose > /dev/null 2>&1",
3528
+ "start:hardhat1:verbose": "hardhat node --config hardhat1.config.js --hostname 0.0.0.0 --port 9595",
3529
+ "start:hardhat2:verbose": "hardhat node --config hardhat2.config.js --hostname 0.0.0.0 --port 8595"
3530
+ },
3531
+ dependencies: {
3532
+ "@0xsequence/abi": "workspace:*",
3533
+ "@0xsequence/account": "workspace:*",
3534
+ "@0xsequence/auth": "workspace:*",
3535
+ "@0xsequence/core": "workspace:*",
3536
+ "@0xsequence/migration": "workspace:*",
3537
+ "@0xsequence/network": "workspace:*",
3538
+ "@0xsequence/relayer": "workspace:*",
3539
+ "@0xsequence/utils": "workspace:*",
3540
+ "@0xsequence/wallet": "workspace:*",
3541
+ eventemitter2: "^6.4.5",
3542
+ "webextension-polyfill": "^0.10.0"
3543
+ },
3544
+ peerDependencies: {
3545
+ ethers: ">=5.5 < 6"
3546
+ },
3547
+ devDependencies: {
3548
+ "@types/webextension-polyfill": "^0.10.0",
3549
+ hardhat: "^2.12.2",
3550
+ ethers: "^5.7.2"
3551
+ },
3552
+ files: [
3553
+ "src",
3554
+ "dist"
3555
+ ]
3556
+ };
3557
+
3508
3558
  /**
3509
3559
  * This session class is meant to persist the state of the wallet connection
3510
3560
  * whitin the dapp. This enables the client to retain the wallet address (and some more)
@@ -3742,7 +3792,8 @@ class SequenceClient {
3742
3792
  await this.openWallet(undefined, {
3743
3793
  type: 'connect',
3744
3794
  options: _extends({}, options, {
3745
- networkId: this.getChainId()
3795
+ networkId: this.getChainId(),
3796
+ clientVersion: packageJson.version
3746
3797
  })
3747
3798
  });
3748
3799
  const connectDetails = await this.transport.waitUntilConnected().catch(error => {
@@ -111,7 +111,7 @@ export interface ConnectOptions {
111
111
  /** origin hint of the dapp's host opening the wallet. This value will automatically
112
112
  * be determined and verified for integrity, and can be omitted. */
113
113
  origin?: string;
114
- /** expiry number (in seconds) to expire connect session. default is 1 week of seconds. */
114
+ /** expiry number (in seconds) that is used for ETHAuth proof. Default is 1 week in seconds. */
115
115
  expiry?: number;
116
116
  /** authorize will perform an ETHAuth eip712 signing and return the proof to the dapp. */
117
117
  authorize?: boolean;
@@ -124,6 +124,8 @@ export interface ConnectOptions {
124
124
  /** keepWalletOpened will keep the wallet window opened after connecting. The default
125
125
  * is to automatically close the wallet after connecting. */
126
126
  keepWalletOpened?: boolean;
127
+ /** clientVersion is the sequence.js version of the dapp client. */
128
+ clientVersion?: string;
127
129
  /** Options to further customize the wallet experience. */
128
130
  settings?: Settings;
129
131
  }
@@ -144,7 +146,7 @@ export interface Settings {
144
146
  /** Specify a banner image. This image, if provided, will be displayed on the wallet during
145
147
  * the connect/authorize process */
146
148
  bannerUrl?: string;
147
- bannerSize?: 'small' | 'medium' | 'large';
149
+ bannerSize?: BannerSize;
148
150
  /** Specify payment providers to use. If not specified,
149
151
  * all available payment providers will be enabled.
150
152
  * Note that this setting will not be persisted, use wallet.open with 'openWithOptions' intent
@@ -190,6 +192,7 @@ export type ThemeOption = 'light' | 'dark' | string;
190
192
  export type PaymentProviderOption = 'moonpay' | 'wyre' | 'ramp';
191
193
  export type CurrencyOption = 'usdc' | 'eth' | 'matic';
192
194
  export type SignInOption = 'email' | 'google' | 'apple' | 'facebook' | 'discord' | 'twitch';
195
+ export type BannerSize = 'small' | 'medium';
193
196
  export interface ConnectDetails {
194
197
  chainId?: string;
195
198
  error?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/provider",
3
- "version": "1.1.12",
3
+ "version": "1.1.14",
4
4
  "description": "provider sub-package for Sequence",
5
5
  "repository": "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
6
6
  "source": "src/index.ts",
@@ -11,15 +11,15 @@
11
11
  "dependencies": {
12
12
  "eventemitter2": "^6.4.5",
13
13
  "webextension-polyfill": "^0.10.0",
14
- "@0xsequence/abi": "1.1.12",
15
- "@0xsequence/account": "1.1.12",
16
- "@0xsequence/auth": "1.1.12",
17
- "@0xsequence/core": "1.1.12",
18
- "@0xsequence/migration": "1.1.12",
19
- "@0xsequence/network": "1.1.12",
20
- "@0xsequence/relayer": "1.1.12",
21
- "@0xsequence/utils": "1.1.12",
22
- "@0xsequence/wallet": "1.1.12"
14
+ "@0xsequence/abi": "1.1.14",
15
+ "@0xsequence/auth": "1.1.14",
16
+ "@0xsequence/account": "1.1.14",
17
+ "@0xsequence/core": "1.1.14",
18
+ "@0xsequence/migration": "1.1.14",
19
+ "@0xsequence/network": "1.1.14",
20
+ "@0xsequence/relayer": "1.1.14",
21
+ "@0xsequence/utils": "1.1.14",
22
+ "@0xsequence/wallet": "1.1.14"
23
23
  },
24
24
  "peerDependencies": {
25
25
  "ethers": ">=5.5 < 6"
package/src/client.ts CHANGED
@@ -19,6 +19,8 @@ import { TypedData } from '@0xsequence/utils'
19
19
  import { toExtended } from './extended'
20
20
  import { ethers } from 'ethers'
21
21
 
22
+ import packageJson from '../package.json'
23
+
22
24
  /**
23
25
  * This session class is meant to persist the state of the wallet connection
24
26
  * whitin the dapp. This enables the client to retain the wallet address (and some more)
@@ -304,7 +306,10 @@ export class SequenceClient {
304
306
  }
305
307
  }
306
308
 
307
- await this.openWallet(undefined, { type: 'connect', options: { ...options, networkId: this.getChainId() } })
309
+ await this.openWallet(undefined, {
310
+ type: 'connect',
311
+ options: { ...options, networkId: this.getChainId(), clientVersion: packageJson.version }
312
+ })
308
313
 
309
314
  const connectDetails = await this.transport.waitUntilConnected().catch((error): ConnectDetails => {
310
315
  if (error instanceof Error) {
@@ -344,7 +349,6 @@ export class SequenceClient {
344
349
  // Working with sendAsync is less idiomatic
345
350
  // but transport uses it instead of send, so we wrap it
346
351
  send(request: JsonRpcRequest, chainId?: number): Promise<any> {
347
-
348
352
  // Internally when sending requests we use `legacy_sign`
349
353
  // to avoid the default EIP6492 behavior overriding an explicit
350
354
  // "legacy sign" request, so we map the method here.
package/src/types.ts CHANGED
@@ -165,7 +165,7 @@ export interface ConnectOptions {
165
165
  * be determined and verified for integrity, and can be omitted. */
166
166
  origin?: string
167
167
 
168
- /** expiry number (in seconds) to expire connect session. default is 1 week of seconds. */
168
+ /** expiry number (in seconds) that is used for ETHAuth proof. Default is 1 week in seconds. */
169
169
  expiry?: number
170
170
 
171
171
  /** authorize will perform an ETHAuth eip712 signing and return the proof to the dapp. */
@@ -184,6 +184,9 @@ export interface ConnectOptions {
184
184
  * is to automatically close the wallet after connecting. */
185
185
  keepWalletOpened?: boolean
186
186
 
187
+ /** clientVersion is the sequence.js version of the dapp client. */
188
+ clientVersion?: string
189
+
187
190
  /** Options to further customize the wallet experience. */
188
191
  settings?: Settings
189
192
  }
@@ -208,7 +211,7 @@ export interface Settings {
208
211
  * the connect/authorize process */
209
212
  bannerUrl?: string
210
213
 
211
- bannerSize?: 'small' | 'medium' | 'large'
214
+ bannerSize?: BannerSize
212
215
 
213
216
  /** Specify payment providers to use. If not specified,
214
217
  * all available payment providers will be enabled.
@@ -263,6 +266,7 @@ export type ThemeOption = 'light' | 'dark' | string
263
266
  export type PaymentProviderOption = 'moonpay' | 'wyre' | 'ramp'
264
267
  export type CurrencyOption = 'usdc' | 'eth' | 'matic'
265
268
  export type SignInOption = 'email' | 'google' | 'apple' | 'facebook' | 'discord' | 'twitch'
269
+ export type BannerSize = 'small' | 'medium' // | 'large'
266
270
 
267
271
  export interface ConnectDetails {
268
272
  // chainId (in hex) and error are defined by EIP-1193 expected fields