@0xsequence/provider 0.0.0-20230825151821 → 0.0.0-20230901183931

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xsequence/provider",
3
- "version": "0.0.0-20230825151821",
3
+ "version": "0.0.0-20230901183931",
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": "0.0.0-20230825151821",
15
- "@0xsequence/account": "0.0.0-20230825151821",
16
- "@0xsequence/auth": "0.0.0-20230825151821",
17
- "@0xsequence/core": "0.0.0-20230825151821",
18
- "@0xsequence/migration": "0.0.0-20230825151821",
19
- "@0xsequence/network": "0.0.0-20230825151821",
20
- "@0xsequence/utils": "0.0.0-20230825151821",
21
- "@0xsequence/relayer": "0.0.0-20230825151821",
22
- "@0xsequence/wallet": "0.0.0-20230825151821"
14
+ "@0xsequence/abi": "0.0.0-20230901183931",
15
+ "@0xsequence/account": "0.0.0-20230901183931",
16
+ "@0xsequence/auth": "0.0.0-20230901183931",
17
+ "@0xsequence/migration": "0.0.0-20230901183931",
18
+ "@0xsequence/network": "0.0.0-20230901183931",
19
+ "@0xsequence/relayer": "0.0.0-20230901183931",
20
+ "@0xsequence/core": "0.0.0-20230901183931",
21
+ "@0xsequence/wallet": "0.0.0-20230901183931",
22
+ "@0xsequence/utils": "0.0.0-20230901183931"
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