@typus/typus-perp-sdk 1.1.32 → 1.1.33
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/dist/src/api/sentio.d.ts +5 -5
- package/dist/src/api/sentio.js +690 -541
- package/dist/src/client.d.ts +28 -0
- package/dist/src/client.js +171 -0
- package/dist/src/fetch.d.ts +554 -36
- package/dist/src/fetch.js +545 -661
- package/dist/src/generated/typus_perp/admin.d.ts +274 -0
- package/dist/src/generated/typus_perp/admin.js +321 -0
- package/dist/src/generated/typus_perp/competition.d.ts +60 -0
- package/dist/src/generated/typus_perp/competition.js +104 -0
- package/dist/src/generated/typus_perp/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/typus_perp/deps/std/type_name.js +25 -0
- package/dist/src/generated/typus_perp/deps/sui/balance.d.ts +12 -0
- package/dist/src/generated/typus_perp/deps/sui/balance.js +20 -0
- package/dist/src/generated/typus_perp/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_perp/deps/sui/object.js +16 -0
- package/dist/src/generated/typus_perp/deps/sui/object_table.d.ts +19 -0
- package/dist/src/generated/typus_perp/deps/sui/object_table.js +59 -0
- package/dist/src/generated/typus_perp/deps/sui/table.d.ts +31 -0
- package/dist/src/generated/typus_perp/deps/sui/table.js +71 -0
- package/dist/src/generated/typus_perp/deps/sui/vec_set.d.ts +18 -0
- package/dist/src/generated/typus_perp/deps/sui/vec_set.js +25 -0
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.d.ts +30 -0
- package/dist/src/generated/typus_perp/deps/typus/keyed_big_vector.js +67 -0
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.d.ts +32 -0
- package/dist/src/generated/typus_perp/deps/typus/linked_object_table.js +71 -0
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.d.ts +15 -0
- package/dist/src/{_framework/init-loader.js → generated/typus_perp/deps/typus_framework/vault.js} +18 -10
- package/dist/src/generated/typus_perp/error.d.ts +443 -0
- package/dist/src/generated/typus_perp/error.js +788 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +109 -0
- package/dist/src/generated/typus_perp/escrow.js +139 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +1853 -0
- package/dist/src/generated/typus_perp/lp_pool.js +1483 -0
- package/dist/src/generated/typus_perp/math.d.ts +95 -0
- package/dist/src/generated/typus_perp/math.js +97 -0
- package/dist/src/generated/typus_perp/position.d.ts +1251 -0
- package/dist/src/generated/typus_perp/position.js +1393 -0
- package/dist/src/generated/typus_perp/profit_vault.d.ts +272 -0
- package/dist/src/generated/typus_perp/profit_vault.js +321 -0
- package/dist/src/generated/typus_perp/symbol.d.ts +47 -0
- package/dist/src/generated/typus_perp/symbol.js +97 -0
- package/dist/src/generated/typus_perp/trading.d.ts +2134 -0
- package/dist/src/generated/typus_perp/trading.js +2050 -0
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +44 -0
- package/dist/src/generated/typus_perp/treasury_caps.js +92 -0
- package/dist/src/generated/typus_perp/user_account.d.ts +146 -0
- package/dist/src/generated/typus_perp/user_account.js +221 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +218 -0
- package/dist/src/generated/typus_stake_pool/admin.js +247 -0
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.d.ts +17 -0
- package/dist/src/generated/typus_stake_pool/deps/std/type_name.js +25 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/object.d.ts +8 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/object.js +16 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.d.ts +30 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_map.js +37 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.d.ts +18 -0
- package/dist/src/generated/typus_stake_pool/deps/sui/vec_set.js +25 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.d.ts +1038 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.js +938 -0
- package/dist/src/generated/utils/index.d.ts +11 -0
- package/dist/src/generated/utils/index.js +138 -0
- package/dist/src/grpc/graphql.d.ts +26 -0
- package/dist/src/grpc/graphql.js +126 -0
- package/dist/src/grpc/grpc.d.ts +1 -0
- package/dist/src/grpc/grpc.js +38 -0
- package/dist/src/grpc/ledgerService.js +64 -0
- package/dist/src/grpc/liveDataService.d.ts +0 -0
- package/dist/src/grpc/liveDataService.js +49 -0
- package/dist/src/index.d.ts +2 -8
- package/dist/src/index.js +30 -56
- package/dist/src/user/history.d.ts +1 -1
- package/dist/src/user/history.js +649 -679
- package/dist/src/user/order.d.ts +21 -11
- package/dist/src/user/order.js +204 -301
- package/dist/src/user/orderWithBidReceipt.d.ts +17 -6
- package/dist/src/user/orderWithBidReceipt.js +164 -224
- package/dist/src/user/tlp.d.ts +25 -25
- package/dist/src/user/tlp.js +317 -468
- package/package.json +11 -2
- package/dist/src/_dependencies/source/0x1/ascii/structs.d.ts +0 -88
- package/dist/src/_dependencies/source/0x1/ascii/structs.js +0 -398
- package/dist/src/_dependencies/source/0x1/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x1/index.js +0 -6
- package/dist/src/_dependencies/source/0x1/option/structs.d.ts +0 -50
- package/dist/src/_dependencies/source/0x1/option/structs.js +0 -271
- package/dist/src/_dependencies/source/0x1/string/structs.d.ts +0 -48
- package/dist/src/_dependencies/source/0x1/string/structs.js +0 -256
- package/dist/src/_dependencies/source/0x1/type-name/structs.d.ts +0 -49
- package/dist/src/_dependencies/source/0x1/type-name/structs.js +0 -223
- package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +0 -54
- package/dist/src/_dependencies/source/0x2/bag/structs.js +0 -229
- package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +0 -84
- package/dist/src/_dependencies/source/0x2/balance/structs.js +0 -386
- package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +0 -406
- package/dist/src/_dependencies/source/0x2/coin/structs.js +0 -1247
- package/dist/src/_dependencies/source/0x2/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0x2/index.js +0 -6
- package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +0 -132
- package/dist/src/_dependencies/source/0x2/linked-table/structs.js +0 -438
- package/dist/src/_dependencies/source/0x2/object/structs.d.ts +0 -86
- package/dist/src/_dependencies/source/0x2/object/structs.js +0 -364
- package/dist/src/_dependencies/source/0x2/object-table/structs.d.ts +0 -54
- package/dist/src/_dependencies/source/0x2/object-table/structs.js +0 -248
- package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +0 -44
- package/dist/src/_dependencies/source/0x2/sui/structs.js +0 -222
- package/dist/src/_dependencies/source/0x2/table/structs.d.ts +0 -54
- package/dist/src/_dependencies/source/0x2/table/structs.js +0 -248
- package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +0 -59
- package/dist/src/_dependencies/source/0x2/table-vec/structs.js +0 -274
- package/dist/src/_dependencies/source/0x2/token/structs.d.ts +0 -421
- package/dist/src/_dependencies/source/0x2/token/structs.js +0 -1095
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +0 -348
- package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +0 -1091
- package/dist/src/_dependencies/source/0x2/url/structs.d.ts +0 -49
- package/dist/src/_dependencies/source/0x2/url/structs.js +0 -223
- package/dist/src/_dependencies/source/0x2/vec-map/structs.d.ts +0 -106
- package/dist/src/_dependencies/source/0x2/vec-map/structs.js +0 -446
- package/dist/src/_dependencies/source/0x2/vec-set/structs.d.ts +0 -49
- package/dist/src/_dependencies/source/0x2/vec-set/structs.js +0 -270
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +0 -422
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +0 -1084
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +0 -130
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +0 -456
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +0 -208
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +0 -653
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +0 -362
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +0 -899
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +0 -8
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +0 -11
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +0 -102
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.d.ts +0 -202
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/keyed-big-vector/structs.js +0 -632
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +0 -600
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +0 -1459
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.d.ts +0 -136
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-object-table/structs.js +0 -438
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +0 -127
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +0 -430
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +0 -957
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +0 -2261
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +0 -244
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +0 -733
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +0 -294
- package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +0 -892
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +0 -73
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +0 -263
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +0 -294
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +0 -591
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +0 -64
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +0 -258
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +0 -756
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +0 -1721
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +0 -44
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +0 -222
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +0 -3
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +0 -6
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +0 -89
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +0 -135
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +0 -444
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.d.ts +0 -2106
- package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/vault/structs.js +0 -4952
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +0 -390
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +0 -844
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +0 -6
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +0 -9
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +0 -2
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +0 -69
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +0 -89
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +0 -376
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +0 -386
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +0 -881
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +0 -59
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +0 -274
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +0 -974
- package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +0 -2387
- package/dist/src/_framework/init-loader.d.ts +0 -2
- package/dist/src/_framework/loader.d.ts +0 -17
- package/dist/src/_framework/loader.js +0 -108
- package/dist/src/_framework/reified.d.ts +0 -108
- package/dist/src/_framework/reified.js +0 -237
- package/dist/src/_framework/util.d.ts +0 -35
- package/dist/src/_framework/util.js +0 -396
- package/dist/src/_framework/vector.d.ts +0 -42
- package/dist/src/_framework/vector.js +0 -112
- package/dist/src/pyth.js +0 -1
- package/dist/src/typus_perp/admin/functions.d.ts +0 -59
- package/dist/src/typus_perp/admin/functions.js +0 -122
- package/dist/src/typus_perp/admin/structs.d.ts +0 -467
- package/dist/src/typus_perp/admin/structs.js +0 -1065
- package/dist/src/typus_perp/competition/functions.d.ts +0 -24
- package/dist/src/typus_perp/competition/functions.js +0 -38
- package/dist/src/typus_perp/competition/structs.d.ts +0 -80
- package/dist/src/typus_perp/competition/structs.js +0 -288
- package/dist/src/typus_perp/error/functions.d.ts +0 -73
- package/dist/src/typus_perp/error/functions.js +0 -363
- package/dist/src/typus_perp/escrow/functions.d.ts +0 -17
- package/dist/src/typus_perp/escrow/functions.js +0 -36
- package/dist/src/typus_perp/escrow/structs.d.ts +0 -160
- package/dist/src/typus_perp/escrow/structs.js +0 -324
- package/dist/src/typus_perp/index.d.ts +0 -1
- package/dist/src/typus_perp/index.js +0 -7
- package/dist/src/typus_perp/init.d.ts +0 -2
- package/dist/src/typus_perp/init.js +0 -118
- package/dist/src/typus_perp/lending/functions.d.ts +0 -15
- package/dist/src/typus_perp/lending/functions.js +0 -22
- package/dist/src/typus_perp/lp-pool/functions.d.ts +0 -460
- package/dist/src/typus_perp/lp-pool/functions.js +0 -732
- package/dist/src/typus_perp/lp-pool/structs.d.ts +0 -3705
- package/dist/src/typus_perp/lp-pool/structs.js +0 -6789
- package/dist/src/typus_perp/math/functions.d.ts +0 -29
- package/dist/src/typus_perp/math/functions.js +0 -61
- package/dist/src/typus_perp/position/functions.d.ts +0 -379
- package/dist/src/typus_perp/position/functions.js +0 -713
- package/dist/src/typus_perp/position/structs.d.ts +0 -905
- package/dist/src/typus_perp/position/structs.js +0 -1450
- package/dist/src/typus_perp/symbol/functions.d.ts +0 -9
- package/dist/src/typus_perp/symbol/functions.js +0 -24
- package/dist/src/typus_perp/symbol/structs.d.ts +0 -70
- package/dist/src/typus_perp/symbol/structs.js +0 -235
- package/dist/src/typus_perp/tlp/functions.d.ts +0 -19
- package/dist/src/typus_perp/tlp/functions.js +0 -40
- package/dist/src/typus_perp/tlp/structs.d.ts +0 -89
- package/dist/src/typus_perp/tlp/structs.js +0 -365
- package/dist/src/typus_perp/token-interface/functions.d.ts +0 -11
- package/dist/src/typus_perp/token-interface/functions.js +0 -22
- package/dist/src/typus_perp/trading/functions.d.ts +0 -812
- package/dist/src/typus_perp/trading/functions.js +0 -1218
- package/dist/src/typus_perp/trading/structs.d.ts +0 -3060
- package/dist/src/typus_perp/trading/structs.js +0 -5813
- package/dist/src/typus_perp/treasury-caps/functions.d.ts +0 -9
- package/dist/src/typus_perp/treasury-caps/functions.js +0 -36
- package/dist/src/typus_perp/treasury-caps/structs.d.ts +0 -49
- package/dist/src/typus_perp/treasury-caps/structs.js +0 -223
- package/dist/src/typus_perp/user-account/functions.d.ts +0 -36
- package/dist/src/typus_perp/user-account/functions.js +0 -70
- package/dist/src/typus_perp/user-account/structs.d.ts +0 -148
- package/dist/src/typus_perp/user-account/structs.js +0 -448
- package/dist/src/typus_stake_pool/admin/functions.d.ts +0 -49
- package/dist/src/typus_stake_pool/admin/functions.js +0 -105
- package/dist/src/typus_stake_pool/admin/structs.d.ts +0 -365
- package/dist/src/typus_stake_pool/admin/structs.js +0 -789
- package/dist/src/typus_stake_pool/index.d.ts +0 -1
- package/dist/src/typus_stake_pool/index.js +0 -7
- package/dist/src/typus_stake_pool/init.d.ts +0 -2
- package/dist/src/typus_stake_pool/init.js +0 -69
- package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +0 -229
- package/dist/src/typus_stake_pool/stake-pool/functions.js +0 -380
- package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +0 -2199
- package/dist/src/typus_stake_pool/stake-pool/structs.js +0 -4653
- /package/dist/src/{pyth.d.ts → grpc/ledgerService.d.ts} +0 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { BcsType, TypeTag, BcsStruct, BcsEnum, BcsTuple } from "@mysten/sui/bcs";
|
|
2
|
+
import { TransactionArgument } from "@mysten/sui/transactions";
|
|
3
|
+
export type RawTransactionArgument<T> = T | TransactionArgument;
|
|
4
|
+
export declare function getPureBcsSchema(typeTag: string | TypeTag): BcsType<any> | null;
|
|
5
|
+
export declare function normalizeMoveArguments(args: unknown[] | object, argTypes: string[], parameterNames?: string[]): TransactionArgument[];
|
|
6
|
+
export declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
7
|
+
}
|
|
8
|
+
export declare class MoveEnum<T extends Record<string, BcsType<any> | null>, const Name extends string> extends BcsEnum<T, Name> {
|
|
9
|
+
}
|
|
10
|
+
export declare class MoveTuple<T extends readonly BcsType<any>[], const Name extends string> extends BcsTuple<T, Name> {
|
|
11
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MoveTuple = exports.MoveEnum = exports.MoveStruct = void 0;
|
|
4
|
+
exports.getPureBcsSchema = getPureBcsSchema;
|
|
5
|
+
exports.normalizeMoveArguments = normalizeMoveArguments;
|
|
6
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
7
|
+
const utils_1 = require("@mysten/sui/utils");
|
|
8
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
9
|
+
const MOVE_STDLIB_ADDRESS = (0, utils_1.normalizeSuiAddress)("0x1");
|
|
10
|
+
const SUI_FRAMEWORK_ADDRESS = (0, utils_1.normalizeSuiAddress)("0x2");
|
|
11
|
+
const SUI_SYSTEM_ADDRESS = (0, utils_1.normalizeSuiAddress)("0x3");
|
|
12
|
+
function getPureBcsSchema(typeTag) {
|
|
13
|
+
const parsedTag = typeof typeTag === "string" ? bcs_1.TypeTagSerializer.parseFromStr(typeTag) : typeTag;
|
|
14
|
+
if ("u8" in parsedTag) {
|
|
15
|
+
return bcs_1.bcs.U8;
|
|
16
|
+
}
|
|
17
|
+
else if ("u16" in parsedTag) {
|
|
18
|
+
return bcs_1.bcs.U16;
|
|
19
|
+
}
|
|
20
|
+
else if ("u32" in parsedTag) {
|
|
21
|
+
return bcs_1.bcs.U32;
|
|
22
|
+
}
|
|
23
|
+
else if ("u64" in parsedTag) {
|
|
24
|
+
return bcs_1.bcs.U64;
|
|
25
|
+
}
|
|
26
|
+
else if ("u128" in parsedTag) {
|
|
27
|
+
return bcs_1.bcs.U128;
|
|
28
|
+
}
|
|
29
|
+
else if ("u256" in parsedTag) {
|
|
30
|
+
return bcs_1.bcs.U256;
|
|
31
|
+
}
|
|
32
|
+
else if ("address" in parsedTag) {
|
|
33
|
+
return bcs_1.bcs.Address;
|
|
34
|
+
}
|
|
35
|
+
else if ("bool" in parsedTag) {
|
|
36
|
+
return bcs_1.bcs.Bool;
|
|
37
|
+
}
|
|
38
|
+
else if ("vector" in parsedTag) {
|
|
39
|
+
const type = getPureBcsSchema(parsedTag.vector);
|
|
40
|
+
return type ? bcs_1.bcs.vector(type) : null;
|
|
41
|
+
}
|
|
42
|
+
else if ("struct" in parsedTag) {
|
|
43
|
+
const structTag = parsedTag.struct;
|
|
44
|
+
const pkg = (0, utils_1.normalizeSuiAddress)(parsedTag.struct.address);
|
|
45
|
+
if (pkg === MOVE_STDLIB_ADDRESS) {
|
|
46
|
+
if ((structTag.module === "ascii" || structTag.module === "string") && structTag.name === "String") {
|
|
47
|
+
return bcs_1.bcs.String;
|
|
48
|
+
}
|
|
49
|
+
if (structTag.module === "option" && structTag.name === "Option") {
|
|
50
|
+
const type = getPureBcsSchema(structTag.typeParams[0]);
|
|
51
|
+
return type ? bcs_1.bcs.option(type) : null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
if (pkg === SUI_FRAMEWORK_ADDRESS && structTag.module === "Object" && structTag.name === "ID") {
|
|
55
|
+
return bcs_1.bcs.Address;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
function normalizeMoveArguments(args, argTypes, parameterNames) {
|
|
61
|
+
const argLen = Array.isArray(args) ? args.length : Object.keys(args).length;
|
|
62
|
+
if (parameterNames && argLen !== parameterNames.length) {
|
|
63
|
+
throw new Error(`Invalid number of arguments, expected ${parameterNames.length}, got ${argLen}`);
|
|
64
|
+
}
|
|
65
|
+
const normalizedArgs = [];
|
|
66
|
+
let index = 0;
|
|
67
|
+
for (const [i, argType] of argTypes.entries()) {
|
|
68
|
+
if (argType === `${SUI_FRAMEWORK_ADDRESS}::deny_list::DenyList`) {
|
|
69
|
+
normalizedArgs.push((tx) => tx.object.denyList());
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
if (argType === `${SUI_FRAMEWORK_ADDRESS}::random::Random`) {
|
|
73
|
+
normalizedArgs.push((tx) => tx.object.random());
|
|
74
|
+
continue;
|
|
75
|
+
}
|
|
76
|
+
if (argType === `${SUI_FRAMEWORK_ADDRESS}::clock::Clock`) {
|
|
77
|
+
normalizedArgs.push((tx) => tx.object.clock());
|
|
78
|
+
continue;
|
|
79
|
+
}
|
|
80
|
+
if (argType === `${SUI_SYSTEM_ADDRESS}::sui_system::SuiSystemState`) {
|
|
81
|
+
normalizedArgs.push((tx) => tx.object.system());
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
let arg;
|
|
85
|
+
if (Array.isArray(args)) {
|
|
86
|
+
if (index >= args.length) {
|
|
87
|
+
throw new Error(`Invalid number of arguments, expected at least ${index + 1}, got ${args.length}`);
|
|
88
|
+
}
|
|
89
|
+
arg = args[index];
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
if (!parameterNames) {
|
|
93
|
+
throw new Error(`Expected arguments to be passed as an array`);
|
|
94
|
+
}
|
|
95
|
+
const name = parameterNames[index];
|
|
96
|
+
arg = args[name];
|
|
97
|
+
if (arg === undefined) {
|
|
98
|
+
throw new Error(`Parameter ${name} is required`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
index += 1;
|
|
102
|
+
if (typeof arg === "function" || (0, transactions_1.isArgument)(arg)) {
|
|
103
|
+
normalizedArgs.push(arg);
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const type = argTypes[i];
|
|
107
|
+
const bcsType = getPureBcsSchema(type);
|
|
108
|
+
if (bcsType) {
|
|
109
|
+
const bytes = bcsType.serialize(arg);
|
|
110
|
+
normalizedArgs.push((tx) => tx.pure(bytes));
|
|
111
|
+
continue;
|
|
112
|
+
}
|
|
113
|
+
else if (typeof arg === "string") {
|
|
114
|
+
normalizedArgs.push((tx) => tx.object(arg));
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`Invalid argument ${stringify(arg)} for type ${type}`);
|
|
118
|
+
}
|
|
119
|
+
return normalizedArgs;
|
|
120
|
+
}
|
|
121
|
+
class MoveStruct extends bcs_1.BcsStruct {
|
|
122
|
+
}
|
|
123
|
+
exports.MoveStruct = MoveStruct;
|
|
124
|
+
class MoveEnum extends bcs_1.BcsEnum {
|
|
125
|
+
}
|
|
126
|
+
exports.MoveEnum = MoveEnum;
|
|
127
|
+
class MoveTuple extends bcs_1.BcsTuple {
|
|
128
|
+
}
|
|
129
|
+
exports.MoveTuple = MoveTuple;
|
|
130
|
+
function stringify(val) {
|
|
131
|
+
if (typeof val === "object") {
|
|
132
|
+
return JSON.stringify(val, (val) => val);
|
|
133
|
+
}
|
|
134
|
+
if (typeof val === "bigint") {
|
|
135
|
+
return val.toString();
|
|
136
|
+
}
|
|
137
|
+
return val;
|
|
138
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SuiGraphQLClient } from "@mysten/sui/graphql";
|
|
2
|
+
export declare function getDynamicFields(gqlClient: SuiGraphQLClient, id: string): Promise<{
|
|
3
|
+
nodes: {
|
|
4
|
+
name: {
|
|
5
|
+
type: {
|
|
6
|
+
repr: string;
|
|
7
|
+
} | null;
|
|
8
|
+
json: unknown;
|
|
9
|
+
} | null;
|
|
10
|
+
value: {
|
|
11
|
+
__typename: "MoveValue";
|
|
12
|
+
type: {
|
|
13
|
+
repr: string;
|
|
14
|
+
} | null;
|
|
15
|
+
json: unknown;
|
|
16
|
+
} | {
|
|
17
|
+
__typename: "MoveObject";
|
|
18
|
+
contents: {
|
|
19
|
+
type: {
|
|
20
|
+
repr: string;
|
|
21
|
+
} | null;
|
|
22
|
+
json: unknown;
|
|
23
|
+
} | null;
|
|
24
|
+
} | null;
|
|
25
|
+
}[];
|
|
26
|
+
} | null | undefined>;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDynamicFields = getDynamicFields;
|
|
4
|
+
const graphql_1 = require("@mysten/sui/graphql");
|
|
5
|
+
const latest_1 = require("@mysten/sui/graphql/schemas/latest");
|
|
6
|
+
const gqlClient = new graphql_1.SuiGraphQLClient({
|
|
7
|
+
url: "https://graphql.testnet.sui.io/graphql",
|
|
8
|
+
});
|
|
9
|
+
const chainIdentifierQuery = (0, latest_1.graphql)(`
|
|
10
|
+
query {
|
|
11
|
+
chainIdentifier
|
|
12
|
+
}
|
|
13
|
+
`);
|
|
14
|
+
async function getChainIdentifier() {
|
|
15
|
+
const result = await gqlClient.query({
|
|
16
|
+
query: chainIdentifierQuery,
|
|
17
|
+
});
|
|
18
|
+
return result.data?.chainIdentifier;
|
|
19
|
+
}
|
|
20
|
+
const getSuinsName = (0, latest_1.graphql)(`
|
|
21
|
+
query getSuiName($address: SuiAddress!) {
|
|
22
|
+
address(address: $address) {
|
|
23
|
+
defaultSuinsName
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
`);
|
|
27
|
+
async function getDefaultSuinsName(address) {
|
|
28
|
+
const result = await gqlClient.query({
|
|
29
|
+
query: getSuinsName,
|
|
30
|
+
variables: {
|
|
31
|
+
address,
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
return result.data?.address?.defaultSuinsName;
|
|
35
|
+
}
|
|
36
|
+
// getDefaultSuinsName("0xd15f079d5f60b8fdfdcf3ca66c0d3473790c758b04b6418929d5d2991c5443ee").then((x) => console.log(x));
|
|
37
|
+
const dynamicFieldQuery = (0, latest_1.graphql)(`
|
|
38
|
+
query DynamicField($address: SuiAddress!) {
|
|
39
|
+
object(address: $address) {
|
|
40
|
+
dynamicField(name: { type: "0x2::kiosk::Lock", bcs: "NLArx1UJguOUYmXgNG8Pv8KbKXLjWtCi6i0Yeq1Vhfw=" }) {
|
|
41
|
+
...DynamicFieldSelect
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
fragment DynamicFieldSelect on DynamicField {
|
|
47
|
+
name {
|
|
48
|
+
...MoveValueFields
|
|
49
|
+
}
|
|
50
|
+
value {
|
|
51
|
+
...DynamicFieldValueSelection
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
fragment DynamicFieldValueSelection on DynamicFieldValue {
|
|
56
|
+
__typename
|
|
57
|
+
... on MoveValue {
|
|
58
|
+
...MoveValueFields
|
|
59
|
+
}
|
|
60
|
+
... on MoveObject {
|
|
61
|
+
hasPublicTransfer
|
|
62
|
+
contents {
|
|
63
|
+
...MoveValueFields
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fragment MoveValueFields on MoveValue {
|
|
69
|
+
type {
|
|
70
|
+
repr
|
|
71
|
+
}
|
|
72
|
+
json
|
|
73
|
+
bcs
|
|
74
|
+
}
|
|
75
|
+
`);
|
|
76
|
+
async function getDynamicField(address) {
|
|
77
|
+
const result = await gqlClient.query({
|
|
78
|
+
query: dynamicFieldQuery,
|
|
79
|
+
variables: {
|
|
80
|
+
address,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
return result.data?.object?.dynamicField;
|
|
84
|
+
}
|
|
85
|
+
// getDynamicField("0xb57fba584a700a5bcb40991e1b2e6bf68b0f3896d767a0da92e69de73de226ac").then((x) => console.log(x));
|
|
86
|
+
const dynamicFieldsQuery = (0, latest_1.graphql)(`
|
|
87
|
+
query ($id: SuiAddress!) {
|
|
88
|
+
address(address: $id) {
|
|
89
|
+
dynamicFields {
|
|
90
|
+
nodes {
|
|
91
|
+
name {
|
|
92
|
+
...Value
|
|
93
|
+
}
|
|
94
|
+
value {
|
|
95
|
+
__typename
|
|
96
|
+
... on MoveValue {
|
|
97
|
+
...Value
|
|
98
|
+
}
|
|
99
|
+
... on MoveObject {
|
|
100
|
+
contents {
|
|
101
|
+
...Value
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
fragment Value on MoveValue {
|
|
111
|
+
type {
|
|
112
|
+
repr
|
|
113
|
+
}
|
|
114
|
+
json
|
|
115
|
+
}
|
|
116
|
+
`);
|
|
117
|
+
async function getDynamicFields(gqlClient, id) {
|
|
118
|
+
const result = await gqlClient.query({
|
|
119
|
+
query: dynamicFieldsQuery,
|
|
120
|
+
variables: {
|
|
121
|
+
id,
|
|
122
|
+
},
|
|
123
|
+
});
|
|
124
|
+
return result.data?.address?.dynamicFields;
|
|
125
|
+
}
|
|
126
|
+
getDynamicFields(gqlClient, "0x54447a759a238f93ff847177bd87ace4b6ebc83553080611b93ac394122ecc4d").then((x) => console.dir(x, { depth: null }));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const grpc_1 = require("@mysten/sui/grpc");
|
|
4
|
+
const src_1 = require("../../src");
|
|
5
|
+
const gRpcClient = new grpc_1.SuiGrpcClient({ network: src_1.NETWORK.toLowerCase(), baseUrl: `https://fullnode.${src_1.NETWORK.toLowerCase()}.sui.io:443` });
|
|
6
|
+
// gRpcClient.ledgerService
|
|
7
|
+
// .getObject({ objectId: LIQUIDITY_POOL_0, readMask: { paths: ["contents"] } })
|
|
8
|
+
// .then((x) => console.log(x.response.object?.contents));
|
|
9
|
+
// gRpcClient.ledgerService
|
|
10
|
+
// .batchGetObjects({
|
|
11
|
+
// requests: [{ objectId: LIQUIDITY_POOL_0 }, { objectId: LIQUIDITY_POOL_0 }],
|
|
12
|
+
// readMask: { paths: ["contents"] },
|
|
13
|
+
// })
|
|
14
|
+
// .then((x) =>
|
|
15
|
+
// x.response.objects.map((x) => {
|
|
16
|
+
// if (x.result.oneofKind === "object") {
|
|
17
|
+
// console.log(x.result.object.contents);
|
|
18
|
+
// } else if (x.result.oneofKind === "error") {
|
|
19
|
+
// console.error(x.result.error);
|
|
20
|
+
// } else {
|
|
21
|
+
// console.warn("undefined case");
|
|
22
|
+
// }
|
|
23
|
+
// })
|
|
24
|
+
// );
|
|
25
|
+
// gRpcClient.stateService
|
|
26
|
+
// .listDynamicFields({
|
|
27
|
+
// parent: "0xfbd1ad8da88e7cb228f1c12a87399b19acd4f25c64a3503a7aad8747751580aa",
|
|
28
|
+
// readMask: { paths: ["field_object"] },
|
|
29
|
+
// })
|
|
30
|
+
// .then((x) =>
|
|
31
|
+
// x.response.dynamicFields.map((x) => {
|
|
32
|
+
// console.log(x);
|
|
33
|
+
// return x.fieldObject?.contents;
|
|
34
|
+
// })
|
|
35
|
+
// );
|
|
36
|
+
// getBalance
|
|
37
|
+
// listBalances;
|
|
38
|
+
// listOwnedObjects
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import * as grpc from "@grpc/grpc-js";
|
|
3
|
+
// import * as protoLoader from "@grpc/proto-loader";
|
|
4
|
+
// // Load proto definitions
|
|
5
|
+
// const packageDefinition = protoLoader.loadSync("sui/rpc/v2/ledger_service.proto", {
|
|
6
|
+
// keepCase: true,
|
|
7
|
+
// longs: String,
|
|
8
|
+
// enums: String,
|
|
9
|
+
// defaults: true,
|
|
10
|
+
// oneofs: true,
|
|
11
|
+
// includeDirs: ["src/grpc/proto"],
|
|
12
|
+
// });
|
|
13
|
+
// const suiProto = grpc.loadPackageDefinition(packageDefinition) as any;
|
|
14
|
+
// const LedgerService = suiProto.sui.rpc.v2.LedgerService;
|
|
15
|
+
// // Create gRPC client
|
|
16
|
+
// const client = new LedgerService("fullnode.testnet.sui.io:443", grpc.credentials.createSsl());
|
|
17
|
+
// // // Sample transaction digest in Base58 format
|
|
18
|
+
// // const base58Digest = "3ByWphQ5sAVojiTrTrGXGM5FmCVzpzYmhsjbhYESJtxp";
|
|
19
|
+
// // // Construct the request
|
|
20
|
+
// // const request = {
|
|
21
|
+
// // digest: base58Digest,
|
|
22
|
+
// // read_mask: {
|
|
23
|
+
// // paths: ["events", "effects"],
|
|
24
|
+
// // },
|
|
25
|
+
// // };
|
|
26
|
+
// // // Make gRPC call
|
|
27
|
+
// // client.GetTransaction(request, (err: any, response: any) => {
|
|
28
|
+
// // if (err) {
|
|
29
|
+
// // console.error("Error:", err);
|
|
30
|
+
// // } else {
|
|
31
|
+
// // console.log("Response:", JSON.stringify(response, null, 2));
|
|
32
|
+
// // }
|
|
33
|
+
// // });
|
|
34
|
+
// // const request = {
|
|
35
|
+
// // object_id: "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460",
|
|
36
|
+
// // read_mask: {
|
|
37
|
+
// // paths: ["bcs"],
|
|
38
|
+
// // },
|
|
39
|
+
// // };
|
|
40
|
+
// // // Make gRPC call
|
|
41
|
+
// // client.GetObject(request, (err: any, response: any) => {
|
|
42
|
+
// // if (err) {
|
|
43
|
+
// // console.error("Error:", err);
|
|
44
|
+
// // } else {
|
|
45
|
+
// // console.dir(response);
|
|
46
|
+
// // }
|
|
47
|
+
// // });
|
|
48
|
+
// const request = {
|
|
49
|
+
// requests: [
|
|
50
|
+
// { object_id: "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460" },
|
|
51
|
+
// { object_id: "0x50b01081469d032e04bfcbd057614b1359376920f55c7bebd076e0e2af07a57f" },
|
|
52
|
+
// ],
|
|
53
|
+
// read_mask: {
|
|
54
|
+
// paths: ["bcs"],
|
|
55
|
+
// },
|
|
56
|
+
// };
|
|
57
|
+
// // Make gRPC call
|
|
58
|
+
// client.BatchGetObjects(request, (err: any, response: any) => {
|
|
59
|
+
// if (err) {
|
|
60
|
+
// console.error("Error:", err);
|
|
61
|
+
// } else {
|
|
62
|
+
// console.dir(response, { depth: null });
|
|
63
|
+
// }
|
|
64
|
+
// });
|
|
File without changes
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// import * as grpc from "@grpc/grpc-js";
|
|
3
|
+
// import * as protoLoader from "@grpc/proto-loader";
|
|
4
|
+
// import * as path from "path";
|
|
5
|
+
// // Load proto definitions
|
|
6
|
+
// const packageDefinition = protoLoader.loadSync("sui/rpc/v2beta2/live_data_service.proto", {
|
|
7
|
+
// keepCase: true,
|
|
8
|
+
// longs: String,
|
|
9
|
+
// enums: String,
|
|
10
|
+
// defaults: true,
|
|
11
|
+
// oneofs: true,
|
|
12
|
+
// includeDirs: ["src/grpc/proto"],
|
|
13
|
+
// });
|
|
14
|
+
// const suiProto = grpc.loadPackageDefinition(packageDefinition) as any;
|
|
15
|
+
// const LiveDataService = suiProto.sui.rpc.v2beta2.LiveDataService;
|
|
16
|
+
// // console.log(Object.keys(LiveDataService.service));
|
|
17
|
+
// // Create gRPC client
|
|
18
|
+
// const client = new LiveDataService("fullnode.testnet.sui.io:443", grpc.credentials.createSsl());
|
|
19
|
+
// // Construct the request
|
|
20
|
+
// const request1 = {
|
|
21
|
+
// parent: "0x0285cbf4aa8585be6c978235d11d06fa35773266ede040d38d34e1d79b049460",
|
|
22
|
+
// page_size: 50, // maximum 1000
|
|
23
|
+
// // page_token,
|
|
24
|
+
// read_mask: {
|
|
25
|
+
// paths: ["name_value", "object"],
|
|
26
|
+
// },
|
|
27
|
+
// };
|
|
28
|
+
// // Make gRPC call
|
|
29
|
+
// client.ListDynamicFields(request1, (err: any, response: any) => {
|
|
30
|
+
// if (err) {
|
|
31
|
+
// console.error("Error:", err);
|
|
32
|
+
// } else {
|
|
33
|
+
// console.log("Response:", JSON.stringify(response, null, 2));
|
|
34
|
+
// }
|
|
35
|
+
// });
|
|
36
|
+
// // // Construct the request
|
|
37
|
+
// // const request2 = {
|
|
38
|
+
// // owner: "0x978f65df8570a075298598a9965c18de9087f9e888eb3430fe20334f5c554cfd",
|
|
39
|
+
// // // page_size: 50, // maximum 1000
|
|
40
|
+
// // // page_token,
|
|
41
|
+
// // };
|
|
42
|
+
// // // Make gRPC call
|
|
43
|
+
// // client.ListOwnedObjects(request2, (err: any, response: any) => {
|
|
44
|
+
// // if (err) {
|
|
45
|
+
// // console.error("Error:", err);
|
|
46
|
+
// // } else {
|
|
47
|
+
// // console.log("Response:", JSON.stringify(response, null, 2));
|
|
48
|
+
// // }
|
|
49
|
+
// // });
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,20 +2,14 @@ export * from "./fetch";
|
|
|
2
2
|
export * from "./user";
|
|
3
3
|
export declare const NETWORK: string;
|
|
4
4
|
export declare const PERP_PACKAGE_ID: string;
|
|
5
|
-
export declare const PERP_PUBLISHED_AT: string;
|
|
6
|
-
export declare const PERP_PKG_V1: string;
|
|
7
5
|
export declare const STAKE_PACKAGE_ID: string;
|
|
8
|
-
export declare const STAKE_PUBLISHED_AT: string;
|
|
9
|
-
export declare const STAKE_PKG_V1: string;
|
|
10
6
|
export declare const LP_POOL: string;
|
|
11
7
|
export declare const LIQUIDITY_POOL: string;
|
|
12
|
-
export declare const LIQUIDITY_POOL_0: string;
|
|
13
8
|
export declare const MARKET: string;
|
|
14
9
|
export declare const PERP_VERSION: string;
|
|
15
|
-
export declare const TLP: string;
|
|
16
|
-
export declare const TLP_TOKEN: string;
|
|
17
10
|
export declare const TLP_TREASURY_CAP: string;
|
|
18
11
|
export declare const STAKE_POOL: string;
|
|
19
|
-
export declare const STAKE_POOL_0: string;
|
|
20
12
|
export declare const STAKE_POOL_VERSION: string;
|
|
21
13
|
export declare const COMPETITION_CONFIG: string;
|
|
14
|
+
export declare const PROFIT_VAULT: string;
|
|
15
|
+
export declare const LOCK_VAULT: string;
|
package/dist/src/index.js
CHANGED
|
@@ -17,77 +17,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
17
17
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
18
|
};
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.
|
|
20
|
+
exports.LOCK_VAULT = exports.PROFIT_VAULT = exports.COMPETITION_CONFIG = exports.STAKE_POOL_VERSION = exports.STAKE_POOL = exports.TLP_TREASURY_CAP = exports.PERP_VERSION = exports.MARKET = exports.LIQUIDITY_POOL = exports.LP_POOL = exports.STAKE_PACKAGE_ID = exports.PERP_PACKAGE_ID = exports.NETWORK = void 0;
|
|
21
21
|
__exportStar(require("./fetch"), exports);
|
|
22
22
|
__exportStar(require("./user"), exports);
|
|
23
|
-
|
|
23
|
+
const dotenv_1 = __importDefault(require("dotenv"));
|
|
24
24
|
// import .env file if exists
|
|
25
25
|
dotenv_1.default.config();
|
|
26
26
|
// default MAINNET
|
|
27
27
|
exports.NETWORK = process.env.NEXT_PUBLIC_CLUSTER == "testnet" ? "TESTNET" : "MAINNET";
|
|
28
|
-
// console.log(`Load .env NEXT_PUBLIC_CLUSTER: ${process.env.NEXT_PUBLIC_CLUSTER}`);
|
|
29
|
-
// console.log(`Initializing Typus Perp SDK for ${NETWORK}`);
|
|
30
|
-
/** Register the MVR plugin globally */
|
|
31
|
-
var transactions_1 = require("@mysten/sui/transactions");
|
|
32
|
-
var mvrPlugin = exports.NETWORK == "MAINNET" ? "https://mainnet.mvr.mystenlabs.com" : "https://testnet.mvr.mystenlabs.com";
|
|
33
|
-
var plugin = (0, transactions_1.namedPackagesPlugin)({ url: mvrPlugin });
|
|
34
|
-
/** Register the MVR plugin globally (once) for our PTB construction */
|
|
35
|
-
transactions_1.Transaction.registerGlobalSerializationPlugin("namedPackagesPlugin", plugin);
|
|
36
28
|
exports.PERP_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
37
|
-
? "
|
|
38
|
-
: "
|
|
39
|
-
exports.PERP_PUBLISHED_AT = exports.NETWORK == "MAINNET" ? "0x9eda9afa0b42bf908766c42d02a549c271d7d0ae02c8c58c5075858f8f4d3b69" : "@typus/perp";
|
|
40
|
-
exports.PERP_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
41
|
-
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5"
|
|
42
|
-
: "0x585924f160f83ef16f8927ec117e4d740abb6f4e571ecfa89ff3e973042cb1b9";
|
|
29
|
+
? "0xf60e3542f1c65a77d9bcdffd5d8a712a46b935ec51b9052e5ad98888e0392d09"
|
|
30
|
+
: "0x94cd358f552e9dd5df837de85939a9d1d682e97480740a203121e6f4c0078853";
|
|
43
31
|
exports.STAKE_PACKAGE_ID = exports.NETWORK == "MAINNET"
|
|
44
|
-
? "
|
|
45
|
-
: "
|
|
46
|
-
|
|
47
|
-
? "0xdf96424bc1ba70a6e53c07b2b55c597eccb8a21f722a917a5b4c9d8514b2d858"
|
|
48
|
-
: "0xcfe3d323fec2dde129480328dbcf075bc47bac50f916f33746d74f1c875acd2e";
|
|
49
|
-
exports.STAKE_PKG_V1 = exports.NETWORK == "MAINNET"
|
|
50
|
-
? "0xc427209145715a00a93d7e674a95c556a7147d79fda1bbaeb1a1cac5f9923966"
|
|
51
|
-
: "0x220e7ba8923c0c30b57c0baab3bc15d781a39bb294cf7af318c0fc816b5cf7e6";
|
|
52
|
-
// Registry
|
|
32
|
+
? "0xd280f3a072bca4b7b5b450f40c82a30b3935cd1d12d927eb9d1f790520a83d3b"
|
|
33
|
+
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
34
|
+
// lp_pool::Registry
|
|
53
35
|
exports.LP_POOL = exports.NETWORK == "MAINNET"
|
|
54
|
-
? "
|
|
55
|
-
: "
|
|
36
|
+
? "0x46ef530d3ad13037ac54b77be324e5ab063124af8a119e86f1f59be8a16a22a2"
|
|
37
|
+
: "0x85fa3cc6dc0fa8b47dda95ba0335fe1cec61dde4a2a8486ccd040f94d399b4c3";
|
|
38
|
+
// liquidity_pool_registry
|
|
56
39
|
exports.LIQUIDITY_POOL = exports.NETWORK == "MAINNET"
|
|
57
|
-
? "
|
|
58
|
-
: "
|
|
59
|
-
exports.LIQUIDITY_POOL_0 = exports.NETWORK == "MAINNET"
|
|
60
|
-
? "0x98110aae0ffaf294259066380a2d35aba74e42860f1e87ee9c201f471eb3ba03"
|
|
61
|
-
: "0x310a065075d2d49a09440402fcf8d2238886111c063cddaa4c118b09b1790e5e";
|
|
40
|
+
? "0x9090a55fea75d0b135dfa53e6bbe234c0b0e9d0e0b21c615f32f0048bc35aca4"
|
|
41
|
+
: "0xe034d157764f273df5a1e264a3c0f78d8f922c37f942c340dabb1d66244c72ba";
|
|
62
42
|
// MarketRegistry
|
|
63
43
|
exports.MARKET = exports.NETWORK == "MAINNET"
|
|
64
|
-
? "
|
|
65
|
-
: "
|
|
66
|
-
// MARKET_0 = 0x442cc2c27cadaf287a5f4413967b4dacc6532bc9063875efbc7b178e5add3e4e
|
|
67
|
-
// testnet MARKET_0 = 0x7f427b15136ab0f5919e66612ff343f9c34d2733e636c95f6d9563a596a4b6ac
|
|
44
|
+
? "0x327c8a176055400e9aacde8553a897898b5da969d6dcdb55eee268bb501a2c3a"
|
|
45
|
+
: "0xd0685e3eca9530f0618625d4a617a80db09f000609285b32a85f863da6baf811";
|
|
68
46
|
exports.PERP_VERSION = exports.NETWORK == "MAINNET"
|
|
69
|
-
? "
|
|
70
|
-
: "
|
|
71
|
-
// LpRegistry
|
|
72
|
-
exports.TLP = exports.NETWORK == "MAINNET"
|
|
73
|
-
? "0xc0a8cc0201d202321cd40b3f19fcf4cc88d6b63ceac0de55b08a2ab16f8a721e"
|
|
74
|
-
: ""; // deprecated in new version TLP
|
|
75
|
-
exports.TLP_TOKEN = exports.NETWORK == "MAINNET"
|
|
76
|
-
? "0xe27969a70f93034de9ce16e6ad661b480324574e68d15a64b513fd90eb2423e5::tlp::TLP"
|
|
77
|
-
: "0xc44ba56ee8f91195facaf7a5a39b5522e0e8268a21b324275757ecc8baaa4e11::itlp_typus::ITLP_TYPUS";
|
|
47
|
+
? "0x7c30204bd3f4dc37918281907308e0d7d09a75a6826473aec0caa1712ee149e5"
|
|
48
|
+
: "0xbb0615832168e64e301db2ebd6ad71b3fe170d7e217ccd0c08714de56b41676b";
|
|
78
49
|
exports.TLP_TREASURY_CAP = exports.NETWORK == "MAINNET"
|
|
79
|
-
? "
|
|
80
|
-
: "
|
|
50
|
+
? "0x99071a9fb7e40546d3279dffac2ff15a278ab90229c3fe06610e1540dcafa7af"
|
|
51
|
+
: "0x1b39c2a5bc109ac520787c62f924da9244343e869bad755157e6e3e22bd7b7ae";
|
|
81
52
|
// StakePoolRegistry
|
|
82
53
|
exports.STAKE_POOL = exports.NETWORK == "MAINNET"
|
|
83
|
-
? "
|
|
84
|
-
: "
|
|
85
|
-
exports.STAKE_POOL_0 = exports.NETWORK == "MAINNET"
|
|
86
|
-
? "0x5c984987380805fbaaf78f41d8ff1973807b6c85176aa87cf5a58518e0a87418"
|
|
87
|
-
: "0xce188b7277324a817a91ce1953dd1d71f2dbb4685364caa90eb430c9ac453dc8";
|
|
54
|
+
? "0xdbd23ed1bfe214a61bce1ba711b86e62048913f2069e845c9ff69119628f41a3"
|
|
55
|
+
: "0x8e5e5435c3fcd77f07cf097c5fbd381af7c2b394420ea035685662215471e578";
|
|
88
56
|
exports.STAKE_POOL_VERSION = exports.NETWORK == "MAINNET"
|
|
89
|
-
? "
|
|
90
|
-
: "
|
|
57
|
+
? "0x64d09fec0002837abc4bb283410034c991710234c4d5b9013eabe38b54cad561"
|
|
58
|
+
: "0x02b94b340a8810f6c451bc244dc2dd8d9d50cf86d727798969ca2c287c3186aa";
|
|
91
59
|
exports.COMPETITION_CONFIG = exports.NETWORK == "MAINNET"
|
|
92
|
-
? "
|
|
93
|
-
: "
|
|
60
|
+
? "0xe896530a778adedc1b38e4fc31059a6557146caa7b1da56950b671a433de5f08"
|
|
61
|
+
: "0x2b811b120177839555aabdc2c28b28078170e663e855d29aa9072013d4fc918d";
|
|
62
|
+
exports.PROFIT_VAULT = exports.NETWORK == "MAINNET"
|
|
63
|
+
? "0xd24222307ba17ee1a08fe46ac587b1106e585e53f314ffffb525a4d4158b64c3" // TODO: Add mainnet PROFIT_VAULT address
|
|
64
|
+
: "0xb1d603139b24db2c46f6a423c8613ce677f329a0b159ff6e57672f3b663aec47"; // TODO: Add testnet PROFIT_VAULT address
|
|
65
|
+
exports.LOCK_VAULT = exports.NETWORK == "MAINNET"
|
|
66
|
+
? "0x585355900351dd1915b77f31c06ae9e6d58b187de848d4e6e6a55d3789e281d6" // TODO: Add mainnet LOCK_VAULT address
|
|
67
|
+
: "0x25dd9540f031b9a62b83784a727e1ef410f9aa91ecf7e3bb27a0c61f8ceecbfb"; // TODO: Add testnet LOCK_VAULT address
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TOKEN } from "@typus/typus-sdk/dist/src/constants";
|
|
2
|
-
export type actionType = "Place Order" | "Cancel Order" | "Order Filled (Open Position)" | "Order Filled (Increase Position)" | "Order Filled (Close Position)" | "Realized PnL" | "Modify Collateral" | "Exercise Position" | "Liquidation" | "Force Cancel Order" | "Force Close Position" | "Swap" | "Realize Funding";
|
|
2
|
+
export type actionType = "Place Order" | "Cancel Order" | "Order Filled (Open Position)" | "Order Filled (Increase Position)" | "Order Filled (Close Position)" | "Realized PnL" | "Modify Collateral" | "Exercise Position" | "Liquidation" | "Force Cancel Order" | "Force Close Position" | "Swap" | "Claim Profit" | "Realize Funding";
|
|
3
3
|
export type sideType = "Long" | "Short";
|
|
4
4
|
export type orderType = "Market" | "Limit" | "Take Profit" | "Stop Loss";
|
|
5
5
|
export type statusType = "Open" | "Filled" | "Canceled";
|