@typus/typus-perp-sdk 1.0.52 → 1.0.53-upgrade

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.
Files changed (112) hide show
  1. package/dist/src/_dependencies/source/0x2/bag/structs.d.ts +61 -0
  2. package/dist/src/_dependencies/source/0x2/bag/structs.js +229 -0
  3. package/dist/src/_dependencies/source/0x2/balance/structs.d.ts +88 -0
  4. package/dist/src/_dependencies/source/0x2/balance/structs.js +386 -0
  5. package/dist/src/_dependencies/source/0x2/coin/structs.d.ts +460 -0
  6. package/dist/src/_dependencies/source/0x2/coin/structs.js +1247 -0
  7. package/dist/src/_dependencies/source/0x2/linked-table/structs.d.ts +153 -0
  8. package/dist/src/_dependencies/source/0x2/linked-table/structs.js +438 -0
  9. package/dist/src/_dependencies/source/0x2/sui/structs.d.ts +46 -0
  10. package/dist/src/_dependencies/source/0x2/sui/structs.js +222 -0
  11. package/dist/src/_dependencies/source/0x2/table/structs.d.ts +61 -0
  12. package/dist/src/_dependencies/source/0x2/table/structs.js +248 -0
  13. package/dist/src/_dependencies/source/0x2/table-vec/structs.d.ts +68 -0
  14. package/dist/src/_dependencies/source/0x2/table-vec/structs.js +274 -0
  15. package/dist/src/_dependencies/source/0x2/token/structs.d.ts +449 -0
  16. package/dist/src/_dependencies/source/0x2/token/structs.js +1095 -0
  17. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.d.ts +370 -0
  18. package/dist/src/_dependencies/source/0x2/transfer-policy/structs.js +1091 -0
  19. package/dist/src/_dependencies/source/0x2/url/structs.d.ts +53 -0
  20. package/dist/src/_dependencies/source/0x2/url/structs.js +223 -0
  21. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.d.ts +489 -0
  22. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/airdrop/structs.js +1084 -0
  23. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.d.ts +147 -0
  24. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/big-vector/structs.js +456 -0
  25. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.d.ts +239 -0
  26. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/critbit/structs.js +653 -0
  27. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.d.ts +405 -0
  28. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/ecosystem/structs.js +899 -0
  29. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.d.ts +8 -0
  30. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/index.js +11 -0
  31. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.d.ts +2 -0
  32. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/init.js +102 -0
  33. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/keyed-big-vector/structs.d.ts +70 -70
  34. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/keyed-big-vector/structs.js +174 -174
  35. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.d.ts +699 -0
  36. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/leaderboard/structs.js +1459 -0
  37. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/linked-object-table/structs.d.ts +62 -62
  38. package/dist/src/_dependencies/source/{0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277 → 0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a}/linked-object-table/structs.js +170 -170
  39. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.d.ts +147 -0
  40. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/linked-set/structs.js +430 -0
  41. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.d.ts +1071 -0
  42. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tails-staking/structs.js +2261 -0
  43. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.d.ts +279 -0
  44. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/tgld/structs.js +733 -0
  45. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.d.ts +328 -0
  46. package/dist/src/_dependencies/source/0x4b0f4ee1a40ce37ec81c987cc4e76a665419e74b863319492fc7d26f708b835a/user/structs.js +892 -0
  47. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.d.ts +88 -0
  48. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/authority/structs.js +263 -0
  49. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.d.ts +347 -0
  50. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/balance-pool/structs.js +591 -0
  51. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.d.ts +73 -0
  52. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/big-vector/structs.js +258 -0
  53. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.d.ts +876 -0
  54. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/dutch/structs.js +1721 -0
  55. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.d.ts +46 -0
  56. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/i64/structs.js +222 -0
  57. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.d.ts +3 -0
  58. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/index.js +6 -0
  59. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.d.ts +2 -0
  60. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/init.js +89 -0
  61. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.d.ts +155 -0
  62. package/dist/src/_dependencies/source/0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274/linked-list/structs.js +444 -0
  63. package/dist/src/_dependencies/source/{0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded → 0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274}/vault/structs.d.ts +84 -84
  64. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.d.ts +446 -0
  65. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/discount-mint/structs.js +844 -0
  66. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.d.ts +6 -0
  67. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/index.js +9 -0
  68. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.d.ts +2 -0
  69. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/init.js +69 -0
  70. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.d.ts +94 -0
  71. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/royalty-rule/structs.js +376 -0
  72. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.d.ts +454 -0
  73. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/staking/structs.js +881 -0
  74. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.d.ts +68 -0
  75. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/table-vec/structs.js +274 -0
  76. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.d.ts +1117 -0
  77. package/dist/src/_dependencies/source/0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196/typus-nft/structs.js +2387 -0
  78. package/dist/src/fetch.d.ts +1 -1
  79. package/dist/src/fetch.js +1 -1
  80. package/dist/src/index.js +18 -18
  81. package/dist/src/typus_perp/admin/structs.d.ts +67 -5
  82. package/dist/src/typus_perp/admin/structs.js +155 -1
  83. package/dist/src/typus_perp/escrow/functions.js +1 -1
  84. package/dist/src/typus_perp/escrow/structs.d.ts +2 -2
  85. package/dist/src/typus_perp/escrow/structs.js +1 -1
  86. package/dist/src/typus_perp/lp-pool/structs.d.ts +28 -28
  87. package/dist/src/typus_perp/position/functions.js +1 -1
  88. package/dist/src/typus_perp/position/structs.d.ts +6 -6
  89. package/dist/src/typus_perp/symbol/structs.d.ts +1 -1
  90. package/dist/src/typus_perp/tlp/structs.d.ts +2 -2
  91. package/dist/src/typus_perp/trading/functions.js +1 -1
  92. package/dist/src/typus_perp/trading/structs.d.ts +32 -32
  93. package/dist/src/typus_perp/trading/structs.js +2 -2
  94. package/dist/src/typus_perp/treasury-caps/structs.d.ts +1 -1
  95. package/dist/src/typus_stake_pool/admin/functions.d.ts +25 -25
  96. package/dist/src/typus_stake_pool/admin/functions.js +66 -53
  97. package/dist/src/typus_stake_pool/admin/structs.d.ts +191 -191
  98. package/dist/src/typus_stake_pool/admin/structs.js +179 -179
  99. package/dist/src/typus_stake_pool/stake-pool/functions.d.ts +50 -44
  100. package/dist/src/typus_stake_pool/stake-pool/functions.js +127 -88
  101. package/dist/src/typus_stake_pool/stake-pool/structs.d.ts +202 -202
  102. package/dist/src/typus_stake_pool/stake-pool/structs.js +432 -432
  103. package/dist/src/user/history.js +6 -4
  104. package/dist/src/user/order.js +34 -34
  105. package/package.json +1 -1
  106. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.d.ts +0 -8
  107. package/dist/src/_dependencies/source/0x4213e12a2220f15f1837a76897110d2260786558169bd8d0847f21e9b551f277/index.js +0 -11
  108. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.d.ts +0 -3
  109. package/dist/src/_dependencies/source/0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded/index.js +0 -6
  110. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.d.ts +0 -3
  111. package/dist/src/_dependencies/source/0x98670585b87e06628ef2d7f7cb1e7bee8ada65b43b82997935225a7e6e21d18e/index.js +0 -6
  112. /package/dist/src/_dependencies/source/{0x908a10789a1a6953e0b73a997c10e3552f7ce4e2907afd00a334ed74bd973ded → 0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274}/vault/structs.js +0 -0
