@reown/appkit-common-react-native 0.0.0-develop-20250728153935 → 0.0.0-develop-20251030154825
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/BitcoinBaseAdapter.js +10 -0
- package/lib/commonjs/adapters/BitcoinBaseAdapter.js.map +1 -0
- package/lib/commonjs/adapters/BlockchainAdapter.js +103 -0
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -0
- package/lib/commonjs/adapters/EvmAdapter.js +193 -0
- package/lib/commonjs/adapters/EvmAdapter.js.map +1 -0
- package/lib/commonjs/adapters/SolanaBaseAdapter.js +10 -0
- package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -0
- package/lib/commonjs/contracts/erc20.js.map +1 -1
- package/lib/commonjs/contracts/usdt.js.map +1 -1
- package/lib/commonjs/index.js +74 -5
- 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/package.json +1 -0
- package/lib/commonjs/types/api/blockchain-api.js +15 -0
- package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
- package/lib/commonjs/types/api/events.js +6 -0
- package/lib/commonjs/types/api/events.js.map +1 -0
- package/lib/commonjs/types/api/index.js +39 -0
- package/lib/commonjs/types/api/index.js.map +1 -0
- package/lib/commonjs/types/api/wallet-api.js +6 -0
- package/lib/commonjs/types/api/wallet-api.js.map +1 -0
- package/lib/commonjs/types/blockchain/adapter.js +6 -0
- package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
- package/lib/commonjs/types/blockchain/balance.js +6 -0
- package/lib/commonjs/types/blockchain/balance.js.map +1 -0
- package/lib/commonjs/types/blockchain/index.js +50 -0
- package/lib/commonjs/types/blockchain/index.js.map +1 -0
- package/lib/commonjs/types/blockchain/network.js +6 -0
- package/lib/commonjs/types/blockchain/network.js.map +1 -0
- package/lib/commonjs/types/blockchain/transaction.js +2 -0
- package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
- package/lib/commonjs/types/common.js +2 -0
- package/lib/commonjs/types/common.js.map +1 -0
- package/lib/commonjs/types/index.js +105 -0
- package/lib/commonjs/types/index.js.map +1 -0
- package/lib/commonjs/types/onramp/countries.js +2 -0
- package/lib/commonjs/types/onramp/countries.js.map +1 -0
- package/lib/commonjs/types/onramp/currencies.js +2 -0
- package/lib/commonjs/types/onramp/currencies.js.map +1 -0
- package/lib/commonjs/types/onramp/errors.js +22 -0
- package/lib/commonjs/types/onramp/errors.js.map +1 -0
- package/lib/commonjs/types/onramp/index.js +50 -0
- package/lib/commonjs/types/onramp/index.js.map +1 -0
- package/lib/commonjs/types/onramp/quotes.js +2 -0
- package/lib/commonjs/types/onramp/quotes.js.map +1 -0
- package/lib/commonjs/types/siwx/config.js +6 -0
- package/lib/commonjs/types/siwx/config.js.map +1 -0
- package/lib/commonjs/types/siwx/index.js +50 -0
- package/lib/commonjs/types/siwx/index.js.map +1 -0
- package/lib/commonjs/types/siwx/message.js +6 -0
- package/lib/commonjs/types/siwx/message.js.map +1 -0
- package/lib/commonjs/types/siwx/storage.js +6 -0
- package/lib/commonjs/types/siwx/storage.js.map +1 -0
- package/lib/commonjs/types/siwx/verifier.js +35 -0
- package/lib/commonjs/types/siwx/verifier.js.map +1 -0
- package/lib/commonjs/types/storage.js +24 -0
- package/lib/commonjs/types/storage.js.map +1 -0
- package/lib/commonjs/types/swap/index.js +17 -0
- package/lib/commonjs/types/swap/index.js.map +1 -0
- package/lib/commonjs/types/swap/tokens.js +6 -0
- package/lib/commonjs/types/swap/tokens.js.map +1 -0
- package/lib/commonjs/types/ui.js +6 -0
- package/lib/commonjs/{utils/TypeUtil.js.map → types/ui.js.map} +1 -1
- package/lib/commonjs/types/wallet/connection.js +6 -0
- package/lib/commonjs/types/wallet/connection.js.map +1 -0
- package/lib/commonjs/types/wallet/connector.js +30 -0
- package/lib/commonjs/types/wallet/connector.js.map +1 -0
- package/lib/commonjs/types/wallet/index.js +39 -0
- package/lib/commonjs/types/wallet/index.js.map +1 -0
- package/lib/commonjs/types/wallet/wallet-info.js +6 -0
- package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
- package/lib/commonjs/utils/ConstantsUtil.js +45 -6
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/ContractUtil.js.map +1 -1
- package/lib/commonjs/utils/DateUtil.js.map +1 -1
- package/lib/commonjs/utils/ErrorUtil.js.map +1 -1
- package/lib/commonjs/utils/NamesUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -0
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/commonjs/utils/NumberUtil.js +53 -13
- package/lib/commonjs/utils/NumberUtil.js.map +1 -1
- package/lib/commonjs/utils/PresetsUtil.js +34 -21
- package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
- package/lib/commonjs/utils/StringUtil.js +7 -0
- package/lib/commonjs/utils/StringUtil.js.map +1 -1
- package/lib/module/adapters/BitcoinBaseAdapter.js +5 -0
- package/lib/module/adapters/BitcoinBaseAdapter.js.map +1 -0
- package/lib/module/adapters/BlockchainAdapter.js +98 -0
- package/lib/module/adapters/BlockchainAdapter.js.map +1 -0
- package/lib/module/adapters/EvmAdapter.js +189 -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/contracts/erc20.js +2 -0
- package/lib/module/contracts/erc20.js.map +1 -1
- package/lib/module/contracts/usdt.js +2 -0
- package/lib/module/contracts/usdt.js.map +1 -1
- package/lib/module/index.js +9 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/networks/bitcoin.js +36 -0
- package/lib/module/networks/bitcoin.js.map +1 -0
- package/lib/module/networks/solana.js +74 -0
- package/lib/module/networks/solana.js.map +1 -0
- package/lib/module/types/api/blockchain-api.js +10 -0
- package/lib/module/types/api/blockchain-api.js.map +1 -0
- package/lib/module/types/api/events.js +4 -0
- package/lib/module/types/api/events.js.map +1 -0
- package/lib/module/types/api/index.js +7 -0
- package/lib/module/types/api/index.js.map +1 -0
- package/lib/module/types/api/wallet-api.js +4 -0
- package/lib/module/types/api/wallet-api.js.map +1 -0
- package/lib/module/types/blockchain/adapter.js +4 -0
- package/lib/module/types/blockchain/adapter.js.map +1 -0
- package/lib/module/types/blockchain/balance.js +4 -0
- package/lib/module/types/blockchain/balance.js.map +1 -0
- package/lib/module/types/blockchain/index.js +8 -0
- package/lib/module/types/blockchain/index.js.map +1 -0
- package/lib/module/types/blockchain/network.js +4 -0
- package/lib/module/types/blockchain/network.js.map +1 -0
- package/lib/module/types/blockchain/transaction.js +2 -0
- package/lib/module/types/blockchain/transaction.js.map +1 -0
- package/lib/module/types/common.js +2 -0
- package/lib/module/types/common.js.map +1 -0
- package/lib/module/types/index.js +31 -0
- package/lib/module/types/index.js.map +1 -0
- package/lib/module/types/onramp/countries.js +2 -0
- package/lib/module/types/onramp/countries.js.map +1 -0
- package/lib/module/types/onramp/currencies.js +2 -0
- package/lib/module/types/onramp/currencies.js.map +1 -0
- package/lib/module/types/onramp/errors.js +18 -0
- package/lib/module/types/onramp/errors.js.map +1 -0
- package/lib/module/types/onramp/index.js +8 -0
- package/lib/module/types/onramp/index.js.map +1 -0
- package/lib/module/types/onramp/quotes.js +2 -0
- package/lib/module/types/onramp/quotes.js.map +1 -0
- package/lib/module/types/siwx/config.js +4 -0
- package/lib/module/types/siwx/config.js.map +1 -0
- package/lib/module/types/siwx/index.js +7 -0
- package/lib/module/types/siwx/index.js.map +1 -0
- package/lib/module/types/siwx/message.js +4 -0
- package/lib/module/types/siwx/message.js.map +1 -0
- package/lib/module/types/siwx/storage.js +4 -0
- package/lib/module/types/siwx/storage.js.map +1 -0
- package/lib/module/types/siwx/verifier.js +30 -0
- package/lib/module/types/siwx/verifier.js.map +1 -0
- package/lib/module/types/storage.js +20 -0
- package/lib/module/types/storage.js.map +1 -0
- package/lib/module/types/swap/index.js +5 -0
- package/lib/module/types/swap/index.js.map +1 -0
- package/lib/module/types/swap/tokens.js +4 -0
- package/lib/module/types/swap/tokens.js.map +1 -0
- package/lib/module/types/ui.js +4 -0
- package/lib/module/{utils/TypeUtil.js.map → types/ui.js.map} +1 -1
- package/lib/module/types/wallet/connection.js +4 -0
- package/lib/module/types/wallet/connection.js.map +1 -0
- package/lib/module/types/wallet/connector.js +25 -0
- package/lib/module/types/wallet/connector.js.map +1 -0
- package/lib/module/types/wallet/index.js +7 -0
- package/lib/module/types/wallet/index.js.map +1 -0
- package/lib/module/types/wallet/wallet-info.js +4 -0
- package/lib/module/types/wallet/wallet-info.js.map +1 -0
- package/lib/module/utils/ConstantsUtil.js +47 -6
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/ContractUtil.js +2 -0
- package/lib/module/utils/ContractUtil.js.map +1 -1
- package/lib/module/utils/DateUtil.js +2 -0
- package/lib/module/utils/DateUtil.js.map +1 -1
- package/lib/module/utils/ErrorUtil.js +2 -0
- package/lib/module/utils/ErrorUtil.js.map +1 -1
- package/lib/module/utils/NamesUtil.js +2 -0
- package/lib/module/utils/NamesUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +5 -0
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/module/utils/NumberUtil.js +54 -11
- package/lib/module/utils/NumberUtil.js.map +1 -1
- package/lib/module/utils/PresetsUtil.js +36 -21
- package/lib/module/utils/PresetsUtil.js.map +1 -1
- package/lib/module/utils/StringUtil.js +9 -0
- package/lib/module/utils/StringUtil.js.map +1 -1
- package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts +5 -0
- package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/BlockchainAdapter.d.ts +26 -0
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/EvmAdapter.d.ts +26 -0
- package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +7 -0
- package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -0
- package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +2 -0
- package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +7 -1
- 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/types/api/blockchain-api.d.ts +183 -0
- package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
- package/lib/typescript/types/api/events.d.ts +357 -0
- package/lib/typescript/types/api/events.d.ts.map +1 -0
- package/lib/typescript/types/api/index.d.ts +4 -0
- package/lib/typescript/types/api/index.d.ts.map +1 -0
- package/lib/typescript/types/api/wallet-api.d.ts +51 -0
- package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
- package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
- package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
- package/lib/typescript/types/blockchain/balance.d.ts +28 -0
- package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
- package/lib/typescript/types/blockchain/index.d.ts +5 -0
- package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
- package/lib/typescript/types/blockchain/network.d.ts +47 -0
- package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
- package/lib/typescript/{utils/TypeUtil.d.ts → types/blockchain/transaction.d.ts} +1 -22
- package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
- package/lib/typescript/types/common.d.ts +24 -0
- package/lib/typescript/types/common.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +10 -0
- package/lib/typescript/types/index.d.ts.map +1 -0
- package/lib/typescript/types/onramp/countries.d.ts +11 -0
- package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
- package/lib/typescript/types/onramp/currencies.d.ts +30 -0
- package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
- package/lib/typescript/types/onramp/errors.d.ts +21 -0
- package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
- package/lib/typescript/types/onramp/index.d.ts +5 -0
- package/lib/typescript/types/onramp/index.d.ts.map +1 -0
- package/lib/typescript/types/onramp/quotes.d.ts +45 -0
- package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
- package/lib/typescript/types/siwx/config.d.ts +73 -0
- package/lib/typescript/types/siwx/config.d.ts.map +1 -0
- package/lib/typescript/types/siwx/index.d.ts +5 -0
- package/lib/typescript/types/siwx/index.d.ts.map +1 -0
- package/lib/typescript/types/siwx/message.d.ts +92 -0
- package/lib/typescript/types/siwx/message.d.ts.map +1 -0
- package/lib/typescript/types/siwx/storage.d.ts +41 -0
- package/lib/typescript/types/siwx/storage.d.ts.map +1 -0
- package/lib/typescript/types/siwx/verifier.d.ts +28 -0
- package/lib/typescript/types/siwx/verifier.d.ts.map +1 -0
- package/lib/typescript/types/storage.d.ts +59 -0
- package/lib/typescript/types/storage.d.ts.map +1 -0
- package/lib/typescript/types/swap/index.d.ts +2 -0
- package/lib/typescript/types/swap/index.d.ts.map +1 -0
- package/lib/typescript/types/swap/tokens.d.ts +19 -0
- package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
- package/lib/typescript/types/ui.d.ts +26 -0
- package/lib/typescript/types/ui.d.ts.map +1 -0
- package/lib/typescript/types/wallet/connection.d.ts +31 -0
- package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
- package/lib/typescript/types/wallet/connector.d.ts +59 -0
- package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
- package/lib/typescript/types/wallet/index.d.ts +4 -0
- package/lib/typescript/types/wallet/index.d.ts.map +1 -0
- package/lib/typescript/types/wallet/wallet-info.d.ts +37 -0
- package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
- package/lib/typescript/utils/ConstantsUtil.d.ts +43 -4
- package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
- package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
- package/lib/typescript/utils/NumberUtil.d.ts +39 -11
- package/lib/typescript/utils/NumberUtil.d.ts.map +1 -1
- package/lib/typescript/utils/PresetsUtil.d.ts +1 -6
- package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
- package/lib/typescript/utils/StringUtil.d.ts +1 -0
- package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
- package/package.json +9 -18
- package/src/adapters/BitcoinBaseAdapter.ts +5 -0
- package/src/adapters/BlockchainAdapter.ts +136 -0
- package/src/adapters/EvmAdapter.ts +247 -0
- package/src/adapters/SolanaBaseAdapter.ts +7 -0
- package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
- package/src/index.ts +8 -1
- package/src/networks/bitcoin.ts +32 -0
- package/src/networks/solana.ts +44 -0
- package/src/types/api/blockchain-api.ts +213 -0
- package/src/types/api/events.ts +462 -0
- package/src/types/api/index.ts +4 -0
- package/src/types/api/wallet-api.ts +71 -0
- package/src/types/blockchain/adapter.ts +52 -0
- package/src/types/blockchain/balance.ts +31 -0
- package/src/types/blockchain/index.ts +5 -0
- package/src/types/blockchain/network.ts +39 -0
- package/src/{utils/TypeUtil.ts → types/blockchain/transaction.ts} +0 -26
- package/src/types/common.ts +56 -0
- package/src/types/index.ts +28 -0
- package/src/types/onramp/countries.ts +11 -0
- package/src/types/onramp/currencies.ts +32 -0
- package/src/types/onramp/errors.ts +22 -0
- package/src/types/onramp/index.ts +5 -0
- package/src/types/onramp/quotes.ts +46 -0
- package/src/types/siwx/config.ts +73 -0
- package/src/types/siwx/index.ts +4 -0
- package/src/types/siwx/message.ts +92 -0
- package/src/types/siwx/storage.ts +44 -0
- package/src/types/siwx/verifier.ts +32 -0
- package/src/types/storage.ts +64 -0
- package/src/types/swap/index.ts +2 -0
- package/src/types/swap/tokens.ts +21 -0
- package/src/types/ui.ts +26 -0
- package/src/types/wallet/connection.ts +34 -0
- package/src/types/wallet/connector.ts +83 -0
- package/src/types/wallet/index.ts +4 -0
- package/src/types/wallet/wallet-info.ts +42 -0
- package/src/utils/ConstantsUtil.ts +48 -7
- package/src/utils/NetworkUtil.ts +5 -0
- package/src/utils/NumberUtil.ts +54 -11
- package/src/utils/PresetsUtil.ts +34 -26
- package/src/utils/StringUtil.ts +7 -0
- package/lib/commonjs/utils/TypeUtil.js +0 -2
- package/lib/module/utils/TypeUtil.js +0 -2
- package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/storage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;;;;OAMG;IACH,GAAG,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzC;;;;;;OAMG;IACH,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;;;;;OAOG;IACH,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,GAAG,CAAC,QAAQ,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ChainNamespace } from '../common';
|
|
2
|
+
import type { SIWXSession } from './message';
|
|
3
|
+
/**
|
|
4
|
+
* This is the base class for a SIWX verifier.
|
|
5
|
+
*/
|
|
6
|
+
export declare abstract class SIWXVerifier {
|
|
7
|
+
/**
|
|
8
|
+
* The chain namespace that this verifier should verify.
|
|
9
|
+
*/
|
|
10
|
+
abstract readonly chainNamespace: ChainNamespace;
|
|
11
|
+
/**
|
|
12
|
+
* This method should return true if the verifier should verify the session.
|
|
13
|
+
* By default it will check by the chain namespace, but you may override it for a specific requirement.
|
|
14
|
+
*
|
|
15
|
+
* @param session SIWXSession
|
|
16
|
+
* @returns boolean
|
|
17
|
+
*/
|
|
18
|
+
shouldVerify(session: SIWXSession): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* This method should verify the session.
|
|
21
|
+
* You must implement this method with the verification logic.
|
|
22
|
+
*
|
|
23
|
+
* @param session SIWXSession
|
|
24
|
+
* @returns Promise<boolean> - If `true` means the session is valid.
|
|
25
|
+
*/
|
|
26
|
+
abstract verify(session: SIWXSession): Promise<boolean>;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=verifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifier.d.ts","sourceRoot":"","sources":["../../../../src/types/siwx/verifier.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,8BAAsB,YAAY;IAChC;;OAEG;IACH,kBAAyB,cAAc,EAAE,cAAc,CAAC;IAExD;;;;;;OAMG;IACI,YAAY,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO;IAIlD;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CACxD"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
export interface Storage {
|
|
2
|
+
/**
|
|
3
|
+
* Returns all keys in storage.
|
|
4
|
+
*/
|
|
5
|
+
getKeys(): Promise<string[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Returns all key-value entries in storage.
|
|
8
|
+
*/
|
|
9
|
+
getEntries<T = any>(): Promise<[string, T][]>;
|
|
10
|
+
/**
|
|
11
|
+
* Get an item from storage for a given key.
|
|
12
|
+
* @param key The key to retrieve.
|
|
13
|
+
*/
|
|
14
|
+
getItem<T = any>(key: string): Promise<T | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Set an item in storage for a given key.
|
|
17
|
+
* @param key The key to set.
|
|
18
|
+
* @param value The value to set.
|
|
19
|
+
*/
|
|
20
|
+
setItem<T = any>(key: string, value: T): Promise<void>;
|
|
21
|
+
/**
|
|
22
|
+
* Remove an item from storage for a given key.
|
|
23
|
+
* @param key The key to remove.
|
|
24
|
+
*/
|
|
25
|
+
removeItem(key: string): Promise<void>;
|
|
26
|
+
}
|
|
27
|
+
export interface SafeStorageItems {
|
|
28
|
+
'WALLETCONNECT_DEEPLINK_CHOICE': string;
|
|
29
|
+
'@appkit/recent_wallet': string;
|
|
30
|
+
'@appkit/connected_connectors': string;
|
|
31
|
+
'@appkit/onramp_preferred_country': string;
|
|
32
|
+
'@appkit/onramp_countries': string;
|
|
33
|
+
'@appkit/onramp_service_providers': string;
|
|
34
|
+
'@appkit/onramp_fiat_limits': string;
|
|
35
|
+
'@appkit/onramp_fiat_currencies': string;
|
|
36
|
+
'@appkit/onramp_preferred_fiat_currency': string;
|
|
37
|
+
'@appkit/onramp_countries_defaults': string;
|
|
38
|
+
'@appkit/active_namespace': string;
|
|
39
|
+
'@appkit/coinbase_connector/session': string;
|
|
40
|
+
'@appkit/siwx-auth-token': string;
|
|
41
|
+
'@appkit/siwx-nonce-token': string;
|
|
42
|
+
}
|
|
43
|
+
export declare const SafeStorageKeys: {
|
|
44
|
+
readonly WC_DEEPLINK: "WALLETCONNECT_DEEPLINK_CHOICE";
|
|
45
|
+
readonly RECENT_WALLET: "@appkit/recent_wallet";
|
|
46
|
+
readonly CONNECTED_CONNECTORS: "@appkit/connected_connectors";
|
|
47
|
+
readonly ONRAMP_PREFERRED_COUNTRY: "@appkit/onramp_preferred_country";
|
|
48
|
+
readonly ONRAMP_COUNTRIES: "@appkit/onramp_countries";
|
|
49
|
+
readonly ONRAMP_SERVICE_PROVIDERS: "@appkit/onramp_service_providers";
|
|
50
|
+
readonly ONRAMP_FIAT_LIMITS: "@appkit/onramp_fiat_limits";
|
|
51
|
+
readonly ONRAMP_FIAT_CURRENCIES: "@appkit/onramp_fiat_currencies";
|
|
52
|
+
readonly ONRAMP_PREFERRED_FIAT_CURRENCY: "@appkit/onramp_preferred_fiat_currency";
|
|
53
|
+
readonly ONRAMP_COUNTRIES_DEFAULTS: "@appkit/onramp_countries_defaults";
|
|
54
|
+
readonly ACTIVE_NAMESPACE: "@appkit/active_namespace";
|
|
55
|
+
readonly COINBASE_CONNECTOR_SESSION: "@appkit/coinbase_connector/session";
|
|
56
|
+
readonly SIWX_AUTH_TOKEN: "@appkit/siwx-auth-token";
|
|
57
|
+
readonly SIWX_NONCE_TOKEN: "@appkit/siwx-nonce-token";
|
|
58
|
+
};
|
|
59
|
+
//# sourceMappingURL=storage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/types/storage.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB;;OAEG;IACH,OAAO,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;IAE7B;;OAEG;IACH,UAAU,CAAC,CAAC,GAAG,GAAG,KAAK,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC;IAE9C;;;OAGG;IACH,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC;IAEtD;;;;OAIG;IACH,OAAO,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEvD;;;OAGG;IACH,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,gBAAgB;IAC/B,+BAA+B,EAAE,MAAM,CAAC;IACxC,uBAAuB,EAAE,MAAM,CAAC;IAChC,8BAA8B,EAAE,MAAM,CAAC;IACvC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,0BAA0B,EAAE,MAAM,CAAC;IACnC,kCAAkC,EAAE,MAAM,CAAC;IAC3C,4BAA4B,EAAE,MAAM,CAAC;IACrC,gCAAgC,EAAE,MAAM,CAAC;IACzC,wCAAwC,EAAE,MAAM,CAAC;IACjD,mCAAmC,EAAE,MAAM,CAAC;IAC5C,0BAA0B,EAAE,MAAM,CAAC;IACnC,oCAAoC,EAAE,MAAM,CAAC;IAC7C,yBAAyB,EAAE,MAAM,CAAC;IAClC,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;CAelB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/swap/index.ts"],"names":[],"mappings":"AACA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { CaipAddress } from '../common';
|
|
2
|
+
export type SwapToken = {
|
|
3
|
+
name: string;
|
|
4
|
+
symbol: string;
|
|
5
|
+
address: CaipAddress;
|
|
6
|
+
decimals: number;
|
|
7
|
+
logoUri: string;
|
|
8
|
+
eip2612?: boolean;
|
|
9
|
+
};
|
|
10
|
+
export type SwapTokenWithBalance = SwapToken & {
|
|
11
|
+
quantity: {
|
|
12
|
+
decimals: string;
|
|
13
|
+
numeric: string;
|
|
14
|
+
};
|
|
15
|
+
price: number;
|
|
16
|
+
value: number;
|
|
17
|
+
};
|
|
18
|
+
export type SwapInputTarget = 'sourceToken' | 'toToken';
|
|
19
|
+
//# sourceMappingURL=tokens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../../../src/types/swap/tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,WAAW,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,SAAS,GAAG;IAC7C,QAAQ,EAAE;QACR,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,SAAS,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { SocialProvider } from './common';
|
|
2
|
+
type EnabledSocials = SocialProvider;
|
|
3
|
+
export type Features = {
|
|
4
|
+
/**
|
|
5
|
+
* @description Enable or disable the swaps feature. Enabled by default.
|
|
6
|
+
* @type {boolean}
|
|
7
|
+
*/
|
|
8
|
+
swaps?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* @description Enable or disable the onramp feature. Enabled by default.
|
|
11
|
+
* @type {boolean}
|
|
12
|
+
*/
|
|
13
|
+
onramp?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* @description Show or hide the regular wallet options when socials are enabled. Enabled by default.
|
|
16
|
+
* @type {boolean}
|
|
17
|
+
*/
|
|
18
|
+
showWallets?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @description Enable or disable the socials feature. Enabled by default.
|
|
21
|
+
* @type {EnabledSocials[]}
|
|
22
|
+
*/
|
|
23
|
+
socials?: EnabledSocials[] | false;
|
|
24
|
+
};
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=ui.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui.d.ts","sourceRoot":"","sources":["../../../src/types/ui.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,KAAK,cAAc,GAAG,cAAc,CAAC;AAErC,MAAM,MAAM,QAAQ,GAAG;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,OAAO,CAAC,EAAE,cAAc,EAAE,GAAG,KAAK,CAAC;CACpC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CaipAddress, CaipNetworkId, SocialProvider, AccountType } from '../common';
|
|
2
|
+
import type { Balance } from '../blockchain/balance';
|
|
3
|
+
import type { WalletInfo, Identity } from './wallet-info';
|
|
4
|
+
import type { BlockchainAdapter } from '../../adapters/BlockchainAdapter';
|
|
5
|
+
export interface Connection {
|
|
6
|
+
accounts: CaipAddress[];
|
|
7
|
+
balances: Map<CaipAddress, Balance[]>;
|
|
8
|
+
adapter: BlockchainAdapter;
|
|
9
|
+
caipNetwork: CaipNetworkId;
|
|
10
|
+
wallet?: WalletInfo;
|
|
11
|
+
properties?: ConnectionProperties;
|
|
12
|
+
type?: AccountType;
|
|
13
|
+
identities?: Map<CaipAddress, Identity>;
|
|
14
|
+
}
|
|
15
|
+
export interface ConnectionProperties {
|
|
16
|
+
email?: string;
|
|
17
|
+
username?: string;
|
|
18
|
+
smartAccounts?: CaipAddress[];
|
|
19
|
+
provider?: SocialProvider;
|
|
20
|
+
sessionTopic?: string;
|
|
21
|
+
canAddEvmChain?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface LinkingRecord {
|
|
24
|
+
redirect: string;
|
|
25
|
+
href: string;
|
|
26
|
+
}
|
|
27
|
+
export interface WalletDeepLink {
|
|
28
|
+
href: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACzF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAE1E,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,WAAW,EAAE,CAAC;IACxB,QAAQ,EAAE,GAAG,CAAC,WAAW,EAAE,OAAO,EAAE,CAAC,CAAC;IACtC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,WAAW,EAAE,aAAa,CAAC;IAC3B,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,UAAU,CAAC,EAAE,oBAAoB,CAAC;IAClC,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,UAAU,CAAC,EAAE,GAAG,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,WAAW,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,cAAc,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { EventEmitter } from 'events';
|
|
3
|
+
import type { ChainNamespace, CaipAddress, CaipNetworkId } from '../common';
|
|
4
|
+
import type { AppKitNetwork } from '../blockchain/network';
|
|
5
|
+
import type { Provider } from '../blockchain/adapter';
|
|
6
|
+
import type { WalletInfo, Metadata } from './wallet-info';
|
|
7
|
+
import type { ConnectionProperties } from './connection';
|
|
8
|
+
import type { Storage } from '../storage';
|
|
9
|
+
import type { WcWallet } from '../api/wallet-api';
|
|
10
|
+
export type ConnectorType = 'walletconnect' | 'coinbase' | 'phantom' | 'solflare';
|
|
11
|
+
export interface BaseNamespace {
|
|
12
|
+
chains?: CaipNetworkId[];
|
|
13
|
+
accounts: CaipAddress[];
|
|
14
|
+
methods: string[];
|
|
15
|
+
events: string[];
|
|
16
|
+
}
|
|
17
|
+
type Namespace = BaseNamespace;
|
|
18
|
+
export type Namespaces = Record<string, Namespace>;
|
|
19
|
+
export type ProposalNamespaces = Record<string, Omit<Namespace, 'accounts'> & Required<Pick<Namespace, 'chains'>> & {
|
|
20
|
+
rpcMap: Record<string, string>;
|
|
21
|
+
}>;
|
|
22
|
+
export type ConnectOptions = {
|
|
23
|
+
namespaces?: ProposalNamespaces;
|
|
24
|
+
defaultNetwork?: AppKitNetwork;
|
|
25
|
+
universalLink?: string;
|
|
26
|
+
};
|
|
27
|
+
export type ConnectorInitOptions = {
|
|
28
|
+
storage: Storage;
|
|
29
|
+
metadata: Metadata;
|
|
30
|
+
};
|
|
31
|
+
export declare abstract class WalletConnector extends EventEmitter {
|
|
32
|
+
type: ConnectorType;
|
|
33
|
+
protected provider?: Provider;
|
|
34
|
+
protected namespaces?: Namespaces;
|
|
35
|
+
protected wallet?: WalletInfo;
|
|
36
|
+
protected storage?: Storage;
|
|
37
|
+
protected metadata?: Metadata;
|
|
38
|
+
protected properties?: ConnectionProperties;
|
|
39
|
+
constructor({ type }: {
|
|
40
|
+
type: ConnectorType;
|
|
41
|
+
});
|
|
42
|
+
init(ops: ConnectorInitOptions): Promise<void>;
|
|
43
|
+
setProvider(provider: Provider): void;
|
|
44
|
+
disconnect(): Promise<void>;
|
|
45
|
+
abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
|
|
46
|
+
abstract getProvider(namespace?: ChainNamespace): Provider;
|
|
47
|
+
abstract getNamespaces(): Namespaces;
|
|
48
|
+
abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
|
|
49
|
+
abstract getWalletInfo(): WalletInfo | undefined;
|
|
50
|
+
abstract getProperties(): ConnectionProperties | undefined;
|
|
51
|
+
abstract switchNetwork(network: AppKitNetwork): Promise<void>;
|
|
52
|
+
abstract restoreSession(): Promise<boolean>;
|
|
53
|
+
}
|
|
54
|
+
export type AppKitConnectOptions = {
|
|
55
|
+
walletId?: string;
|
|
56
|
+
wallet?: WcWallet;
|
|
57
|
+
};
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=connector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connector.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/connector.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { CaipNetworkId } from '../common';
|
|
2
|
+
export interface WalletInfo {
|
|
3
|
+
name?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
url?: string;
|
|
7
|
+
icons?: string[];
|
|
8
|
+
redirect?: {
|
|
9
|
+
native?: string;
|
|
10
|
+
universal?: string;
|
|
11
|
+
linkMode?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type?: 'walletconnect' | 'external' | 'unknown';
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}
|
|
16
|
+
export type Metadata = {
|
|
17
|
+
name: string;
|
|
18
|
+
description: string;
|
|
19
|
+
url: string;
|
|
20
|
+
icons: string[];
|
|
21
|
+
redirect?: {
|
|
22
|
+
native?: string;
|
|
23
|
+
universal?: string;
|
|
24
|
+
linkMode?: boolean;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export interface Token {
|
|
28
|
+
address: string;
|
|
29
|
+
image?: string;
|
|
30
|
+
}
|
|
31
|
+
export type Tokens = Record<CaipNetworkId, Token>;
|
|
32
|
+
export interface Identity {
|
|
33
|
+
name: string;
|
|
34
|
+
avatar?: string;
|
|
35
|
+
}
|
|
36
|
+
export type ConnectedWalletInfo = WalletInfo | undefined;
|
|
37
|
+
//# sourceMappingURL=wallet-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-info.d.ts","sourceRoot":"","sources":["../../../../src/types/wallet/wallet-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,MAAM,WAAW,UAAU;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;IACF,IAAI,CAAC,EAAE,eAAe,GAAG,UAAU,GAAG,SAAS,CAAC;IAChD,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,QAAQ,GAAG;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,QAAQ,CAAC,EAAE;QACT,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB,CAAC;CACH,CAAC;AAEF,MAAM,WAAW,KAAK;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,MAAM,GAAG,MAAM,CAAC,aAAa,EAAE,KAAK,CAAC,CAAC;AAElD,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,GAAG,SAAS,CAAC"}
|
|
@@ -8,10 +8,49 @@ export declare const ConstantsUtil: {
|
|
|
8
8
|
BLOCKCHAIN_API_RPC_URL_STAGING: string;
|
|
9
9
|
PULSE_API_URL: string;
|
|
10
10
|
API_URL: string;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
WEB_WALLET_URL: string;
|
|
12
|
+
SECURE_SITE_DASHBOARD: string;
|
|
13
|
+
SECURE_SITE_ICON: string;
|
|
14
|
+
REOWN_URL: string;
|
|
15
|
+
CHAIN_NAME_MAP: {
|
|
16
|
+
eip155: string;
|
|
17
|
+
solana: string;
|
|
18
|
+
polkadot: string;
|
|
19
|
+
bip122: string;
|
|
20
|
+
cosmos: string;
|
|
21
|
+
sui: string;
|
|
22
|
+
stacks: string;
|
|
23
|
+
};
|
|
15
24
|
USDT_CONTRACT_ADDRESSES: string[];
|
|
25
|
+
PHANTOM_CUSTOM_WALLET: {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
image_id: string;
|
|
29
|
+
mobile_link: string;
|
|
30
|
+
play_store: string;
|
|
31
|
+
app_store: string;
|
|
32
|
+
android_app_id: string;
|
|
33
|
+
ios_schema: string;
|
|
34
|
+
};
|
|
35
|
+
COINBASE_CUSTOM_WALLET: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
image_id: string;
|
|
39
|
+
mobile_link: string;
|
|
40
|
+
play_store: string;
|
|
41
|
+
app_store: string;
|
|
42
|
+
android_app_id: string;
|
|
43
|
+
ios_schema: string;
|
|
44
|
+
};
|
|
45
|
+
SOLFLARE_CUSTOM_WALLET: {
|
|
46
|
+
id: string;
|
|
47
|
+
name: string;
|
|
48
|
+
image_id: string;
|
|
49
|
+
mobile_link: string;
|
|
50
|
+
play_store: string;
|
|
51
|
+
app_store: string;
|
|
52
|
+
android_app_id: string;
|
|
53
|
+
ios_schema: string;
|
|
54
|
+
};
|
|
16
55
|
};
|
|
17
56
|
//# sourceMappingURL=ConstantsUtil.d.ts.map
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6EzB,CAAC"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { CaipAddress } from '../types';
|
|
1
2
|
export declare const NetworkUtil: {
|
|
2
3
|
caipNetworkIdToNumber(caipnetworkId?: `${string}:${string}`): number | undefined;
|
|
4
|
+
getPlainAddress(caipAddress?: CaipAddress): string | undefined;
|
|
3
5
|
};
|
|
4
6
|
//# sourceMappingURL=NetworkUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;0CACgB,GAAG,MAAM,IAAI,MAAM,EAAE;
|
|
1
|
+
{"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAE5C,eAAO,MAAM,WAAW;0CACgB,GAAG,MAAM,IAAI,MAAM,EAAE;kCAG7B,WAAW;CAG1C,CAAC"}
|
|
@@ -1,27 +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;
|
|
26
|
+
/**
|
|
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
|
+
*/
|
|
12
32
|
nextMultipleOfTen(amount?: number): number;
|
|
13
33
|
/**
|
|
14
|
-
*
|
|
15
|
-
* @param value - The value to format
|
|
16
|
-
* @param decimals - number of
|
|
17
|
-
* @returns
|
|
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.
|
|
18
38
|
*/
|
|
19
39
|
formatNumberToLocalString(value: string | number | undefined, decimals?: number): string;
|
|
20
40
|
/**
|
|
21
|
-
*
|
|
22
|
-
* @param value - The formatted string to parse
|
|
23
|
-
* @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.
|
|
24
44
|
*/
|
|
25
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;
|
|
26
54
|
};
|
|
27
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,10 +1,5 @@
|
|
|
1
|
-
import type { ConnectorType } from './TypeUtil';
|
|
2
1
|
export declare const PresetsUtil: {
|
|
3
|
-
|
|
4
|
-
EIP155NetworkImageIds: Record<string, string>;
|
|
5
|
-
ConnectorNamesMap: Record<string, string>;
|
|
6
|
-
ConnectorImageIds: Record<string, string>;
|
|
7
|
-
ConnectorTypesMap: Record<string, ConnectorType>;
|
|
2
|
+
NetworkImageIds: Record<string, string>;
|
|
8
3
|
RpcChainIds: number[];
|
|
9
4
|
};
|
|
10
5
|
//# sourceMappingURL=PresetsUtil.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"PresetsUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/PresetsUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;CA2HvB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM;
|
|
1
|
+
{"version":3,"file":"StringUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/StringUtil.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;uBACF,MAAM;0BAOH,MAAM;CAO7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reown/appkit-common-react-native",
|
|
3
|
-
"version": "0.0.0-develop-
|
|
3
|
+
"version": "0.0.0-develop-20251030154825",
|
|
4
4
|
"main": "lib/commonjs/index.js",
|
|
5
5
|
"types": "lib/typescript/index.d.ts",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
7
|
+
"react-native": "src/index.ts",
|
|
7
8
|
"source": "src/index.ts",
|
|
8
9
|
"scripts": {
|
|
9
10
|
"build": "bob build",
|
|
@@ -15,6 +16,10 @@
|
|
|
15
16
|
"bignumber.js": "9.1.2",
|
|
16
17
|
"dayjs": "1.11.10"
|
|
17
18
|
},
|
|
19
|
+
"peerDependencies": {
|
|
20
|
+
"react": ">=18",
|
|
21
|
+
"react-native": ">=0.72"
|
|
22
|
+
},
|
|
18
23
|
"files": [
|
|
19
24
|
"src",
|
|
20
25
|
"lib"
|
|
@@ -30,28 +35,14 @@
|
|
|
30
35
|
"repository": "https://github.com/reown-com/appkit-react-native",
|
|
31
36
|
"author": "Reown (https://discord.gg/reown)",
|
|
32
37
|
"homepage": "https://reown.com/appkit",
|
|
33
|
-
"license": "
|
|
38
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
34
39
|
"bugs": {
|
|
35
40
|
"url": "https://github.com/reown-com/appkit-react-native/issues"
|
|
36
41
|
},
|
|
37
42
|
"publishConfig": {
|
|
38
43
|
"registry": "https://registry.npmjs.org/",
|
|
39
|
-
"access": "public"
|
|
40
|
-
|
|
41
|
-
"react-native": "src/index.ts",
|
|
42
|
-
"react-native-builder-bob": {
|
|
43
|
-
"source": "src",
|
|
44
|
-
"output": "lib",
|
|
45
|
-
"targets": [
|
|
46
|
-
"commonjs",
|
|
47
|
-
"module",
|
|
48
|
-
[
|
|
49
|
-
"typescript",
|
|
50
|
-
{
|
|
51
|
-
"tsc": "../../node_modules/.bin/tsc"
|
|
52
|
-
}
|
|
53
|
-
]
|
|
54
|
-
]
|
|
44
|
+
"access": "public",
|
|
45
|
+
"provenance": true
|
|
55
46
|
},
|
|
56
47
|
"eslintIgnore": [
|
|
57
48
|
"node_modules/",
|