@cryptorubic/web3 0.4.3 → 0.5.1
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/README.md +1 -0
- package/package.json +13 -15
- package/src/lib/adapter/adapters/bitcoin-adapter.js +4 -4
- package/src/lib/adapter/adapters/constants/erc20-token-abi.js +12 -12
- package/src/lib/adapter/adapters/constants/possible-errors.js +1 -1
- package/src/lib/adapter/adapters/constants/trc-20-contract-abi.js +15 -15
- package/src/lib/adapter/adapters/constants/tron-multicall-abi.js +6 -6
- package/src/lib/adapter/adapters/constants/uni-v3-permit-abi.js +16 -16
- package/src/lib/adapter/adapters/evm-adapter.js +26 -26
- package/src/lib/adapter/adapters/solana-adapter.js +1 -1
- package/src/lib/adapter/adapters/ton-adapter.js +3 -3
- package/src/lib/adapter/adapters/tron-adapter.js +15 -17
- package/src/lib/adapter/adapters/utils/ton-api.service.js +24 -24
- package/src/lib/adapter/blockchain-adapter-factory.service.js +2 -2
- package/src/lib/adapter/constants/chain-configs/chain-configs.js +353 -353
- package/src/lib/adapter/constants/viem-blockchain-mapping.js +1 -1
- package/src/lib/utils/constants/changenow-api-blockchain.js +2 -2
- package/src/lib/utils/constants/web3-pure-store.js +33 -33
- package/src/lib/utils/web3-types/solana-web3-pure.js +1 -1
- package/src/lib/utils/web3-types/ton-web3-pure.js +1 -1
- package/src/lib/utils/web3-types/tron-web3-pure.js +2 -2
|
@@ -70,5 +70,5 @@ exports.viemBlockchainMapping = {
|
|
|
70
70
|
[core_1.BLOCKCHAIN_NAME.BAHAMUT]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.BAHAMUT],
|
|
71
71
|
[core_1.BLOCKCHAIN_NAME.BITLAYER]: chain_configs_1.viemConfig[core_1.BLOCKCHAIN_NAME.BITLAYER],
|
|
72
72
|
[core_1.BLOCKCHAIN_NAME.SEI]: chains_1.sei,
|
|
73
|
-
[core_1.BLOCKCHAIN_NAME.GRAVITY]: chains_1.gravity
|
|
73
|
+
[core_1.BLOCKCHAIN_NAME.GRAVITY]: chains_1.gravity
|
|
74
74
|
};
|
|
@@ -22,7 +22,7 @@ exports.changeNowEvmSupportedBlockchain = {
|
|
|
22
22
|
[core_1.BLOCKCHAIN_NAME.XDC]: 'xdc',
|
|
23
23
|
[core_1.BLOCKCHAIN_NAME.PULSECHAIN]: 'pulse',
|
|
24
24
|
[core_1.BLOCKCHAIN_NAME.BASE]: 'base',
|
|
25
|
-
[core_1.BLOCKCHAIN_NAME.ZK_SYNC]: 'zksync'
|
|
25
|
+
[core_1.BLOCKCHAIN_NAME.ZK_SYNC]: 'zksync'
|
|
26
26
|
};
|
|
27
27
|
exports.changenowApiBlockchain = {
|
|
28
28
|
// Evm
|
|
@@ -104,5 +104,5 @@ exports.changenowApiBlockchain = {
|
|
|
104
104
|
[core_1.BLOCKCHAIN_NAME.HORIZEN]: 'zen',
|
|
105
105
|
[core_1.BLOCKCHAIN_NAME.ZILLIQA]: 'zil',
|
|
106
106
|
[core_1.BLOCKCHAIN_NAME.TRON]: 'trx',
|
|
107
|
-
[core_1.BLOCKCHAIN_NAME.KAVA_COSMOS]: 'kava'
|
|
107
|
+
[core_1.BLOCKCHAIN_NAME.KAVA_COSMOS]: 'kava'
|
|
108
108
|
};
|
|
@@ -22,120 +22,120 @@ exports.web3PureStore = {
|
|
|
22
22
|
// Common Web3
|
|
23
23
|
[core_1.CHAIN_TYPE.RIPPLE]: new common_web3_pure_1.CommonWeb3Pure({
|
|
24
24
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.RIPPLE,
|
|
25
|
-
regex: /^r[1-9A-HJ-NP-Za-km-z]{25,34}
|
|
25
|
+
regex: /^r[1-9A-HJ-NP-Za-km-z]{25,34}$/
|
|
26
26
|
}),
|
|
27
27
|
[core_1.CHAIN_TYPE.CARDANO]: new common_web3_pure_1.CommonWeb3Pure({
|
|
28
28
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.CARDANO,
|
|
29
|
-
regex: /^([1-9A-HJ-NP-Za-km-z]{59,104})|([0-9A-Za-z]{58,104})
|
|
29
|
+
regex: /^([1-9A-HJ-NP-Za-km-z]{59,104})|([0-9A-Za-z]{58,104})$/
|
|
30
30
|
}),
|
|
31
31
|
[core_1.CHAIN_TYPE.DOGECOIN]: new common_web3_pure_1.CommonWeb3Pure({
|
|
32
32
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.DOGECOIN,
|
|
33
|
-
regex: /^[X|7][0-9A-Za-z]{33}
|
|
33
|
+
regex: /^[X|7][0-9A-Za-z]{33}$/
|
|
34
34
|
}),
|
|
35
35
|
[core_1.CHAIN_TYPE.POLKADOT]: new common_web3_pure_1.CommonWeb3Pure({
|
|
36
36
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.POLKADOT,
|
|
37
|
-
regex: /^1[0-9a-z-A-Z]{44,49}
|
|
37
|
+
regex: /^1[0-9a-z-A-Z]{44,49}$/
|
|
38
38
|
}),
|
|
39
39
|
[core_1.CHAIN_TYPE.LITECOIN]: new common_web3_pure_1.CommonWeb3Pure({
|
|
40
40
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.LITECOIN,
|
|
41
|
-
regex: /^(L|M|3)[A-Za-z0-9]{33}$|^(ltc1)[0-9A-Za-z]{39}
|
|
41
|
+
regex: /^(L|M|3)[A-Za-z0-9]{33}$|^(ltc1)[0-9A-Za-z]{39}$/
|
|
42
42
|
}),
|
|
43
43
|
[core_1.CHAIN_TYPE.MONERO]: new common_web3_pure_1.CommonWeb3Pure({
|
|
44
44
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.MONERO,
|
|
45
|
-
regex: /^[48][a-zA-Z|\d]{94}([a-zA-Z|\d]{11})
|
|
45
|
+
regex: /^[48][a-zA-Z|\d]{94}([a-zA-Z|\d]{11})?$/
|
|
46
46
|
}),
|
|
47
47
|
[core_1.CHAIN_TYPE.NEAR]: new common_web3_pure_1.CommonWeb3Pure({
|
|
48
48
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.NEAR,
|
|
49
|
-
regex: /(^[a-z0-9_-]{2,64}\.near$)|(^[0-9a-f]{64}$)
|
|
49
|
+
regex: /(^[a-z0-9_-]{2,64}\.near$)|(^[0-9a-f]{64}$)/
|
|
50
50
|
}),
|
|
51
51
|
[core_1.CHAIN_TYPE.ALGORAND]: new common_web3_pure_1.CommonWeb3Pure({
|
|
52
52
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.ALGORAND,
|
|
53
|
-
regex: /^[A-Z0-9]{58}
|
|
53
|
+
regex: /^[A-Z0-9]{58}/
|
|
54
54
|
}),
|
|
55
55
|
[core_1.CHAIN_TYPE.TEZOS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
56
56
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.TEZOS,
|
|
57
|
-
regex: /^tz1[a-zA-Z0-9]{33}
|
|
57
|
+
regex: /^tz1[a-zA-Z0-9]{33}$/
|
|
58
58
|
}),
|
|
59
59
|
[core_1.CHAIN_TYPE.DASH]: new common_web3_pure_1.CommonWeb3Pure({
|
|
60
60
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.DASH,
|
|
61
|
-
regex: /^[X|7][0-9A-Za-z]{33}
|
|
61
|
+
regex: /^[X|7][0-9A-Za-z]{33}$/
|
|
62
62
|
}),
|
|
63
63
|
[core_1.CHAIN_TYPE.ZILLIQA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
64
64
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.ZILLIQA,
|
|
65
|
-
regex: /^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}
|
|
65
|
+
regex: /^zil1[qpzry9x8gf2tvdw0s3jn54khce6mua7l]{38}$/
|
|
66
66
|
}),
|
|
67
67
|
[core_1.CHAIN_TYPE.KAVA_COSMOS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
68
68
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.KAVA_COSMOS,
|
|
69
|
-
regex: /^(kava1)[0-9a-z]{38}
|
|
69
|
+
regex: /^(kava1)[0-9a-z]{38}$/
|
|
70
70
|
}),
|
|
71
71
|
[core_1.CHAIN_TYPE.APTOS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
72
72
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.APTOS,
|
|
73
|
-
regex: /^(0x)[0-9A-Za-z]{64}
|
|
73
|
+
regex: /^(0x)[0-9A-Za-z]{64}$/
|
|
74
74
|
}),
|
|
75
75
|
[core_1.CHAIN_TYPE.ASTAR]: new common_web3_pure_1.CommonWeb3Pure({
|
|
76
76
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.ASTAR,
|
|
77
|
-
regex: /^[0-9a-z-A-Z]{44,50}
|
|
77
|
+
regex: /^[0-9a-z-A-Z]{44,50}$/
|
|
78
78
|
}),
|
|
79
79
|
[core_1.CHAIN_TYPE.COSMOS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
80
80
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.COSMOS,
|
|
81
|
-
regex: /^(cosmos1)[0-9a-z]{38}
|
|
81
|
+
regex: /^(cosmos1)[0-9a-z]{38}$/
|
|
82
82
|
}),
|
|
83
83
|
[core_1.CHAIN_TYPE.FLOW]: new common_web3_pure_1.CommonWeb3Pure({
|
|
84
84
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.FLOW,
|
|
85
|
-
regex: /^(0x)[0-9A-Fa-f]{16}
|
|
85
|
+
regex: /^(0x)[0-9A-Fa-f]{16}$/
|
|
86
86
|
}),
|
|
87
87
|
[core_1.CHAIN_TYPE.HEDERA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
88
88
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.HEDERA,
|
|
89
|
-
regex: /^0\.0\.\d{1,7}
|
|
89
|
+
regex: /^0\.0\.\d{1,7}$/
|
|
90
90
|
}),
|
|
91
91
|
[core_1.CHAIN_TYPE.IOTA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
92
92
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.IOTA,
|
|
93
|
-
regex: /^(iota)[0-9a-z]{60}
|
|
93
|
+
regex: /^(iota)[0-9a-z]{60}$/
|
|
94
94
|
}),
|
|
95
95
|
[core_1.CHAIN_TYPE.KADENA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
96
96
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.KADENA,
|
|
97
|
-
regex: /^k:[0-9a-zA-Z]{64}
|
|
97
|
+
regex: /^k:[0-9a-zA-Z]{64}$/
|
|
98
98
|
}),
|
|
99
99
|
[core_1.CHAIN_TYPE.KUSAMA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
100
100
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.KUSAMA,
|
|
101
|
-
regex: /^[C-Z][a-km-zA-HJ-NP-Z1-9]{46}
|
|
101
|
+
regex: /^[C-Z][a-km-zA-HJ-NP-Z1-9]{46}$/
|
|
102
102
|
}),
|
|
103
103
|
[core_1.CHAIN_TYPE.MINA_PROTOCOL]: new common_web3_pure_1.CommonWeb3Pure({
|
|
104
104
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.MINA_PROTOCOL,
|
|
105
|
-
regex: /^(B62)[A-Za-z0-9]{52}
|
|
105
|
+
regex: /^(B62)[A-Za-z0-9]{52}$/
|
|
106
106
|
}),
|
|
107
107
|
[core_1.CHAIN_TYPE.NEO]: new common_web3_pure_1.CommonWeb3Pure({
|
|
108
108
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.NEO,
|
|
109
|
-
regex: /^(A)[A-Za-z0-9]{33}
|
|
109
|
+
regex: /^(A)[A-Za-z0-9]{33}$/
|
|
110
110
|
}),
|
|
111
111
|
[core_1.CHAIN_TYPE.OSMOSIS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
112
112
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.OSMOSIS,
|
|
113
|
-
regex: /^(osmo1)[0-9a-z]{38}
|
|
113
|
+
regex: /^(osmo1)[0-9a-z]{38}$/
|
|
114
114
|
}),
|
|
115
115
|
[core_1.CHAIN_TYPE.SIA]: new common_web3_pure_1.CommonWeb3Pure({
|
|
116
116
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.SIA,
|
|
117
|
-
regex: /^[A-Za-z0-9]{76}
|
|
117
|
+
regex: /^[A-Za-z0-9]{76}$/
|
|
118
118
|
}),
|
|
119
119
|
[core_1.CHAIN_TYPE.SECRET]: new common_web3_pure_1.CommonWeb3Pure({
|
|
120
120
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.SECRET,
|
|
121
|
-
regex: /^(secret1)[0-9a-z]{38}
|
|
121
|
+
regex: /^(secret1)[0-9a-z]{38}$/
|
|
122
122
|
}),
|
|
123
123
|
[core_1.CHAIN_TYPE.TON]: new ton_web3_pure_1.TonWeb3Pure(),
|
|
124
124
|
[core_1.CHAIN_TYPE.WAVES]: new common_web3_pure_1.CommonWeb3Pure({
|
|
125
125
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.WAVES,
|
|
126
|
-
regex: /^(3P)[0-9A-Za-z]{33}
|
|
126
|
+
regex: /^(3P)[0-9A-Za-z]{33}$/
|
|
127
127
|
}),
|
|
128
128
|
[core_1.CHAIN_TYPE.WAX]: new common_web3_pure_1.CommonWeb3Pure({
|
|
129
129
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.WAX,
|
|
130
|
-
regex: /^[a-z1-5.]{1,12}
|
|
130
|
+
regex: /^[a-z1-5.]{1,12}$/
|
|
131
131
|
}),
|
|
132
132
|
[core_1.CHAIN_TYPE.STELLAR]: new common_web3_pure_1.CommonWeb3Pure({
|
|
133
133
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.STEEM,
|
|
134
|
-
regex: /^G[A-D]{1}[A-Z2-7]{54}
|
|
134
|
+
regex: /^G[A-D]{1}[A-Z2-7]{54}$/
|
|
135
135
|
}),
|
|
136
136
|
[core_1.CHAIN_TYPE.XDC]: new common_web3_pure_1.CommonWeb3Pure({
|
|
137
137
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.XDC,
|
|
138
|
-
regex: /^xdc[a-fA-F\d]{40}
|
|
138
|
+
regex: /^xdc[a-fA-F\d]{40}$/
|
|
139
139
|
}),
|
|
140
140
|
[core_1.CHAIN_TYPE.ONTOLOGY]: new common_web3_pure_1.CommonWeb3Pure({
|
|
141
141
|
// @TODO
|
|
@@ -144,15 +144,15 @@ exports.web3PureStore = {
|
|
|
144
144
|
}),
|
|
145
145
|
[core_1.CHAIN_TYPE.EOS]: new common_web3_pure_1.CommonWeb3Pure({
|
|
146
146
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.EOS,
|
|
147
|
-
regex: /^[1-5a-z]{12}
|
|
147
|
+
regex: /^[1-5a-z]{12}$/
|
|
148
148
|
}),
|
|
149
149
|
[core_1.CHAIN_TYPE.FILECOIN]: new common_web3_pure_1.CommonWeb3Pure({
|
|
150
150
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.FILECOIN,
|
|
151
|
-
regex: /[a-z0-9]{41}$|[a-z0-9]{86}
|
|
151
|
+
regex: /[a-z0-9]{41}$|[a-z0-9]{86}$/
|
|
152
152
|
}),
|
|
153
153
|
[core_1.CHAIN_TYPE.CASPER]: new common_web3_pure_1.CommonWeb3Pure({
|
|
154
154
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.CASPER,
|
|
155
|
-
regex: /^[A-Za-z0-9]{66,68}
|
|
155
|
+
regex: /^[A-Za-z0-9]{66,68}$/
|
|
156
156
|
}),
|
|
157
157
|
[core_1.CHAIN_TYPE.AION]: new common_web3_pure_1.CommonWeb3Pure({
|
|
158
158
|
// @TODO
|
|
@@ -333,5 +333,5 @@ exports.web3PureStore = {
|
|
|
333
333
|
// @TODO
|
|
334
334
|
// cnApiKey: changenowApiBlockchain.RIPPLE,
|
|
335
335
|
// regex: ?
|
|
336
|
-
})
|
|
336
|
+
})
|
|
337
337
|
};
|
|
@@ -7,7 +7,7 @@ class SolanaWeb3Pure extends common_web3_pure_1.CommonWeb3Pure {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
super({
|
|
9
9
|
cnApiKey: changenow_api_blockchain_1.changenowApiBlockchain.SOLANA,
|
|
10
|
-
regex: /^[1-9A-HJ-NP-Za-km-z]{32,44}
|
|
10
|
+
regex: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/
|
|
11
11
|
});
|
|
12
12
|
this.nativeTokenAddress = 'So11111111111111111111111111111111111111111';
|
|
13
13
|
}
|
|
@@ -95,7 +95,7 @@ class TronWeb3Pure extends common_web3_pure_1.CommonWeb3Pure {
|
|
|
95
95
|
const parameterField = parameter[paramKey];
|
|
96
96
|
return {
|
|
97
97
|
...acc,
|
|
98
|
-
[paramKey]: this.flattenParameterToPrimitive(parameterField)
|
|
98
|
+
[paramKey]: this.flattenParameterToPrimitive(parameterField)
|
|
99
99
|
};
|
|
100
100
|
}, {});
|
|
101
101
|
}
|
|
@@ -110,7 +110,7 @@ class TronWeb3Pure extends common_web3_pure_1.CommonWeb3Pure {
|
|
|
110
110
|
arguments: methodArguments,
|
|
111
111
|
signature,
|
|
112
112
|
...(callValue && { callValue }),
|
|
113
|
-
...(feeLimit && { feeLimit })
|
|
113
|
+
...(feeLimit && { feeLimit })
|
|
114
114
|
};
|
|
115
115
|
}
|
|
116
116
|
}
|