@reown/appkit-common-react-native 1.2.4 → 2.0.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.
- package/lib/commonjs/adapters/BlockchainAdapter.js +79 -0
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -0
- package/lib/commonjs/adapters/EvmAdapter.js +83 -0
- package/lib/commonjs/adapters/EvmAdapter.js.map +1 -0
- package/lib/commonjs/adapters/SolanaBaseAdapter.js +12 -0
- package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -0
- package/lib/commonjs/index.js +62 -1
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/networks/bitcoin.js +40 -0
- package/lib/commonjs/networks/bitcoin.js.map +1 -0
- package/lib/commonjs/networks/solana.js +78 -0
- package/lib/commonjs/networks/solana.js.map +1 -0
- package/lib/commonjs/utils/ConstantsUtil.js +2 -1
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/DateUtil.js +3 -0
- package/lib/commonjs/utils/DateUtil.js.map +1 -1
- package/lib/commonjs/utils/NumberUtil.js +56 -11
- package/lib/commonjs/utils/NumberUtil.js.map +1 -1
- package/lib/commonjs/utils/PresetsUtil.js +34 -3
- package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
- package/lib/commonjs/utils/StringUtil.js +1 -1
- package/lib/commonjs/utils/StringUtil.js.map +1 -1
- package/lib/commonjs/utils/TypeUtil.js +34 -0
- package/lib/commonjs/utils/TypeUtil.js.map +1 -1
- package/lib/module/adapters/BlockchainAdapter.js +72 -0
- package/lib/module/adapters/BlockchainAdapter.js.map +1 -0
- package/lib/module/adapters/EvmAdapter.js +76 -0
- package/lib/module/adapters/EvmAdapter.js.map +1 -0
- package/lib/module/adapters/SolanaBaseAdapter.js +5 -0
- package/lib/module/adapters/SolanaBaseAdapter.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/networks/bitcoin.js +34 -0
- package/lib/module/networks/bitcoin.js.map +1 -0
- package/lib/module/networks/solana.js +72 -0
- package/lib/module/networks/solana.js.map +1 -0
- package/lib/module/utils/ConstantsUtil.js +2 -1
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/DateUtil.js +3 -0
- package/lib/module/utils/DateUtil.js.map +1 -1
- package/lib/module/utils/NumberUtil.js +56 -11
- package/lib/module/utils/NumberUtil.js.map +1 -1
- package/lib/module/utils/PresetsUtil.js +34 -3
- package/lib/module/utils/PresetsUtil.js.map +1 -1
- package/lib/module/utils/StringUtil.js +1 -1
- package/lib/module/utils/StringUtil.js.map +1 -1
- package/lib/module/utils/TypeUtil.js +28 -0
- package/lib/module/utils/TypeUtil.js.map +1 -1
- package/lib/typescript/adapters/BlockchainAdapter.d.ts +27 -0
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/EvmAdapter.d.ts +6 -0
- package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +4 -0
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +5 -0
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/networks/bitcoin.d.ts +4 -0
- package/lib/typescript/networks/bitcoin.d.ts.map +1 -0
- package/lib/typescript/networks/solana.d.ts +5 -0
- package/lib/typescript/networks/solana.d.ts.map +1 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts +1 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/DateUtil.d.ts +1 -0
- package/lib/typescript/utils/DateUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NumberUtil.d.ts +40 -11
- package/lib/typescript/utils/NumberUtil.d.ts.map +1 -1
- package/lib/typescript/utils/PresetsUtil.d.ts +1 -1
- package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/TypeUtil.d.ts +193 -1
- package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/BlockchainAdapter.ts +109 -0
- package/src/adapters/EvmAdapter.ts +79 -0
- package/src/adapters/SolanaBaseAdapter.ts +5 -0
- package/src/index.ts +5 -0
- package/src/networks/bitcoin.ts +32 -0
- package/src/networks/solana.ts +44 -0
- package/src/utils/ConstantsUtil.ts +2 -1
- package/src/utils/DateUtil.ts +4 -0
- package/src/utils/NumberUtil.ts +60 -11
- package/src/utils/PresetsUtil.ts +36 -3
- package/src/utils/StringUtil.ts +1 -1
- package/src/utils/TypeUtil.ts +240 -1
|
@@ -3,11 +3,11 @@ export const PresetsUtil = {
|
|
|
3
3
|
ConnectorExplorerIds: {
|
|
4
4
|
[ConstantsUtil.COINBASE_CONNECTOR_ID]: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa'
|
|
5
5
|
},
|
|
6
|
-
|
|
6
|
+
NetworkImageIds: {
|
|
7
7
|
// Ethereum
|
|
8
8
|
1: 'ba0ba0cd-17c6-4806-ad93-f9d174f17900',
|
|
9
9
|
// Arbitrum
|
|
10
|
-
42161: '
|
|
10
|
+
42161: '3bff954d-5cb0-47a0-9a23-d20192e74600',
|
|
11
11
|
// Avalanche
|
|
12
12
|
43114: '30c46e53-e989-45fb-4549-be3bd4eb3b00',
|
|
13
13
|
// Binance Smart Chain
|
|
@@ -18,6 +18,20 @@ export const PresetsUtil = {
|
|
|
18
18
|
10: 'ab9c186a-c52f-464b-2906-ca59d760a400',
|
|
19
19
|
// Polygon
|
|
20
20
|
137: '41d04d42-da3b-4453-8506-668cc0727900',
|
|
21
|
+
// Mantle
|
|
22
|
+
5000: 'e86fae9b-b770-4eea-e520-150e12c81100',
|
|
23
|
+
// Hedera Mainnet
|
|
24
|
+
295: '6a97d510-cac8-4e58-c7ce-e8681b044c00',
|
|
25
|
+
// Sepolia
|
|
26
|
+
11_155_111: 'e909ea0a-f92a-4512-c8fc-748044ea6800',
|
|
27
|
+
// Base Sepolia
|
|
28
|
+
84532: 'a18a7ecd-e307-4360-4746-283182228e00',
|
|
29
|
+
// Unichain Sepolia
|
|
30
|
+
1301: '4eeea7ef-0014-4649-5d1d-07271a80f600',
|
|
31
|
+
// Unichain Mainnet
|
|
32
|
+
130: '2257980a-3463-48c6-cbac-a42d2a956e00',
|
|
33
|
+
// Monad Testnet
|
|
34
|
+
10_143: '0a728e83-bacb-46db-7844-948f05434900',
|
|
21
35
|
// Gnosis
|
|
22
36
|
100: '02b53f6a-e3d4-479e-1cb4-21178987d100',
|
|
23
37
|
// EVMos
|
|
@@ -41,7 +55,24 @@ export const PresetsUtil = {
|
|
|
41
55
|
// Base
|
|
42
56
|
8453: '7289c336-3981-4081-c5f4-efc26ac64a00',
|
|
43
57
|
// Aurora
|
|
44
|
-
1313161554: '3ff73439-a619-4894-9262-4470c773a100'
|
|
58
|
+
1313161554: '3ff73439-a619-4894-9262-4470c773a100',
|
|
59
|
+
// Ronin Mainnet
|
|
60
|
+
2020: 'b8101fc0-9c19-4b6f-ec65-f6dfff106e00',
|
|
61
|
+
// Saigon Testnet (a.k.a. Ronin)
|
|
62
|
+
2021: 'b8101fc0-9c19-4b6f-ec65-f6dfff106e00',
|
|
63
|
+
// Berachain Mainnet
|
|
64
|
+
80094: 'e329c2c9-59b0-4a02-83e4-212ff3779900',
|
|
65
|
+
// Abstract Mainnet
|
|
66
|
+
2741: 'fc2427d1-5af9-4a9c-8da5-6f94627cd900',
|
|
67
|
+
// Solana networks
|
|
68
|
+
/// Mainnet
|
|
69
|
+
'5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp': 'a1b58899-f671-4276-6a5e-56ca5bd59700',
|
|
70
|
+
/// Testnet
|
|
71
|
+
'4uhcVJyU9pJkvQyS88uRDiswHXSCkY3z': 'a1b58899-f671-4276-6a5e-56ca5bd59700',
|
|
72
|
+
// Bitcoin
|
|
73
|
+
'000000000019d6689c085ae165831e93': '0b4838db-0161-4ffe-022d-532bf03dba00',
|
|
74
|
+
// Bitcoin Testnet
|
|
75
|
+
'000000000933ea01ad0ee984209779ba': '39354064-d79b-420b-065d-f980c4b78200'
|
|
45
76
|
},
|
|
46
77
|
ConnectorNamesMap: {
|
|
47
78
|
[ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: 'WalletConnect',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ConstantsUtil","PresetsUtil","ConnectorExplorerIds","COINBASE_CONNECTOR_ID","
|
|
1
|
+
{"version":3,"names":["ConstantsUtil","PresetsUtil","ConnectorExplorerIds","COINBASE_CONNECTOR_ID","NetworkImageIds","ConnectorNamesMap","WALLET_CONNECT_CONNECTOR_ID","AUTH_CONNECTOR_ID","ConnectorImageIds","ConnectorTypesMap","RpcChainIds"],"sourceRoot":"../../../src","sources":["utils/PresetsUtil.ts"],"mappings":"AACA,SAASA,aAAa,QAAQ,iBAAiB;AAE/C,OAAO,MAAMC,WAAW,GAAG;EACzBC,oBAAoB,EAAE;IACpB,CAACF,aAAa,CAACG,qBAAqB,GAClC;EACJ,CAA2B;EAE3BC,eAAe,EAAE;IACf;IACA,CAAC,EAAE,sCAAsC;IACzC;IACA,KAAK,EAAE,sCAAsC;IAC7C;IACA,KAAK,EAAE,sCAAsC;IAC7C;IACA,EAAE,EAAE,sCAAsC;IAC1C;IACA,GAAG,EAAE,sCAAsC;IAC3C;IACA,EAAE,EAAE,sCAAsC;IAC1C;IACA,GAAG,EAAE,sCAAsC;IAC3C;IACA,IAAI,EAAE,sCAAsC;IAC5C;IACA,GAAG,EAAE,sCAAsC;IAC3C;IACA,UAAU,EAAE,sCAAsC;IAClD;IACA,KAAK,EAAE,sCAAsC;IAC7C;IACA,IAAI,EAAE,sCAAsC;IAC5C;IACA,GAAG,EAAE,sCAAsC;IAC3C;IACA,MAAM,EAAE,sCAAsC;IAC9C;IACA,GAAG,EAAE,sCAAsC;IAC3C;IACA,IAAI,EAAE,sCA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EACA,KAAK;EACL;EACA,UAAU;EACV;EACA,UAAU;EACV;EACA,EAAE;EACF;EACA,EAAE;EACF;EACA,KAAK;EACL;EACA,KAAK;EACL;EACA,GAAG;EACH;EACA,IAAI;EACJ;EACA,KAAK;EACL;EACA,OAAO;EACP;EACA,GAAG;EACH;EACA,GAAG;EACH;EACA,GAAG;AAEP,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["StringUtil","capitalize","value","charAt","toUpperCase","slice"],"sourceRoot":"../../../src","sources":["utils/StringUtil.ts"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACxBC,UAAUA,CAACC,KAAc,EAAE;IACzB,IAAI,CAACA,KAAK,EAAE;MACV,OAAO,EAAE;IACX;IAEA,OAAOA,KAAK,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,KAAK,CAACG,KAAK,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"names":["StringUtil","capitalize","value","charAt","toUpperCase","slice","toLowerCase"],"sourceRoot":"../../../src","sources":["utils/StringUtil.ts"],"mappings":"AAAA,OAAO,MAAMA,UAAU,GAAG;EACxBC,UAAUA,CAACC,KAAc,EAAE;IACzB,IAAI,CAACA,KAAK,EAAE;MACV,OAAO,EAAE;IACX;IAEA,OAAOA,KAAK,CAACC,MAAM,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC,GAAGF,KAAK,CAACG,KAAK,CAAC,CAAC,CAAC,CAACC,WAAW,CAAC,CAAC;EACrE;AACF,CAAC"}
|
|
@@ -1,2 +1,30 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
1
2
|
|
|
3
|
+
//********** Adapter Event Payloads **********//
|
|
4
|
+
|
|
5
|
+
//********** Adapter Event Map **********//
|
|
6
|
+
|
|
7
|
+
//********** Connector Types **********//
|
|
8
|
+
|
|
9
|
+
export class WalletConnector extends EventEmitter {
|
|
10
|
+
constructor({
|
|
11
|
+
type
|
|
12
|
+
}) {
|
|
13
|
+
super();
|
|
14
|
+
this.type = type;
|
|
15
|
+
}
|
|
16
|
+
async init(ops) {
|
|
17
|
+
this.storage = ops.storage;
|
|
18
|
+
this.metadata = ops.metadata;
|
|
19
|
+
}
|
|
20
|
+
setProvider(provider) {
|
|
21
|
+
this.provider = provider;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
//********** Provider Types **********//
|
|
26
|
+
|
|
27
|
+
//TODO: rename this and remove the old one ConnectorType
|
|
28
|
+
|
|
29
|
+
//********** Others **********//
|
|
2
30
|
//# sourceMappingURL=TypeUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["utils/TypeUtil.ts"],"mappings":""}
|
|
1
|
+
{"version":3,"names":["EventEmitter","WalletConnector","constructor","type","init","ops","storage","metadata","setProvider","provider"],"sourceRoot":"../../../src","sources":["utils/TypeUtil.ts"],"mappings":"AAAA,SAASA,YAAY,QAAQ,QAAQ;;AAgKrC;;AAoBA;;AAsBA;;AA6BA,OAAO,MAAeC,eAAe,SAASD,YAAY,CAAC;EAQzDE,WAAWA,CAAC;IAAEC;EAAkC,CAAC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EAEA,MAAaC,IAAIA,CAACC,GAAyB,EAAE;IAC3C,IAAI,CAACC,OAAO,GAAGD,GAAG,CAACC,OAAO;IAC1B,IAAI,CAACC,QAAQ,GAAGF,GAAG,CAACE,QAAQ;EAC9B;EAEOC,WAAWA,CAACC,QAAkB,EAAE;IACrC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;AASF;;AAEA;;AAmBA;;AAGA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import type { AdapterEvents, AppKitNetwork, CaipAddress, ChainNamespace, GetBalanceParams, GetBalanceResponse, Provider, WalletConnector } from '../utils/TypeUtil';
|
|
4
|
+
export declare abstract class BlockchainAdapter extends EventEmitter {
|
|
5
|
+
projectId: string;
|
|
6
|
+
connector?: WalletConnector;
|
|
7
|
+
supportedNamespace: ChainNamespace;
|
|
8
|
+
emit<K extends keyof AdapterEvents>(event: K, payload: Parameters<AdapterEvents[K]>[0]): boolean;
|
|
9
|
+
constructor({ projectId, supportedNamespace }: {
|
|
10
|
+
projectId: string;
|
|
11
|
+
supportedNamespace: ChainNamespace;
|
|
12
|
+
});
|
|
13
|
+
setConnector(connector: WalletConnector): void;
|
|
14
|
+
removeConnector(): void;
|
|
15
|
+
getProvider(): Provider;
|
|
16
|
+
subscribeToEvents(): void;
|
|
17
|
+
onChainChanged(chainId: string): void;
|
|
18
|
+
onAccountsChanged(accounts: string[]): void;
|
|
19
|
+
onDisconnect(): void;
|
|
20
|
+
parseUnits(value: string, decimals: number): bigint;
|
|
21
|
+
abstract disconnect(): Promise<void>;
|
|
22
|
+
abstract getSupportedNamespace(): ChainNamespace;
|
|
23
|
+
abstract getBalance(params: GetBalanceParams): Promise<GetBalanceResponse>;
|
|
24
|
+
abstract getAccounts(): CaipAddress[] | undefined;
|
|
25
|
+
abstract switchNetwork(network: AppKitNetwork): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=BlockchainAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BlockchainAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/BlockchainAdapter.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAE3B,8BAAsB,iBAAkB,SAAQ,YAAY;IACnD,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,kBAAkB,EAAE,cAAc,CAAC;IAGjC,IAAI,CAAC,CAAC,SAAS,MAAM,aAAa,EACzC,KAAK,EAAE,CAAC,EACR,OAAO,EAAE,UAAU,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GACvC,OAAO;gBAIE,EACV,SAAS,EACT,kBAAkB,EACnB,EAAE;QACD,SAAS,EAAE,MAAM,CAAC;QAClB,kBAAkB,EAAE,cAAc,CAAC;KACpC;IAMD,YAAY,CAAC,SAAS,EAAE,eAAe;IAKvC,eAAe;IAIf,WAAW,IAAI,QAAQ;IAMvB,iBAAiB,IAAI,IAAI;IASzB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IASrC,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,IAAI;IAa3C,YAAY,IAAI,IAAI;IAapB,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAOnD,QAAQ,CAAC,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IACpC,QAAQ,CAAC,qBAAqB,IAAI,cAAc;IAChD,QAAQ,CAAC,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAC1E,QAAQ,CAAC,WAAW,IAAI,WAAW,EAAE,GAAG,SAAS;IACjD,QAAQ,CAAC,aAAa,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BlockchainAdapter } from './BlockchainAdapter';
|
|
2
|
+
export declare abstract class EVMAdapter extends BlockchainAdapter {
|
|
3
|
+
estimateGas({ address, to, data, chainNamespace }: any): Promise<bigint>;
|
|
4
|
+
sendTransaction(data: any): Promise<`0x${string}` | null>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=EvmAdapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EvmAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/EvmAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGxD,8BAAsB,UAAW,SAAQ,iBAAiB;IAClD,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAkCxE,eAAe,CAAC,IAAI,EAAE,GAAG;CAwChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SolanaBaseAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/SolanaBaseAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,8BAAsB,iBAAkB,SAAQ,iBAAiB;CAEhE"}
|
|
@@ -8,5 +8,10 @@ export { PresetsUtil } from './utils/PresetsUtil';
|
|
|
8
8
|
export { StringUtil } from './utils/StringUtil';
|
|
9
9
|
export { ErrorUtil } from './utils/ErrorUtil';
|
|
10
10
|
export { erc20ABI } from './contracts/erc20';
|
|
11
|
+
export { solana, solanaDevnet, solanaTestnet } from './networks/solana';
|
|
12
|
+
export { bitcoin, bitcoinTestnet } from './networks/bitcoin';
|
|
13
|
+
export { BlockchainAdapter } from './adapters/BlockchainAdapter';
|
|
14
|
+
export { EVMAdapter } from './adapters/EvmAdapter';
|
|
15
|
+
export { SolanaBaseAdapter } from './adapters/SolanaBaseAdapter';
|
|
11
16
|
export * from './utils/TypeUtil';
|
|
12
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAC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BAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../src/networks/bitcoin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,OAAO,EAAE,aAarB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAc5B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/networks/solana.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAEvD,eAAO,MAAM,MAAM,EAAE,aAcpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAY1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAW3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa
|
|
1
|
+
{"version":3,"file":"ConstantsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/ConstantsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;CAoCzB,CAAC"}
|
|
@@ -3,5 +3,6 @@ export declare const DateUtil: {
|
|
|
3
3
|
getRelativeDateFromNow(date: string | number): string;
|
|
4
4
|
formatDate(date: string | number, format?: string): string;
|
|
5
5
|
getMonth(month: number): string;
|
|
6
|
+
isMoreThanOneWeekAgo(date: string | number): boolean;
|
|
6
7
|
};
|
|
7
8
|
//# sourceMappingURL=DateUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/DateUtil.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,QAAQ;mBACL,MAAM;iCAIS,MAAM,GAAG,MAAM;qBAI3B,MAAM,GAAG,MAAM;oBAIhB,MAAM;
|
|
1
|
+
{"version":3,"file":"DateUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/DateUtil.ts"],"names":[],"mappings":"AA8BA,eAAO,MAAM,QAAQ;mBACL,MAAM;iCAIS,MAAM,GAAG,MAAM;qBAI3B,MAAM,GAAG,MAAM;oBAIhB,MAAM;+BAIK,MAAM,GAAG,MAAM;CAG3C,CAAC"}
|
|
@@ -1,26 +1,55 @@
|
|
|
1
1
|
import * as BigNumber from 'bignumber.js';
|
|
2
2
|
export declare const NumberUtil: {
|
|
3
|
+
/**
|
|
4
|
+
* Creates a BigNumber instance from a given value.
|
|
5
|
+
* If the value is a string, commas are removed before conversion.
|
|
6
|
+
* @param value - The input value (string, number, or BigNumber) to convert to a BigNumber.
|
|
7
|
+
* @returns A BigNumber instance.
|
|
8
|
+
*/
|
|
3
9
|
bigNumber(value: BigNumber.BigNumber.Value): BigNumber.BigNumber;
|
|
4
10
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* @param
|
|
8
|
-
* @
|
|
11
|
+
* Multiplies two numbers using BigNumber for precision, especially with decimals.
|
|
12
|
+
* Handles undefined inputs by returning BigNumber(0).
|
|
13
|
+
* @param a - The first multiplicand (string, number, or BigNumber). Commas are removed if it's a string.
|
|
14
|
+
* @param b - The second multiplicand (string, number, or BigNumber). Commas are removed if it's a string.
|
|
15
|
+
* @returns The product as a BigNumber instance, or BigNumber(0) if either input is undefined.
|
|
9
16
|
*/
|
|
10
17
|
multiply(a: BigNumber.BigNumber.Value | undefined, b: BigNumber.BigNumber.Value | undefined): BigNumber.BigNumber;
|
|
18
|
+
/**
|
|
19
|
+
* Rounds a number to a specified number of decimal places if its string representation meets a certain length threshold.
|
|
20
|
+
* @param number - The number to potentially round.
|
|
21
|
+
* @param threshold - The minimum string length of the number to trigger rounding.
|
|
22
|
+
* @param fixed - The number of decimal places to round to.
|
|
23
|
+
* @returns The rounded number (as a string if rounded, otherwise the original number) or the original number.
|
|
24
|
+
*/
|
|
11
25
|
roundNumber(number: number, threshold: number, fixed: number): string | number;
|
|
12
26
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* @param
|
|
16
|
-
* @returns
|
|
27
|
+
* Calculates the next multiple of ten greater than or equal to the given amount.
|
|
28
|
+
* Defaults to 10 if no amount is provided or if the calculated multiple is less than 10.
|
|
29
|
+
* @param amount - The number for which to find the next multiple of ten. Optional.
|
|
30
|
+
* @returns The next multiple of ten, at least 10.
|
|
31
|
+
*/
|
|
32
|
+
nextMultipleOfTen(amount?: number): number;
|
|
33
|
+
/**
|
|
34
|
+
* Formats a number or string to a human-readable string with a specified number of decimal places, using US locale formatting.
|
|
35
|
+
* @param value - The value to format (string, number, or undefined). If undefined, returns '0.00'.
|
|
36
|
+
* @param decimals - The number of decimal places to display. Defaults to 2.
|
|
37
|
+
* @returns A locale-formatted string representation of the number.
|
|
17
38
|
*/
|
|
18
39
|
formatNumberToLocalString(value: string | number | undefined, decimals?: number): string;
|
|
19
40
|
/**
|
|
20
|
-
*
|
|
21
|
-
* @param value - The formatted string to parse
|
|
22
|
-
* @returns
|
|
41
|
+
* Parses a locale-formatted numeric string (e.g., with commas) back into a number.
|
|
42
|
+
* @param value - The formatted string to parse. If undefined, returns 0.
|
|
43
|
+
* @returns The parsed number, or 0 if the input is undefined.
|
|
23
44
|
*/
|
|
24
45
|
parseLocalStringToNumber(value: string | undefined): number;
|
|
46
|
+
/**
|
|
47
|
+
* Converts a numeric value (BigInt, number, or string representation of a number) to a 0x-prefixed hexadecimal string.
|
|
48
|
+
* This is often required for Ethereum RPC parameters like value, gas, gasPrice.
|
|
49
|
+
* @param value - The value to convert. Can be BigInt, number, or a string (decimal or hex).
|
|
50
|
+
* @returns A 0x-prefixed hexadecimal string, or undefined if the input is undefined or null.
|
|
51
|
+
* @throws Error if the value cannot be converted to BigInt.
|
|
52
|
+
*/
|
|
53
|
+
convertNumericToHexString: (value: any) => string | undefined;
|
|
25
54
|
};
|
|
26
55
|
//# sourceMappingURL=NumberUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NumberUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NumberUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,UAAU;
|
|
1
|
+
{"version":3,"file":"NumberUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NumberUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,cAAc,CAAC;AAE1C,eAAO,MAAM,UAAU;IACrB;;;;;OAKG;qBACc,mBAAmB,CAAC,KAAK;IAQ1C;;;;;;OAMG;gBACS,mBAAmB,CAAC,KAAK,GAAG,SAAS,KAAK,mBAAmB,CAAC,KAAK,GAAG,SAAS;IAW3F;;;;;;OAMG;wBACiB,MAAM,aAAa,MAAM,SAAS,MAAM;IAO5D;;;;;OAKG;+BACwB,MAAM;IAMjC;;;;;OAKG;qCAC8B,MAAM,GAAG,MAAM,GAAG,SAAS;IAkB5D;;;;OAIG;oCAC6B,MAAM,GAAG,SAAS;IASlD;;;;;;OAMG;uCACgC,GAAG,KAAG,MAAM,GAAG,SAAS;CAc5D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ConnectorType } from './TypeUtil';
|
|
2
2
|
export declare const PresetsUtil: {
|
|
3
3
|
ConnectorExplorerIds: Record<string, string>;
|
|
4
|
-
|
|
4
|
+
NetworkImageIds: Record<string, string>;
|
|
5
5
|
ConnectorNamesMap: Record<string, string>;
|
|
6
6
|
ConnectorImageIds: Record<string, string>;
|
|
7
7
|
ConnectorTypesMap: Record<string, ConnectorType>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,eAAO,MAAM,WAAW;;;;;;;
|
|
1
|
+
{"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAGhD,eAAO,MAAM,WAAW;;;;;;;CAiJvB,CAAC"}
|
|
@@ -1,8 +1,56 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
export type CaipAddress = `${string}:${string}:${string}`;
|
|
4
|
+
export type CaipNetworkId = `${string}:${string}`;
|
|
5
|
+
export type ChainNamespace = 'eip155' | 'solana' | 'polkadot' | 'bip122';
|
|
6
|
+
export type Network = {
|
|
7
|
+
id: number | string;
|
|
8
|
+
name: string;
|
|
9
|
+
nativeCurrency: {
|
|
10
|
+
name: string;
|
|
11
|
+
symbol: string;
|
|
12
|
+
decimals: number;
|
|
13
|
+
};
|
|
14
|
+
rpcUrls: {
|
|
15
|
+
default: {
|
|
16
|
+
http: readonly string[];
|
|
17
|
+
};
|
|
18
|
+
[key: string]: {
|
|
19
|
+
http: readonly string[];
|
|
20
|
+
} | undefined;
|
|
21
|
+
};
|
|
22
|
+
blockExplorers?: {
|
|
23
|
+
default: {
|
|
24
|
+
name: string;
|
|
25
|
+
url: string;
|
|
26
|
+
};
|
|
27
|
+
[key: string]: {
|
|
28
|
+
name: string;
|
|
29
|
+
url: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
};
|
|
32
|
+
chainNamespace?: ChainNamespace;
|
|
33
|
+
caipNetworkId?: CaipNetworkId;
|
|
34
|
+
testnet?: boolean;
|
|
35
|
+
deprecatedCaipNetworkId?: CaipNetworkId;
|
|
36
|
+
};
|
|
37
|
+
export type AppKitNetwork = Network & {
|
|
38
|
+
chainNamespace: ChainNamespace;
|
|
39
|
+
caipNetworkId: CaipNetworkId;
|
|
40
|
+
testnet?: boolean;
|
|
41
|
+
deprecatedCaipNetworkId?: CaipNetworkId;
|
|
42
|
+
};
|
|
43
|
+
export interface CaipNetwork {
|
|
44
|
+
id: CaipNetworkId;
|
|
45
|
+
name?: string;
|
|
46
|
+
imageId?: string;
|
|
47
|
+
imageUrl?: string;
|
|
48
|
+
}
|
|
1
49
|
export interface Balance {
|
|
2
50
|
name: string;
|
|
3
51
|
symbol: string;
|
|
4
52
|
chainId: string;
|
|
5
|
-
address?:
|
|
53
|
+
address?: CaipAddress;
|
|
6
54
|
value?: number;
|
|
7
55
|
price: number;
|
|
8
56
|
quantity: BalanceQuantity;
|
|
@@ -79,6 +127,150 @@ export type ThemeMode = 'dark' | 'light';
|
|
|
79
127
|
export interface ThemeVariables {
|
|
80
128
|
accent?: string;
|
|
81
129
|
}
|
|
130
|
+
export interface Token {
|
|
131
|
+
address: string;
|
|
132
|
+
image?: string;
|
|
133
|
+
}
|
|
134
|
+
export type Tokens = Record<CaipNetworkId, Token>;
|
|
82
135
|
export type ConnectorType = 'WALLET_CONNECT' | 'COINBASE' | 'AUTH' | 'EXTERNAL';
|
|
136
|
+
export type Metadata = {
|
|
137
|
+
name: string;
|
|
138
|
+
description: string;
|
|
139
|
+
url: string;
|
|
140
|
+
icons: string[];
|
|
141
|
+
redirect?: {
|
|
142
|
+
native?: string;
|
|
143
|
+
universal?: string;
|
|
144
|
+
linkMode?: boolean;
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
export type AccountsChangedEvent = {
|
|
148
|
+
accounts: string[];
|
|
149
|
+
};
|
|
150
|
+
export type ChainChangedEvent = {
|
|
151
|
+
chainId: string;
|
|
152
|
+
};
|
|
153
|
+
export type DisconnectEvent = {};
|
|
154
|
+
export type BalanceChangedEvent = {
|
|
155
|
+
address: CaipAddress;
|
|
156
|
+
balance: {
|
|
157
|
+
amount: string;
|
|
158
|
+
symbol: string;
|
|
159
|
+
contractAddress?: ContractAddress;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
export interface AdapterEvents {
|
|
163
|
+
accountsChanged: (event: AccountsChangedEvent) => void;
|
|
164
|
+
chainChanged: (event: ChainChangedEvent) => void;
|
|
165
|
+
disconnect: (event: DisconnectEvent) => void;
|
|
166
|
+
balanceChanged: (event: BalanceChangedEvent) => void;
|
|
167
|
+
}
|
|
168
|
+
export interface GetBalanceParams {
|
|
169
|
+
address?: CaipAddress;
|
|
170
|
+
network?: AppKitNetwork;
|
|
171
|
+
tokens?: Tokens;
|
|
172
|
+
}
|
|
173
|
+
type ContractAddress = CaipAddress;
|
|
174
|
+
export interface GetBalanceResponse {
|
|
175
|
+
amount: string;
|
|
176
|
+
symbol: string;
|
|
177
|
+
contractAddress?: ContractAddress;
|
|
178
|
+
}
|
|
179
|
+
interface BaseNamespace {
|
|
180
|
+
chains?: CaipNetworkId[];
|
|
181
|
+
accounts: CaipAddress[];
|
|
182
|
+
methods: string[];
|
|
183
|
+
events: string[];
|
|
184
|
+
}
|
|
185
|
+
type Namespace = BaseNamespace;
|
|
186
|
+
export type Namespaces = Record<string, Namespace>;
|
|
187
|
+
export type ProposalNamespaces = Record<string, Omit<Namespace, 'accounts'> & Required<Pick<Namespace, 'chains'>> & {
|
|
188
|
+
rpcMap: Record<string, string>;
|
|
189
|
+
}>;
|
|
190
|
+
export type ConnectOptions = {
|
|
191
|
+
namespaces?: ProposalNamespaces;
|
|
192
|
+
defaultChain?: CaipNetworkId;
|
|
193
|
+
universalLink?: string;
|
|
194
|
+
};
|
|
195
|
+
export type ConnectorInitOptions = {
|
|
196
|
+
storage: Storage;
|
|
197
|
+
metadata: Metadata;
|
|
198
|
+
};
|
|
199
|
+
export declare abstract class WalletConnector extends EventEmitter {
|
|
200
|
+
type: New_ConnectorType;
|
|
201
|
+
protected provider?: Provider;
|
|
202
|
+
protected namespaces?: Namespaces;
|
|
203
|
+
protected wallet?: WalletInfo;
|
|
204
|
+
protected storage?: Storage;
|
|
205
|
+
protected metadata?: Metadata;
|
|
206
|
+
constructor({ type }: {
|
|
207
|
+
type: New_ConnectorType;
|
|
208
|
+
});
|
|
209
|
+
init(ops: ConnectorInitOptions): Promise<void>;
|
|
210
|
+
setProvider(provider: Provider): void;
|
|
211
|
+
abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
|
|
212
|
+
abstract disconnect(): Promise<void>;
|
|
213
|
+
abstract getProvider(): Provider;
|
|
214
|
+
abstract getNamespaces(): Namespaces;
|
|
215
|
+
abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
|
|
216
|
+
abstract getWalletInfo(): WalletInfo | undefined;
|
|
217
|
+
abstract switchNetwork(network: AppKitNetwork): Promise<void>;
|
|
218
|
+
}
|
|
219
|
+
export interface Provider {
|
|
220
|
+
connect<T>(params?: any): Promise<T>;
|
|
221
|
+
disconnect(): Promise<void>;
|
|
222
|
+
request<T = unknown>(args: RequestArguments, chain?: string | undefined, expiry?: number | undefined): Promise<T>;
|
|
223
|
+
on(event: string, listener: (args?: any) => void): any;
|
|
224
|
+
off(event: string, listener: (args?: any) => void): any;
|
|
225
|
+
}
|
|
226
|
+
export interface RequestArguments {
|
|
227
|
+
method: string;
|
|
228
|
+
params?: unknown[] | Record<string, unknown> | object | undefined;
|
|
229
|
+
}
|
|
230
|
+
export type New_ConnectorType = 'walletconnect' | 'coinbase' | 'auth' | 'phantom';
|
|
231
|
+
export interface ConnectionResponse {
|
|
232
|
+
accounts: string[];
|
|
233
|
+
chainId: string;
|
|
234
|
+
[key: string]: any;
|
|
235
|
+
}
|
|
236
|
+
export interface WalletInfo {
|
|
237
|
+
name?: string;
|
|
238
|
+
icon?: string;
|
|
239
|
+
description?: string;
|
|
240
|
+
url?: string;
|
|
241
|
+
icons?: string[];
|
|
242
|
+
redirect?: {
|
|
243
|
+
native?: string;
|
|
244
|
+
universal?: string;
|
|
245
|
+
linkMode?: boolean;
|
|
246
|
+
};
|
|
247
|
+
[key: string]: unknown;
|
|
248
|
+
}
|
|
249
|
+
export interface Storage {
|
|
250
|
+
/**
|
|
251
|
+
* Returns all keys in storage.
|
|
252
|
+
*/
|
|
253
|
+
getKeys(): Promise<string[]>;
|
|
254
|
+
/**
|
|
255
|
+
* Returns all key-value entries in storage.
|
|
256
|
+
*/
|
|
257
|
+
getEntries<T = any>(): Promise<[string, T][]>;
|
|
258
|
+
/**
|
|
259
|
+
* Get an item from storage for a given key.
|
|
260
|
+
* @param key The key to retrieve.
|
|
261
|
+
*/
|
|
262
|
+
getItem<T = any>(key: string): Promise<T | undefined>;
|
|
263
|
+
/**
|
|
264
|
+
* Set an item in storage for a given key.
|
|
265
|
+
* @param key The key to set.
|
|
266
|
+
* @param value The value to set.
|
|
267
|
+
*/
|
|
268
|
+
setItem<T = any>(key: string, value: T): Promise<void>;
|
|
269
|
+
/**
|
|
270
|
+
* Remove an item from storage for a given key.
|
|
271
|
+
* @param key The key to remove.
|
|
272
|
+
*/
|
|
273
|
+
removeItem(key: string): Promise<void>;
|
|
274
|
+
}
|
|
83
275
|
export {};
|
|
84
276
|
//# sourceMappingURL=TypeUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TypeUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/TypeUtil.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"TypeUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/TypeUtil.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAE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