@reown/appkit-common-react-native 0.0.0-feat-multichain-20250801190527 → 0.0.0-feat-multichain-20250805142032
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 +1 -1
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
- package/lib/commonjs/index.js +4 -4
- package/lib/commonjs/index.js.map +1 -1
- 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 +2 -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/siwe/config.js +6 -0
- package/lib/commonjs/types/siwe/config.js.map +1 -0
- package/lib/commonjs/types/siwe/index.js +28 -0
- package/lib/commonjs/types/siwe/index.js.map +1 -0
- package/lib/commonjs/types/siwe/message.js +6 -0
- package/lib/commonjs/types/siwe/message.js.map +1 -0
- package/lib/commonjs/types/storage.js +2 -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/types/ui.js.map +1 -0
- package/lib/commonjs/types/wallet/connection.js +6 -0
- package/lib/commonjs/types/wallet/connection.js.map +1 -0
- package/lib/commonjs/{utils/TypeUtil.js → types/wallet/connector.js} +1 -15
- 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 +2 -1
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/adapters/BlockchainAdapter.js +1 -1
- package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
- package/lib/module/index.js +1 -1
- package/lib/module/index.js.map +1 -1
- 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 +2 -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/siwe/config.js +4 -0
- package/lib/module/types/siwe/config.js.map +1 -0
- package/lib/module/types/siwe/index.js +6 -0
- package/lib/module/types/siwe/index.js.map +1 -0
- package/lib/module/types/siwe/message.js +4 -0
- package/lib/module/types/siwe/message.js.map +1 -0
- package/lib/module/types/storage.js +2 -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/types/ui.js.map +1 -0
- package/lib/module/types/wallet/connection.js +4 -0
- package/lib/module/types/wallet/connection.js.map +1 -0
- package/lib/module/{utils/TypeUtil.js → types/wallet/connector.js} +1 -16
- 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 +2 -1
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/typescript/adapters/BlockchainAdapter.d.ts +1 -1
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
- package/lib/typescript/adapters/EvmAdapter.d.ts +1 -1
- package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
- package/lib/typescript/index.d.ts +1 -1
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/networks/bitcoin.d.ts +1 -1
- package/lib/typescript/networks/bitcoin.d.ts.map +1 -1
- package/lib/typescript/networks/solana.d.ts +1 -1
- package/lib/typescript/networks/solana.d.ts.map +1 -1
- 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 +304 -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 +45 -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/types/blockchain/transaction.d.ts +63 -0
- 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/siwe/config.d.ts +31 -0
- package/lib/typescript/types/siwe/config.d.ts.map +1 -0
- package/lib/typescript/types/siwe/index.d.ts +3 -0
- package/lib/typescript/types/siwe/index.d.ts.map +1 -0
- package/lib/typescript/types/siwe/message.d.ts +57 -0
- package/lib/typescript/types/siwe/message.d.ts.map +1 -0
- package/lib/typescript/types/storage.d.ts +27 -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 +30 -0
- package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
- package/lib/typescript/types/wallet/connector.d.ts +57 -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 +36 -0
- package/lib/typescript/types/wallet/wallet-info.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/NetworkUtil.d.ts +1 -1
- package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/adapters/BlockchainAdapter.ts +2 -2
- package/src/adapters/EvmAdapter.ts +1 -1
- package/src/adapters/__tests__/EvmAdapter.test.ts +1 -1
- package/src/index.ts +2 -1
- package/src/networks/bitcoin.ts +1 -1
- package/src/networks/solana.ts +1 -1
- package/src/types/api/blockchain-api.ts +213 -0
- package/src/types/api/events.ts +394 -0
- package/src/types/api/index.ts +4 -0
- package/src/types/api/wallet-api.ts +64 -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/types/blockchain/transaction.ts +71 -0
- 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/siwe/config.ts +44 -0
- package/src/types/siwe/index.ts +3 -0
- package/src/types/siwe/message.ts +62 -0
- package/src/types/storage.ts +30 -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 +33 -0
- package/src/types/wallet/connector.ts +84 -0
- package/src/types/wallet/index.ts +4 -0
- package/src/types/wallet/wallet-info.ts +41 -0
- package/src/utils/ConstantsUtil.ts +2 -1
- package/src/utils/NetworkUtil.ts +1 -1
- package/lib/commonjs/utils/TypeUtil.js.map +0 -1
- package/lib/module/utils/TypeUtil.js.map +0 -1
- package/lib/typescript/utils/TypeUtil.d.ts +0 -395
- package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
- package/src/utils/TypeUtil.ts +0 -495
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
[key: string]: unknown;
|
|
14
|
+
}
|
|
15
|
+
export type Metadata = {
|
|
16
|
+
name: string;
|
|
17
|
+
description: string;
|
|
18
|
+
url: string;
|
|
19
|
+
icons: string[];
|
|
20
|
+
redirect?: {
|
|
21
|
+
native?: string;
|
|
22
|
+
universal?: string;
|
|
23
|
+
linkMode?: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export interface Token {
|
|
27
|
+
address: string;
|
|
28
|
+
image?: string;
|
|
29
|
+
}
|
|
30
|
+
export type Tokens = Record<CaipNetworkId, Token>;
|
|
31
|
+
export interface Identity {
|
|
32
|
+
name: string;
|
|
33
|
+
avatar?: string;
|
|
34
|
+
}
|
|
35
|
+
export type ConnectedWalletInfo = WalletInfo | undefined;
|
|
36
|
+
//# 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,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"}
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgEzB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CaipAddress } from '
|
|
1
|
+
import type { CaipAddress } from '../types';
|
|
2
2
|
export declare const NetworkUtil: {
|
|
3
3
|
caipNetworkIdToNumber(caipnetworkId?: `${string}:${string}`): number | undefined;
|
|
4
4
|
getPlainAddress(caipAddress?: CaipAddress): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NetworkUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/NetworkUtil.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
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"}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@ import type {
|
|
|
11
11
|
GetBalanceResponse,
|
|
12
12
|
Provider,
|
|
13
13
|
WalletConnector
|
|
14
|
-
} from '../
|
|
14
|
+
} from '../types';
|
|
15
15
|
import { NetworkUtil } from '../utils/NetworkUtil';
|
|
16
16
|
|
|
17
17
|
export abstract class BlockchainAdapter extends EventEmitter {
|
|
@@ -56,7 +56,7 @@ export abstract class BlockchainAdapter extends EventEmitter {
|
|
|
56
56
|
getProvider(): Provider {
|
|
57
57
|
if (!this.connector) throw new Error('No active connector');
|
|
58
58
|
|
|
59
|
-
return this.connector.getProvider();
|
|
59
|
+
return this.connector.getProvider(this.getSupportedNamespace());
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
subscribeToEvents(): void {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BlockchainAdapter } from './BlockchainAdapter';
|
|
2
2
|
import { NumberUtil } from '../utils/NumberUtil';
|
|
3
|
-
import type { AppKitNetwork } from '../
|
|
3
|
+
import type { AppKitNetwork } from '../types';
|
|
4
4
|
|
|
5
5
|
// Type definitions for writeContract
|
|
6
6
|
export interface WriteContractData {
|
package/src/index.ts
CHANGED
|
@@ -13,4 +13,5 @@ export { bitcoin, bitcoinTestnet } from './networks/bitcoin';
|
|
|
13
13
|
export { BlockchainAdapter } from './adapters/BlockchainAdapter';
|
|
14
14
|
export { EVMAdapter } from './adapters/EvmAdapter';
|
|
15
15
|
export { SolanaBaseAdapter } from './adapters/SolanaBaseAdapter';
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
export * from './types';
|
package/src/networks/bitcoin.ts
CHANGED
package/src/networks/solana.ts
CHANGED
|
@@ -0,0 +1,213 @@
|
|
|
1
|
+
import type { CaipAddress, CaipNetworkId, BaseError, RequestCache } from '../common';
|
|
2
|
+
import type { Transaction } from '../blockchain/transaction';
|
|
3
|
+
import type { SwapToken } from '../swap';
|
|
4
|
+
|
|
5
|
+
export interface BlockchainApiIdentityRequest {
|
|
6
|
+
address: `0x${string}`;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface BlockchainApiIdentityResponse {
|
|
10
|
+
avatar: string;
|
|
11
|
+
name: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface BlockchainApiBalance {
|
|
15
|
+
name: string;
|
|
16
|
+
symbol: string;
|
|
17
|
+
chainId: string;
|
|
18
|
+
address?: CaipAddress;
|
|
19
|
+
value?: number;
|
|
20
|
+
price: number;
|
|
21
|
+
quantity: {
|
|
22
|
+
decimals: string;
|
|
23
|
+
numeric: string;
|
|
24
|
+
};
|
|
25
|
+
iconUrl: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export interface BlockchainApiBalanceResponse {
|
|
29
|
+
balances: BlockchainApiBalance[];
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export interface BlockchainApiTransactionsRequest {
|
|
33
|
+
account: string;
|
|
34
|
+
projectId: string;
|
|
35
|
+
cursor?: string;
|
|
36
|
+
signal?: AbortSignal;
|
|
37
|
+
cache?: RequestCache;
|
|
38
|
+
chainId: CaipNetworkId;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface BlockchainApiTransactionsResponse {
|
|
42
|
+
data: Transaction[];
|
|
43
|
+
next: string | null;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface BlockchainApiSwapAllowanceResponse {
|
|
47
|
+
allowance: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface BlockchainApiGenerateSwapCalldataRequest {
|
|
51
|
+
projectId: string;
|
|
52
|
+
userAddress: CaipAddress;
|
|
53
|
+
from: CaipAddress;
|
|
54
|
+
to: CaipAddress;
|
|
55
|
+
amount: string;
|
|
56
|
+
eip155?: {
|
|
57
|
+
slippage: string;
|
|
58
|
+
permit?: string;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export interface BlockchainApiGenerateSwapCalldataResponse {
|
|
63
|
+
tx: {
|
|
64
|
+
from: CaipAddress;
|
|
65
|
+
to: CaipAddress;
|
|
66
|
+
data: `0x${string}`;
|
|
67
|
+
amount: string;
|
|
68
|
+
eip155: {
|
|
69
|
+
gas: string;
|
|
70
|
+
gasPrice: string;
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface BlockchainApiGenerateApproveCalldataRequest {
|
|
76
|
+
projectId: string;
|
|
77
|
+
userAddress: CaipAddress;
|
|
78
|
+
from: CaipAddress;
|
|
79
|
+
to: CaipAddress;
|
|
80
|
+
amount?: number;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
export interface BlockchainApiGenerateApproveCalldataResponse {
|
|
84
|
+
tx: {
|
|
85
|
+
from: CaipAddress;
|
|
86
|
+
to: CaipAddress;
|
|
87
|
+
data: `0x${string}`;
|
|
88
|
+
value: string;
|
|
89
|
+
eip155: {
|
|
90
|
+
gas: number;
|
|
91
|
+
gasPrice: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface BlockchainApiTokenPriceRequest {
|
|
97
|
+
projectId: string;
|
|
98
|
+
currency?: 'usd' | 'eur' | 'gbp' | 'aud' | 'cad' | 'inr' | 'jpy' | 'btc' | 'eth';
|
|
99
|
+
addresses: CaipAddress[];
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface BlockchainApiTokenPriceResponse {
|
|
103
|
+
fungibles: {
|
|
104
|
+
name: string;
|
|
105
|
+
symbol: string;
|
|
106
|
+
iconUrl: string;
|
|
107
|
+
price: number;
|
|
108
|
+
}[];
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export interface BlockchainApiSwapAllowanceRequest {
|
|
112
|
+
projectId: string;
|
|
113
|
+
tokenAddress: CaipAddress;
|
|
114
|
+
userAddress: CaipAddress;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export interface BlockchainApiGasPriceRequest {
|
|
118
|
+
projectId: string;
|
|
119
|
+
chainId: CaipNetworkId;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface BlockchainApiGasPriceResponse {
|
|
123
|
+
standard: string;
|
|
124
|
+
fast: string;
|
|
125
|
+
instant: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface BlockchainApiEnsError extends BaseError {
|
|
129
|
+
status: string;
|
|
130
|
+
reasons: { name: string; description: string }[];
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export type ReownName = `${string}.reown.id` | `${string}.wcn.id`;
|
|
134
|
+
|
|
135
|
+
export interface BlockchainApiLookupEnsName {
|
|
136
|
+
name: ReownName;
|
|
137
|
+
registered: number;
|
|
138
|
+
updated: number;
|
|
139
|
+
addresses: Record<
|
|
140
|
+
string,
|
|
141
|
+
{
|
|
142
|
+
address: string;
|
|
143
|
+
created: string;
|
|
144
|
+
}
|
|
145
|
+
>;
|
|
146
|
+
attributes: {
|
|
147
|
+
avatar?: string;
|
|
148
|
+
bio?: string;
|
|
149
|
+
}[];
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
export interface BlockchainApiSwapQuoteRequest {
|
|
153
|
+
projectId: string;
|
|
154
|
+
chainId?: CaipNetworkId;
|
|
155
|
+
amount: string;
|
|
156
|
+
userAddress: CaipAddress;
|
|
157
|
+
from: CaipAddress;
|
|
158
|
+
to: CaipAddress;
|
|
159
|
+
gasPrice: string;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface BlockchainApiSwapQuoteResponse {
|
|
163
|
+
quotes: {
|
|
164
|
+
id: string | null;
|
|
165
|
+
fromAmount: string;
|
|
166
|
+
fromAccount: string;
|
|
167
|
+
toAmount: string;
|
|
168
|
+
toAccount: string;
|
|
169
|
+
}[];
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface BlockchainApiSwapTokensRequest {
|
|
173
|
+
projectId: string;
|
|
174
|
+
chainId: CaipNetworkId;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface BlockchainApiOnRampQuotesRequest {
|
|
178
|
+
countryCode: string;
|
|
179
|
+
paymentMethodType?: string;
|
|
180
|
+
destinationCurrencyCode: string;
|
|
181
|
+
sourceAmount: number;
|
|
182
|
+
sourceCurrencyCode: string;
|
|
183
|
+
walletAddress: string;
|
|
184
|
+
excludeProviders?: string[];
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export interface BlockchainApiSwapTokensResponse {
|
|
188
|
+
tokens: SwapToken[];
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
export interface BlockchainApiOnRampWidgetRequest {
|
|
192
|
+
countryCode: string;
|
|
193
|
+
destinationCurrencyCode: string;
|
|
194
|
+
paymentMethodType: string;
|
|
195
|
+
serviceProvider: string;
|
|
196
|
+
sourceAmount: number;
|
|
197
|
+
sourceCurrencyCode: string;
|
|
198
|
+
walletAddress: string;
|
|
199
|
+
redirectUrl?: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export type BlockchainApiOnRampWidgetResponse = {
|
|
203
|
+
widgetUrl: string;
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
export class BlockchainOnRampError extends Error {
|
|
207
|
+
code: string;
|
|
208
|
+
constructor(code: string, message: string) {
|
|
209
|
+
super(message);
|
|
210
|
+
this.code = code;
|
|
211
|
+
this.message = message;
|
|
212
|
+
}
|
|
213
|
+
}
|