@sentio/sdk 2.15.0-rc.2 → 2.15.0-rc.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/aptos/context.d.ts +7 -8
- package/lib/aptos/context.js +10 -7
- package/lib/aptos/context.js.map +1 -1
- package/lib/aptos/ext/aptos-dex.d.ts +11 -19
- package/lib/aptos/ext/aptos-dex.js +13 -172
- package/lib/aptos/ext/aptos-dex.js.map +1 -1
- package/lib/aptos/ext/coin.d.ts +2 -10
- package/lib/aptos/ext/coin.js +0 -3
- package/lib/aptos/ext/coin.js.map +1 -1
- package/lib/move/abstract-move-coder.d.ts +1 -1
- package/lib/move/abstract-move-coder.js.map +1 -1
- package/lib/move/ext/coin-list.d.ts +8 -0
- package/lib/move/ext/coin-list.js +2 -0
- package/lib/move/ext/coin-list.js.map +1 -0
- package/lib/move/ext/index.d.ts +2 -0
- package/lib/move/ext/index.js +3 -0
- package/lib/move/ext/index.js.map +1 -0
- package/lib/move/ext/move-dex.d.ts +34 -0
- package/lib/move/ext/move-dex.js +180 -0
- package/lib/move/ext/move-dex.js.map +1 -0
- package/lib/move/index.d.ts +1 -0
- package/lib/move/index.js +1 -0
- package/lib/move/index.js.map +1 -1
- package/lib/move/move-context.d.ts +14 -0
- package/lib/move/move-context.js +12 -0
- package/lib/move/move-context.js.map +1 -0
- package/lib/sui/context.d.ts +9 -8
- package/lib/sui/context.js +11 -6
- package/lib/sui/context.js.map +1 -1
- package/lib/sui/ext/coin.d.ts +14 -0
- package/lib/sui/ext/coin.js +509 -0
- package/lib/sui/ext/coin.js.map +1 -0
- package/lib/sui/ext/move-dex.d.ts +18 -0
- package/lib/sui/ext/move-dex.js +21 -0
- package/lib/sui/ext/move-dex.js.map +1 -0
- package/package.json +3 -3
- package/src/aptos/context.ts +13 -8
- package/src/aptos/ext/aptos-dex.ts +34 -224
- package/src/aptos/ext/coin.ts +2 -11
- package/src/move/abstract-move-coder.ts +1 -1
- package/src/move/ext/coin-list.ts +9 -0
- package/src/move/ext/index.ts +2 -0
- package/src/move/ext/move-dex.ts +255 -0
- package/src/move/index.ts +1 -0
- package/src/move/move-context.ts +18 -0
- package/src/sui/context.ts +26 -8
- package/src/sui/ext/coin.ts +544 -0
- package/src/sui/ext/move-dex.ts +41 -0
@@ -0,0 +1,509 @@
|
|
1
|
+
// import fetch from "node-fetch";
|
2
|
+
import { SPLITTER } from '../../move/index.js';
|
3
|
+
import { getPriceByType } from '../../utils/index.js';
|
4
|
+
import { SuiChainId } from '../../core/chain.js';
|
5
|
+
import { validateAndNormalizeAddress } from '../utils.js';
|
6
|
+
const WHITELISTED_COINS = new Map();
|
7
|
+
export async function initCoinList() {
|
8
|
+
const list = DEFAULT_LIST.coinlist;
|
9
|
+
// try {
|
10
|
+
// const resp = await fetch(
|
11
|
+
// 'https://raw.githubusercontent.com/hippospace/aptos-coin-list/main/src/permissionless.json'
|
12
|
+
// )
|
13
|
+
// list = (await resp.json()) as any[]
|
14
|
+
// } catch (e) {
|
15
|
+
// console.warn("Can't not fetch newest coin list, use default list")
|
16
|
+
// }
|
17
|
+
setCoinList(list);
|
18
|
+
}
|
19
|
+
function setCoinList(list) {
|
20
|
+
for (const info of list) {
|
21
|
+
if (info.address.startsWith('0x2::coin::Coin')) {
|
22
|
+
continue;
|
23
|
+
}
|
24
|
+
if (info.network !== 'mainnet') {
|
25
|
+
continue;
|
26
|
+
}
|
27
|
+
let bridge = 'native';
|
28
|
+
if (info.name.includes('Celer')) {
|
29
|
+
bridge = 'Celer';
|
30
|
+
}
|
31
|
+
if (info.name.includes('LayerZero')) {
|
32
|
+
bridge = 'LayerZero';
|
33
|
+
}
|
34
|
+
if (info.name.includes('Wormhole')) {
|
35
|
+
bridge = 'Wormhole';
|
36
|
+
}
|
37
|
+
WHITELISTED_COINS.set(info.address, {
|
38
|
+
token_type: {
|
39
|
+
type: info.address,
|
40
|
+
account_address: info.address.split('::')[0],
|
41
|
+
},
|
42
|
+
symbol: info.symbol,
|
43
|
+
decimals: info.decimals,
|
44
|
+
bridge,
|
45
|
+
});
|
46
|
+
}
|
47
|
+
}
|
48
|
+
export function whitelistCoins() {
|
49
|
+
return WHITELISTED_COINS;
|
50
|
+
}
|
51
|
+
export function whiteListed(coin) {
|
52
|
+
const [addr, module, type] = coin.split(SPLITTER);
|
53
|
+
const normalized = [validateAndNormalizeAddress(addr), module, type].join(SPLITTER);
|
54
|
+
return WHITELISTED_COINS.has(normalized);
|
55
|
+
}
|
56
|
+
export function getCoinInfo(type) {
|
57
|
+
const r = WHITELISTED_COINS.get(type);
|
58
|
+
if (!r) {
|
59
|
+
const parts = type.split('::');
|
60
|
+
// TDDO retrive from network
|
61
|
+
return {
|
62
|
+
token_type: { type: type, account_address: parts[0] },
|
63
|
+
symbol: parts[2],
|
64
|
+
decimals: 8,
|
65
|
+
bridge: 'native',
|
66
|
+
};
|
67
|
+
}
|
68
|
+
return r;
|
69
|
+
}
|
70
|
+
export async function getPrice(coinType, timestamp) {
|
71
|
+
if (!whiteListed(coinType)) {
|
72
|
+
return 0.0;
|
73
|
+
}
|
74
|
+
const date = new Date(timestamp / 1000);
|
75
|
+
try {
|
76
|
+
return (await getPriceByType(SuiChainId.SUI_MAINNET, coinType, date)) || 0;
|
77
|
+
}
|
78
|
+
catch (error) {
|
79
|
+
console.log(JSON.stringify(error));
|
80
|
+
throw error;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
export async function calculateValueInUsd(n, coinInfo, timestamp) {
|
84
|
+
const price = await getPrice(coinInfo.token_type.type, timestamp);
|
85
|
+
const amount = n.scaleDown(coinInfo.decimals);
|
86
|
+
return amount.multipliedBy(price);
|
87
|
+
}
|
88
|
+
const DEFAULT_LIST = {
|
89
|
+
name: 'Sui Coin List',
|
90
|
+
timestamp: '2022-12-01T13:34:30.145Z',
|
91
|
+
logoURI: 'https://s2.coinmarketcap.com/static/img/coins/128x128/20947.png',
|
92
|
+
coinlist: [
|
93
|
+
{
|
94
|
+
network: 'mainnet',
|
95
|
+
address: '0x2::coin::Coin<0x2::sui::SUI>',
|
96
|
+
symbol: 'SUI',
|
97
|
+
name: 'Sui Coin',
|
98
|
+
decimals: 9,
|
99
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
100
|
+
tags: [],
|
101
|
+
extensions: {
|
102
|
+
coingeckoId: 'sui',
|
103
|
+
},
|
104
|
+
},
|
105
|
+
{
|
106
|
+
network: 'testnet',
|
107
|
+
address: '0x2::coin::Coin<0x2::sui::SUI>',
|
108
|
+
symbol: 'SUI',
|
109
|
+
name: 'Sui Coin',
|
110
|
+
decimals: 9,
|
111
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
112
|
+
tags: [],
|
113
|
+
extensions: {
|
114
|
+
coingeckoId: 'sui',
|
115
|
+
},
|
116
|
+
},
|
117
|
+
{
|
118
|
+
network: 'devnet',
|
119
|
+
address: '0x2::coin::Coin<0x2::sui::SUI>',
|
120
|
+
symbol: 'SUI',
|
121
|
+
name: 'Sui Coin',
|
122
|
+
decimals: 9,
|
123
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
124
|
+
tags: [],
|
125
|
+
extensions: {
|
126
|
+
coingeckoId: 'sui',
|
127
|
+
},
|
128
|
+
},
|
129
|
+
{
|
130
|
+
network: 'mainnet',
|
131
|
+
address: '0x2::sui::SUI',
|
132
|
+
symbol: 'SUI',
|
133
|
+
name: 'Sui Coin',
|
134
|
+
decimals: 9,
|
135
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
136
|
+
tags: [],
|
137
|
+
extensions: {
|
138
|
+
coingeckoId: 'sui',
|
139
|
+
},
|
140
|
+
},
|
141
|
+
{
|
142
|
+
network: 'testnet',
|
143
|
+
address: '0x2::sui::SUI',
|
144
|
+
symbol: 'SUI',
|
145
|
+
name: 'Sui Coin',
|
146
|
+
decimals: 9,
|
147
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
148
|
+
tags: [],
|
149
|
+
extensions: {
|
150
|
+
coingeckoId: 'sui',
|
151
|
+
},
|
152
|
+
},
|
153
|
+
{
|
154
|
+
network: 'devnet',
|
155
|
+
address: '0x2::sui::SUI',
|
156
|
+
symbol: 'SUI',
|
157
|
+
name: 'Sui Coin',
|
158
|
+
decimals: 9,
|
159
|
+
logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',
|
160
|
+
tags: [],
|
161
|
+
extensions: {
|
162
|
+
coingeckoId: 'sui',
|
163
|
+
},
|
164
|
+
},
|
165
|
+
{
|
166
|
+
network: 'testnet',
|
167
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST',
|
168
|
+
symbol: 'TEST',
|
169
|
+
name: 'Test Token',
|
170
|
+
logoURI: 'https://suiswap.app/images/token/suiswap-test.svg',
|
171
|
+
tags: [],
|
172
|
+
decimals: 8,
|
173
|
+
extensions: {},
|
174
|
+
},
|
175
|
+
{
|
176
|
+
network: 'testnet',
|
177
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT',
|
178
|
+
symbol: 'USDT',
|
179
|
+
name: 'Tether',
|
180
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',
|
181
|
+
tags: [],
|
182
|
+
decimals: 8,
|
183
|
+
extensions: {
|
184
|
+
coingeckoId: 'tether',
|
185
|
+
},
|
186
|
+
},
|
187
|
+
{
|
188
|
+
network: 'testnet',
|
189
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC',
|
190
|
+
symbol: 'USDC',
|
191
|
+
name: 'USD Coin',
|
192
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',
|
193
|
+
decimals: 8,
|
194
|
+
tags: [],
|
195
|
+
extensions: {
|
196
|
+
coingeckoId: 'usd-coin',
|
197
|
+
},
|
198
|
+
},
|
199
|
+
{
|
200
|
+
network: 'testnet',
|
201
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL',
|
202
|
+
symbol: 'SOL',
|
203
|
+
name: 'Solana',
|
204
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png',
|
205
|
+
decimals: 8,
|
206
|
+
extensions: {
|
207
|
+
coingeckoId: 'solana',
|
208
|
+
},
|
209
|
+
},
|
210
|
+
{
|
211
|
+
network: 'testnet',
|
212
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC',
|
213
|
+
symbol: 'BTC',
|
214
|
+
name: 'Bitcoin',
|
215
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png',
|
216
|
+
decimals: 8,
|
217
|
+
tags: [],
|
218
|
+
extensions: {
|
219
|
+
coingeckoId: 'bitcoin',
|
220
|
+
},
|
221
|
+
},
|
222
|
+
{
|
223
|
+
network: 'testnet',
|
224
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI',
|
225
|
+
symbol: 'DAI',
|
226
|
+
name: 'DAI',
|
227
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png',
|
228
|
+
decimals: 8,
|
229
|
+
tags: [],
|
230
|
+
extensions: {
|
231
|
+
coingeckoId: 'dai',
|
232
|
+
},
|
233
|
+
},
|
234
|
+
{
|
235
|
+
network: 'testnet',
|
236
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB',
|
237
|
+
symbol: 'BNB',
|
238
|
+
name: 'BNB',
|
239
|
+
logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
|
240
|
+
decimals: 8,
|
241
|
+
tags: [],
|
242
|
+
extensions: {
|
243
|
+
coingeckoId: 'binancecoin',
|
244
|
+
},
|
245
|
+
},
|
246
|
+
{
|
247
|
+
network: 'testnet',
|
248
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH',
|
249
|
+
symbol: 'ETH',
|
250
|
+
name: 'Ethereum',
|
251
|
+
logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
252
|
+
decimals: 8,
|
253
|
+
tags: [],
|
254
|
+
extensions: {
|
255
|
+
coingeckoId: 'ethereum',
|
256
|
+
},
|
257
|
+
},
|
258
|
+
{
|
259
|
+
network: 'testnet',
|
260
|
+
address: '0x31b14985adb91360ed90a5786cb0956c83e7f275a8ae6123f38adab9d2b792b1::usdc::USDC',
|
261
|
+
symbol: 'USDC',
|
262
|
+
name: 'USD Coin',
|
263
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',
|
264
|
+
decimals: 8,
|
265
|
+
tags: [],
|
266
|
+
extensions: {
|
267
|
+
coingeckoId: 'usd-coin',
|
268
|
+
},
|
269
|
+
},
|
270
|
+
{
|
271
|
+
network: 'devnet',
|
272
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST',
|
273
|
+
symbol: 'TEST',
|
274
|
+
name: 'Test Token',
|
275
|
+
logoURI: 'https://suiswap.app/images/token/suiswap-test.svg',
|
276
|
+
tags: [],
|
277
|
+
decimals: 8,
|
278
|
+
extensions: {},
|
279
|
+
},
|
280
|
+
{
|
281
|
+
network: 'devnet',
|
282
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT',
|
283
|
+
symbol: 'USDT',
|
284
|
+
name: 'Tether',
|
285
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',
|
286
|
+
tags: [],
|
287
|
+
decimals: 8,
|
288
|
+
extensions: {
|
289
|
+
coingeckoId: 'tether',
|
290
|
+
},
|
291
|
+
},
|
292
|
+
{
|
293
|
+
network: 'devnet',
|
294
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC',
|
295
|
+
symbol: 'USDC',
|
296
|
+
name: 'USD Coin',
|
297
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',
|
298
|
+
decimals: 8,
|
299
|
+
tags: [],
|
300
|
+
extensions: {
|
301
|
+
coingeckoId: 'usd-coin',
|
302
|
+
},
|
303
|
+
},
|
304
|
+
{
|
305
|
+
network: 'devnet',
|
306
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL',
|
307
|
+
symbol: 'SOL',
|
308
|
+
name: 'Solana',
|
309
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png',
|
310
|
+
decimals: 8,
|
311
|
+
extensions: {
|
312
|
+
coingeckoId: 'solana',
|
313
|
+
},
|
314
|
+
},
|
315
|
+
{
|
316
|
+
network: 'devnet',
|
317
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC',
|
318
|
+
symbol: 'BTC',
|
319
|
+
name: 'Bitcoin',
|
320
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png',
|
321
|
+
decimals: 8,
|
322
|
+
tags: [],
|
323
|
+
extensions: {
|
324
|
+
coingeckoId: 'bitcoin',
|
325
|
+
},
|
326
|
+
},
|
327
|
+
{
|
328
|
+
network: 'devnet',
|
329
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI',
|
330
|
+
symbol: 'DAI',
|
331
|
+
name: 'DAI',
|
332
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png',
|
333
|
+
decimals: 8,
|
334
|
+
tags: [],
|
335
|
+
extensions: {
|
336
|
+
coingeckoId: 'dai',
|
337
|
+
},
|
338
|
+
},
|
339
|
+
{
|
340
|
+
network: 'devnet',
|
341
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB',
|
342
|
+
symbol: 'BNB',
|
343
|
+
name: 'BNB',
|
344
|
+
logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
|
345
|
+
decimals: 8,
|
346
|
+
tags: [],
|
347
|
+
extensions: {
|
348
|
+
coingeckoId: 'binancecoin',
|
349
|
+
},
|
350
|
+
},
|
351
|
+
{
|
352
|
+
network: 'devnet',
|
353
|
+
address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH',
|
354
|
+
symbol: 'ETH',
|
355
|
+
name: 'Ethereum',
|
356
|
+
logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
357
|
+
decimals: 8,
|
358
|
+
tags: [],
|
359
|
+
extensions: {
|
360
|
+
coingeckoId: 'ethereum',
|
361
|
+
},
|
362
|
+
},
|
363
|
+
{
|
364
|
+
network: 'mainnet',
|
365
|
+
address: '0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN',
|
366
|
+
symbol: 'wETH',
|
367
|
+
name: 'Wrapped Ethereum (Wormhole)',
|
368
|
+
decimals: 8,
|
369
|
+
logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',
|
370
|
+
tags: [],
|
371
|
+
extensions: {
|
372
|
+
coingeckoId: 'ethereum',
|
373
|
+
},
|
374
|
+
},
|
375
|
+
{
|
376
|
+
network: 'mainnet',
|
377
|
+
address: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN',
|
378
|
+
symbol: 'wUSDT',
|
379
|
+
name: 'Tether (Wormhole)',
|
380
|
+
decimals: 6,
|
381
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',
|
382
|
+
tags: [],
|
383
|
+
extensions: {
|
384
|
+
coingeckoId: 'tether',
|
385
|
+
},
|
386
|
+
},
|
387
|
+
{
|
388
|
+
network: 'mainnet',
|
389
|
+
address: '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN',
|
390
|
+
symbol: 'wUSDC',
|
391
|
+
name: 'USD Coin (Wormhole)',
|
392
|
+
decimals: 6,
|
393
|
+
logoURI: 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',
|
394
|
+
tags: [],
|
395
|
+
extensions: {
|
396
|
+
coingeckoId: 'usd-coin',
|
397
|
+
},
|
398
|
+
},
|
399
|
+
{
|
400
|
+
network: 'mainnet',
|
401
|
+
address: '0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN',
|
402
|
+
symbol: 'wCELO',
|
403
|
+
name: 'Celo (Wormhole)',
|
404
|
+
decimals: 8,
|
405
|
+
logoURI: 'https://assets.coingecko.com/coins/images/11090/large/InjXBNx9_400x400.jpg',
|
406
|
+
tags: [],
|
407
|
+
extensions: {
|
408
|
+
coingeckoId: 'celo',
|
409
|
+
},
|
410
|
+
},
|
411
|
+
{
|
412
|
+
network: 'mainnet',
|
413
|
+
address: '0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN',
|
414
|
+
symbol: 'wMATIC',
|
415
|
+
name: 'Wrapped Matic (Wormhole)',
|
416
|
+
decimals: 8,
|
417
|
+
logoURI: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',
|
418
|
+
tags: [],
|
419
|
+
extensions: {
|
420
|
+
coingeckoId: 'matic-network',
|
421
|
+
},
|
422
|
+
},
|
423
|
+
{
|
424
|
+
network: 'mainnet',
|
425
|
+
address: '0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN',
|
426
|
+
symbol: 'wBNB',
|
427
|
+
name: 'Wrapped BNB (Wormhole)',
|
428
|
+
decimals: 8,
|
429
|
+
logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',
|
430
|
+
tags: [],
|
431
|
+
extensions: {
|
432
|
+
coingeckoId: 'binancecoin',
|
433
|
+
},
|
434
|
+
},
|
435
|
+
{
|
436
|
+
network: 'mainnet',
|
437
|
+
address: '0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN',
|
438
|
+
symbol: 'wBTC',
|
439
|
+
name: 'Wrapped Bitcoin (Wormhole)',
|
440
|
+
decimals: 8,
|
441
|
+
logoURI: 'https://assets.coingecko.com/coins/images/1/large/bitcoin.png',
|
442
|
+
tags: [],
|
443
|
+
extensions: {
|
444
|
+
coingeckoId: 'bitcoin',
|
445
|
+
},
|
446
|
+
},
|
447
|
+
{
|
448
|
+
network: 'mainnet',
|
449
|
+
address: '0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN',
|
450
|
+
symbol: 'wAVAX',
|
451
|
+
name: 'Wrapped AVAX (Wormhole)',
|
452
|
+
decimals: 8,
|
453
|
+
logoURI: 'https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png',
|
454
|
+
tags: [],
|
455
|
+
extensions: {
|
456
|
+
coingeckoId: 'avalanche-2',
|
457
|
+
},
|
458
|
+
},
|
459
|
+
{
|
460
|
+
network: 'mainnet',
|
461
|
+
address: '0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN',
|
462
|
+
symbol: 'wFTM',
|
463
|
+
name: 'Wrapped Fantom (Wormhole)',
|
464
|
+
decimals: 8,
|
465
|
+
logoURI: 'https://assets.coingecko.com/coins/images/4001/large/Fantom_round.png',
|
466
|
+
tags: [],
|
467
|
+
extensions: {
|
468
|
+
coingeckoId: 'fantom',
|
469
|
+
},
|
470
|
+
},
|
471
|
+
{
|
472
|
+
network: 'mainnet',
|
473
|
+
address: '0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN',
|
474
|
+
symbol: 'wGLMR',
|
475
|
+
name: 'Wrapped GLMR (Wormhole)',
|
476
|
+
decimals: 8,
|
477
|
+
logoURI: 'https://assets.coingecko.com/coins/images/22459/large/glmr.png',
|
478
|
+
tags: [],
|
479
|
+
extensions: {
|
480
|
+
coingeckoId: 'moonbeam',
|
481
|
+
},
|
482
|
+
},
|
483
|
+
{
|
484
|
+
network: 'mainnet',
|
485
|
+
address: '0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN',
|
486
|
+
symbol: 'wSOL',
|
487
|
+
name: 'Wrapped Solana (Wormhole)',
|
488
|
+
decimals: 8,
|
489
|
+
logoURI: 'https://assets.coingecko.com/coins/images/4128/large/solana.png',
|
490
|
+
tags: [],
|
491
|
+
extensions: {
|
492
|
+
coingeckoId: 'solana',
|
493
|
+
},
|
494
|
+
},
|
495
|
+
{
|
496
|
+
network: 'mainnet',
|
497
|
+
address: '0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN',
|
498
|
+
symbol: 'wUSDCsol',
|
499
|
+
name: 'USD Coin Solana (Wormhole)',
|
500
|
+
decimals: 6,
|
501
|
+
logoURI: 'https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png',
|
502
|
+
tags: [],
|
503
|
+
extensions: {
|
504
|
+
coingeckoId: 'usd-coin',
|
505
|
+
},
|
506
|
+
},
|
507
|
+
],
|
508
|
+
};
|
509
|
+
//# sourceMappingURL=coin.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"coin.js","sourceRoot":"","sources":["../../../src/sui/ext/coin.ts"],"names":[],"mappings":"AACA,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAEzD,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAA0B,CAAA;AAE3D,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAA;IAClC,QAAQ;IACR,8BAA8B;IAC9B,oGAAoG;IACpG,MAAM;IACN,wCAAwC;IACxC,gBAAgB;IAChB,uEAAuE;IACvE,IAAI;IAEJ,WAAW,CAAC,IAAI,CAAC,CAAA;AACnB,CAA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E,EAAE;YACR,UAAU,EAAE;gBACV,WAAW,EAAE,QAAQ;aACtB;SACF;QACD;YACE,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,gFAAgF;YACzF,MAAM,EAAE,OAAO;YACf,IAAI,EAAE,yBAAyB;YAC/B,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,gEAAgE;YACzE,IAAI,EAAE,EAAE;YACR,UAAU,EAAE;gBACV,WAAW,EAAE,UAAU;aACxB;SACF;QACD;YACE,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,gFAAgF;YACzF,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,2BAA2B;YACjC,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,iEAAiE;YAC1E,IAAI,EAAE,EAAE;YACR,UAAU,EAAE;gBACV,WAAW,EAAE,QAAQ;aACtB;SACF;QACD;YACE,OAAO,EAAE,SAAS;YAClB,OAAO,EAAE,gFAAgF;YACzF,MAAM,EAAE,UAAU;YAClB,IAAI,EAAE,4BAA4B;YAClC,QAAQ,EAAE,CAAC;YACX,OAAO,EAAE,wEAAwE;YACjF,IAAI,EAAE,EAAE;YACR,UAAU,EAAE;gBACV,WAAW,EAAE,UAAU;aACxB;SACF;KACF;CACF,CAAA","sourcesContent":["import { SimpleCoinInfo } from '../../move/ext/index.js'\n// import fetch from \"node-fetch\";\nimport { SPLITTER } from '../../move/index.js'\nimport { getPriceByType } from '../../utils/index.js'\nimport { SuiChainId } from '../../core/chain.js'\nimport { validateAndNormalizeAddress } from '../utils.js'\n\nconst WHITELISTED_COINS = new Map<string, SimpleCoinInfo>()\n\nexport async function initCoinList() {\n const list = DEFAULT_LIST.coinlist\n // try {\n // const resp = await fetch(\n // 'https://raw.githubusercontent.com/hippospace/aptos-coin-list/main/src/permissionless.json'\n // )\n // list = (await resp.json()) as any[]\n // } catch (e) {\n // console.warn(\"Can't not fetch newest coin list, use default list\")\n // }\n\n setCoinList(list)\n}\n\nexport interface SuiCoinInfo {\n network: string\n address: string\n symbol: string\n name: string\n decimals: number\n // \"logoURI\": \"https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg\",\n // \"tags\": [],\n // \"extensions\": {\n // \"coingeckoId\": \"sui\"\n // }\n}\n\nfunction setCoinList(list: SuiCoinInfo[]) {\n for (const info of list) {\n if (info.address.startsWith('0x2::coin::Coin')) {\n continue\n }\n if (info.network !== 'mainnet') {\n continue\n }\n let bridge = 'native'\n if (info.name.includes('Celer')) {\n bridge = 'Celer'\n }\n if (info.name.includes('LayerZero')) {\n bridge = 'LayerZero'\n }\n if (info.name.includes('Wormhole')) {\n bridge = 'Wormhole'\n }\n WHITELISTED_COINS.set(info.address, {\n token_type: {\n type: info.address,\n account_address: info.address.split('::')[0],\n },\n symbol: info.symbol,\n decimals: info.decimals,\n bridge,\n })\n }\n}\n\nexport function whitelistCoins() {\n return WHITELISTED_COINS\n}\n\nexport function whiteListed(coin: string): boolean {\n const [addr, module, type] = coin.split(SPLITTER)\n const normalized = [validateAndNormalizeAddress(addr), module, type].join(SPLITTER)\n return WHITELISTED_COINS.has(normalized)\n}\n\nexport function getCoinInfo(type: string): SimpleCoinInfo {\n const r = WHITELISTED_COINS.get(type)\n if (!r) {\n const parts = type.split('::')\n // TDDO retrive from network\n return {\n token_type: { type: type, account_address: parts[0] },\n symbol: parts[2],\n decimals: 8,\n bridge: 'native',\n }\n }\n return r\n}\n\nexport async function getPrice(coinType: string, timestamp: number): Promise<number> {\n if (!whiteListed(coinType)) {\n return 0.0\n }\n const date = new Date(timestamp / 1000)\n try {\n return (await getPriceByType(SuiChainId.SUI_MAINNET, coinType, date)) || 0\n } catch (error) {\n console.log(JSON.stringify(error))\n throw error\n }\n}\n\nexport async function calculateValueInUsd(n: bigint, coinInfo: SimpleCoinInfo, timestamp: number) {\n const price = await getPrice(coinInfo.token_type.type, timestamp)\n const amount = n.scaleDown(coinInfo.decimals)\n return amount.multipliedBy(price)\n}\n\nconst DEFAULT_LIST = {\n name: 'Sui Coin List',\n timestamp: '2022-12-01T13:34:30.145Z',\n logoURI: 'https://s2.coinmarketcap.com/static/img/coins/128x128/20947.png',\n coinlist: [\n {\n network: 'mainnet',\n address: '0x2::coin::Coin<0x2::sui::SUI>',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'testnet',\n address: '0x2::coin::Coin<0x2::sui::SUI>',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'devnet',\n address: '0x2::coin::Coin<0x2::sui::SUI>',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'mainnet',\n address: '0x2::sui::SUI',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'testnet',\n address: '0x2::sui::SUI',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'devnet',\n address: '0x2::sui::SUI',\n symbol: 'SUI',\n name: 'Sui Coin',\n decimals: 9,\n logoURI: 'https://cryptototem.com/wp-content/uploads/2022/08/SUI-logo.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'sui',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST',\n symbol: 'TEST',\n name: 'Test Token',\n logoURI: 'https://suiswap.app/images/token/suiswap-test.svg',\n tags: [],\n decimals: 8,\n extensions: {},\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT',\n symbol: 'USDT',\n name: 'Tether',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',\n tags: [],\n decimals: 8,\n extensions: {\n coingeckoId: 'tether',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC',\n symbol: 'USDC',\n name: 'USD Coin',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'usd-coin',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL',\n symbol: 'SOL',\n name: 'Solana',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png',\n decimals: 8,\n extensions: {\n coingeckoId: 'solana',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC',\n symbol: 'BTC',\n name: 'Bitcoin',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'bitcoin',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI',\n symbol: 'DAI',\n name: 'DAI',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'dai',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB',\n symbol: 'BNB',\n name: 'BNB',\n logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'binancecoin',\n },\n },\n {\n network: 'testnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH',\n symbol: 'ETH',\n name: 'Ethereum',\n logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'ethereum',\n },\n },\n {\n network: 'testnet',\n address: '0x31b14985adb91360ed90a5786cb0956c83e7f275a8ae6123f38adab9d2b792b1::usdc::USDC',\n symbol: 'USDC',\n name: 'USD Coin',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'usd-coin',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestTEST',\n symbol: 'TEST',\n name: 'Test Token',\n logoURI: 'https://suiswap.app/images/token/suiswap-test.svg',\n tags: [],\n decimals: 8,\n extensions: {},\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDT',\n symbol: 'USDT',\n name: 'Tether',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',\n tags: [],\n decimals: 8,\n extensions: {\n coingeckoId: 'tether',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestUSDC',\n symbol: 'USDC',\n name: 'USD Coin',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'usd-coin',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestSOL',\n symbol: 'SOL',\n name: 'Solana',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/So11111111111111111111111111111111111111112/logo.png',\n decimals: 8,\n extensions: {\n coingeckoId: 'solana',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBTC',\n symbol: 'BTC',\n name: 'Bitcoin',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/9n4nbM75f5Ui33ZbPYXn59EwSgE8CGsHtAeTH5YFeJ9E/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'bitcoin',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestDAI',\n symbol: 'DAI',\n name: 'DAI',\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/FYpdBuyAHSbdaAyD1sKkxyLWbAP8uUW9h6uvdhK74ij1/logo.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'dai',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestBNB',\n symbol: 'BNB',\n name: 'BNB',\n logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'binancecoin',\n },\n },\n {\n network: 'devnet',\n address: '0xe158e6df182971bb6c85eb9de9fbfb460b68163d19afc45873c8672b5cc521b2::TOKEN::TestETH',\n symbol: 'ETH',\n name: 'Ethereum',\n logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',\n decimals: 8,\n tags: [],\n extensions: {\n coingeckoId: 'ethereum',\n },\n },\n {\n network: 'mainnet',\n address: '0xaf8cd5edc19c4512f4259f0bee101a40d41ebed738ade5874359610ef8eeced5::coin::COIN',\n symbol: 'wETH',\n name: 'Wrapped Ethereum (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/279/large/ethereum.png',\n tags: [],\n extensions: {\n coingeckoId: 'ethereum',\n },\n },\n {\n network: 'mainnet',\n address: '0xc060006111016b8a020ad5b33834984a437aaa7d3c74c18e09a95d48aceab08c::coin::COIN',\n symbol: 'wUSDT',\n name: 'Tether (Wormhole)',\n decimals: 6,\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/BQcdHdAQW1hczDbBi9hiegXAR7A98Q9jx3X3iBBBDiq4/logo.png',\n tags: [],\n extensions: {\n coingeckoId: 'tether',\n },\n },\n {\n network: 'mainnet',\n address: '0x5d4b302506645c37ff133b98c4b50a5ae14841659738d6d733d59d0d217a93bf::coin::COIN',\n symbol: 'wUSDC',\n name: 'USD Coin (Wormhole)',\n decimals: 6,\n logoURI:\n 'https://raw.githubusercontent.com/solana-labs/token-list/main/assets/mainnet/EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v/logo.png',\n tags: [],\n extensions: {\n coingeckoId: 'usd-coin',\n },\n },\n {\n network: 'mainnet',\n address: '0xa198f3be41cda8c07b3bf3fee02263526e535d682499806979a111e88a5a8d0f::coin::COIN',\n symbol: 'wCELO',\n name: 'Celo (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/11090/large/InjXBNx9_400x400.jpg',\n tags: [],\n extensions: {\n coingeckoId: 'celo',\n },\n },\n {\n network: 'mainnet',\n address: '0xdbe380b13a6d0f5cdedd58de8f04625263f113b3f9db32b3e1983f49e2841676::coin::COIN',\n symbol: 'wMATIC',\n name: 'Wrapped Matic (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/4713/large/matic-token-icon.png',\n tags: [],\n extensions: {\n coingeckoId: 'matic-network',\n },\n },\n {\n network: 'mainnet',\n address: '0xb848cce11ef3a8f62eccea6eb5b35a12c4c2b1ee1af7755d02d7bd6218e8226f::coin::COIN',\n symbol: 'wBNB',\n name: 'Wrapped BNB (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/825/large/bnb-icon2_2x.png',\n tags: [],\n extensions: {\n coingeckoId: 'binancecoin',\n },\n },\n {\n network: 'mainnet',\n address: '0x027792d9fed7f9844eb4839566001bb6f6cb4804f66aa2da6fe1ee242d896881::coin::COIN',\n symbol: 'wBTC',\n name: 'Wrapped Bitcoin (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/1/large/bitcoin.png',\n tags: [],\n extensions: {\n coingeckoId: 'bitcoin',\n },\n },\n {\n network: 'mainnet',\n address: '0x1e8b532cca6569cab9f9b9ebc73f8c13885012ade714729aa3b450e0339ac766::coin::COIN',\n symbol: 'wAVAX',\n name: 'Wrapped AVAX (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/12559/large/Avalanche_Circle_RedWhite_Trans.png',\n tags: [],\n extensions: {\n coingeckoId: 'avalanche-2',\n },\n },\n {\n network: 'mainnet',\n address: '0x6081300950a4f1e2081580e919c210436a1bed49080502834950d31ee55a2396::coin::COIN',\n symbol: 'wFTM',\n name: 'Wrapped Fantom (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/4001/large/Fantom_round.png',\n tags: [],\n extensions: {\n coingeckoId: 'fantom',\n },\n },\n {\n network: 'mainnet',\n address: '0x66f87084e49c38f76502d17f87d17f943f183bb94117561eb573e075fdc5ff75::coin::COIN',\n symbol: 'wGLMR',\n name: 'Wrapped GLMR (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/22459/large/glmr.png',\n tags: [],\n extensions: {\n coingeckoId: 'moonbeam',\n },\n },\n {\n network: 'mainnet',\n address: '0xb7844e289a8410e50fb3ca48d69eb9cf29e27d223ef90353fe1bd8e27ff8f3f8::coin::COIN',\n symbol: 'wSOL',\n name: 'Wrapped Solana (Wormhole)',\n decimals: 8,\n logoURI: 'https://assets.coingecko.com/coins/images/4128/large/solana.png',\n tags: [],\n extensions: {\n coingeckoId: 'solana',\n },\n },\n {\n network: 'mainnet',\n address: '0xb231fcda8bbddb31f2ef02e6161444aec64a514e2c89279584ac9806ce9cf037::coin::COIN',\n symbol: 'wUSDCsol',\n name: 'USD Coin Solana (Wormhole)',\n decimals: 6,\n logoURI: 'https://assets.coingecko.com/coins/images/6319/large/USD_Coin_icon.png',\n tags: [],\n extensions: {\n coingeckoId: 'usd-coin',\n },\n },\n ],\n}\n"]}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
/// <reference types="node" resolution-mode="require"/>
|
2
|
+
import { BigDecimal } from '@sentio/bigdecimal';
|
3
|
+
import { MoveCoinList, MoveDex, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js';
|
4
|
+
import { SuiMoveObject, SuiMovePackage } from '@mysten/sui.js';
|
5
|
+
import { SuiNetwork } from '../network.js';
|
6
|
+
import { SuiContext, SuiObjectsContext } from '../context.js';
|
7
|
+
export type PoolAdaptor<T> = MovePoolAdaptor<SuiMoveObject, T>;
|
8
|
+
export declare class CoinList implements MoveCoinList {
|
9
|
+
calculateValueInUsd(amount: bigint, coinInfo: SimpleCoinInfo, timestamp: number): Promise<BigDecimal>;
|
10
|
+
getCoinInfo(type: string): SimpleCoinInfo;
|
11
|
+
whiteListed(type: string): boolean;
|
12
|
+
whitelistCoins(): Map<string, SimpleCoinInfo>;
|
13
|
+
}
|
14
|
+
export declare const SuiCoinList: CoinList;
|
15
|
+
export declare class SuiDex<T> extends MoveDex<SuiNetwork, SuiMovePackage, SuiMoveObject, Event, SuiContext, SuiObjectsContext, T> {
|
16
|
+
coinList: CoinList;
|
17
|
+
poolAdaptor: PoolAdaptor<T>;
|
18
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
import { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js';
|
2
|
+
import { MoveDex } from '../../move/ext/index.js';
|
3
|
+
export class CoinList {
|
4
|
+
calculateValueInUsd(amount, coinInfo, timestamp) {
|
5
|
+
return calculateValueInUsd(amount, coinInfo, timestamp);
|
6
|
+
}
|
7
|
+
getCoinInfo(type) {
|
8
|
+
return getCoinInfo(type);
|
9
|
+
}
|
10
|
+
whiteListed(type) {
|
11
|
+
return whiteListed(type);
|
12
|
+
}
|
13
|
+
whitelistCoins() {
|
14
|
+
return whitelistCoins();
|
15
|
+
}
|
16
|
+
}
|
17
|
+
export const SuiCoinList = new CoinList();
|
18
|
+
export class SuiDex extends MoveDex {
|
19
|
+
coinList = SuiCoinList;
|
20
|
+
}
|
21
|
+
//# sourceMappingURL=move-dex.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"move-dex.js","sourceRoot":"","sources":["../../../src/sui/ext/move-dex.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AACzF,OAAO,EAAgB,OAAO,EAAmC,MAAM,yBAAyB,CAAA;AAOhG,MAAM,OAAO,QAAQ;IACnB,mBAAmB,CAAC,MAAc,EAAE,QAAwB,EAAE,SAAiB;QAC7E,OAAO,mBAAmB,CAAC,MAAM,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAA;IACzD,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,WAAW,CAAC,IAAY;QACtB,OAAO,WAAW,CAAC,IAAI,CAAC,CAAA;IAC1B,CAAC;IAED,cAAc;QACZ,OAAO,cAAc,EAAE,CAAA;IACzB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,QAAQ,EAAE,CAAA;AAEzC,MAAM,OAAO,MAAU,SAAQ,OAQ9B;IACC,QAAQ,GAAG,WAAW,CAAA;CAEvB","sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { calculateValueInUsd, getCoinInfo, whitelistCoins, whiteListed } from './coin.js'\nimport { MoveCoinList, MoveDex, MovePoolAdaptor, SimpleCoinInfo } from '../../move/ext/index.js'\nimport { SuiMoveObject, SuiMovePackage } from '@mysten/sui.js'\nimport { SuiNetwork } from '../network.js'\nimport { SuiContext, SuiObjectsContext } from '../context.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<SuiMoveObject, T>\n\nexport class CoinList implements MoveCoinList {\n calculateValueInUsd(amount: bigint, coinInfo: SimpleCoinInfo, timestamp: number): Promise<BigDecimal> {\n return calculateValueInUsd(amount, coinInfo, timestamp)\n }\n\n getCoinInfo(type: string): SimpleCoinInfo {\n return getCoinInfo(type)\n }\n\n whiteListed(type: string): boolean {\n return whiteListed(type)\n }\n\n whitelistCoins(): Map<string, SimpleCoinInfo> {\n return whitelistCoins()\n }\n}\n\nexport const SuiCoinList = new CoinList()\n\nexport class SuiDex<T> extends MoveDex<\n SuiNetwork,\n SuiMovePackage,\n SuiMoveObject,\n Event,\n SuiContext,\n SuiObjectsContext,\n T\n> {\n coinList = SuiCoinList\n declare poolAdaptor: PoolAdaptor<T>\n}\n"]}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentio/sdk",
|
3
|
-
"version": "2.15.0-rc.
|
3
|
+
"version": "2.15.0-rc.3",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -68,8 +68,8 @@
|
|
68
68
|
"typechain": "^8.0.0",
|
69
69
|
"typedoc": "^0.24.1",
|
70
70
|
"yaml": "^2.2.1",
|
71
|
-
"@sentio/protos": "^2.15.0-rc.
|
72
|
-
"@sentio/runtime": "^2.15.0-rc.
|
71
|
+
"@sentio/protos": "^2.15.0-rc.3",
|
72
|
+
"@sentio/runtime": "^2.15.0-rc.3"
|
73
73
|
},
|
74
74
|
"peerDependencies": {
|
75
75
|
"tsup": "npm:@sentio/tsup@^6.7.0"
|