@reown/appkit-common-react-native 2.0.0-alpha.2 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/adapters/BlockchainAdapter.js +25 -12
- package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
- package/lib/commonjs/adapters/EvmAdapter.js +0 -11
- package/lib/commonjs/adapters/EvmAdapter.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 +8 -6
- package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
- package/lib/commonjs/utils/NetworkUtil.js +3 -0
- package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
- package/lib/module/adapters/BlockchainAdapter.js +25 -12
- package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
- package/lib/module/adapters/EvmAdapter.js +0 -11
- package/lib/module/adapters/EvmAdapter.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 +8 -6
- package/lib/module/utils/ConstantsUtil.js.map +1 -1
- package/lib/module/utils/NetworkUtil.js +3 -0
- package/lib/module/utils/NetworkUtil.js.map +1 -1
- package/lib/typescript/adapters/BlockchainAdapter.d.ts +5 -4
- package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
- package/lib/typescript/adapters/EvmAdapter.d.ts +1 -2
- 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 +7 -5
- 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/package.json +1 -1
- package/src/adapters/BlockchainAdapter.ts +34 -15
- package/src/adapters/EvmAdapter.ts +1 -13
- package/src/adapters/__tests__/EvmAdapter.test.ts +2 -2
- 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 +9 -8
- package/src/utils/NetworkUtil.ts +5 -0
- 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 -394
- package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
- package/src/utils/TypeUtil.ts +0 -493
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export const OnRampErrorType = {
|
|
4
|
+
AMOUNT_TOO_LOW: 'INVALID_AMOUNT_TOO_LOW',
|
|
5
|
+
AMOUNT_TOO_HIGH: 'INVALID_AMOUNT_TOO_HIGH',
|
|
6
|
+
INVALID_AMOUNT: 'INVALID_AMOUNT',
|
|
7
|
+
INCOMPATIBLE_REQUEST: 'INCOMPATIBLE_REQUEST',
|
|
8
|
+
BAD_REQUEST: 'BAD_REQUEST',
|
|
9
|
+
NO_VALID_QUOTES: 'NO_VALID_QUOTES',
|
|
10
|
+
FAILED_TO_LOAD: 'FAILED_TO_LOAD',
|
|
11
|
+
FAILED_TO_LOAD_COUNTRIES: 'FAILED_TO_LOAD_COUNTRIES',
|
|
12
|
+
FAILED_TO_LOAD_PROVIDERS: 'FAILED_TO_LOAD_PROVIDERS',
|
|
13
|
+
FAILED_TO_LOAD_METHODS: 'FAILED_TO_LOAD_METHODS',
|
|
14
|
+
FAILED_TO_LOAD_CURRENCIES: 'FAILED_TO_LOAD_CURRENCIES',
|
|
15
|
+
FAILED_TO_LOAD_LIMITS: 'FAILED_TO_LOAD_LIMITS',
|
|
16
|
+
UNKNOWN: 'UNKNOWN_ERROR'
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["OnRampErrorType","AMOUNT_TOO_LOW","AMOUNT_TOO_HIGH","INVALID_AMOUNT","INCOMPATIBLE_REQUEST","BAD_REQUEST","NO_VALID_QUOTES","FAILED_TO_LOAD","FAILED_TO_LOAD_COUNTRIES","FAILED_TO_LOAD_PROVIDERS","FAILED_TO_LOAD_METHODS","FAILED_TO_LOAD_CURRENCIES","FAILED_TO_LOAD_LIMITS","UNKNOWN"],"sourceRoot":"../../../../src","sources":["types/onramp/errors.ts"],"mappings":";;AAAA,OAAO,MAAMA,eAAe,GAAG;EAC7BC,cAAc,EAAE,wBAAwB;EACxCC,eAAe,EAAE,yBAAyB;EAC1CC,cAAc,EAAE,gBAAgB;EAChCC,oBAAoB,EAAE,sBAAsB;EAC5CC,WAAW,EAAE,aAAa;EAC1BC,eAAe,EAAE,iBAAiB;EAClCC,cAAc,EAAE,gBAAgB;EAChCC,wBAAwB,EAAE,0BAA0B;EACpDC,wBAAwB,EAAE,0BAA0B;EACpDC,sBAAsB,EAAE,wBAAwB;EAChDC,yBAAyB,EAAE,2BAA2B;EACtDC,qBAAqB,EAAE,uBAAuB;EAC9CC,OAAO,EAAE;AACX,CAAU","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/onramp/index.ts"],"mappings":";;AAAA;AACA,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,UAAU;AACxB,cAAc,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/onramp/quotes.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/siwe/config.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/siwe/index.ts"],"mappings":";;AAAA;AACA,cAAc,UAAU;AACxB,cAAc,WAAW","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/siwe/message.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/storage.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/swap/index.ts"],"mappings":";;AAAA;AACA,cAAc,UAAU","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/swap/tokens.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/ui.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/wallet/connection.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import { EventEmitter } from 'events';
|
|
4
|
-
|
|
5
|
-
//********** Adapter Event Payloads **********//
|
|
6
|
-
|
|
7
|
-
//********** Adapter Event Map **********//
|
|
8
|
-
|
|
9
|
-
//********** Connector Types **********//
|
|
10
|
-
|
|
11
4
|
export class WalletConnector extends EventEmitter {
|
|
12
5
|
constructor({
|
|
13
6
|
type
|
|
@@ -29,12 +22,4 @@ export class WalletConnector extends EventEmitter {
|
|
|
29
22
|
this.properties = undefined;
|
|
30
23
|
}
|
|
31
24
|
}
|
|
32
|
-
|
|
33
|
-
//********** Provider Types **********//
|
|
34
|
-
|
|
35
|
-
//********** Others **********//
|
|
36
|
-
|
|
37
|
-
//********** SIWE Types **********//
|
|
38
|
-
|
|
39
|
-
// Signed Cacao (CAIP-74)
|
|
40
|
-
//# sourceMappingURL=TypeUtil.js.map
|
|
25
|
+
//# sourceMappingURL=connector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["EventEmitter","WalletConnector","constructor","type","init","ops","storage","metadata","setProvider","provider","disconnect","namespaces","undefined","wallet","properties"],"sourceRoot":"../../../../src","sources":["types/wallet/connector.ts"],"mappings":";;AAAA,SAASA,YAAY,QAAQ,QAAQ;AAwCrC,OAAO,MAAeC,eAAe,SAASD,YAAY,CAAC;EASzDE,WAAWA,CAAC;IAAEC;EAA8B,CAAC,EAAE;IAC7C,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;EAEA,MAAaC,UAAUA,CAAA,EAAG;IACxB,MAAM,IAAI,CAACD,QAAQ,EAAEC,UAAU,CAAC,CAAC;IACjC,IAAI,CAACC,UAAU,GAAGC,SAAS;IAC3B,IAAI,CAACC,MAAM,GAAGD,SAAS;IACvB,IAAI,CAACE,UAAU,GAAGF,SAAS;EAC7B;AAUF","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/wallet/index.ts"],"mappings":";;AAAA;AACA,cAAc,aAAa;AAC3B,cAAc,cAAc;AAC5B,cAAc,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../../src","sources":["types/wallet/wallet-info.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
export const ConstantsUtil = {
|
|
4
|
-
VERSION: '2.0.0-alpha.
|
|
4
|
+
VERSION: '2.0.0-alpha.3',
|
|
5
5
|
EIP155: 'eip155',
|
|
6
6
|
ADD_CHAIN_METHOD: 'wallet_addEthereumChain',
|
|
7
7
|
WC_NAME_SUFFIX: '.reown.id',
|
|
@@ -13,9 +13,7 @@ export const ConstantsUtil = {
|
|
|
13
13
|
WEB_WALLET_URL: 'https://web-wallet.walletconnect.org',
|
|
14
14
|
SECURE_SITE_DASHBOARD: `https://secure.reown.com/dashboard`,
|
|
15
15
|
SECURE_SITE_ICON: `https://secure.reown.com/images/favicon.png`,
|
|
16
|
-
|
|
17
|
-
PHANTOM_EXPLORER_ID: 'a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393',
|
|
18
|
-
WALLET_CONNECT_IMAGE_ID: 'ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400',
|
|
16
|
+
REOWN_URL: `https://reown.com`,
|
|
19
17
|
USDT_CONTRACT_ADDRESSES: [
|
|
20
18
|
// Mainnet
|
|
21
19
|
'0xdac17f958d2ee523a2206206994597c13d831ec7',
|
|
@@ -37,14 +35,18 @@ export const ConstantsUtil = {
|
|
|
37
35
|
image_id: 'b6ec7b81-bb4f-427d-e290-7631e6e50d00',
|
|
38
36
|
mobile_link: 'phantom://'
|
|
39
37
|
},
|
|
38
|
+
COINBASE_CUSTOM_WALLET: {
|
|
39
|
+
id: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa',
|
|
40
|
+
name: 'Coinbase Wallet',
|
|
41
|
+
image_id: 'a5ebc364-8f91-4200-fcc6-be81310a0000',
|
|
42
|
+
mobile_link: 'https://wallet.coinbase.com/wsegue'
|
|
43
|
+
},
|
|
40
44
|
// Storage Keys
|
|
41
45
|
STORAGE_KEYS: {
|
|
42
46
|
WC_DEEPLINK: 'WALLETCONNECT_DEEPLINK_CHOICE',
|
|
43
47
|
//dont change this one
|
|
44
48
|
RECENT_WALLET: '@appkit/recent_wallet',
|
|
45
|
-
CONNECTED_WALLET_IMAGE_URL: '@appkit/connected_wallet_image_url',
|
|
46
49
|
CONNECTED_CONNECTORS: '@appkit/connected_connectors',
|
|
47
|
-
CONNECTED_SOCIAL: '@appkit/connected_social',
|
|
48
50
|
ONRAMP_PREFERRED_COUNTRY: '@appkit/onramp_preferred_country',
|
|
49
51
|
ONRAMP_COUNTRIES: '@appkit/onramp_countries',
|
|
50
52
|
ONRAMP_SERVICE_PROVIDERS: '@appkit/onramp_service_providers',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ConstantsUtil","VERSION","EIP155","ADD_CHAIN_METHOD","WC_NAME_SUFFIX","WC_NAME_SUFFIX_LEGACY","BLOCKCHAIN_API_RPC_URL","BLOCKCHAIN_API_RPC_URL_STAGING","PULSE_API_URL","API_URL","WEB_WALLET_URL","SECURE_SITE_DASHBOARD","SECURE_SITE_ICON","
|
|
1
|
+
{"version":3,"names":["ConstantsUtil","VERSION","EIP155","ADD_CHAIN_METHOD","WC_NAME_SUFFIX","WC_NAME_SUFFIX_LEGACY","BLOCKCHAIN_API_RPC_URL","BLOCKCHAIN_API_RPC_URL_STAGING","PULSE_API_URL","API_URL","WEB_WALLET_URL","SECURE_SITE_DASHBOARD","SECURE_SITE_ICON","REOWN_URL","USDT_CONTRACT_ADDRESSES","PHANTOM_CUSTOM_WALLET","id","name","image_id","mobile_link","COINBASE_CUSTOM_WALLET","STORAGE_KEYS","WC_DEEPLINK","RECENT_WALLET","CONNECTED_CONNECTORS","ONRAMP_PREFERRED_COUNTRY","ONRAMP_COUNTRIES","ONRAMP_SERVICE_PROVIDERS","ONRAMP_FIAT_LIMITS","ONRAMP_FIAT_CURRENCIES","ONRAMP_PREFERRED_FIAT_CURRENCY","ONRAMP_COUNTRIES_DEFAULTS","ACTIVE_NAMESPACE","COINBASE_CONNECTOR_SESSION"],"sourceRoot":"../../../src","sources":["utils/Constant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5CC,0BAA0B,EAAE;EAC9B;AACF,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
export const NetworkUtil = {
|
|
4
4
|
caipNetworkIdToNumber(caipnetworkId) {
|
|
5
5
|
return caipnetworkId ? Number(caipnetworkId.split(':')[1]) : undefined;
|
|
6
|
+
},
|
|
7
|
+
getPlainAddress(caipAddress) {
|
|
8
|
+
return caipAddress?.split(':')[2];
|
|
6
9
|
}
|
|
7
10
|
};
|
|
8
11
|
//# sourceMappingURL=NetworkUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NetworkUtil","caipNetworkIdToNumber","caipnetworkId","Number","split","undefined"],"sourceRoot":"../../../src","sources":["utils/NetworkUtil.ts"],"mappings":";;
|
|
1
|
+
{"version":3,"names":["NetworkUtil","caipNetworkIdToNumber","caipnetworkId","Number","split","undefined","getPlainAddress","caipAddress"],"sourceRoot":"../../../src","sources":["utils/NetworkUtil.ts"],"mappings":";;AAEA,OAAO,MAAMA,WAAW,GAAG;EACzBC,qBAAqBA,CAACC,aAAqC,EAAE;IAC3D,OAAOA,aAAa,GAAGC,MAAM,CAACD,aAAa,CAACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAGC,SAAS;EACxE,CAAC;EACDC,eAAeA,CAACC,WAAyB,EAAE;IACzC,OAAOA,WAAW,EAAEH,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;EACnC;AACF,CAAC","ignoreList":[]}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { EventEmitter } from 'events';
|
|
3
|
-
import type { AdapterEvents, AdapterType, AppKitNetwork, BlockchainAdapterConfig, CaipAddress, ChainNamespace, GetBalanceParams, GetBalanceResponse, Provider, WalletConnector } from '../
|
|
3
|
+
import type { AdapterEvents, AdapterType, AppKitNetwork, BlockchainAdapterConfig, BlockchainAdapterInitParams, CaipAddress, ChainNamespace, GetBalanceParams, GetBalanceResponse, Provider, WalletConnector } from '../types';
|
|
4
4
|
export declare abstract class BlockchainAdapter extends EventEmitter {
|
|
5
|
-
projectId: string;
|
|
6
5
|
connector?: WalletConnector;
|
|
7
6
|
supportedNamespace: ChainNamespace;
|
|
8
7
|
adapterType: AdapterType;
|
|
9
8
|
emit<K extends keyof AdapterEvents>(event: K, payload: Parameters<AdapterEvents[K]>[0]): boolean;
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
on<K extends keyof AdapterEvents>(event: K, listener: AdapterEvents[K]): this;
|
|
10
|
+
off<K extends keyof AdapterEvents>(event: K, listener: AdapterEvents[K]): this;
|
|
11
|
+
constructor({ supportedNamespace, adapterType }: BlockchainAdapterConfig);
|
|
12
|
+
init({ connector }: BlockchainAdapterInitParams): void;
|
|
12
13
|
removeConnector(): void;
|
|
13
14
|
getProvider(): Provider;
|
|
14
15
|
subscribeToEvents(): void;
|
|
@@ -1 +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,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EAChB,MAAM,
|
|
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,WAAW,EACX,aAAa,EACb,uBAAuB,EACvB,2BAA2B,EAC3B,WAAW,EACX,cAAc,EACd,gBAAgB,EAChB,kBAAkB,EAClB,QAAQ,EACR,eAAe,EAChB,MAAM,UAAU,CAAC;AAGlB,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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BlockchainAdapter } from './BlockchainAdapter';
|
|
2
|
-
import type { AppKitNetwork } from '../
|
|
2
|
+
import type { AppKitNetwork } from '../types';
|
|
3
3
|
export interface WriteContractData {
|
|
4
4
|
tokenAddress: `0x${string}`;
|
|
5
5
|
receiverAddress: `0x${string}`;
|
|
@@ -18,7 +18,6 @@ export interface SendTransactionData {
|
|
|
18
18
|
data: string;
|
|
19
19
|
}
|
|
20
20
|
export declare abstract class EVMAdapter extends BlockchainAdapter {
|
|
21
|
-
subscribeToEvents(): void;
|
|
22
21
|
signMessage(address: string, message: string, chain?: string): Promise<string>;
|
|
23
22
|
estimateGas({ address, to, data, chainNamespace }: any): Promise<bigint>;
|
|
24
23
|
sendTransaction(data: SendTransactionData): Promise<`0x${string}` | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EvmAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/EvmAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"EvmAdapter.d.ts","sourceRoot":"","sources":["../../../src/adapters/EvmAdapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAG9C,MAAM,WAAW,iBAAiB;IAChC,YAAY,EAAE,KAAK,MAAM,EAAE,CAAC;IAC5B,eAAe,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;IAC3B,MAAM,EAAE,UAAU,GAAG,cAAc,GAAG,SAAS,CAAC;IAChD,GAAG,CAAC,EAAE,GAAG,CAAC;IACV,cAAc,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IAC/B,OAAO,EAAE,aAAa,CAAC;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB,OAAO,EAAE,aAAa,CAAC;IACvB,EAAE,EAAE,KAAK,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd;AAkDD,8BAAsB,UAAW,SAAQ,iBAAiB;IAClD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAiB9E,WAAW,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,IAAI,EAAE,cAAc,EAAE,EAAE,GAAG,GAAG,OAAO,CAAC,MAAM,CAAC;IAkCxE,eAAe,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;IAkCzE,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,KAAK,MAAM,EAAE,GAAG,IAAI,CAAC;CAwF5E"}
|
|
@@ -13,5 +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
|
-
export * from './
|
|
16
|
+
export * from './types';
|
|
17
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;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,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O,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEjE,cAAc,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../src/networks/bitcoin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../src/networks/bitcoin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,OAAO,EAAE,aAarB,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAc5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/networks/solana.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../src/networks/solana.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAE9C,eAAO,MAAM,MAAM,EAAE,aAcpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAY1B,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAW3B,CAAC"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { CaipAddress, CaipNetworkId, BaseError, RequestCache } from '../common';
|
|
2
|
+
import type { Transaction } from '../blockchain/transaction';
|
|
3
|
+
import type { SwapToken } from '../swap';
|
|
4
|
+
export interface BlockchainApiIdentityRequest {
|
|
5
|
+
address: `0x${string}`;
|
|
6
|
+
}
|
|
7
|
+
export interface BlockchainApiIdentityResponse {
|
|
8
|
+
avatar: string;
|
|
9
|
+
name: string;
|
|
10
|
+
}
|
|
11
|
+
export interface BlockchainApiBalance {
|
|
12
|
+
name: string;
|
|
13
|
+
symbol: string;
|
|
14
|
+
chainId: string;
|
|
15
|
+
address?: CaipAddress;
|
|
16
|
+
value?: number;
|
|
17
|
+
price: number;
|
|
18
|
+
quantity: {
|
|
19
|
+
decimals: string;
|
|
20
|
+
numeric: string;
|
|
21
|
+
};
|
|
22
|
+
iconUrl: string;
|
|
23
|
+
}
|
|
24
|
+
export interface BlockchainApiBalanceResponse {
|
|
25
|
+
balances: BlockchainApiBalance[];
|
|
26
|
+
}
|
|
27
|
+
export interface BlockchainApiTransactionsRequest {
|
|
28
|
+
account: string;
|
|
29
|
+
projectId: string;
|
|
30
|
+
cursor?: string;
|
|
31
|
+
signal?: AbortSignal;
|
|
32
|
+
cache?: RequestCache;
|
|
33
|
+
chainId: CaipNetworkId;
|
|
34
|
+
}
|
|
35
|
+
export interface BlockchainApiTransactionsResponse {
|
|
36
|
+
data: Transaction[];
|
|
37
|
+
next: string | null;
|
|
38
|
+
}
|
|
39
|
+
export interface BlockchainApiSwapAllowanceResponse {
|
|
40
|
+
allowance: string;
|
|
41
|
+
}
|
|
42
|
+
export interface BlockchainApiGenerateSwapCalldataRequest {
|
|
43
|
+
projectId: string;
|
|
44
|
+
userAddress: CaipAddress;
|
|
45
|
+
from: CaipAddress;
|
|
46
|
+
to: CaipAddress;
|
|
47
|
+
amount: string;
|
|
48
|
+
eip155?: {
|
|
49
|
+
slippage: string;
|
|
50
|
+
permit?: string;
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export interface BlockchainApiGenerateSwapCalldataResponse {
|
|
54
|
+
tx: {
|
|
55
|
+
from: CaipAddress;
|
|
56
|
+
to: CaipAddress;
|
|
57
|
+
data: `0x${string}`;
|
|
58
|
+
amount: string;
|
|
59
|
+
eip155: {
|
|
60
|
+
gas: string;
|
|
61
|
+
gasPrice: string;
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export interface BlockchainApiGenerateApproveCalldataRequest {
|
|
66
|
+
projectId: string;
|
|
67
|
+
userAddress: CaipAddress;
|
|
68
|
+
from: CaipAddress;
|
|
69
|
+
to: CaipAddress;
|
|
70
|
+
amount?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface BlockchainApiGenerateApproveCalldataResponse {
|
|
73
|
+
tx: {
|
|
74
|
+
from: CaipAddress;
|
|
75
|
+
to: CaipAddress;
|
|
76
|
+
data: `0x${string}`;
|
|
77
|
+
value: string;
|
|
78
|
+
eip155: {
|
|
79
|
+
gas: number;
|
|
80
|
+
gasPrice: string;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface BlockchainApiTokenPriceRequest {
|
|
85
|
+
projectId: string;
|
|
86
|
+
currency?: 'usd' | 'eur' | 'gbp' | 'aud' | 'cad' | 'inr' | 'jpy' | 'btc' | 'eth';
|
|
87
|
+
addresses: CaipAddress[];
|
|
88
|
+
}
|
|
89
|
+
export interface BlockchainApiTokenPriceResponse {
|
|
90
|
+
fungibles: {
|
|
91
|
+
name: string;
|
|
92
|
+
symbol: string;
|
|
93
|
+
iconUrl: string;
|
|
94
|
+
price: number;
|
|
95
|
+
}[];
|
|
96
|
+
}
|
|
97
|
+
export interface BlockchainApiSwapAllowanceRequest {
|
|
98
|
+
projectId: string;
|
|
99
|
+
tokenAddress: CaipAddress;
|
|
100
|
+
userAddress: CaipAddress;
|
|
101
|
+
}
|
|
102
|
+
export interface BlockchainApiGasPriceRequest {
|
|
103
|
+
projectId: string;
|
|
104
|
+
chainId: CaipNetworkId;
|
|
105
|
+
}
|
|
106
|
+
export interface BlockchainApiGasPriceResponse {
|
|
107
|
+
standard: string;
|
|
108
|
+
fast: string;
|
|
109
|
+
instant: string;
|
|
110
|
+
}
|
|
111
|
+
export interface BlockchainApiEnsError extends BaseError {
|
|
112
|
+
status: string;
|
|
113
|
+
reasons: {
|
|
114
|
+
name: string;
|
|
115
|
+
description: string;
|
|
116
|
+
}[];
|
|
117
|
+
}
|
|
118
|
+
export type ReownName = `${string}.reown.id` | `${string}.wcn.id`;
|
|
119
|
+
export interface BlockchainApiLookupEnsName {
|
|
120
|
+
name: ReownName;
|
|
121
|
+
registered: number;
|
|
122
|
+
updated: number;
|
|
123
|
+
addresses: Record<string, {
|
|
124
|
+
address: string;
|
|
125
|
+
created: string;
|
|
126
|
+
}>;
|
|
127
|
+
attributes: {
|
|
128
|
+
avatar?: string;
|
|
129
|
+
bio?: string;
|
|
130
|
+
}[];
|
|
131
|
+
}
|
|
132
|
+
export interface BlockchainApiSwapQuoteRequest {
|
|
133
|
+
projectId: string;
|
|
134
|
+
chainId?: CaipNetworkId;
|
|
135
|
+
amount: string;
|
|
136
|
+
userAddress: CaipAddress;
|
|
137
|
+
from: CaipAddress;
|
|
138
|
+
to: CaipAddress;
|
|
139
|
+
gasPrice: string;
|
|
140
|
+
}
|
|
141
|
+
export interface BlockchainApiSwapQuoteResponse {
|
|
142
|
+
quotes: {
|
|
143
|
+
id: string | null;
|
|
144
|
+
fromAmount: string;
|
|
145
|
+
fromAccount: string;
|
|
146
|
+
toAmount: string;
|
|
147
|
+
toAccount: string;
|
|
148
|
+
}[];
|
|
149
|
+
}
|
|
150
|
+
export interface BlockchainApiSwapTokensRequest {
|
|
151
|
+
projectId: string;
|
|
152
|
+
chainId: CaipNetworkId;
|
|
153
|
+
}
|
|
154
|
+
export interface BlockchainApiOnRampQuotesRequest {
|
|
155
|
+
countryCode: string;
|
|
156
|
+
paymentMethodType?: string;
|
|
157
|
+
destinationCurrencyCode: string;
|
|
158
|
+
sourceAmount: number;
|
|
159
|
+
sourceCurrencyCode: string;
|
|
160
|
+
walletAddress: string;
|
|
161
|
+
excludeProviders?: string[];
|
|
162
|
+
}
|
|
163
|
+
export interface BlockchainApiSwapTokensResponse {
|
|
164
|
+
tokens: SwapToken[];
|
|
165
|
+
}
|
|
166
|
+
export interface BlockchainApiOnRampWidgetRequest {
|
|
167
|
+
countryCode: string;
|
|
168
|
+
destinationCurrencyCode: string;
|
|
169
|
+
paymentMethodType: string;
|
|
170
|
+
serviceProvider: string;
|
|
171
|
+
sourceAmount: number;
|
|
172
|
+
sourceCurrencyCode: string;
|
|
173
|
+
walletAddress: string;
|
|
174
|
+
redirectUrl?: string;
|
|
175
|
+
}
|
|
176
|
+
export type BlockchainApiOnRampWidgetResponse = {
|
|
177
|
+
widgetUrl: string;
|
|
178
|
+
};
|
|
179
|
+
export declare class BlockchainOnRampError extends Error {
|
|
180
|
+
code: string;
|
|
181
|
+
constructor(code: string, message: string);
|
|
182
|
+
}
|
|
183
|
+
//# sourceMappingURL=blockchain-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blockchain-api.d.ts","sourceRoot":"","sources":["../../../../src/types/api/blockchain-api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACrF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,6BAA6B;IAC5C,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAA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