@typus/typus-perp-sdk 1.1.32 → 1.1.34
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 +540 -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 +988 -0
- package/dist/src/generated/typus_stake_pool/stake_pool.js +937 -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,44 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The `treasury_caps` module defines the `TreasuryCaps` struct, which is a shared
|
|
6
|
+
* object that stores the treasury caps for the TLP tokens.
|
|
7
|
+
*/
|
|
8
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index";
|
|
9
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
10
|
+
export declare const TreasuryCaps: MoveStruct<{
|
|
11
|
+
id: MoveStruct<{
|
|
12
|
+
id: import("@mysten/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
13
|
+
}, "0x2::object::UID">;
|
|
14
|
+
}, "@typus/perp::treasury_caps::TreasuryCaps">;
|
|
15
|
+
export interface InitOptions {
|
|
16
|
+
package?: string;
|
|
17
|
+
arguments?: [];
|
|
18
|
+
}
|
|
19
|
+
export declare function init(options?: InitOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
20
|
+
export interface GetMutTreasuryCapArguments {
|
|
21
|
+
treasuryCaps: RawTransactionArgument<string>;
|
|
22
|
+
}
|
|
23
|
+
export interface GetMutTreasuryCapOptions {
|
|
24
|
+
package?: string;
|
|
25
|
+
arguments: GetMutTreasuryCapArguments | [treasuryCaps: RawTransactionArgument<string>];
|
|
26
|
+
typeArguments: [string];
|
|
27
|
+
}
|
|
28
|
+
/** Gets a mutable reference to a treasury cap. WARNING: no authority check inside */
|
|
29
|
+
export declare function getMutTreasuryCap(options: GetMutTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
30
|
+
export interface ManagerStoreTreasuryCapArguments {
|
|
31
|
+
version: RawTransactionArgument<string>;
|
|
32
|
+
treasuryCaps: RawTransactionArgument<string>;
|
|
33
|
+
treasuryCap: RawTransactionArgument<string>;
|
|
34
|
+
}
|
|
35
|
+
export interface ManagerStoreTreasuryCapOptions {
|
|
36
|
+
package?: string;
|
|
37
|
+
arguments: ManagerStoreTreasuryCapArguments | [
|
|
38
|
+
version: RawTransactionArgument<string>,
|
|
39
|
+
treasuryCaps: RawTransactionArgument<string>,
|
|
40
|
+
treasuryCap: RawTransactionArgument<string>
|
|
41
|
+
];
|
|
42
|
+
typeArguments: [string];
|
|
43
|
+
}
|
|
44
|
+
export declare function managerStoreTreasuryCap(options: ManagerStoreTreasuryCapOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,92 @@
|
|
|
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.TreasuryCaps = void 0;
|
|
40
|
+
exports.init = init;
|
|
41
|
+
exports.getMutTreasuryCap = getMutTreasuryCap;
|
|
42
|
+
exports.managerStoreTreasuryCap = managerStoreTreasuryCap;
|
|
43
|
+
/**
|
|
44
|
+
* The `treasury_caps` module defines the `TreasuryCaps` struct, which is a shared
|
|
45
|
+
* object that stores the treasury caps for the TLP tokens.
|
|
46
|
+
*/
|
|
47
|
+
const index_1 = require("../utils/index");
|
|
48
|
+
const object = __importStar(require("./deps/sui/object"));
|
|
49
|
+
const $moduleName = "@typus/perp::treasury_caps";
|
|
50
|
+
exports.TreasuryCaps = new index_1.MoveStruct({
|
|
51
|
+
name: `${$moduleName}::TreasuryCaps`,
|
|
52
|
+
fields: {
|
|
53
|
+
id: object.UID,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
function init(options = {}) {
|
|
57
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
58
|
+
return (tx) => tx.moveCall({
|
|
59
|
+
package: packageAddress,
|
|
60
|
+
module: "treasury_caps",
|
|
61
|
+
function: "init",
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
/** Gets a mutable reference to a treasury cap. WARNING: no authority check inside */
|
|
65
|
+
function getMutTreasuryCap(options) {
|
|
66
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
67
|
+
const argumentsTypes = [`${packageAddress}::treasury_caps::TreasuryCaps`];
|
|
68
|
+
const parameterNames = ["treasuryCaps"];
|
|
69
|
+
return (tx) => tx.moveCall({
|
|
70
|
+
package: packageAddress,
|
|
71
|
+
module: "treasury_caps",
|
|
72
|
+
function: "get_mut_treasury_cap",
|
|
73
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
74
|
+
typeArguments: options.typeArguments,
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function managerStoreTreasuryCap(options) {
|
|
78
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
79
|
+
const argumentsTypes = [
|
|
80
|
+
`${packageAddress}::admin::Version`,
|
|
81
|
+
`${packageAddress}::treasury_caps::TreasuryCaps`,
|
|
82
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::coin::TreasuryCap<${options.typeArguments[0]}>`,
|
|
83
|
+
];
|
|
84
|
+
const parameterNames = ["version", "treasuryCaps", "treasuryCap"];
|
|
85
|
+
return (tx) => tx.moveCall({
|
|
86
|
+
package: packageAddress,
|
|
87
|
+
module: "treasury_caps",
|
|
88
|
+
function: "manager_store_treasury_cap",
|
|
89
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
90
|
+
typeArguments: options.typeArguments,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* The `user_account` module defines the `UserAccount` and `UserAccountCap`
|
|
6
|
+
* structs, and the logic for creating, updating, and using them.
|
|
7
|
+
*/
|
|
8
|
+
import { MoveStruct, type RawTransactionArgument } from "../utils/index";
|
|
9
|
+
import { type Transaction } from "@mysten/sui/transactions";
|
|
10
|
+
export declare const UserAccount: MoveStruct<{
|
|
11
|
+
id: MoveStruct<{
|
|
12
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
13
|
+
}, "0x2::object::UID">;
|
|
14
|
+
/** The address of the owner of the user account. */
|
|
15
|
+
owner: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
16
|
+
/** A vector of the delegate users. */
|
|
17
|
+
delegate_user: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | Uint8Array<ArrayBufferLike>> & {
|
|
18
|
+
length: number;
|
|
19
|
+
}, string>;
|
|
20
|
+
/** A vector of the symbols of the tokens in the user account. */
|
|
21
|
+
symbols: import("@mysten/sui/bcs").BcsType<{
|
|
22
|
+
name: string;
|
|
23
|
+
}[], Iterable<{
|
|
24
|
+
name: string;
|
|
25
|
+
}> & {
|
|
26
|
+
length: number;
|
|
27
|
+
}, string>;
|
|
28
|
+
/** Padding for future use. */
|
|
29
|
+
u64_padding: import("@mysten/sui/bcs").BcsType<string[], Iterable<string | number | bigint> & {
|
|
30
|
+
length: number;
|
|
31
|
+
}, string>;
|
|
32
|
+
}, "@typus/perp::user_account::UserAccount">;
|
|
33
|
+
export declare const UserAccountCap: MoveStruct<{
|
|
34
|
+
id: MoveStruct<{
|
|
35
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
36
|
+
}, "0x2::object::UID">;
|
|
37
|
+
/** The address of the owner of the user account. */
|
|
38
|
+
owner: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
39
|
+
/** The ID of the user account. */
|
|
40
|
+
user_account_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
41
|
+
}, "@typus/perp::user_account::UserAccountCap">;
|
|
42
|
+
export interface NewUserAccountOptions {
|
|
43
|
+
package?: string;
|
|
44
|
+
arguments?: [];
|
|
45
|
+
}
|
|
46
|
+
/** Creates a new user account and capability. */
|
|
47
|
+
export declare function newUserAccount(options?: NewUserAccountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
48
|
+
export interface RemoveUserAccountArguments {
|
|
49
|
+
marketId: RawTransactionArgument<string>;
|
|
50
|
+
user: RawTransactionArgument<string>;
|
|
51
|
+
userAccountCap: RawTransactionArgument<string>;
|
|
52
|
+
}
|
|
53
|
+
export interface RemoveUserAccountOptions {
|
|
54
|
+
package?: string;
|
|
55
|
+
arguments: RemoveUserAccountArguments | [marketId: RawTransactionArgument<string>, user: RawTransactionArgument<string>, userAccountCap: RawTransactionArgument<string>];
|
|
56
|
+
}
|
|
57
|
+
/** Removes a user account. WARNING: no authority check inside */
|
|
58
|
+
export declare function removeUserAccount(options: RemoveUserAccountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
59
|
+
export interface HasUserAccountArguments {
|
|
60
|
+
marketId: RawTransactionArgument<string>;
|
|
61
|
+
user: RawTransactionArgument<string>;
|
|
62
|
+
}
|
|
63
|
+
export interface HasUserAccountOptions {
|
|
64
|
+
package?: string;
|
|
65
|
+
arguments: HasUserAccountArguments | [marketId: RawTransactionArgument<string>, user: RawTransactionArgument<string>];
|
|
66
|
+
}
|
|
67
|
+
/** Checks if a user has an account. */
|
|
68
|
+
export declare function hasUserAccount(options: HasUserAccountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
69
|
+
export interface GetMutUserAccountArguments {
|
|
70
|
+
marketId: RawTransactionArgument<string>;
|
|
71
|
+
user: RawTransactionArgument<string>;
|
|
72
|
+
}
|
|
73
|
+
export interface GetMutUserAccountOptions {
|
|
74
|
+
package?: string;
|
|
75
|
+
arguments: GetMutUserAccountArguments | [marketId: RawTransactionArgument<string>, user: RawTransactionArgument<string>];
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Gets a mutable reference to a user account. WARNING: no security check, only
|
|
79
|
+
* delegate_user or cranker can access
|
|
80
|
+
*/
|
|
81
|
+
export declare function getMutUserAccount(options: GetMutUserAccountOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
82
|
+
export interface CheckOwnerArguments {
|
|
83
|
+
userAccount: RawTransactionArgument<string>;
|
|
84
|
+
}
|
|
85
|
+
export interface CheckOwnerOptions {
|
|
86
|
+
package?: string;
|
|
87
|
+
arguments: CheckOwnerArguments | [userAccount: RawTransactionArgument<string>];
|
|
88
|
+
}
|
|
89
|
+
/** Checks if the sender is the owner of the user account. Abort if not owner */
|
|
90
|
+
export declare function checkOwner(options: CheckOwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
91
|
+
export interface AddDelegateUserArguments {
|
|
92
|
+
userAccount: RawTransactionArgument<string>;
|
|
93
|
+
user: RawTransactionArgument<string>;
|
|
94
|
+
}
|
|
95
|
+
export interface AddDelegateUserOptions {
|
|
96
|
+
package?: string;
|
|
97
|
+
arguments: AddDelegateUserArguments | [userAccount: RawTransactionArgument<string>, user: RawTransactionArgument<string>];
|
|
98
|
+
}
|
|
99
|
+
/** Adds a delegate user to a user account. WARNING: no authority check inside */
|
|
100
|
+
export declare function addDelegateUser(options: AddDelegateUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
101
|
+
export interface RemoveDelegateUserArguments {
|
|
102
|
+
userAccount: RawTransactionArgument<string>;
|
|
103
|
+
user: RawTransactionArgument<string>;
|
|
104
|
+
}
|
|
105
|
+
export interface RemoveDelegateUserOptions {
|
|
106
|
+
package?: string;
|
|
107
|
+
arguments: RemoveDelegateUserArguments | [userAccount: RawTransactionArgument<string>, user: RawTransactionArgument<string>];
|
|
108
|
+
}
|
|
109
|
+
/** Remove a delegate user from a user account. WARNING: no authority check inside */
|
|
110
|
+
export declare function removeDelegateUser(options: RemoveDelegateUserOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
111
|
+
export interface DepositArguments {
|
|
112
|
+
userAccount: RawTransactionArgument<string>;
|
|
113
|
+
balance: RawTransactionArgument<string>;
|
|
114
|
+
}
|
|
115
|
+
export interface DepositOptions {
|
|
116
|
+
package?: string;
|
|
117
|
+
arguments: DepositArguments | [userAccount: RawTransactionArgument<string>, balance: RawTransactionArgument<string>];
|
|
118
|
+
typeArguments: [string];
|
|
119
|
+
}
|
|
120
|
+
/** Deposits collateral into a user account. WARNING: no authority check inside */
|
|
121
|
+
export declare function deposit(options: DepositOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
122
|
+
export interface WithdrawArguments {
|
|
123
|
+
userAccount: RawTransactionArgument<string>;
|
|
124
|
+
amount: RawTransactionArgument<number | bigint | null>;
|
|
125
|
+
userAccountCap: RawTransactionArgument<string>;
|
|
126
|
+
}
|
|
127
|
+
export interface WithdrawOptions {
|
|
128
|
+
package?: string;
|
|
129
|
+
arguments: WithdrawArguments | [
|
|
130
|
+
userAccount: RawTransactionArgument<string>,
|
|
131
|
+
amount: RawTransactionArgument<number | bigint | null>,
|
|
132
|
+
userAccountCap: RawTransactionArgument<string>
|
|
133
|
+
];
|
|
134
|
+
typeArguments: [string];
|
|
135
|
+
}
|
|
136
|
+
/** Withdraws collateral from a user account. WARNING: no authority check inside */
|
|
137
|
+
export declare function withdraw(options: WithdrawOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
138
|
+
export interface GetUserAccountOwnerArguments {
|
|
139
|
+
userAccountCap: RawTransactionArgument<string>;
|
|
140
|
+
}
|
|
141
|
+
export interface GetUserAccountOwnerOptions {
|
|
142
|
+
package?: string;
|
|
143
|
+
arguments: GetUserAccountOwnerArguments | [userAccountCap: RawTransactionArgument<string>];
|
|
144
|
+
}
|
|
145
|
+
/** Gets the owner of a user account from a capability. */
|
|
146
|
+
export declare function getUserAccountOwner(options: GetUserAccountOwnerOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
@@ -0,0 +1,221 @@
|
|
|
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.UserAccountCap = exports.UserAccount = void 0;
|
|
40
|
+
exports.newUserAccount = newUserAccount;
|
|
41
|
+
exports.removeUserAccount = removeUserAccount;
|
|
42
|
+
exports.hasUserAccount = hasUserAccount;
|
|
43
|
+
exports.getMutUserAccount = getMutUserAccount;
|
|
44
|
+
exports.checkOwner = checkOwner;
|
|
45
|
+
exports.addDelegateUser = addDelegateUser;
|
|
46
|
+
exports.removeDelegateUser = removeDelegateUser;
|
|
47
|
+
exports.deposit = deposit;
|
|
48
|
+
exports.withdraw = withdraw;
|
|
49
|
+
exports.getUserAccountOwner = getUserAccountOwner;
|
|
50
|
+
/**
|
|
51
|
+
* The `user_account` module defines the `UserAccount` and `UserAccountCap`
|
|
52
|
+
* structs, and the logic for creating, updating, and using them.
|
|
53
|
+
*/
|
|
54
|
+
const index_1 = require("../utils/index");
|
|
55
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
|
56
|
+
const object = __importStar(require("./deps/sui/object"));
|
|
57
|
+
const type_name = __importStar(require("./deps/std/type_name"));
|
|
58
|
+
const $moduleName = "@typus/perp::user_account";
|
|
59
|
+
exports.UserAccount = new index_1.MoveStruct({
|
|
60
|
+
name: `${$moduleName}::UserAccount`,
|
|
61
|
+
fields: {
|
|
62
|
+
id: object.UID,
|
|
63
|
+
/** The address of the owner of the user account. */
|
|
64
|
+
owner: bcs_1.bcs.Address,
|
|
65
|
+
/** A vector of the delegate users. */
|
|
66
|
+
delegate_user: bcs_1.bcs.vector(bcs_1.bcs.Address),
|
|
67
|
+
/** A vector of the symbols of the tokens in the user account. */
|
|
68
|
+
symbols: bcs_1.bcs.vector(type_name.TypeName),
|
|
69
|
+
/** Padding for future use. */
|
|
70
|
+
u64_padding: bcs_1.bcs.vector(bcs_1.bcs.u64()),
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
exports.UserAccountCap = new index_1.MoveStruct({
|
|
74
|
+
name: `${$moduleName}::UserAccountCap`,
|
|
75
|
+
fields: {
|
|
76
|
+
id: object.UID,
|
|
77
|
+
/** The address of the owner of the user account. */
|
|
78
|
+
owner: bcs_1.bcs.Address,
|
|
79
|
+
/** The ID of the user account. */
|
|
80
|
+
user_account_id: bcs_1.bcs.Address,
|
|
81
|
+
},
|
|
82
|
+
});
|
|
83
|
+
/** Creates a new user account and capability. */
|
|
84
|
+
function newUserAccount(options = {}) {
|
|
85
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
86
|
+
return (tx) => tx.moveCall({
|
|
87
|
+
package: packageAddress,
|
|
88
|
+
module: "user_account",
|
|
89
|
+
function: "new_user_account",
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
/** Removes a user account. WARNING: no authority check inside */
|
|
93
|
+
function removeUserAccount(options) {
|
|
94
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
95
|
+
const argumentsTypes = [
|
|
96
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
|
|
97
|
+
"address",
|
|
98
|
+
`${packageAddress}::user_account::UserAccountCap`,
|
|
99
|
+
];
|
|
100
|
+
const parameterNames = ["marketId", "user", "userAccountCap"];
|
|
101
|
+
return (tx) => tx.moveCall({
|
|
102
|
+
package: packageAddress,
|
|
103
|
+
module: "user_account",
|
|
104
|
+
function: "remove_user_account",
|
|
105
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
/** Checks if a user has an account. */
|
|
109
|
+
function hasUserAccount(options) {
|
|
110
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
111
|
+
const argumentsTypes = [
|
|
112
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
|
|
113
|
+
"address",
|
|
114
|
+
];
|
|
115
|
+
const parameterNames = ["marketId", "user"];
|
|
116
|
+
return (tx) => tx.moveCall({
|
|
117
|
+
package: packageAddress,
|
|
118
|
+
module: "user_account",
|
|
119
|
+
function: "has_user_account",
|
|
120
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Gets a mutable reference to a user account. WARNING: no security check, only
|
|
125
|
+
* delegate_user or cranker can access
|
|
126
|
+
*/
|
|
127
|
+
function getMutUserAccount(options) {
|
|
128
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
129
|
+
const argumentsTypes = [
|
|
130
|
+
"0x0000000000000000000000000000000000000000000000000000000000000002::object::UID",
|
|
131
|
+
"address",
|
|
132
|
+
];
|
|
133
|
+
const parameterNames = ["marketId", "user"];
|
|
134
|
+
return (tx) => tx.moveCall({
|
|
135
|
+
package: packageAddress,
|
|
136
|
+
module: "user_account",
|
|
137
|
+
function: "get_mut_user_account",
|
|
138
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
/** Checks if the sender is the owner of the user account. Abort if not owner */
|
|
142
|
+
function checkOwner(options) {
|
|
143
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
144
|
+
const argumentsTypes = [`${packageAddress}::user_account::UserAccount`];
|
|
145
|
+
const parameterNames = ["userAccount"];
|
|
146
|
+
return (tx) => tx.moveCall({
|
|
147
|
+
package: packageAddress,
|
|
148
|
+
module: "user_account",
|
|
149
|
+
function: "check_owner",
|
|
150
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
/** Adds a delegate user to a user account. WARNING: no authority check inside */
|
|
154
|
+
function addDelegateUser(options) {
|
|
155
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
156
|
+
const argumentsTypes = [`${packageAddress}::user_account::UserAccount`, "address"];
|
|
157
|
+
const parameterNames = ["userAccount", "user"];
|
|
158
|
+
return (tx) => tx.moveCall({
|
|
159
|
+
package: packageAddress,
|
|
160
|
+
module: "user_account",
|
|
161
|
+
function: "add_delegate_user",
|
|
162
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
/** Remove a delegate user from a user account. WARNING: no authority check inside */
|
|
166
|
+
function removeDelegateUser(options) {
|
|
167
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
168
|
+
const argumentsTypes = [`${packageAddress}::user_account::UserAccount`, "address"];
|
|
169
|
+
const parameterNames = ["userAccount", "user"];
|
|
170
|
+
return (tx) => tx.moveCall({
|
|
171
|
+
package: packageAddress,
|
|
172
|
+
module: "user_account",
|
|
173
|
+
function: "remove_delegate_user",
|
|
174
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/** Deposits collateral into a user account. WARNING: no authority check inside */
|
|
178
|
+
function deposit(options) {
|
|
179
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
180
|
+
const argumentsTypes = [
|
|
181
|
+
`${packageAddress}::user_account::UserAccount`,
|
|
182
|
+
`0x0000000000000000000000000000000000000000000000000000000000000002::balance::Balance<${options.typeArguments[0]}>`,
|
|
183
|
+
];
|
|
184
|
+
const parameterNames = ["userAccount", "balance"];
|
|
185
|
+
return (tx) => tx.moveCall({
|
|
186
|
+
package: packageAddress,
|
|
187
|
+
module: "user_account",
|
|
188
|
+
function: "deposit",
|
|
189
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
190
|
+
typeArguments: options.typeArguments,
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** Withdraws collateral from a user account. WARNING: no authority check inside */
|
|
194
|
+
function withdraw(options) {
|
|
195
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
196
|
+
const argumentsTypes = [
|
|
197
|
+
`${packageAddress}::user_account::UserAccount`,
|
|
198
|
+
"0x0000000000000000000000000000000000000000000000000000000000000001::option::Option<u64>",
|
|
199
|
+
`${packageAddress}::user_account::UserAccountCap`,
|
|
200
|
+
];
|
|
201
|
+
const parameterNames = ["userAccount", "amount", "userAccountCap"];
|
|
202
|
+
return (tx) => tx.moveCall({
|
|
203
|
+
package: packageAddress,
|
|
204
|
+
module: "user_account",
|
|
205
|
+
function: "withdraw",
|
|
206
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
207
|
+
typeArguments: options.typeArguments,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
/** Gets the owner of a user account from a capability. */
|
|
211
|
+
function getUserAccountOwner(options) {
|
|
212
|
+
const packageAddress = options.package ?? "@typus/perp";
|
|
213
|
+
const argumentsTypes = [`${packageAddress}::user_account::UserAccountCap`];
|
|
214
|
+
const parameterNames = ["userAccountCap"];
|
|
215
|
+
return (tx) => tx.moveCall({
|
|
216
|
+
package: packageAddress,
|
|
217
|
+
module: "user_account",
|
|
218
|
+
function: "get_user_account_owner",
|
|
219
|
+
arguments: (0, index_1.normalizeMoveArguments)(options.arguments, argumentsTypes, parameterNames),
|
|
220
|
+
});
|
|
221
|
+
}
|