@0xsequence/provider 1.6.2 → 1.7.0
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.
|
@@ -3573,7 +3573,7 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
|
|
|
3573
3573
|
|
|
3574
3574
|
var packageJson = {
|
|
3575
3575
|
name: "@0xsequence/provider",
|
|
3576
|
-
version: "1.
|
|
3576
|
+
version: "1.7.0",
|
|
3577
3577
|
description: "provider sub-package for Sequence",
|
|
3578
3578
|
repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
|
|
3579
3579
|
source: "src/index.ts",
|
|
@@ -4051,11 +4051,19 @@ const DefaultProviderConfig = {
|
|
|
4051
4051
|
defaultNetwork: 1
|
|
4052
4052
|
};
|
|
4053
4053
|
let sequenceWalletProvider;
|
|
4054
|
-
|
|
4054
|
+
|
|
4055
|
+
/**
|
|
4056
|
+
* Initializes a wallet with the provided project access key and optional configuration.
|
|
4057
|
+
*
|
|
4058
|
+
* @param projectAccessKey - Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
4059
|
+
* @param partialConfig - Optional partial configuration for the wallet.
|
|
4060
|
+
* @returns The initialized wallet provider.
|
|
4061
|
+
* @throws Error if projectAccessKey is not provided, empty string or is not string.
|
|
4062
|
+
*/
|
|
4063
|
+
const initWallet = (projectAccessKey, partialConfig) => {
|
|
4055
4064
|
var _config$networks$filt, _config$networks, _findNetworkConfig;
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
console.warn('Please pass a projectAccessKey in initWallet config as it will be required in near future.');
|
|
4065
|
+
if (!projectAccessKey || typeof projectAccessKey !== 'string') {
|
|
4066
|
+
throw new Error('Please pass a projectAccessKey in initWallet.');
|
|
4059
4067
|
}
|
|
4060
4068
|
if (sequenceWalletProvider) {
|
|
4061
4069
|
return sequenceWalletProvider;
|
|
@@ -4079,8 +4087,7 @@ const initWallet = partialConfig => {
|
|
|
4079
4087
|
const network = (_config$networks2 = config.networks) == null ? void 0 : _config$networks2.find(cn => cn.chainId === n.chainId);
|
|
4080
4088
|
return network ? _extends({}, n, network) : n;
|
|
4081
4089
|
}).concat(newNetworks).map(network => {
|
|
4082
|
-
|
|
4083
|
-
network.rpcUrl = network.rpcUrl + toAppend;
|
|
4090
|
+
network.rpcUrl = network.rpcUrl + `/${projectAccessKey}`;
|
|
4084
4091
|
return network;
|
|
4085
4092
|
});
|
|
4086
4093
|
|
|
@@ -3573,7 +3573,7 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
|
|
|
3573
3573
|
|
|
3574
3574
|
var packageJson = {
|
|
3575
3575
|
name: "@0xsequence/provider",
|
|
3576
|
-
version: "1.
|
|
3576
|
+
version: "1.7.0",
|
|
3577
3577
|
description: "provider sub-package for Sequence",
|
|
3578
3578
|
repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
|
|
3579
3579
|
source: "src/index.ts",
|
|
@@ -4051,11 +4051,19 @@ const DefaultProviderConfig = {
|
|
|
4051
4051
|
defaultNetwork: 1
|
|
4052
4052
|
};
|
|
4053
4053
|
let sequenceWalletProvider;
|
|
4054
|
-
|
|
4054
|
+
|
|
4055
|
+
/**
|
|
4056
|
+
* Initializes a wallet with the provided project access key and optional configuration.
|
|
4057
|
+
*
|
|
4058
|
+
* @param projectAccessKey - Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
4059
|
+
* @param partialConfig - Optional partial configuration for the wallet.
|
|
4060
|
+
* @returns The initialized wallet provider.
|
|
4061
|
+
* @throws Error if projectAccessKey is not provided, empty string or is not string.
|
|
4062
|
+
*/
|
|
4063
|
+
const initWallet = (projectAccessKey, partialConfig) => {
|
|
4055
4064
|
var _config$networks$filt, _config$networks, _findNetworkConfig;
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
console.warn('Please pass a projectAccessKey in initWallet config as it will be required in near future.');
|
|
4065
|
+
if (!projectAccessKey || typeof projectAccessKey !== 'string') {
|
|
4066
|
+
throw new Error('Please pass a projectAccessKey in initWallet.');
|
|
4059
4067
|
}
|
|
4060
4068
|
if (sequenceWalletProvider) {
|
|
4061
4069
|
return sequenceWalletProvider;
|
|
@@ -4079,8 +4087,7 @@ const initWallet = partialConfig => {
|
|
|
4079
4087
|
const network = (_config$networks2 = config.networks) == null ? void 0 : _config$networks2.find(cn => cn.chainId === n.chainId);
|
|
4080
4088
|
return network ? _extends({}, n, network) : n;
|
|
4081
4089
|
}).concat(newNetworks).map(network => {
|
|
4082
|
-
|
|
4083
|
-
network.rpcUrl = network.rpcUrl + toAppend;
|
|
4090
|
+
network.rpcUrl = network.rpcUrl + `/${projectAccessKey}`;
|
|
4084
4091
|
return network;
|
|
4085
4092
|
});
|
|
4086
4093
|
|
|
@@ -3569,7 +3569,7 @@ class SingleNetworkSequenceProvider extends SequenceProvider {
|
|
|
3569
3569
|
|
|
3570
3570
|
var packageJson = {
|
|
3571
3571
|
name: "@0xsequence/provider",
|
|
3572
|
-
version: "1.
|
|
3572
|
+
version: "1.7.0",
|
|
3573
3573
|
description: "provider sub-package for Sequence",
|
|
3574
3574
|
repository: "https://github.com/0xsequence/sequence.js/tree/master/packages/provider",
|
|
3575
3575
|
source: "src/index.ts",
|
|
@@ -4047,11 +4047,19 @@ const DefaultProviderConfig = {
|
|
|
4047
4047
|
defaultNetwork: 1
|
|
4048
4048
|
};
|
|
4049
4049
|
let sequenceWalletProvider;
|
|
4050
|
-
|
|
4050
|
+
|
|
4051
|
+
/**
|
|
4052
|
+
* Initializes a wallet with the provided project access key and optional configuration.
|
|
4053
|
+
*
|
|
4054
|
+
* @param projectAccessKey - Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
4055
|
+
* @param partialConfig - Optional partial configuration for the wallet.
|
|
4056
|
+
* @returns The initialized wallet provider.
|
|
4057
|
+
* @throws Error if projectAccessKey is not provided, empty string or is not string.
|
|
4058
|
+
*/
|
|
4059
|
+
const initWallet = (projectAccessKey, partialConfig) => {
|
|
4051
4060
|
var _config$networks$filt, _config$networks, _findNetworkConfig;
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
console.warn('Please pass a projectAccessKey in initWallet config as it will be required in near future.');
|
|
4061
|
+
if (!projectAccessKey || typeof projectAccessKey !== 'string') {
|
|
4062
|
+
throw new Error('Please pass a projectAccessKey in initWallet.');
|
|
4055
4063
|
}
|
|
4056
4064
|
if (sequenceWalletProvider) {
|
|
4057
4065
|
return sequenceWalletProvider;
|
|
@@ -4075,8 +4083,7 @@ const initWallet = partialConfig => {
|
|
|
4075
4083
|
const network = (_config$networks2 = config.networks) == null ? void 0 : _config$networks2.find(cn => cn.chainId === n.chainId);
|
|
4076
4084
|
return network ? _extends({}, n, network) : n;
|
|
4077
4085
|
}).concat(newNetworks).map(network => {
|
|
4078
|
-
|
|
4079
|
-
network.rpcUrl = network.rpcUrl + toAppend;
|
|
4086
|
+
network.rpcUrl = network.rpcUrl + `/${projectAccessKey}`;
|
|
4080
4087
|
return network;
|
|
4081
4088
|
});
|
|
4082
4089
|
|
|
@@ -3,7 +3,6 @@ import { MuxTransportTemplate } from "./transports/index.js";
|
|
|
3
3
|
import { ItemStore } from "./utils.js";
|
|
4
4
|
import { SequenceProvider } from "./provider.js";
|
|
5
5
|
export interface ProviderConfig {
|
|
6
|
-
projectAccessKey?: string;
|
|
7
6
|
localStorage?: ItemStore;
|
|
8
7
|
defaultNetwork?: ChainIdLike;
|
|
9
8
|
defaultEIP6492?: boolean;
|
|
@@ -22,6 +21,14 @@ export declare const DefaultProviderConfig: {
|
|
|
22
21
|
};
|
|
23
22
|
defaultNetwork: number;
|
|
24
23
|
};
|
|
25
|
-
|
|
24
|
+
/**
|
|
25
|
+
* Initializes a wallet with the provided project access key and optional configuration.
|
|
26
|
+
*
|
|
27
|
+
* @param projectAccessKey - Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
28
|
+
* @param partialConfig - Optional partial configuration for the wallet.
|
|
29
|
+
* @returns The initialized wallet provider.
|
|
30
|
+
* @throws Error if projectAccessKey is not provided, empty string or is not string.
|
|
31
|
+
*/
|
|
32
|
+
export declare const initWallet: (projectAccessKey: string, partialConfig?: Partial<ProviderConfig>) => SequenceProvider;
|
|
26
33
|
export declare const unregisterWallet: () => void;
|
|
27
34
|
export declare const getWallet: () => SequenceProvider;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xsequence/provider",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
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.
|
|
15
|
-
"@0xsequence/account": "1.
|
|
16
|
-
"@0xsequence/auth": "1.
|
|
17
|
-
"@0xsequence/core": "1.
|
|
18
|
-
"@0xsequence/migration": "1.
|
|
19
|
-
"@0xsequence/network": "1.
|
|
20
|
-
"@0xsequence/relayer": "1.
|
|
21
|
-
"@0xsequence/
|
|
22
|
-
"@0xsequence/
|
|
14
|
+
"@0xsequence/abi": "1.7.0",
|
|
15
|
+
"@0xsequence/account": "1.7.0",
|
|
16
|
+
"@0xsequence/auth": "1.7.0",
|
|
17
|
+
"@0xsequence/core": "1.7.0",
|
|
18
|
+
"@0xsequence/migration": "1.7.0",
|
|
19
|
+
"@0xsequence/network": "1.7.0",
|
|
20
|
+
"@0xsequence/relayer": "1.7.0",
|
|
21
|
+
"@0xsequence/wallet": "1.7.0",
|
|
22
|
+
"@0xsequence/utils": "1.7.0"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"ethers": ">=5.5 < 6"
|
package/src/init.ts
CHANGED
|
@@ -16,9 +16,6 @@ import { SequenceClient } from './client'
|
|
|
16
16
|
import { SequenceProvider } from './provider'
|
|
17
17
|
|
|
18
18
|
export interface ProviderConfig {
|
|
19
|
-
// Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
20
|
-
projectAccessKey?: string
|
|
21
|
-
|
|
22
19
|
// The local storage dependency for the wallet provider, defaults to window.localStorage.
|
|
23
20
|
// For example, this option should be used when using React Native since window.localStorage is not available.
|
|
24
21
|
localStorage?: ItemStore
|
|
@@ -57,11 +54,17 @@ export const DefaultProviderConfig = {
|
|
|
57
54
|
|
|
58
55
|
let sequenceWalletProvider: SequenceProvider | undefined
|
|
59
56
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Initializes a wallet with the provided project access key and optional configuration.
|
|
59
|
+
*
|
|
60
|
+
* @param projectAccessKey - Access key for the project that can be obtained from Sequence Builder on sequence.build
|
|
61
|
+
* @param partialConfig - Optional partial configuration for the wallet.
|
|
62
|
+
* @returns The initialized wallet provider.
|
|
63
|
+
* @throws Error if projectAccessKey is not provided, empty string or is not string.
|
|
64
|
+
*/
|
|
65
|
+
export const initWallet = (projectAccessKey: string, partialConfig?: Partial<ProviderConfig>) => {
|
|
66
|
+
if (!projectAccessKey || typeof projectAccessKey !== 'string') {
|
|
67
|
+
throw new Error('Please pass a projectAccessKey in initWallet.')
|
|
65
68
|
}
|
|
66
69
|
|
|
67
70
|
if (sequenceWalletProvider) {
|
|
@@ -94,8 +97,7 @@ export const initWallet = (partialConfig?: Partial<ProviderConfig>) => {
|
|
|
94
97
|
})
|
|
95
98
|
.concat(newNetworks)
|
|
96
99
|
.map(network => {
|
|
97
|
-
|
|
98
|
-
network.rpcUrl = network.rpcUrl + toAppend
|
|
100
|
+
network.rpcUrl = network.rpcUrl + `/${projectAccessKey}`
|
|
99
101
|
return network
|
|
100
102
|
})
|
|
101
103
|
|