@sentio/sdk-bundle 2.57.13-rc.1 → 2.57.13-rc.10
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/builtin/0x1.js +8 -8
- package/lib/aptos/builtin/0x3.js +9 -9
- package/lib/aptos/builtin/0x4.js +9 -9
- package/lib/aptos/builtin/index.js +10 -10
- package/lib/aptos/ext/index.js +11 -11
- package/lib/aptos/ext/index.js.map +1 -1
- package/lib/aptos/index.js +8 -8
- package/lib/btc/index.js +2 -2
- package/lib/{chunk-XGPBQVLT.js → chunk-2OFA5JDV.js} +1648 -570
- package/lib/chunk-2OFA5JDV.js.map +1 -0
- package/lib/{chunk-FSB2FFUL.js → chunk-2Q6JJZUV.js} +3 -3
- package/lib/{chunk-RH64WB4U.js → chunk-4KURLHO4.js} +4 -4
- package/lib/{chunk-DJGFPJCC.js → chunk-5GWL2KUM.js} +2 -2
- package/lib/{chunk-ESA446QU.js → chunk-6FDVNSJK.js} +5 -5
- package/lib/{chunk-Y2VTRRAQ.js → chunk-7I4EWEE6.js} +2 -2
- package/lib/{chunk-OUHPNVFU.js → chunk-AP3PMK2U.js} +2 -2
- package/lib/{chunk-V7DNQ4WS.js → chunk-CX5EK4MU.js} +5 -5
- package/lib/chunk-CX5EK4MU.js.map +1 -0
- package/lib/{chunk-CAEPIBMR.js → chunk-F5JO5KNG.js} +2 -2
- package/lib/{chunk-YPKJ6KJ6.js → chunk-GGVLBV4T.js} +2 -2
- package/lib/{chunk-CQ67FVD5.js → chunk-GUWMSIEW.js} +3 -3
- package/lib/{chunk-5U5YGWHY.js → chunk-KCIQ2OKY.js} +2 -2
- package/lib/{chunk-ULFJA63E.js → chunk-LESVU2KM.js} +2 -2
- package/lib/{chunk-TYSYZK7X.js → chunk-NZ5TSWXT.js} +2 -2
- package/lib/{chunk-VDA2BYO7.js → chunk-O2WEEUKV.js} +4 -4
- package/lib/chunk-O2WEEUKV.js.map +1 -0
- package/lib/{chunk-JI66ORW5.js → chunk-OVZHBJP6.js} +2 -2
- package/lib/{chunk-PRQDQXWN.js → chunk-PQ6XVEEC.js} +4 -4
- package/lib/{chunk-UEFVZL4I.js → chunk-RCHDJAQ3.js} +12 -12
- package/lib/chunk-RCHDJAQ3.js.map +1 -0
- package/lib/{chunk-UWKOO7H3.js → chunk-UZ6GGAUG.js} +18 -2
- package/lib/{chunk-UWKOO7H3.js.map → chunk-UZ6GGAUG.js.map} +1 -1
- package/lib/{chunk-3YA23Q63.js → chunk-WFPUUK3B.js} +3 -3
- package/lib/{chunk-KMLCBYMB.js → chunk-WSSWG6BM.js} +5 -5
- package/lib/{chunk-IVHB6EX5.js → chunk-YORAHN24.js} +6 -6
- package/lib/core/index.js +1 -1
- package/lib/eth/builtin/eacaggregatorproxy.js +3 -3
- package/lib/eth/builtin/erc1155.js +3 -3
- package/lib/eth/builtin/erc20.js +2 -2
- package/lib/eth/builtin/erc721.js +2 -2
- package/lib/eth/builtin/index.js +6 -6
- package/lib/eth/builtin/weth9.js +3 -3
- package/lib/eth/index.js +2 -2
- package/lib/fuel/index.js +2 -2
- package/lib/index.js +1 -1
- package/lib/move/ext/index.js +1 -1
- package/lib/move/index.js +2 -2
- package/lib/solana/builtin/index.js +3 -3
- package/lib/solana/index.js +3 -3
- package/lib/stark/index.js +1 -1
- package/lib/store/index.js +12 -2
- package/lib/store/index.js.map +1 -1
- package/lib/sui/builtin/0x1.js +9 -9
- package/lib/sui/builtin/0x2.js +10 -10
- package/lib/sui/builtin/0x3.js +11 -11
- package/lib/sui/builtin/index.js +11 -11
- package/lib/sui/ext/index.js +8 -8
- package/lib/sui/index.js +8 -8
- package/lib/testing/index.js +20 -16
- package/lib/testing/index.js.map +1 -1
- package/lib/utils/index.js +5 -5
- package/package.json +2 -2
- package/lib/chunk-UEFVZL4I.js.map +0 -1
- package/lib/chunk-V7DNQ4WS.js.map +0 -1
- package/lib/chunk-VDA2BYO7.js.map +0 -1
- package/lib/chunk-XGPBQVLT.js.map +0 -1
- /package/lib/{chunk-FSB2FFUL.js.map → chunk-2Q6JJZUV.js.map} +0 -0
- /package/lib/{chunk-RH64WB4U.js.map → chunk-4KURLHO4.js.map} +0 -0
- /package/lib/{chunk-DJGFPJCC.js.map → chunk-5GWL2KUM.js.map} +0 -0
- /package/lib/{chunk-ESA446QU.js.map → chunk-6FDVNSJK.js.map} +0 -0
- /package/lib/{chunk-Y2VTRRAQ.js.map → chunk-7I4EWEE6.js.map} +0 -0
- /package/lib/{chunk-OUHPNVFU.js.map → chunk-AP3PMK2U.js.map} +0 -0
- /package/lib/{chunk-CAEPIBMR.js.map → chunk-F5JO5KNG.js.map} +0 -0
- /package/lib/{chunk-YPKJ6KJ6.js.map → chunk-GGVLBV4T.js.map} +0 -0
- /package/lib/{chunk-CQ67FVD5.js.map → chunk-GUWMSIEW.js.map} +0 -0
- /package/lib/{chunk-5U5YGWHY.js.map → chunk-KCIQ2OKY.js.map} +0 -0
- /package/lib/{chunk-ULFJA63E.js.map → chunk-LESVU2KM.js.map} +0 -0
- /package/lib/{chunk-TYSYZK7X.js.map → chunk-NZ5TSWXT.js.map} +0 -0
- /package/lib/{chunk-JI66ORW5.js.map → chunk-OVZHBJP6.js.map} +0 -0
- /package/lib/{chunk-PRQDQXWN.js.map → chunk-PQ6XVEEC.js.map} +0 -0
- /package/lib/{chunk-3YA23Q63.js.map → chunk-WFPUUK3B.js.map} +0 -0
- /package/lib/{chunk-KMLCBYMB.js.map → chunk-WSSWG6BM.js.map} +0 -0
- /package/lib/{chunk-IVHB6EX5.js.map → chunk-YORAHN24.js.map} +0 -0
package/lib/aptos/builtin/0x1.js
CHANGED
|
@@ -88,20 +88,20 @@ import {
|
|
|
88
88
|
version,
|
|
89
89
|
vesting,
|
|
90
90
|
voting
|
|
91
|
-
} from "../../chunk-
|
|
91
|
+
} from "../../chunk-6FDVNSJK.js";
|
|
92
92
|
import "../../chunk-LR232ZJV.js";
|
|
93
93
|
import "../../chunk-742S42NO.js";
|
|
94
94
|
import "../../chunk-7IDGS56O.js";
|
|
95
|
-
import "../../chunk-
|
|
96
|
-
import "../../chunk-
|
|
97
|
-
import "../../chunk-
|
|
98
|
-
import "../../chunk-
|
|
95
|
+
import "../../chunk-2OFA5JDV.js";
|
|
96
|
+
import "../../chunk-NZ5TSWXT.js";
|
|
97
|
+
import "../../chunk-GGVLBV4T.js";
|
|
98
|
+
import "../../chunk-O2WEEUKV.js";
|
|
99
99
|
import "../../chunk-732PRUHO.js";
|
|
100
100
|
import "../../chunk-43HP4DQZ.js";
|
|
101
|
-
import "../../chunk-
|
|
102
|
-
import "../../chunk-
|
|
101
|
+
import "../../chunk-KCIQ2OKY.js";
|
|
102
|
+
import "../../chunk-LESVU2KM.js";
|
|
103
103
|
import "../../chunk-ZR7UHHH2.js";
|
|
104
|
-
import "../../chunk-
|
|
104
|
+
import "../../chunk-UZ6GGAUG.js";
|
|
105
105
|
import "../../chunk-J5UEW4B7.js";
|
|
106
106
|
import "../../chunk-73SHERGU.js";
|
|
107
107
|
import "../../chunk-R7PMHHKJ.js";
|
package/lib/aptos/builtin/0x3.js
CHANGED
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
token_coin_swap,
|
|
7
7
|
token_event_store,
|
|
8
8
|
token_transfers
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-GUWMSIEW.js";
|
|
10
|
+
import "../../chunk-6FDVNSJK.js";
|
|
11
11
|
import "../../chunk-LR232ZJV.js";
|
|
12
12
|
import "../../chunk-742S42NO.js";
|
|
13
13
|
import "../../chunk-7IDGS56O.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-2OFA5JDV.js";
|
|
15
|
+
import "../../chunk-NZ5TSWXT.js";
|
|
16
|
+
import "../../chunk-GGVLBV4T.js";
|
|
17
|
+
import "../../chunk-O2WEEUKV.js";
|
|
18
18
|
import "../../chunk-732PRUHO.js";
|
|
19
19
|
import "../../chunk-43HP4DQZ.js";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-KCIQ2OKY.js";
|
|
21
|
+
import "../../chunk-LESVU2KM.js";
|
|
22
22
|
import "../../chunk-ZR7UHHH2.js";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-UZ6GGAUG.js";
|
|
24
24
|
import "../../chunk-J5UEW4B7.js";
|
|
25
25
|
import "../../chunk-73SHERGU.js";
|
|
26
26
|
import "../../chunk-R7PMHHKJ.js";
|
package/lib/aptos/builtin/0x4.js
CHANGED
|
@@ -6,21 +6,21 @@ import {
|
|
|
6
6
|
property_map,
|
|
7
7
|
royalty,
|
|
8
8
|
token
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
9
|
+
} from "../../chunk-2Q6JJZUV.js";
|
|
10
|
+
import "../../chunk-6FDVNSJK.js";
|
|
11
11
|
import "../../chunk-LR232ZJV.js";
|
|
12
12
|
import "../../chunk-742S42NO.js";
|
|
13
13
|
import "../../chunk-7IDGS56O.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-2OFA5JDV.js";
|
|
15
|
+
import "../../chunk-NZ5TSWXT.js";
|
|
16
|
+
import "../../chunk-GGVLBV4T.js";
|
|
17
|
+
import "../../chunk-O2WEEUKV.js";
|
|
18
18
|
import "../../chunk-732PRUHO.js";
|
|
19
19
|
import "../../chunk-43HP4DQZ.js";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-KCIQ2OKY.js";
|
|
21
|
+
import "../../chunk-LESVU2KM.js";
|
|
22
22
|
import "../../chunk-ZR7UHHH2.js";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-UZ6GGAUG.js";
|
|
24
24
|
import "../../chunk-J5UEW4B7.js";
|
|
25
25
|
import "../../chunk-73SHERGU.js";
|
|
26
26
|
import "../../chunk-R7PMHHKJ.js";
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
|
|
2
2
|
import {
|
|
3
3
|
x3_exports
|
|
4
|
-
} from "../../chunk-
|
|
4
|
+
} from "../../chunk-GUWMSIEW.js";
|
|
5
5
|
import {
|
|
6
6
|
x4_exports
|
|
7
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-2Q6JJZUV.js";
|
|
8
8
|
import {
|
|
9
9
|
x1_exports
|
|
10
|
-
} from "../../chunk-
|
|
10
|
+
} from "../../chunk-6FDVNSJK.js";
|
|
11
11
|
import "../../chunk-LR232ZJV.js";
|
|
12
12
|
import "../../chunk-742S42NO.js";
|
|
13
13
|
import "../../chunk-7IDGS56O.js";
|
|
14
|
-
import "../../chunk-
|
|
15
|
-
import "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
17
|
-
import "../../chunk-
|
|
14
|
+
import "../../chunk-2OFA5JDV.js";
|
|
15
|
+
import "../../chunk-NZ5TSWXT.js";
|
|
16
|
+
import "../../chunk-GGVLBV4T.js";
|
|
17
|
+
import "../../chunk-O2WEEUKV.js";
|
|
18
18
|
import "../../chunk-732PRUHO.js";
|
|
19
19
|
import "../../chunk-43HP4DQZ.js";
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
20
|
+
import "../../chunk-KCIQ2OKY.js";
|
|
21
|
+
import "../../chunk-LESVU2KM.js";
|
|
22
22
|
import "../../chunk-ZR7UHHH2.js";
|
|
23
|
-
import "../../chunk-
|
|
23
|
+
import "../../chunk-UZ6GGAUG.js";
|
|
24
24
|
import "../../chunk-J5UEW4B7.js";
|
|
25
25
|
import "../../chunk-73SHERGU.js";
|
|
26
26
|
import "../../chunk-R7PMHHKJ.js";
|
package/lib/aptos/ext/index.js
CHANGED
|
@@ -2,7 +2,7 @@ import { createRequire as createRequireSdkShim } from 'module'; const require =
|
|
|
2
2
|
import {
|
|
3
3
|
MoveDex,
|
|
4
4
|
moveGetPairValue
|
|
5
|
-
} from "../../chunk-
|
|
5
|
+
} from "../../chunk-RCHDJAQ3.js";
|
|
6
6
|
import {
|
|
7
7
|
AptosNetwork,
|
|
8
8
|
getPriceForToken,
|
|
@@ -11,20 +11,20 @@ import {
|
|
|
11
11
|
isWhiteListToken,
|
|
12
12
|
tokenTokenValueInUsd,
|
|
13
13
|
whitelistTokens
|
|
14
|
-
} from "../../chunk-
|
|
14
|
+
} from "../../chunk-6FDVNSJK.js";
|
|
15
15
|
import "../../chunk-LR232ZJV.js";
|
|
16
16
|
import "../../chunk-742S42NO.js";
|
|
17
17
|
import "../../chunk-7IDGS56O.js";
|
|
18
|
-
import "../../chunk-
|
|
19
|
-
import "../../chunk-
|
|
20
|
-
import "../../chunk-
|
|
21
|
-
import "../../chunk-
|
|
18
|
+
import "../../chunk-2OFA5JDV.js";
|
|
19
|
+
import "../../chunk-NZ5TSWXT.js";
|
|
20
|
+
import "../../chunk-GGVLBV4T.js";
|
|
21
|
+
import "../../chunk-O2WEEUKV.js";
|
|
22
22
|
import "../../chunk-732PRUHO.js";
|
|
23
23
|
import "../../chunk-43HP4DQZ.js";
|
|
24
|
-
import "../../chunk-
|
|
25
|
-
import "../../chunk-
|
|
24
|
+
import "../../chunk-KCIQ2OKY.js";
|
|
25
|
+
import "../../chunk-LESVU2KM.js";
|
|
26
26
|
import "../../chunk-ZR7UHHH2.js";
|
|
27
|
-
import "../../chunk-
|
|
27
|
+
import "../../chunk-UZ6GGAUG.js";
|
|
28
28
|
import "../../chunk-J5UEW4B7.js";
|
|
29
29
|
import "../../chunk-73SHERGU.js";
|
|
30
30
|
import {
|
|
@@ -39,8 +39,8 @@ var CoinList = class {
|
|
|
39
39
|
calculateValueInUsd(amount, coinInfo, timestamp, network = AptosNetwork.MAIN_NET) {
|
|
40
40
|
return tokenTokenValueInUsd(amount, coinInfo, timestamp, network);
|
|
41
41
|
}
|
|
42
|
-
async getCoinInfo(type) {
|
|
43
|
-
return getTokenInfoWithFallback(type);
|
|
42
|
+
async getCoinInfo(type, network = AptosNetwork.MAIN_NET) {
|
|
43
|
+
return getTokenInfoWithFallback(type, network);
|
|
44
44
|
}
|
|
45
45
|
whiteListed(type) {
|
|
46
46
|
return whitelistTokens().has(type);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/aptos/ext/aptos-dex.ts","../../../src/aptos/ext/coin-event.ts","../../../src/aptos/ext/index.ts"],"sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { AptosResourcesContext, AptosContext, AptosNetwork } from '../index.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor } from '../../move/ext/index.js'\nimport { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'\nimport { getTokenInfoWithFallback, TokenInfo, tokenTokenValueInUsd, whitelistTokens } from './token.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<MoveResource, T>\n\nexport class CoinList implements MoveCoinList<TokenInfo, AptosNetwork> {\n calculateValueInUsd(\n amount: bigint,\n coinInfo: TokenInfo,\n timestamp: number,\n network: AptosNetwork = AptosNetwork.MAIN_NET\n ): Promise<BigDecimal> {\n return tokenTokenValueInUsd(amount, coinInfo, timestamp, network)\n }\n\n async getCoinInfo(type: string) {\n return getTokenInfoWithFallback(type)\n }\n\n whiteListed(type: string): boolean {\n return whitelistTokens().has(type)\n }\n\n whitelistCoins() {\n return whitelistTokens()\n }\n}\n\nexport const AptosCoinList = new CoinList()\n\nexport class AptosDex<T> extends MoveDex<\n TokenInfo,\n AptosNetwork,\n MoveModuleBytecode,\n MoveResource,\n Event,\n AptosContext,\n AptosResourcesContext,\n T\n> {\n coinList = new CoinList()\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: AptosContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(AptosCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'\nimport { coin } from '../builtin/0x1.js'\nimport { parseMoveType } from '../../move/index.js'\n\nexport function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n if (writeResource.data.type !== `0x1::coin::CoinStore<${coin}>`) {\n continue\n }\n return {\n value: BigInt((writeResource.data.data as any).coin.value)\n }\n }\n return undefined\n}\n\ninterface EventHandlerState {\n counter: string\n guid: {\n id: {\n addr: string\n creation_num: string\n }\n }\n}\n\n// TODO event handler name could be auto located from ABI\nfunction findResourceChangeType(evt: Event, tx: UserTransactionResponse, eventHandlerName: string) {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n\n const state: EventHandlerState = (writeResource.data.data as any)[eventHandlerName]\n\n if (\n BigInt(state.counter) === BigInt(evt.sequence_number) + 1n &&\n state.guid.id.addr === evt.guid.account_address &&\n state.guid.id.creation_num === evt.guid.creation_number\n ) {\n return writeResource.data.type\n }\n }\n\n const errStr = `Can't find matched resource change type: ${JSON.stringify(evt.data)} ${\n tx.version\n } ${eventHandlerName}`\n throw Error(errStr)\n}\n\nexport function getDepositCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'deposit_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n\nexport function getWithDrawCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'withdraw_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './aptos-dex.js'\nexport * from './token.js'\nexport { findNewCoinBalances } from './coin-event.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAM,WAAN,MAAgE;AAAA,EARvE,OAQuE;AAAA;AAAA;AAAA,EACrE,oBACE,QACA,UACA,WACA,UAAwB,aAAa,UAChB;AACrB,WAAO,qBAAqB,QAAQ,UAAU,WAAW,OAAO;AAAA,EAClE;AAAA,EAEA,MAAM,YAAY,MAAc;
|
|
1
|
+
{"version":3,"sources":["../../../src/aptos/ext/aptos-dex.ts","../../../src/aptos/ext/coin-event.ts","../../../src/aptos/ext/index.ts"],"sourcesContent":["import { BigDecimal } from '@sentio/bigdecimal'\nimport { AptosResourcesContext, AptosContext, AptosNetwork } from '../index.js'\nimport { MoveCoinList, MoveDex, moveGetPairValue, MovePoolAdaptor } from '../../move/ext/index.js'\nimport { MoveResource, Event, MoveModuleBytecode } from '@aptos-labs/ts-sdk'\nimport { getTokenInfoWithFallback, TokenInfo, tokenTokenValueInUsd, whitelistTokens } from './token.js'\n\nexport type PoolAdaptor<T> = MovePoolAdaptor<MoveResource, T>\n\nexport class CoinList implements MoveCoinList<TokenInfo, AptosNetwork> {\n calculateValueInUsd(\n amount: bigint,\n coinInfo: TokenInfo,\n timestamp: number,\n network: AptosNetwork = AptosNetwork.MAIN_NET\n ): Promise<BigDecimal> {\n return tokenTokenValueInUsd(amount, coinInfo, timestamp, network)\n }\n\n async getCoinInfo(type: string, network: AptosNetwork = AptosNetwork.MAIN_NET) {\n return getTokenInfoWithFallback(type, network)\n }\n\n whiteListed(type: string): boolean {\n return whitelistTokens().has(type)\n }\n\n whitelistCoins() {\n return whitelistTokens()\n }\n}\n\nexport const AptosCoinList = new CoinList()\n\nexport class AptosDex<T> extends MoveDex<\n TokenInfo,\n AptosNetwork,\n MoveModuleBytecode,\n MoveResource,\n Event,\n AptosContext,\n AptosResourcesContext,\n T\n> {\n coinList = new CoinList()\n declare poolAdaptor: PoolAdaptor<T>\n}\n\nexport async function getPairValue(\n ctx: AptosContext,\n coinx: string,\n coiny: string,\n coinXAmount: bigint,\n coinYAmount: bigint\n): Promise<BigDecimal> {\n return moveGetPairValue(AptosCoinList, ctx, coinx, coiny, coinXAmount, coinYAmount)\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","import { Event, UserTransactionResponse, WriteSetChangeWriteResource } from '@aptos-labs/ts-sdk'\nimport { coin } from '../builtin/0x1.js'\nimport { parseMoveType } from '../../move/index.js'\n\nexport function findNewCoinBalances(evt: Event, tx: UserTransactionResponse, coin: string): coin.Coin<any> | undefined {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n if (writeResource.data.type !== `0x1::coin::CoinStore<${coin}>`) {\n continue\n }\n return {\n value: BigInt((writeResource.data.data as any).coin.value)\n }\n }\n return undefined\n}\n\ninterface EventHandlerState {\n counter: string\n guid: {\n id: {\n addr: string\n creation_num: string\n }\n }\n}\n\n// TODO event handler name could be auto located from ABI\nfunction findResourceChangeType(evt: Event, tx: UserTransactionResponse, eventHandlerName: string) {\n if (!tx.changes) {\n throw Error('No resource change found, did you forget set fetchOption to { resourceChanges: true } ')\n }\n\n for (const change of tx.changes) {\n if (change.type !== 'write_resource') {\n continue\n }\n\n const writeResource = change as WriteSetChangeWriteResource\n if (writeResource.address !== evt.guid.account_address) {\n continue\n }\n\n const state: EventHandlerState = (writeResource.data.data as any)[eventHandlerName]\n\n if (\n BigInt(state.counter) === BigInt(evt.sequence_number) + 1n &&\n state.guid.id.addr === evt.guid.account_address &&\n state.guid.id.creation_num === evt.guid.creation_number\n ) {\n return writeResource.data.type\n }\n }\n\n const errStr = `Can't find matched resource change type: ${JSON.stringify(evt.data)} ${\n tx.version\n } ${eventHandlerName}`\n throw Error(errStr)\n}\n\nexport function getDepositCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'deposit_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n\nexport function getWithDrawCoinType(evt: Event, tx: UserTransactionResponse) {\n const coinStore = findResourceChangeType(evt, tx, 'withdraw_events')\n return parseMoveType(coinStore).typeArgs[0].getSignature()\n}\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));","export * from './aptos-dex.js'\nexport * from './token.js'\nexport { findNewCoinBalances } from './coin-event.js'\n;import(\"node:process\").then((p) => p.stdout.write(\"\"));"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQO,IAAM,WAAN,MAAgE;AAAA,EARvE,OAQuE;AAAA;AAAA;AAAA,EACrE,oBACE,QACA,UACA,WACA,UAAwB,aAAa,UAChB;AACrB,WAAO,qBAAqB,QAAQ,UAAU,WAAW,OAAO;AAAA,EAClE;AAAA,EAEA,MAAM,YAAY,MAAc,UAAwB,aAAa,UAAU;AAC7E,WAAO,yBAAyB,MAAM,OAAO;AAAA,EAC/C;AAAA,EAEA,YAAY,MAAuB;AACjC,WAAO,gBAAgB,EAAE,IAAI,IAAI;AAAA,EACnC;AAAA,EAEA,iBAAiB;AACf,WAAO,gBAAgB;AAAA,EACzB;AACF;AAEO,IAAM,gBAAgB,IAAI,SAAS;AAEnC,IAAM,WAAN,cAA0B,QAS/B;AAAA,EA1CF,OA0CE;AAAA;AAAA;AAAA,EACA,WAAW,IAAI,SAAS;AAE1B;AAEA,eAAsB,aACpB,KACA,OACA,OACA,aACA,aACqB;AACrB,SAAO,iBAAiB,eAAe,KAAK,OAAO,OAAO,aAAa,WAAW;AACpF;AARsB;AASrB,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;ACpD/C,SAAS,oBAAoB,KAAY,IAA6B,MAA0C;AACrH,MAAI,CAAC,GAAG,SAAS;AACf,UAAM,MAAM,yFAAyF;AAAA,EACvG;AACA,aAAW,UAAU,GAAG,SAAS;AAC/B,QAAI,OAAO,SAAS,kBAAkB;AACpC;AAAA,IACF;AACA,UAAM,gBAAgB;AACtB,QAAI,cAAc,YAAY,IAAI,KAAK,iBAAiB;AACtD;AAAA,IACF;AACA,QAAI,cAAc,KAAK,SAAS,wBAAwB,IAAI,KAAK;AAC/D;AAAA,IACF;AACA,WAAO;AAAA,MACL,OAAO,OAAQ,cAAc,KAAK,KAAa,KAAK,KAAK;AAAA,IAC3D;AAAA,EACF;AACA,SAAO;AACT;AApBgB;AA0Ef,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;;;AC3ErD,OAAO,cAAc,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,MAAM,EAAE,CAAC;","names":[]}
|
package/lib/aptos/index.js
CHANGED
|
@@ -17,22 +17,22 @@ import {
|
|
|
17
17
|
RichAptosClientWithContext,
|
|
18
18
|
defaultMoveCoder,
|
|
19
19
|
defaultMoveCoderForClient
|
|
20
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-6FDVNSJK.js";
|
|
21
21
|
import "../chunk-LR232ZJV.js";
|
|
22
22
|
import "../chunk-742S42NO.js";
|
|
23
23
|
import "../chunk-7IDGS56O.js";
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
24
|
+
import "../chunk-2OFA5JDV.js";
|
|
25
|
+
import "../chunk-NZ5TSWXT.js";
|
|
26
|
+
import "../chunk-GGVLBV4T.js";
|
|
27
|
+
import "../chunk-O2WEEUKV.js";
|
|
28
28
|
import "../chunk-732PRUHO.js";
|
|
29
29
|
import "../chunk-43HP4DQZ.js";
|
|
30
30
|
import {
|
|
31
31
|
BUILTIN_TYPES
|
|
32
|
-
} from "../chunk-
|
|
33
|
-
import "../chunk-
|
|
32
|
+
} from "../chunk-KCIQ2OKY.js";
|
|
33
|
+
import "../chunk-LESVU2KM.js";
|
|
34
34
|
import "../chunk-ZR7UHHH2.js";
|
|
35
|
-
import "../chunk-
|
|
35
|
+
import "../chunk-UZ6GGAUG.js";
|
|
36
36
|
import "../chunk-J5UEW4B7.js";
|
|
37
37
|
import "../chunk-73SHERGU.js";
|
|
38
38
|
import "../chunk-R7PMHHKJ.js";
|
package/lib/btc/index.js
CHANGED
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
BTCProcessor,
|
|
7
7
|
BTCProcessorState,
|
|
8
8
|
filters2Proto
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-5GWL2KUM.js";
|
|
10
10
|
import "../chunk-43HP4DQZ.js";
|
|
11
|
-
import "../chunk-
|
|
11
|
+
import "../chunk-UZ6GGAUG.js";
|
|
12
12
|
import "../chunk-J5UEW4B7.js";
|
|
13
13
|
import "../chunk-73SHERGU.js";
|
|
14
14
|
import "../chunk-R7PMHHKJ.js";
|