@@ -0,0 +1,6 @@
1
+ export declare const PACKAGE_ID = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196";
2
+ export declare const PUBLISHED_AT = "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3";
3
+ export declare const PKG_V17 = "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3";
4
+ export declare const PKG_V8 = "0x1abc57354a357ac988e81d60b76ce5bf0322605d666aec701d40291952150082";
5
+ export declare const PKG_V1 = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196";
6
+ export declare const PKG_V6 = "0xe227fb985a005a4e6e87856f59862ba0e0337b7fe6d587cab588c8436ba05743";
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PKG_V6 = exports.PKG_V1 = exports.PKG_V8 = exports.PKG_V17 = exports.PUBLISHED_AT = exports.PACKAGE_ID = void 0;
4
+ exports.PACKAGE_ID = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196";
5
+ exports.PUBLISHED_AT = "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3";
6
+ exports.PKG_V17 = "0x153ead7b2ccad1483458d41f0daffa35965d89960d1024a4883ba52fb18332b3";
7
+ exports.PKG_V8 = "0x1abc57354a357ac988e81d60b76ce5bf0322605d666aec701d40291952150082";
8
+ exports.PKG_V1 = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196";
9
+ exports.PKG_V6 = "0xe227fb985a005a4e6e87856f59862ba0e0337b7fe6d587cab588c8436ba05743";
@@ -0,0 +1,2 @@
1
+ import { StructClassLoader } from "../../../_framework/loader";
2
+ export declare function registerClasses(loader: StructClassLoader): void;
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.registerClasses = registerClasses;
37
+ var discountMint = __importStar(require("./discount-mint/structs"));
38
+ var royaltyRule = __importStar(require("./royalty-rule/structs"));
39
+ var staking = __importStar(require("./staking/structs"));
40
+ var tableVec = __importStar(require("./table-vec/structs"));
41
+ var typusNft = __importStar(require("./typus-nft/structs"));
42
+ function registerClasses(loader) {
43
+ loader.register(discountMint.DiscountEventV3);
44
+ loader.register(discountMint.MintRequest);
45
+ loader.register(discountMint.MintRequestEvent);
46
+ loader.register(discountMint.Pool);
47
+ loader.register(royaltyRule.Config);
48
+ loader.register(royaltyRule.Rule);
49
+ loader.register(staking.LevelUpEvent);
50
+ loader.register(staking.ManagerCap);
51
+ loader.register(staking.NftExtension);
52
+ loader.register(staking.Registry);
53
+ loader.register(staking.StakingTails);
54
+ loader.register(tableVec.TableVec);
55
+ loader.register(typusNft.ExpDownEvent);
56
+ loader.register(typusNft.ExpUpEvent);
57
+ loader.register(typusNft.FirstBidEvent);
58
+ loader.register(typusNft.FirstDepositEvent);
59
+ loader.register(typusNft.LevelUpEvent);
60
+ loader.register(typusNft.ManagerCap);
61
+ loader.register(typusNft.MintEvent);
62
+ loader.register(typusNft.NewManagerCapEvent);
63
+ loader.register(typusNft.Pool);
64
+ loader.register(typusNft.Royalty);
65
+ loader.register(typusNft.RoyaltyUpdateEvent);
66
+ loader.register(typusNft.TYPUS_NFT);
67
+ loader.register(typusNft.Tails);
68
+ loader.register(typusNft.Whitelist);
69
+ }
@@ -0,0 +1,94 @@
1
+ import { PhantomReified, Reified, StructClass, ToField, ToTypeStr } from "../../../../_framework/reified";
2
+ import { FieldsWithTypes } from "../../../../_framework/util";
3
+ import { PKG_V1 } from "../index";
4
+ import { SuiClient, SuiObjectData, SuiParsedData } from "@mysten/sui/client";
5
+ export declare function isConfig(type: string): boolean;
6
+ export interface ConfigFields {
7
+ amountBp: ToField<"u16">;
8
+ minAmount: ToField<"u64">;
9
+ }
10
+ export type ConfigReified = Reified<Config, ConfigFields>;
11
+ export declare class Config implements StructClass {
12
+ __StructClass: true;
13
+ static readonly $typeName = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Config";
14
+ static readonly $numTypeParams = 0;
15
+ static readonly $isPhantom: readonly [];
16
+ readonly $typeName = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Config";
17
+ readonly $fullTypeName: `${typeof PKG_V1}::royalty_rule::Config`;
18
+ readonly $typeArgs: [];
19
+ readonly $isPhantom: readonly [];
20
+ readonly amountBp: ToField<"u16">;
21
+ readonly minAmount: ToField<"u64">;
22
+ private constructor();
23
+ static reified(): ConfigReified;
24
+ static get r(): import("../../../../_framework/reified").StructClassReified<Config, ConfigFields>;
25
+ static phantom(): PhantomReified<ToTypeStr<Config>>;
26
+ static get p(): PhantomReified<"0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Config">;
27
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
28
+ amount_bp: number;
29
+ min_amount: string;
30
+ }, {
31
+ amount_bp: number;
32
+ min_amount: string | number | bigint;
33
+ }>;
34
+ static fromFields(fields: Record<string, any>): Config;
35
+ static fromFieldsWithTypes(item: FieldsWithTypes): Config;
36
+ static fromBcs(data: Uint8Array): Config;
37
+ toJSONField(): {
38
+ amountBp: number;
39
+ minAmount: string;
40
+ };
41
+ toJSON(): {
42
+ amountBp: number;
43
+ minAmount: string;
44
+ $typeName: string;
45
+ $typeArgs: [];
46
+ };
47
+ static fromJSONField(field: any): Config;
48
+ static fromJSON(json: Record<string, any>): Config;
49
+ static fromSuiParsedData(content: SuiParsedData): Config;
50
+ static fromSuiObjectData(data: SuiObjectData): Config;
51
+ static fetch(client: SuiClient, id: string): Promise<Config>;
52
+ }
53
+ export declare function isRule(type: string): boolean;
54
+ export interface RuleFields {
55
+ dummyField: ToField<"bool">;
56
+ }
57
+ export type RuleReified = Reified<Rule, RuleFields>;
58
+ export declare class Rule implements StructClass {
59
+ __StructClass: true;
60
+ static readonly $typeName = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Rule";
61
+ static readonly $numTypeParams = 0;
62
+ static readonly $isPhantom: readonly [];
63
+ readonly $typeName = "0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Rule";
64
+ readonly $fullTypeName: `${typeof PKG_V1}::royalty_rule::Rule`;
65
+ readonly $typeArgs: [];
66
+ readonly $isPhantom: readonly [];
67
+ readonly dummyField: ToField<"bool">;
68
+ private constructor();
69
+ static reified(): RuleReified;
70
+ static get r(): import("../../../../_framework/reified").StructClassReified<Rule, RuleFields>;
71
+ static phantom(): PhantomReified<ToTypeStr<Rule>>;
72
+ static get p(): PhantomReified<"0xbd147bc7f12f38f175d78947a61364e8e077b9b188b00e7094bc0c3623162196::royalty_rule::Rule">;
73
+ static get bcs(): import("@mysten/sui/bcs").BcsType<{
74
+ dummy_field: boolean;
75
+ }, {
76
+ dummy_field: boolean;
77
+ }>;
78
+ static fromFields(fields: Record<string, any>): Rule;
79
+ static fromFieldsWithTypes(item: FieldsWithTypes): Rule;
80
+ static fromBcs(data: Uint8Array): Rule;
81
+ toJSONField(): {
82
+ dummyField: boolean;
83
+ };
84
+ toJSON(): {
85
+ dummyField: boolean;
86
+ $typeName: string;
87
+ $typeArgs: [];
88
+ };
89
+ static fromJSONField(field: any): Rule;
90
+ static fromJSON(json: Record<string, any>): Rule;
91
+ static fromSuiParsedData(content: SuiParsedData): Rule;
92
+ static fromSuiObjectData(data: SuiObjectData): Rule;
93
+ static fetch(client: SuiClient, id: string): Promise<Rule>;
94
+ }
@@ -0,0 +1,376 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
14
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
15
+ return new (P || (P = Promise))(function (resolve, reject) {
16
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
17
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
18
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
19
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
20
+ });
21
+ };
22
+ var __generator = (this && this.__generator) || function (thisArg, body) {
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
+ function verb(n) { return function (v) { return step([n, v]); }; }
26
+ function step(op) {
27
+ if (f) throw new TypeError("Generator is already executing.");
28
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
29
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
30
+ if (y = 0, t) op = [op[0] & 2, t.value];
31
+ switch (op[0]) {
32
+ case 0: case 1: t = op; break;
33
+ case 4: _.label++; return { value: op[1], done: false };
34
+ case 5: _.label++; y = op[1]; op = [0]; continue;
35
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
36
+ default:
37
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
38
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
39
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
40
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
41
+ if (t[2]) _.ops.pop();
42
+ _.trys.pop(); continue;
43
+ }
44
+ op = body.call(thisArg, _);
45
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
46
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
47
+ }
48
+ };
49
+ var __read = (this && this.__read) || function (o, n) {
50
+ var m = typeof Symbol === "function" && o[Symbol.iterator];
51
+ if (!m) return o;
52
+ var i = m.call(o), r, ar = [], e;
53
+ try {
54
+ while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
55
+ }
56
+ catch (error) { e = { error: error }; }
57
+ finally {
58
+ try {
59
+ if (r && !r.done && (m = i["return"])) m.call(i);
60
+ }
61
+ finally { if (e) throw e.error; }
62
+ }
63
+ return ar;
64
+ };
65
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
66
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
67
+ if (ar || !(i in from)) {
68
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
69
+ ar[i] = from[i];
70
+ }
71
+ }
72
+ return to.concat(ar || Array.prototype.slice.call(from));
73
+ };
74
+ Object.defineProperty(exports, "__esModule", { value: true });
75
+ exports.Rule = exports.Config = void 0;
76
+ exports.isConfig = isConfig;
77
+ exports.isRule = isRule;
78
+ var reified_1 = require("../../../../_framework/reified");
79
+ var util_1 = require("../../../../_framework/util");
80
+ var index_1 = require("../index");
81
+ var bcs_1 = require("@mysten/sui/bcs");
82
+ var utils_1 = require("@mysten/sui/utils");
83
+ /* ============================== Config =============================== */
84
+ function isConfig(type) {
85
+ type = (0, util_1.compressSuiType)(type);
86
+ return type === "".concat(index_1.PKG_V1, "::royalty_rule::Config");
87
+ }
88
+ var Config = /** @class */ (function () {
89
+ function Config(typeArgs, fields) {
90
+ this.__StructClass = true;
91
+ this.$typeName = Config.$typeName;
92
+ this.$isPhantom = Config.$isPhantom;
93
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], __read(typeArgs), false));
94
+ this.$typeArgs = typeArgs;
95
+ this.amountBp = fields.amountBp;
96
+ this.minAmount = fields.minAmount;
97
+ }
98
+ Config.reified = function () {
99
+ var _this = this;
100
+ return {
101
+ typeName: Config.$typeName,
102
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Config.$typeName], [], false)),
103
+ typeArgs: [],
104
+ isPhantom: Config.$isPhantom,
105
+ reifiedTypeArgs: [],
106
+ fromFields: function (fields) { return Config.fromFields(fields); },
107
+ fromFieldsWithTypes: function (item) { return Config.fromFieldsWithTypes(item); },
108
+ fromBcs: function (data) { return Config.fromBcs(data); },
109
+ bcs: Config.bcs,
110
+ fromJSONField: function (field) { return Config.fromJSONField(field); },
111
+ fromJSON: function (json) { return Config.fromJSON(json); },
112
+ fromSuiParsedData: function (content) { return Config.fromSuiParsedData(content); },
113
+ fromSuiObjectData: function (content) { return Config.fromSuiObjectData(content); },
114
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
115
+ return [2 /*return*/, Config.fetch(client, id)];
116
+ }); }); },
117
+ new: function (fields) {
118
+ return new Config([], fields);
119
+ },
120
+ kind: "StructClassReified",
121
+ };
122
+ };
123
+ Object.defineProperty(Config, "r", {
124
+ get: function () {
125
+ return Config.reified();
126
+ },
127
+ enumerable: false,
128
+ configurable: true
129
+ });
130
+ Config.phantom = function () {
131
+ return (0, reified_1.phantom)(Config.reified());
132
+ };
133
+ Object.defineProperty(Config, "p", {
134
+ get: function () {
135
+ return Config.phantom();
136
+ },
137
+ enumerable: false,
138
+ configurable: true
139
+ });
140
+ Object.defineProperty(Config, "bcs", {
141
+ get: function () {
142
+ return bcs_1.bcs.struct("Config", {
143
+ amount_bp: bcs_1.bcs.u16(),
144
+ min_amount: bcs_1.bcs.u64(),
145
+ });
146
+ },
147
+ enumerable: false,
148
+ configurable: true
149
+ });
150
+ Config.fromFields = function (fields) {
151
+ return Config.reified().new({
152
+ amountBp: (0, reified_1.decodeFromFields)("u16", fields.amount_bp),
153
+ minAmount: (0, reified_1.decodeFromFields)("u64", fields.min_amount),
154
+ });
155
+ };
156
+ Config.fromFieldsWithTypes = function (item) {
157
+ if (!isConfig(item.type)) {
158
+ throw new Error("not a Config type");
159
+ }
160
+ return Config.reified().new({
161
+ amountBp: (0, reified_1.decodeFromFieldsWithTypes)("u16", item.fields.amount_bp),
162
+ minAmount: (0, reified_1.decodeFromFieldsWithTypes)("u64", item.fields.min_amount),
163
+ });
164
+ };
165
+ Config.fromBcs = function (data) {
166
+ return Config.fromFields(Config.bcs.parse(data));
167
+ };
168
+ Config.prototype.toJSONField = function () {
169
+ return {
170
+ amountBp: this.amountBp,
171
+ minAmount: this.minAmount.toString(),
172
+ };
173
+ };
174
+ Config.prototype.toJSON = function () {
175
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
176
+ };
177
+ Config.fromJSONField = function (field) {
178
+ return Config.reified().new({
179
+ amountBp: (0, reified_1.decodeFromJSONField)("u16", field.amountBp),
180
+ minAmount: (0, reified_1.decodeFromJSONField)("u64", field.minAmount),
181
+ });
182
+ };
183
+ Config.fromJSON = function (json) {
184
+ if (json.$typeName !== Config.$typeName) {
185
+ throw new Error("not a WithTwoGenerics json object");
186
+ }
187
+ return Config.fromJSONField(json);
188
+ };
189
+ Config.fromSuiParsedData = function (content) {
190
+ if (content.dataType !== "moveObject") {
191
+ throw new Error("not an object");
192
+ }
193
+ if (!isConfig(content.type)) {
194
+ throw new Error("object at ".concat(content.fields.id, " is not a Config object"));
195
+ }
196
+ return Config.fromFieldsWithTypes(content);
197
+ };
198
+ Config.fromSuiObjectData = function (data) {
199
+ if (data.bcs) {
200
+ if (data.bcs.dataType !== "moveObject" || !isConfig(data.bcs.type)) {
201
+ throw new Error("object at is not a Config object");
202
+ }
203
+ return Config.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
204
+ }
205
+ if (data.content) {
206
+ return Config.fromSuiParsedData(data.content);
207
+ }
208
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
209
+ };
210
+ Config.fetch = function (client, id) {
211
+ return __awaiter(this, void 0, void 0, function () {
212
+ var res;
213
+ var _a, _b;
214
+ return __generator(this, function (_c) {
215
+ switch (_c.label) {
216
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
217
+ case 1:
218
+ res = _c.sent();
219
+ if (res.error) {
220
+ throw new Error("error fetching Config object at id ".concat(id, ": ").concat(res.error.code));
221
+ }
222
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isConfig(res.data.bcs.type)) {
223
+ throw new Error("object at id ".concat(id, " is not a Config object"));
224
+ }
225
+ return [2 /*return*/, Config.fromSuiObjectData(res.data)];
226
+ }
227
+ });
228
+ });
229
+ };
230
+ Config.$typeName = "".concat(index_1.PKG_V1, "::royalty_rule::Config");
231
+ Config.$numTypeParams = 0;
232
+ Config.$isPhantom = [];
233
+ return Config;
234
+ }());
235
+ exports.Config = Config;
236
+ /* ============================== Rule =============================== */
237
+ function isRule(type) {
238
+ type = (0, util_1.compressSuiType)(type);
239
+ return type === "".concat(index_1.PKG_V1, "::royalty_rule::Rule");
240
+ }
241
+ var Rule = /** @class */ (function () {
242
+ function Rule(typeArgs, fields) {
243
+ this.__StructClass = true;
244
+ this.$typeName = Rule.$typeName;
245
+ this.$isPhantom = Rule.$isPhantom;
246
+ this.$fullTypeName = util_1.composeSuiType.apply(void 0, __spreadArray([Rule.$typeName], __read(typeArgs), false));
247
+ this.$typeArgs = typeArgs;
248
+ this.dummyField = fields.dummyField;
249
+ }
250
+ Rule.reified = function () {
251
+ var _this = this;
252
+ return {
253
+ typeName: Rule.$typeName,
254
+ fullTypeName: util_1.composeSuiType.apply(void 0, __spreadArray([Rule.$typeName], [], false)),
255
+ typeArgs: [],
256
+ isPhantom: Rule.$isPhantom,
257
+ reifiedTypeArgs: [],
258
+ fromFields: function (fields) { return Rule.fromFields(fields); },
259
+ fromFieldsWithTypes: function (item) { return Rule.fromFieldsWithTypes(item); },
260
+ fromBcs: function (data) { return Rule.fromBcs(data); },
261
+ bcs: Rule.bcs,
262
+ fromJSONField: function (field) { return Rule.fromJSONField(field); },
263
+ fromJSON: function (json) { return Rule.fromJSON(json); },
264
+ fromSuiParsedData: function (content) { return Rule.fromSuiParsedData(content); },
265
+ fromSuiObjectData: function (content) { return Rule.fromSuiObjectData(content); },
266
+ fetch: function (client, id) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {
267
+ return [2 /*return*/, Rule.fetch(client, id)];
268
+ }); }); },
269
+ new: function (fields) {
270
+ return new Rule([], fields);
271
+ },
272
+ kind: "StructClassReified",
273
+ };
274
+ };
275
+ Object.defineProperty(Rule, "r", {
276
+ get: function () {
277
+ return Rule.reified();
278
+ },
279
+ enumerable: false,
280
+ configurable: true
281
+ });
282
+ Rule.phantom = function () {
283
+ return (0, reified_1.phantom)(Rule.reified());
284
+ };
285
+ Object.defineProperty(Rule, "p", {
286
+ get: function () {
287
+ return Rule.phantom();
288
+ },
289
+ enumerable: false,
290
+ configurable: true
291
+ });
292
+ Object.defineProperty(Rule, "bcs", {
293
+ get: function () {
294
+ return bcs_1.bcs.struct("Rule", {
295
+ dummy_field: bcs_1.bcs.bool(),
296
+ });
297
+ },
298
+ enumerable: false,
299
+ configurable: true
300
+ });
301
+ Rule.fromFields = function (fields) {
302
+ return Rule.reified().new({ dummyField: (0, reified_1.decodeFromFields)("bool", fields.dummy_field) });
303
+ };
304
+ Rule.fromFieldsWithTypes = function (item) {
305
+ if (!isRule(item.type)) {
306
+ throw new Error("not a Rule type");
307
+ }
308
+ return Rule.reified().new({ dummyField: (0, reified_1.decodeFromFieldsWithTypes)("bool", item.fields.dummy_field) });
309
+ };
310
+ Rule.fromBcs = function (data) {
311
+ return Rule.fromFields(Rule.bcs.parse(data));
312
+ };
313
+ Rule.prototype.toJSONField = function () {
314
+ return {
315
+ dummyField: this.dummyField,
316
+ };
317
+ };
318
+ Rule.prototype.toJSON = function () {
319
+ return __assign({ $typeName: this.$typeName, $typeArgs: this.$typeArgs }, this.toJSONField());
320
+ };
321
+ Rule.fromJSONField = function (field) {
322
+ return Rule.reified().new({ dummyField: (0, reified_1.decodeFromJSONField)("bool", field.dummyField) });
323
+ };
324
+ Rule.fromJSON = function (json) {
325
+ if (json.$typeName !== Rule.$typeName) {
326
+ throw new Error("not a WithTwoGenerics json object");
327
+ }
328
+ return Rule.fromJSONField(json);
329
+ };
330
+ Rule.fromSuiParsedData = function (content) {
331
+ if (content.dataType !== "moveObject") {
332
+ throw new Error("not an object");
333
+ }
334
+ if (!isRule(content.type)) {
335
+ throw new Error("object at ".concat(content.fields.id, " is not a Rule object"));
336
+ }
337
+ return Rule.fromFieldsWithTypes(content);
338
+ };
339
+ Rule.fromSuiObjectData = function (data) {
340
+ if (data.bcs) {
341
+ if (data.bcs.dataType !== "moveObject" || !isRule(data.bcs.type)) {
342
+ throw new Error("object at is not a Rule object");
343
+ }
344
+ return Rule.fromBcs((0, utils_1.fromB64)(data.bcs.bcsBytes));
345
+ }
346
+ if (data.content) {
347
+ return Rule.fromSuiParsedData(data.content);
348
+ }
349
+ throw new Error("Both `bcs` and `content` fields are missing from the data. Include `showBcs` or `showContent` in the request.");
350
+ };
351
+ Rule.fetch = function (client, id) {
352
+ return __awaiter(this, void 0, void 0, function () {
353
+ var res;
354
+ var _a, _b;
355
+ return __generator(this, function (_c) {
356
+ switch (_c.label) {
357
+ case 0: return [4 /*yield*/, client.getObject({ id: id, options: { showBcs: true } })];
358
+ case 1:
359
+ res = _c.sent();
360
+ if (res.error) {
361
+ throw new Error("error fetching Rule object at id ".concat(id, ": ").concat(res.error.code));
362
+ }
363
+ if (((_b = (_a = res.data) === null || _a === void 0 ? void 0 : _a.bcs) === null || _b === void 0 ? void 0 : _b.dataType) !== "moveObject" || !isRule(res.data.bcs.type)) {
364
+ throw new Error("object at id ".concat(id, " is not a Rule object"));
365
+ }
366
+ return [2 /*return*/, Rule.fromSuiObjectData(res.data)];
367
+ }
368
+ });
369
+ });
370
+ };
371
+ Rule.$typeName = "".concat(index_1.PKG_V1, "::royalty_rule::Rule");
372
+ Rule.$numTypeParams = 0;
373
+ Rule.$isPhantom = [];
374
+ return Rule;
375
+ }());
376
+ exports.Rule = Rule;