@dynamic-labs/rpc-providers 0.19.1 → 0.19.3
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/CHANGELOG.md +31 -0
- package/package.json +3 -2
- package/src/ChainRpcProviders.cjs +10 -0
- package/src/ChainRpcProviders.d.ts +4 -2
- package/src/ChainRpcProviders.js +10 -0
- package/src/types.cjs +1 -0
- package/src/types.d.ts +9 -1
- package/src/types.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,4 +1,35 @@
|
|
|
1
1
|
|
|
2
|
+
### [0.19.3](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.2...v0.19.3) (2023-11-22)
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* multiple starknet improvements [Support for default/custom RPC Providers + Dynamic Domains in signature] ([#3938](https://github.com/dynamic-labs/DynamicAuth/issues/3938)) ([d299622](https://github.com/dynamic-labs/DynamicAuth/commit/d299622197cb28483c6c6d6d051c917d6cbbe5df)), closes [#3881](https://github.com/dynamic-labs/DynamicAuth/issues/3881) [#3927](https://github.com/dynamic-labs/DynamicAuth/issues/3927)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* allow user's metadata field to be updated in updateUser hook ([#3930](https://github.com/dynamic-labs/DynamicAuth/issues/3930)) ([7d00014](https://github.com/dynamic-labs/DynamicAuth/commit/7d000140f87453bd158798b973917fa8309c8e5e))
|
|
13
|
+
* better handling of wallet disconnect state edge case ([#3940](https://github.com/dynamic-labs/DynamicAuth/issues/3940)) ([#3942](https://github.com/dynamic-labs/DynamicAuth/issues/3942)) ([e9f944c](https://github.com/dynamic-labs/DynamicAuth/commit/e9f944c2c68de446e83c1dbd62aaaedd07443326))
|
|
14
|
+
|
|
15
|
+
### [0.19.2](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.1...v0.19.2) (2023-11-17)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* feat: add support for forced network validation via DynamicContext setting ([#3907](https://github.com/dynamic-labs/DynamicAuth/issues/3907)) ([87e31e4](https://github.com/dynamic-labs/DynamicAuth/commit/87e31e40b0874eb344fa161defdfb36819d9019b)), closes [#3879](https://github.com/dynamic-labs/DynamicAuth/issues/3879)
|
|
21
|
+
* feat: add help section to sign message modal ([4e0a0c4](https://github.com/dynamic-labs/DynamicAuth/commit/4e0a0c4cde73f802bfcaa99351d295060244382f))
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* fix(embedded wallets): allow switching primary wallet ([#3796](https://github.com/dynamic-labs/DynamicAuth/issues/3796)) ([#3797](https://github.com/dynamic-labs/DynamicAuth/issues/3797)) ([a01af71](https://github.com/dynamic-labs/DynamicAuth/commit/a01af71ce0c79a791c4c4bb7d3f3d41bd7fe8edf))
|
|
26
|
+
* fix(embedded wallets): improve logic to check for enabled providers ([5189b96](https://github.com/dynamic-labs/DynamicAuth/commit/5189b96d8fa82e656c916cad130619be6e3b7afd))
|
|
27
|
+
* fix(single wallet): improve account switching UX ([#3742](https://github.com/dynamic-labs/DynamicAuth/issues/3742)) ([#3856](https://github.com/dynamic-labs/DynamicAuth/issues/3856)) ([1efffab](https://github.com/dynamic-labs/DynamicAuth/commit/1efffabf4a668f266564ecaa4405f3fb063bbf38))
|
|
28
|
+
* fix(wagmi): ensure chain is defined on wallet client ([#3888](https://github.com/dynamic-labs/DynamicAuth/issues/3888)) ([#3897](https://github.com/dynamic-labs/DynamicAuth/issues/3897)) ([3ee4885](https://github.com/dynamic-labs/DynamicAuth/commit/3ee4885b129ee619bc82ce09e39a3d5934afd734))
|
|
29
|
+
* fix(ui): remove the coming soon label ([#3876](https://github.com/dynamic-labs/DynamicAuth/issues/3876)) ([298f777](https://github.com/dynamic-labs/DynamicAuth/commit/298f777e4c5923075856e8b47c792c1951615c0e)), closes [#3860](https://github.com/dynamic-labs/DynamicAuth/issues/3860)
|
|
30
|
+
* fix(ssr): add window null check to utils ([#3882](https://github.com/dynamic-labs/DynamicAuth/issues/3882)) ([#3885](https://github.com/dynamic-labs/DynamicAuth/issues/3885)) ([bc8b8e3](https://github.com/dynamic-labs/DynamicAuth/commit/bc8b8e386fd82d9ca6b53deaa3aa852d6ebdafdc))
|
|
31
|
+
* fix(callbacks): pass correct wallet connector onLinkSuccess ([#3904](https://github.com/dynamic-labs/DynamicAuth/issues/3904)) ([#3908](https://github.com/dynamic-labs/DynamicAuth/issues/3908)) ([f05f5f8](https://github.com/dynamic-labs/DynamicAuth/commit/f05f5f8f336c42e24a7422959ba06002aba8be02))
|
|
32
|
+
|
|
2
33
|
### [0.19.1](https://github.com/dynamic-labs/DynamicAuth/compare/v0.19.0...v0.19.1) (2023-11-03)
|
|
3
34
|
|
|
4
35
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dynamic-labs/rpc-providers",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.3",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/dynamic-labs/DynamicAuth.git",
|
|
@@ -27,7 +27,8 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@solana/web3.js": "1.70.1",
|
|
30
|
-
"
|
|
30
|
+
"starknet": "^5.19.5",
|
|
31
|
+
"@dynamic-labs/types": "0.19.3"
|
|
31
32
|
},
|
|
32
33
|
"peerDependencies": {
|
|
33
34
|
"viem": "^1.1.0"
|
|
@@ -50,11 +50,21 @@ class ChainRpcProviders {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
ChainRpcProviders.providers = {};
|
|
53
|
+
ChainRpcProviders.wipeInstance = () => {
|
|
54
|
+
ChainRpcProviders.instance = undefined;
|
|
55
|
+
ChainRpcProviders.providers = {};
|
|
56
|
+
};
|
|
53
57
|
ChainRpcProviders.getSolanaRpcProviderByChainId = (config, chainId) => {
|
|
54
58
|
var _a;
|
|
55
59
|
const rpcProviders = ChainRpcProviders.getProviders(config);
|
|
56
60
|
const provider = (_a = rpcProviders['solana']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
|
|
57
61
|
return provider;
|
|
58
62
|
};
|
|
63
|
+
ChainRpcProviders.getStarknetRpcProviderByChainId = (config, chainId) => {
|
|
64
|
+
var _a;
|
|
65
|
+
const rpcProviders = ChainRpcProviders.getProviders(config);
|
|
66
|
+
const provider = (_a = rpcProviders['starknet']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
|
|
67
|
+
return provider;
|
|
68
|
+
};
|
|
59
69
|
|
|
60
70
|
exports.ChainRpcProviders = ChainRpcProviders;
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
import { NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
2
|
-
import { EvmRpcProvider, ProviderChain, RegisteredProviderMethod, RpcProviders, SolanaRpcProvider } from './types';
|
|
2
|
+
import { EvmRpcProvider, ProviderChain, RegisteredProviderMethod, RpcProviders, SolanaRpcProvider, StarknetRpcProvider } from './types';
|
|
3
3
|
export declare class ChainRpcProviders {
|
|
4
4
|
private static instance;
|
|
5
|
+
private static providers;
|
|
5
6
|
private getProvidersMethods;
|
|
6
7
|
static get client(): ChainRpcProviders;
|
|
7
8
|
private constructor();
|
|
8
|
-
|
|
9
|
+
static wipeInstance: () => void;
|
|
9
10
|
static getProviders(configurations: NetworkConfigurationMap): RpcProviders;
|
|
10
11
|
static registerChainProviders(providerChain: ProviderChain, fn: RegisteredProviderMethod): Promise<void>;
|
|
11
12
|
static getEvmProviderByChainId(config: NetworkConfigurationMap, chainId: number): EvmRpcProvider | undefined;
|
|
12
13
|
static getSolanaRpcProviderByChainId: (config: NetworkConfigurationMap, chainId: string) => SolanaRpcProvider | undefined;
|
|
14
|
+
static getStarknetRpcProviderByChainId: (config: NetworkConfigurationMap, chainId: string) => StarknetRpcProvider | undefined;
|
|
13
15
|
}
|
package/src/ChainRpcProviders.js
CHANGED
|
@@ -46,11 +46,21 @@ class ChainRpcProviders {
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
ChainRpcProviders.providers = {};
|
|
49
|
+
ChainRpcProviders.wipeInstance = () => {
|
|
50
|
+
ChainRpcProviders.instance = undefined;
|
|
51
|
+
ChainRpcProviders.providers = {};
|
|
52
|
+
};
|
|
49
53
|
ChainRpcProviders.getSolanaRpcProviderByChainId = (config, chainId) => {
|
|
50
54
|
var _a;
|
|
51
55
|
const rpcProviders = ChainRpcProviders.getProviders(config);
|
|
52
56
|
const provider = (_a = rpcProviders['solana']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
|
|
53
57
|
return provider;
|
|
54
58
|
};
|
|
59
|
+
ChainRpcProviders.getStarknetRpcProviderByChainId = (config, chainId) => {
|
|
60
|
+
var _a;
|
|
61
|
+
const rpcProviders = ChainRpcProviders.getProviders(config);
|
|
62
|
+
const provider = (_a = rpcProviders['starknet']) === null || _a === void 0 ? void 0 : _a.find((rpcProvider) => rpcProvider.chainId === chainId);
|
|
63
|
+
return provider;
|
|
64
|
+
};
|
|
55
65
|
|
|
56
66
|
export { ChainRpcProviders };
|
package/src/types.cjs
CHANGED
package/src/types.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { type Connection } from '@solana/web3.js';
|
|
2
2
|
import { PublicClient } from 'viem';
|
|
3
|
+
import { type RpcProvider } from 'starknet';
|
|
3
4
|
import { type NetworkConfigurationMap } from '@dynamic-labs/types';
|
|
4
5
|
export declare enum ProviderChain {
|
|
5
6
|
EVM = "evm",
|
|
6
|
-
SOLANA = "solana"
|
|
7
|
+
SOLANA = "solana",
|
|
8
|
+
STARKNET = "starknet"
|
|
7
9
|
}
|
|
8
10
|
export type EvmRpcProvider = {
|
|
9
11
|
chainId: number;
|
|
@@ -15,9 +17,15 @@ export type SolanaRpcProvider = {
|
|
|
15
17
|
chainName: string;
|
|
16
18
|
provider: Connection;
|
|
17
19
|
};
|
|
20
|
+
export type StarknetRpcProvider = {
|
|
21
|
+
chainId: string;
|
|
22
|
+
chainName: string;
|
|
23
|
+
provider: RpcProvider;
|
|
24
|
+
};
|
|
18
25
|
export type RpcProviderLookup = {
|
|
19
26
|
evm: EvmRpcProvider[];
|
|
20
27
|
solana: SolanaRpcProvider[];
|
|
28
|
+
starknet: StarknetRpcProvider[];
|
|
21
29
|
};
|
|
22
30
|
export type RpcProviders = {
|
|
23
31
|
[key in ProviderChain]?: RpcProviderLookup[key];
|