@typus/typus-perp-sdk 1.1.30-testnet → 1.1.31-codegen
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.js +604 -538
- package/dist/src/client.d.ts +27 -0
- package/dist/src/client.js +108 -0
- package/dist/src/fetch.d.ts +160 -34
- package/dist/src/fetch.js +365 -665
- package/dist/src/generated/typus_perp/admin.d.ts +117 -0
- package/dist/src/generated/typus_perp/admin.js +110 -0
- package/dist/src/generated/typus_perp/competition.d.ts +22 -0
- package/dist/src/generated/typus_perp/competition.js +58 -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/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 +23 -0
- package/dist/src/generated/typus_perp/deps/typus_framework/vault.js +61 -0
- package/dist/src/generated/typus_perp/escrow.d.ts +59 -0
- package/dist/src/generated/typus_perp/escrow.js +76 -0
- package/dist/src/generated/typus_perp/lending.d.ts +47 -0
- package/dist/src/generated/typus_perp/lending.js +50 -0
- package/dist/src/generated/typus_perp/lp_pool.d.ts +2327 -0
- package/dist/src/generated/typus_perp/lp_pool.js +1956 -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 +234 -0
- package/dist/src/generated/typus_perp/position.js +204 -0
- package/dist/src/generated/typus_perp/symbol.d.ts +18 -0
- package/dist/src/generated/typus_perp/symbol.js +55 -0
- package/dist/src/generated/typus_perp/tlp.d.ts +13 -0
- package/dist/src/generated/typus_perp/tlp.js +56 -0
- package/dist/src/generated/typus_perp/trading.d.ts +2486 -0
- package/dist/src/generated/typus_perp/trading.js +2476 -0
- package/dist/src/generated/typus_perp/treasury_caps.d.ts +13 -0
- package/dist/src/{_framework/init-loader.js → generated/typus_perp/treasury_caps.js} +17 -10
- package/dist/src/generated/typus_perp/user_account.d.ts +40 -0
- package/dist/src/generated/typus_perp/user_account.js +72 -0
- package/dist/src/generated/typus_stake_pool/admin.d.ts +100 -0
- package/dist/src/generated/typus_stake_pool/admin.js +91 -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 +1023 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.js +918 -0
- package/dist/src/generated/utils/index.d.ts +11 -0
- package/dist/src/generated/utils/index.js +135 -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 +0 -4
- package/dist/src/index.js +20 -39
- package/dist/src/user/history.js +611 -680
- package/dist/src/user/order.d.ts +11 -11
- package/dist/src/user/order.js +171 -302
- package/dist/src/user/orderWithBidReceipt.d.ts +8 -6
- package/dist/src/user/orderWithBidReceipt.js +127 -226
- package/dist/src/user/tlp.d.ts +32 -23
- package/dist/src/user/tlp.js +316 -468
- package/package.json +45 -37
- 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,95 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The `math` module provides mathematical utility functions for the Typus
|
|
6
|
+
* Perpetual Protocol.
|
|
7
|
+
*/
|
|
8
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
9
|
+
import { type RawTransactionArgument } from "../utils/index";
|
|
10
|
+
export interface SetU64VectorValueArguments {
|
|
11
|
+
u64Vector: RawTransactionArgument<number | bigint[]>;
|
|
12
|
+
i: RawTransactionArgument<number | bigint>;
|
|
13
|
+
value: RawTransactionArgument<number | bigint>;
|
|
14
|
+
}
|
|
15
|
+
export interface SetU64VectorValueOptions {
|
|
16
|
+
package?: string;
|
|
17
|
+
arguments: SetU64VectorValueArguments | [
|
|
18
|
+
u64Vector: RawTransactionArgument<number | bigint[]>,
|
|
19
|
+
i: RawTransactionArgument<number | bigint>,
|
|
20
|
+
value: RawTransactionArgument<number | bigint>
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Sets a value in a `vector<u64>` at a specific index. It will extend the vector
|
|
25
|
+
* with zeros if the index is out of bounds.
|
|
26
|
+
*/
|
|
27
|
+
export declare function setU64VectorValue(options: SetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
28
|
+
export interface GetU64VectorValueArguments {
|
|
29
|
+
u64Vector: RawTransactionArgument<number | bigint[]>;
|
|
30
|
+
i: RawTransactionArgument<number | bigint>;
|
|
31
|
+
}
|
|
32
|
+
export interface GetU64VectorValueOptions {
|
|
33
|
+
package?: string;
|
|
34
|
+
arguments: GetU64VectorValueArguments | [u64Vector: RawTransactionArgument<number | bigint[]>, i: RawTransactionArgument<number | bigint>];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Gets a value from a `vector<u64>` at a specific index. It will return 0 if the
|
|
38
|
+
* index is out of bounds.
|
|
39
|
+
*/
|
|
40
|
+
export declare function getU64VectorValue(options: GetU64VectorValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
41
|
+
export interface MultiplierArguments {
|
|
42
|
+
decimal: RawTransactionArgument<number | bigint>;
|
|
43
|
+
}
|
|
44
|
+
export interface MultiplierOptions {
|
|
45
|
+
package?: string;
|
|
46
|
+
arguments: MultiplierArguments | [decimal: RawTransactionArgument<number | bigint>];
|
|
47
|
+
}
|
|
48
|
+
/** Calculates a multiplier for a given number of decimals. */
|
|
49
|
+
export declare function multiplier(options: MultiplierOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
50
|
+
export interface AmountToUsdArguments {
|
|
51
|
+
amount: RawTransactionArgument<number | bigint>;
|
|
52
|
+
amountDecimal: RawTransactionArgument<number | bigint>;
|
|
53
|
+
price: RawTransactionArgument<number | bigint>;
|
|
54
|
+
priceDecimal: RawTransactionArgument<number | bigint>;
|
|
55
|
+
}
|
|
56
|
+
export interface AmountToUsdOptions {
|
|
57
|
+
package?: string;
|
|
58
|
+
arguments: AmountToUsdArguments | [
|
|
59
|
+
amount: RawTransactionArgument<number | bigint>,
|
|
60
|
+
amountDecimal: RawTransactionArgument<number | bigint>,
|
|
61
|
+
price: RawTransactionArgument<number | bigint>,
|
|
62
|
+
priceDecimal: RawTransactionArgument<number | bigint>
|
|
63
|
+
];
|
|
64
|
+
}
|
|
65
|
+
/** Converts an amount of a token to USD. */
|
|
66
|
+
export declare function amountToUsd(options: AmountToUsdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
67
|
+
export interface UsdToAmountArguments {
|
|
68
|
+
usd: RawTransactionArgument<number | bigint>;
|
|
69
|
+
amountDecimal: RawTransactionArgument<number | bigint>;
|
|
70
|
+
price: RawTransactionArgument<number | bigint>;
|
|
71
|
+
priceDecimal: RawTransactionArgument<number | bigint>;
|
|
72
|
+
}
|
|
73
|
+
export interface UsdToAmountOptions {
|
|
74
|
+
package?: string;
|
|
75
|
+
arguments: UsdToAmountArguments | [
|
|
76
|
+
usd: RawTransactionArgument<number | bigint>,
|
|
77
|
+
amountDecimal: RawTransactionArgument<number | bigint>,
|
|
78
|
+
price: RawTransactionArgument<number | bigint>,
|
|
79
|
+
priceDecimal: RawTransactionArgument<number | bigint>
|
|
80
|
+
];
|
|
81
|
+
}
|
|
82
|
+
/** Converts an amount of USD to a token. */
|
|
83
|
+
export declare function usdToAmount(options: UsdToAmountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
84
|
+
export interface GetUsdDecimalOptions {
|
|
85
|
+
package?: string;
|
|
86
|
+
arguments?: [];
|
|
87
|
+
}
|
|
88
|
+
/** Returns the number of decimals for USD. */
|
|
89
|
+
export declare function getUsdDecimal(options?: GetUsdDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
90
|
+
export interface GetFundingRateDecimalOptions {
|
|
91
|
+
package?: string;
|
|
92
|
+
arguments?: [];
|
|
93
|
+
}
|
|
94
|
+
/** Returns the number of decimals for the funding rate. */
|
|
95
|
+
export declare function getFundingRateDecimal(options?: GetFundingRateDecimalOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************************************************
|
|
3
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
4
|
+
**************************************************************/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.setU64VectorValue = setU64VectorValue;
|
|
7
|
+
exports.getU64VectorValue = getU64VectorValue;
|
|
8
|
+
exports.multiplier = multiplier;
|
|
9
|
+
exports.amountToUsd = amountToUsd;
|
|
10
|
+
exports.usdToAmount = usdToAmount;
|
|
11
|
+
exports.getUsdDecimal = getUsdDecimal;
|
|
12
|
+
exports.getFundingRateDecimal = getFundingRateDecimal;
|
|
13
|
+
const index_1 = require("../utils/index");
|
|
14
|
+
/**
|
|
15
|
+
* Sets a value in a `vector<u64>` at a specific index. It will extend the vector
|
|
16
|
+
* with zeros if the index is out of bounds.
|
|
17
|
+
*/
|
|
18
|
+
function setU64VectorValue(options) {
|
|
19
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
20
|
+
const argumentsTypes = ["vector<u64>", "u64", "u64"];
|
|
21
|
+
const parameterNames = ["u64Vector", "i", "value"];
|
|
22
|
+
return (tx) => tx.moveCall({
|
|
23
|
+
package: packageAddress,
|
|
24
|
+
module: "math",
|
|
25
|
+
function: "set_u64_vector_value",
|
|
26
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Gets a value from a `vector<u64>` at a specific index. It will return 0 if the
|
|
31
|
+
* index is out of bounds.
|
|
32
|
+
*/
|
|
33
|
+
function getU64VectorValue(options) {
|
|
34
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
35
|
+
const argumentsTypes = ["vector<u64>", "u64"];
|
|
36
|
+
const parameterNames = ["u64Vector", "i"];
|
|
37
|
+
return (tx) => tx.moveCall({
|
|
38
|
+
package: packageAddress,
|
|
39
|
+
module: "math",
|
|
40
|
+
function: "get_u64_vector_value",
|
|
41
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
/** Calculates a multiplier for a given number of decimals. */
|
|
45
|
+
function multiplier(options) {
|
|
46
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
47
|
+
const argumentsTypes = ["u64"];
|
|
48
|
+
const parameterNames = ["decimal"];
|
|
49
|
+
return (tx) => tx.moveCall({
|
|
50
|
+
package: packageAddress,
|
|
51
|
+
module: "math",
|
|
52
|
+
function: "multiplier",
|
|
53
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/** Converts an amount of a token to USD. */
|
|
57
|
+
function amountToUsd(options) {
|
|
58
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
59
|
+
const argumentsTypes = ["u64", "u64", "u64", "u64"];
|
|
60
|
+
const parameterNames = ["amount", "amountDecimal", "price", "priceDecimal"];
|
|
61
|
+
return (tx) => tx.moveCall({
|
|
62
|
+
package: packageAddress,
|
|
63
|
+
module: "math",
|
|
64
|
+
function: "amount_to_usd",
|
|
65
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/** Converts an amount of USD to a token. */
|
|
69
|
+
function usdToAmount(options) {
|
|
70
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
71
|
+
const argumentsTypes = ["u64", "u64", "u64", "u64"];
|
|
72
|
+
const parameterNames = ["usd", "amountDecimal", "price", "priceDecimal"];
|
|
73
|
+
return (tx) => tx.moveCall({
|
|
74
|
+
package: packageAddress,
|
|
75
|
+
module: "math",
|
|
76
|
+
function: "usd_to_amount",
|
|
77
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
/** Returns the number of decimals for USD. */
|
|
81
|
+
function getUsdDecimal(options = {}) {
|
|
82
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
83
|
+
return (tx) => tx.moveCall({
|
|
84
|
+
package: packageAddress,
|
|
85
|
+
module: "math",
|
|
86
|
+
function: "get_usd_decimal",
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
/** Returns the number of decimals for the funding rate. */
|
|
90
|
+
function getFundingRateDecimal(options = {}) {
|
|
91
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
92
|
+
return (tx) => tx.moveCall({
|
|
93
|
+
package: packageAddress,
|
|
94
|
+
module: "math",
|
|
95
|
+
function: "get_funding_rate_decimal",
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The `position` module defines the `Position` and `TradingOrder` structs, and the
|
|
6
|
+
* logic for creating, updating, and closing them. All of the functions are inner
|
|
7
|
+
* package functions used in `trading.move`.
|
|
8
|
+
*/
|
|
9
|
+
import { MoveStruct } from "../utils/index";
|
|
10
|
+
export declare const OptionCollateralInfo: MoveStruct<{
|
|
11
|
+
/** The index of the portfolio. */
|
|
12
|
+
index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
13
|
+
/** The type name of the bid token. */
|
|
14
|
+
bid_token: MoveStruct<{
|
|
15
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
16
|
+
}, "std::type_name::TypeName">;
|
|
17
|
+
/** A vector of the BCS-serialized bid receipts. */
|
|
18
|
+
bid_receipts_bcs: import("@mysten/sui/bcs").BcsType<number[][], Iterable<Iterable<number> & {
|
|
19
|
+
length: number;
|
|
20
|
+
}> & {
|
|
21
|
+
length: number;
|
|
22
|
+
}, string>;
|
|
23
|
+
}, "@typus/perp::position::OptionCollateralInfo">;
|
|
24
|
+
export declare const Position: MoveStruct<{
|
|
25
|
+
id: MoveStruct<{
|
|
26
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
27
|
+
}, "0x2::object::UID">;
|
|
28
|
+
/** The timestamp when the position was created. */
|
|
29
|
+
create_ts_ms: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
30
|
+
/** The ID of the position. */
|
|
31
|
+
position_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
32
|
+
/** A vector of the linked order IDs. */
|
|
33
|
+
linked_order_ids: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
34
|
+
length: number;
|
|
35
|
+
}, string>;
|
|
36
|
+
/** A vector of the linked order prices. */
|
|
37
|
+
linked_order_prices: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
38
|
+
length: number;
|
|
39
|
+
}, string>;
|
|
40
|
+
/** The address of the user. */
|
|
41
|
+
user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
42
|
+
/** Whether the position is long. */
|
|
43
|
+
is_long: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
44
|
+
/** The size of the position. */
|
|
45
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
46
|
+
/** The number of decimals for the size. */
|
|
47
|
+
size_decimal: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
48
|
+
/** The type name of the collateral token. */
|
|
49
|
+
collateral_token: MoveStruct<{
|
|
50
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
51
|
+
}, "std::type_name::TypeName">;
|
|
52
|
+
/** The number of decimals for the collateral token. */
|
|
53
|
+
collateral_token_decimal: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
54
|
+
/** The symbol of the trading pair. */
|
|
55
|
+
symbol: MoveStruct<{
|
|
56
|
+
base_token: MoveStruct<{
|
|
57
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
58
|
+
}, "std::type_name::TypeName">;
|
|
59
|
+
quote_token: MoveStruct<{
|
|
60
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
61
|
+
}, "std::type_name::TypeName">;
|
|
62
|
+
}, "@typus/perp::symbol::Symbol">;
|
|
63
|
+
/** The amount of collateral. */
|
|
64
|
+
collateral_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
65
|
+
/** The amount of reserved collateral. */
|
|
66
|
+
reserve_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
67
|
+
/** The average price of the position. */
|
|
68
|
+
average_price: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
69
|
+
/** The entry borrow index. */
|
|
70
|
+
entry_borrow_index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
71
|
+
/** The sign of the entry funding rate index. */
|
|
72
|
+
entry_funding_rate_index_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
73
|
+
/** The entry funding rate index. */
|
|
74
|
+
entry_funding_rate_index: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
75
|
+
/** The unrealized loss. */
|
|
76
|
+
unrealized_loss: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
77
|
+
/** The sign of the unrealized funding fee. */
|
|
78
|
+
unrealized_funding_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
79
|
+
/** The unrealized funding fee. */
|
|
80
|
+
unrealized_funding_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
81
|
+
/** The unrealized trading fee. */
|
|
82
|
+
unrealized_trading_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
83
|
+
/** The unrealized borrow fee. */
|
|
84
|
+
unrealized_borrow_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
85
|
+
/** The unrealized rebate. */
|
|
86
|
+
unrealized_rebate: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
87
|
+
/** Information about the option collateral. */
|
|
88
|
+
option_collateral_info: import("@mysten/sui/bcs").BcsType<{
|
|
89
|
+
index: string;
|
|
90
|
+
bid_token: {
|
|
91
|
+
name: string;
|
|
92
|
+
};
|
|
93
|
+
bid_receipts_bcs: number[][];
|
|
94
|
+
} | null, {
|
|
95
|
+
index: string | number | bigint;
|
|
96
|
+
bid_token: {
|
|
97
|
+
name: string;
|
|
98
|
+
};
|
|
99
|
+
bid_receipts_bcs: Iterable<Iterable<number> & {
|
|
100
|
+
length: number;
|
|
101
|
+
}> & {
|
|
102
|
+
length: number;
|
|
103
|
+
};
|
|
104
|
+
} | null | undefined, "Option<@typus/perp::position::OptionCollateralInfo>">;
|
|
105
|
+
/** Padding for future use. */
|
|
106
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
107
|
+
length: number;
|
|
108
|
+
}, string>;
|
|
109
|
+
}, "@typus/perp::position::Position">;
|
|
110
|
+
export declare const TradingOrder: MoveStruct<{
|
|
111
|
+
id: MoveStruct<{
|
|
112
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
113
|
+
}, "0x2::object::UID">;
|
|
114
|
+
/** The timestamp when the order was created. */
|
|
115
|
+
create_ts_ms: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
116
|
+
/** The ID of the order. */
|
|
117
|
+
order_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
118
|
+
/** The ID of the linked position. */
|
|
119
|
+
linked_position_id: import("@mysten/sui/bcs").BcsType<string | null, string | number | bigint | null | undefined, "Option<u64>">;
|
|
120
|
+
/** The address of the user. */
|
|
121
|
+
user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
122
|
+
/** The type name of the collateral token. */
|
|
123
|
+
collateral_token: MoveStruct<{
|
|
124
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
125
|
+
}, "std::type_name::TypeName">;
|
|
126
|
+
/** The number of decimals for the collateral token. */
|
|
127
|
+
collateral_token_decimal: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
128
|
+
/** The symbol of the trading pair. */
|
|
129
|
+
symbol: MoveStruct<{
|
|
130
|
+
base_token: MoveStruct<{
|
|
131
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
132
|
+
}, "std::type_name::TypeName">;
|
|
133
|
+
quote_token: MoveStruct<{
|
|
134
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
135
|
+
}, "std::type_name::TypeName">;
|
|
136
|
+
}, "@typus/perp::symbol::Symbol">;
|
|
137
|
+
/** The leverage in mega basis points. */
|
|
138
|
+
leverage_mbp: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
139
|
+
/** Whether the order is reduce-only. */
|
|
140
|
+
reduce_only: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
141
|
+
/** Whether the order is long. */
|
|
142
|
+
is_long: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
143
|
+
/** Whether the order is a stop order. */
|
|
144
|
+
is_stop_order: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
145
|
+
/** The size of the order. */
|
|
146
|
+
size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
147
|
+
/** The number of decimals for the size. */
|
|
148
|
+
size_decimal: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
149
|
+
/** The trigger price of the order. */
|
|
150
|
+
trigger_price: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
151
|
+
/** The oracle price when the order was placed. */
|
|
152
|
+
oracle_price_when_placing: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
153
|
+
/** Padding for future use. */
|
|
154
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
155
|
+
length: number;
|
|
156
|
+
}, string>;
|
|
157
|
+
}, "@typus/perp::position::TradingOrder">;
|
|
158
|
+
export declare const RemovePositionEvent: MoveStruct<{
|
|
159
|
+
user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
160
|
+
collateral_token: MoveStruct<{
|
|
161
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
162
|
+
}, "std::type_name::TypeName">;
|
|
163
|
+
symbol: MoveStruct<{
|
|
164
|
+
base_token: MoveStruct<{
|
|
165
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
166
|
+
}, "std::type_name::TypeName">;
|
|
167
|
+
quote_token: MoveStruct<{
|
|
168
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
169
|
+
}, "std::type_name::TypeName">;
|
|
170
|
+
}, "@typus/perp::symbol::Symbol">;
|
|
171
|
+
linked_order_ids: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
172
|
+
length: number;
|
|
173
|
+
}, string>;
|
|
174
|
+
linked_order_prices: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
175
|
+
length: number;
|
|
176
|
+
}, string>;
|
|
177
|
+
remaining_collateral_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
178
|
+
realized_trading_fee_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
179
|
+
realized_borrow_fee_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
180
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
181
|
+
length: number;
|
|
182
|
+
}, string>;
|
|
183
|
+
}, "@typus/perp::position::RemovePositionEvent">;
|
|
184
|
+
export declare const OrderFilledEvent: MoveStruct<{
|
|
185
|
+
user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
186
|
+
collateral_token: MoveStruct<{
|
|
187
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
188
|
+
}, "std::type_name::TypeName">;
|
|
189
|
+
symbol: MoveStruct<{
|
|
190
|
+
base_token: MoveStruct<{
|
|
191
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
192
|
+
}, "std::type_name::TypeName">;
|
|
193
|
+
quote_token: MoveStruct<{
|
|
194
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
195
|
+
}, "std::type_name::TypeName">;
|
|
196
|
+
}, "@typus/perp::symbol::Symbol">;
|
|
197
|
+
order_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
198
|
+
linked_position_id: import("@mysten/sui/bcs").BcsType<string | null, string | number | bigint | null | undefined, "Option<u64>">;
|
|
199
|
+
new_position_id: import("@mysten/sui/bcs").BcsType<string | null, string | number | bigint | null | undefined, "Option<u64>">;
|
|
200
|
+
filled_size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
201
|
+
filled_price: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
202
|
+
position_side: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
203
|
+
position_size: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
204
|
+
position_average_price: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
205
|
+
realized_trading_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
206
|
+
realized_borrow_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
207
|
+
realized_fee_in_usd: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
208
|
+
realized_amount: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
209
|
+
realized_amount_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
210
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
211
|
+
length: number;
|
|
212
|
+
}, string>;
|
|
213
|
+
}, "@typus/perp::position::OrderFilledEvent">;
|
|
214
|
+
export declare const RealizeFundingEvent: MoveStruct<{
|
|
215
|
+
user: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
216
|
+
collateral_token: MoveStruct<{
|
|
217
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
218
|
+
}, "std::type_name::TypeName">;
|
|
219
|
+
symbol: MoveStruct<{
|
|
220
|
+
base_token: MoveStruct<{
|
|
221
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
222
|
+
}, "std::type_name::TypeName">;
|
|
223
|
+
quote_token: MoveStruct<{
|
|
224
|
+
name: import("@mysten/sui/bcs").BcsType<string, string, "string">;
|
|
225
|
+
}, "std::type_name::TypeName">;
|
|
226
|
+
}, "@typus/perp::symbol::Symbol">;
|
|
227
|
+
position_id: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
228
|
+
realized_funding_sign: import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">;
|
|
229
|
+
realized_funding_fee: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
230
|
+
realized_funding_fee_usd: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
231
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
232
|
+
length: number;
|
|
233
|
+
}, string>;
|
|
234
|
+
}, "@typus/perp::position::RealizeFundingEvent">;
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**************************************************************
|
|
3
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
4
|
+
**************************************************************/
|
|
5
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
8
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
9
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
10
|
+
}
|
|
11
|
+
Object.defineProperty(o, k2, desc);
|
|
12
|
+
}) : (function(o, m, k, k2) {
|
|
13
|
+
if (k2 === undefined) k2 = k;
|
|
14
|
+
o[k2] = m[k];
|
|
15
|
+
}));
|
|
16
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
18
|
+
}) : function(o, v) {
|
|
19
|
+
o["default"] = v;
|
|
20
|
+
});
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.RealizeFundingEvent = exports.OrderFilledEvent = exports.RemovePositionEvent = exports.TradingOrder = exports.Position = exports.OptionCollateralInfo = void 0;
|
|
40
|
+
/**
|
|
41
|
+
* The `position` module defines the `Position` and `TradingOrder` structs, and the
|
|
42
|
+
* logic for creating, updating, and closing them. All of the functions are inner
|
|
43
|
+
* package functions used in `trading.move`.
|
|
44
|
+
*/
|
|
45
|
+
const index_1 = require("../utils/index");
|
|
46
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
47
|
+
const type_name = __importStar(require("./deps/std/type_name"));
|
|
48
|
+
const object = __importStar(require("./deps/sui/object"));
|
|
49
|
+
const symbol = __importStar(require("./symbol"));
|
|
50
|
+
const $moduleName = "@typus/perp::position";
|
|
51
|
+
exports.OptionCollateralInfo = new index_1.MoveStruct({
|
|
52
|
+
name: `${$moduleName}::OptionCollateralInfo`,
|
|
53
|
+
fields: {
|
|
54
|
+
/** The index of the portfolio. */
|
|
55
|
+
index: bcs_1.bcs.u64(),
|
|
56
|
+
/** The type name of the bid token. */
|
|
57
|
+
bid_token: type_name.TypeName,
|
|
58
|
+
/** A vector of the BCS-serialized bid receipts. */
|
|
59
|
+
bid_receipts_bcs: bcs_1.bcs.vector(bcs_1.bcs.vector(bcs_1.bcs.u8())),
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
exports.Position = new index_1.MoveStruct({
|
|
63
|
+
name: `${$moduleName}::Position`,
|
|
64
|
+
fields: {
|
|
65
|
+
id: object.UID,
|
|
66
|
+
/** The timestamp when the position was created. */
|
|
67
|
+
create_ts_ms: bcs_1.bcs.u64(),
|
|
68
|
+
/** The ID of the position. */
|
|
69
|
+
position_id: bcs_1.bcs.u64(),
|
|
70
|
+
/** A vector of the linked order IDs. */
|
|
71
|
+
linked_order_ids: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
72
|
+
/** A vector of the linked order prices. */
|
|
73
|
+
linked_order_prices: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
74
|
+
/** The address of the user. */
|
|
75
|
+
user: bcs_1.bcs.Address,
|
|
76
|
+
/** Whether the position is long. */
|
|
77
|
+
is_long: bcs_1.bcs.bool(),
|
|
78
|
+
/** The size of the position. */
|
|
79
|
+
size: bcs_1.bcs.u64(),
|
|
80
|
+
/** The number of decimals for the size. */
|
|
81
|
+
size_decimal: bcs_1.bcs.u64(),
|
|
82
|
+
/** The type name of the collateral token. */
|
|
83
|
+
collateral_token: type_name.TypeName,
|
|
84
|
+
/** The number of decimals for the collateral token. */
|
|
85
|
+
collateral_token_decimal: bcs_1.bcs.u64(),
|
|
86
|
+
/** The symbol of the trading pair. */
|
|
87
|
+
symbol: symbol.Symbol,
|
|
88
|
+
/** The amount of collateral. */
|
|
89
|
+
collateral_amount: bcs_1.bcs.u64(),
|
|
90
|
+
/** The amount of reserved collateral. */
|
|
91
|
+
reserve_amount: bcs_1.bcs.u64(),
|
|
92
|
+
/** The average price of the position. */
|
|
93
|
+
average_price: bcs_1.bcs.u64(),
|
|
94
|
+
/** The entry borrow index. */
|
|
95
|
+
entry_borrow_index: bcs_1.bcs.u64(),
|
|
96
|
+
/** The sign of the entry funding rate index. */
|
|
97
|
+
entry_funding_rate_index_sign: bcs_1.bcs.bool(),
|
|
98
|
+
/** The entry funding rate index. */
|
|
99
|
+
entry_funding_rate_index: bcs_1.bcs.u64(),
|
|
100
|
+
/** The unrealized loss. */
|
|
101
|
+
unrealized_loss: bcs_1.bcs.u64(),
|
|
102
|
+
/** The sign of the unrealized funding fee. */
|
|
103
|
+
unrealized_funding_sign: bcs_1.bcs.bool(),
|
|
104
|
+
/** The unrealized funding fee. */
|
|
105
|
+
unrealized_funding_fee: bcs_1.bcs.u64(),
|
|
106
|
+
/** The unrealized trading fee. */
|
|
107
|
+
unrealized_trading_fee: bcs_1.bcs.u64(),
|
|
108
|
+
/** The unrealized borrow fee. */
|
|
109
|
+
unrealized_borrow_fee: bcs_1.bcs.u64(),
|
|
110
|
+
/** The unrealized rebate. */
|
|
111
|
+
unrealized_rebate: bcs_1.bcs.u64(),
|
|
112
|
+
/** Information about the option collateral. */
|
|
113
|
+
option_collateral_info: bcs_1.bcs.option(exports.OptionCollateralInfo),
|
|
114
|
+
/** Padding for future use. */
|
|
115
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
116
|
+
},
|
|
117
|
+
});
|
|
118
|
+
exports.TradingOrder = new index_1.MoveStruct({
|
|
119
|
+
name: `${$moduleName}::TradingOrder`,
|
|
120
|
+
fields: {
|
|
121
|
+
id: object.UID,
|
|
122
|
+
/** The timestamp when the order was created. */
|
|
123
|
+
create_ts_ms: bcs_1.bcs.u64(),
|
|
124
|
+
/** The ID of the order. */
|
|
125
|
+
order_id: bcs_1.bcs.u64(),
|
|
126
|
+
/** The ID of the linked position. */
|
|
127
|
+
linked_position_id: bcs_1.bcs.option(bcs_1.bcs.u64()),
|
|
128
|
+
/** The address of the user. */
|
|
129
|
+
user: bcs_1.bcs.Address,
|
|
130
|
+
/** The type name of the collateral token. */
|
|
131
|
+
collateral_token: type_name.TypeName,
|
|
132
|
+
/** The number of decimals for the collateral token. */
|
|
133
|
+
collateral_token_decimal: bcs_1.bcs.u64(),
|
|
134
|
+
/** The symbol of the trading pair. */
|
|
135
|
+
symbol: symbol.Symbol,
|
|
136
|
+
/** The leverage in mega basis points. */
|
|
137
|
+
leverage_mbp: bcs_1.bcs.u64(),
|
|
138
|
+
/** Whether the order is reduce-only. */
|
|
139
|
+
reduce_only: bcs_1.bcs.bool(),
|
|
140
|
+
/** Whether the order is long. */
|
|
141
|
+
is_long: bcs_1.bcs.bool(),
|
|
142
|
+
/** Whether the order is a stop order. */
|
|
143
|
+
is_stop_order: bcs_1.bcs.bool(),
|
|
144
|
+
/** The size of the order. */
|
|
145
|
+
size: bcs_1.bcs.u64(),
|
|
146
|
+
/** The number of decimals for the size. */
|
|
147
|
+
size_decimal: bcs_1.bcs.u64(),
|
|
148
|
+
/** The trigger price of the order. */
|
|
149
|
+
trigger_price: bcs_1.bcs.u64(),
|
|
150
|
+
/** The oracle price when the order was placed. */
|
|
151
|
+
oracle_price_when_placing: bcs_1.bcs.u64(),
|
|
152
|
+
/** Padding for future use. */
|
|
153
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
exports.RemovePositionEvent = new index_1.MoveStruct({
|
|
157
|
+
name: `${$moduleName}::RemovePositionEvent`,
|
|
158
|
+
fields: {
|
|
159
|
+
user: bcs_1.bcs.Address,
|
|
160
|
+
collateral_token: type_name.TypeName,
|
|
161
|
+
symbol: symbol.Symbol,
|
|
162
|
+
linked_order_ids: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
163
|
+
linked_order_prices: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
164
|
+
remaining_collateral_amount: bcs_1.bcs.u64(),
|
|
165
|
+
realized_trading_fee_amount: bcs_1.bcs.u64(),
|
|
166
|
+
realized_borrow_fee_amount: bcs_1.bcs.u64(),
|
|
167
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
168
|
+
},
|
|
169
|
+
});
|
|
170
|
+
exports.OrderFilledEvent = new index_1.MoveStruct({
|
|
171
|
+
name: `${$moduleName}::OrderFilledEvent`,
|
|
172
|
+
fields: {
|
|
173
|
+
user: bcs_1.bcs.Address,
|
|
174
|
+
collateral_token: type_name.TypeName,
|
|
175
|
+
symbol: symbol.Symbol,
|
|
176
|
+
order_id: bcs_1.bcs.u64(),
|
|
177
|
+
linked_position_id: bcs_1.bcs.option(bcs_1.bcs.u64()),
|
|
178
|
+
new_position_id: bcs_1.bcs.option(bcs_1.bcs.u64()),
|
|
179
|
+
filled_size: bcs_1.bcs.u64(),
|
|
180
|
+
filled_price: bcs_1.bcs.u64(),
|
|
181
|
+
position_side: bcs_1.bcs.bool(),
|
|
182
|
+
position_size: bcs_1.bcs.u64(),
|
|
183
|
+
position_average_price: bcs_1.bcs.u64(),
|
|
184
|
+
realized_trading_fee: bcs_1.bcs.u64(),
|
|
185
|
+
realized_borrow_fee: bcs_1.bcs.u64(),
|
|
186
|
+
realized_fee_in_usd: bcs_1.bcs.u64(),
|
|
187
|
+
realized_amount: bcs_1.bcs.u64(),
|
|
188
|
+
realized_amount_sign: bcs_1.bcs.bool(),
|
|
189
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
190
|
+
},
|
|
191
|
+
});
|
|
192
|
+
exports.RealizeFundingEvent = new index_1.MoveStruct({
|
|
193
|
+
name: `${$moduleName}::RealizeFundingEvent`,
|
|
194
|
+
fields: {
|
|
195
|
+
user: bcs_1.bcs.Address,
|
|
196
|
+
collateral_token: type_name.TypeName,
|
|
197
|
+
symbol: symbol.Symbol,
|
|
198
|
+
position_id: bcs_1.bcs.u64(),
|
|
199
|
+
realized_funding_sign: bcs_1.bcs.bool(),
|
|
200
|
+
realized_funding_fee: bcs_1.bcs.u64(),
|
|
201
|
+
realized_funding_fee_usd: bcs_1.bcs.u64(),
|
|
202
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
203
|
+
},
|
|
204
|
+
});
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The `symbol` module defines the `Symbol` struct, which represents a trading
|
|
6
|
+
* pair.
|
|
7
|
+
*/
|
|
8
|
+
import { MoveStruct } from "../utils/index";
|
|
9
|
+
export declare const Symbol: MoveStruct<{
|
|
10
|
+
/** The base token of the trading pair. */
|
|
11
|
+
base_token: MoveStruct<{
|
|
12
|
+
name: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
13
|
+
}, "std::type_name::TypeName">;
|
|
14
|
+
/** The quote token of the trading pair. */
|
|
15
|
+
quote_token: MoveStruct<{
|
|
16
|
+
name: import("@mysten/bcs").BcsType<string, string, "string">;
|
|
17
|
+
}, "std::type_name::TypeName">;
|
|
18
|
+
}, "@typus/perp::symbol::Symbol">;
|