@haneullabs/haneulns 1.0.3 → 1.2.5

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 (115) hide show
  1. package/CHANGELOG.md +108 -0
  2. package/dist/constants.d.mts.map +1 -1
  3. package/dist/constants.mjs +20 -20
  4. package/dist/constants.mjs.map +1 -1
  5. package/dist/contracts/haneulns/controller.mjs +11 -4
  6. package/dist/contracts/haneulns/controller.mjs.map +1 -1
  7. package/dist/contracts/haneulns/deps/haneul/balance.mjs +2 -13
  8. package/dist/contracts/haneulns/deps/haneul/balance.mjs.map +1 -1
  9. package/dist/contracts/haneulns/deps/haneul/vec_map.mjs +1 -2
  10. package/dist/contracts/haneulns/deps/haneul/vec_map.mjs.map +1 -1
  11. package/dist/contracts/haneulns/deps/std/type_name.mjs +13 -10
  12. package/dist/contracts/haneulns/deps/std/type_name.mjs.map +1 -1
  13. package/dist/contracts/haneulns/domain.mjs +11 -16
  14. package/dist/contracts/haneulns/domain.mjs.map +1 -1
  15. package/dist/contracts/haneulns/haneulns.mjs +11 -8
  16. package/dist/contracts/haneulns/haneulns.mjs.map +1 -1
  17. package/dist/contracts/haneulns/name_record.mjs +14 -13
  18. package/dist/contracts/haneulns/name_record.mjs.map +1 -1
  19. package/dist/contracts/haneulns/payment.mjs +16 -17
  20. package/dist/contracts/haneulns/payment.mjs.map +1 -1
  21. package/dist/contracts/haneulns/pricing_config.mjs +1 -2
  22. package/dist/contracts/haneulns/pricing_config.mjs.map +1 -1
  23. package/dist/contracts/haneulns_coupons/coupon_house.mjs +4 -5
  24. package/dist/contracts/haneulns_coupons/coupon_house.mjs.map +1 -1
  25. package/dist/contracts/haneulns_coupons/data.mjs +2 -8
  26. package/dist/contracts/haneulns_coupons/data.mjs.map +1 -1
  27. package/dist/contracts/haneulns_coupons/deps/haneul/bag.mjs +4 -32
  28. package/dist/contracts/haneulns_coupons/deps/haneul/bag.mjs.map +1 -1
  29. package/dist/contracts/haneulns_discounts/deps/haneul/linked_table.mjs +5 -2
  30. package/dist/contracts/haneulns_discounts/deps/haneul/linked_table.mjs.map +1 -1
  31. package/dist/contracts/haneulns_discounts/deps/haneulns/pricing_config.mjs +2 -8
  32. package/dist/contracts/haneulns_discounts/deps/haneulns/pricing_config.mjs.map +1 -1
  33. package/dist/contracts/haneulns_discounts/discounts.mjs +3 -4
  34. package/dist/contracts/haneulns_discounts/discounts.mjs.map +1 -1
  35. package/dist/contracts/haneulns_discounts/free_claims.mjs +4 -5
  36. package/dist/contracts/haneulns_discounts/free_claims.mjs.map +1 -1
  37. package/dist/contracts/haneulns_payments/deps/haneul/vec_map.mjs +1 -2
  38. package/dist/contracts/haneulns_payments/deps/haneul/vec_map.mjs.map +1 -1
  39. package/dist/contracts/haneulns_payments/deps/std/type_name.mjs +13 -10
  40. package/dist/contracts/haneulns_payments/deps/std/type_name.mjs.map +1 -1
  41. package/dist/contracts/haneulns_payments/payments.mjs +4 -3
  42. package/dist/contracts/haneulns_payments/payments.mjs.map +1 -1
  43. package/dist/contracts/pyth/data_source.mjs +2 -8
  44. package/dist/contracts/pyth/data_source.mjs.map +1 -1
  45. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +2 -8
  46. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -1
  47. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +2 -8
  48. package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -1
  49. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs +2 -8
  50. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs.map +1 -1
  51. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs +2 -8
  52. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs.map +1 -1
  53. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs +2 -8
  54. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs.map +1 -1
  55. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs +2 -8
  56. package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs.map +1 -1
  57. package/dist/contracts/pyth/state.mjs +2 -8
  58. package/dist/contracts/pyth/state.mjs.map +1 -1
  59. package/dist/contracts/utils/index.mjs +97 -12
  60. package/dist/contracts/utils/index.mjs.map +1 -1
  61. package/dist/contracts/wormhole/bytes32.mjs +2 -8
  62. package/dist/contracts/wormhole/bytes32.mjs.map +1 -1
  63. package/dist/contracts/wormhole/consumed_vaas.mjs +2 -8
  64. package/dist/contracts/wormhole/consumed_vaas.mjs.map +1 -1
  65. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +2 -8
  66. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -1
  67. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +2 -8
  68. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -1
  69. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +2 -8
  70. package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -1
  71. package/dist/contracts/wormhole/external_address.mjs +2 -8
  72. package/dist/contracts/wormhole/external_address.mjs.map +1 -1
  73. package/dist/contracts/wormhole/fee_collector.mjs +2 -8
  74. package/dist/contracts/wormhole/fee_collector.mjs.map +1 -1
  75. package/dist/contracts/wormhole/set.mjs +2 -8
  76. package/dist/contracts/wormhole/set.mjs.map +1 -1
  77. package/dist/contracts/wormhole/state.mjs +2 -8
  78. package/dist/contracts/wormhole/state.mjs.map +1 -1
  79. package/dist/haneulns-client.d.mts.map +1 -1
  80. package/dist/haneulns-client.mjs +1 -2
  81. package/dist/haneulns-client.mjs.map +1 -1
  82. package/dist/haneulns-transaction.d.mts +1 -2
  83. package/dist/haneulns-transaction.d.mts.map +1 -1
  84. package/dist/haneulns-transaction.mjs +1 -2
  85. package/dist/haneulns-transaction.mjs.map +1 -1
  86. package/dist/helpers.d.mts.map +1 -1
  87. package/dist/helpers.mjs +1 -2
  88. package/dist/helpers.mjs.map +1 -1
  89. package/dist/index.mjs +1 -2
  90. package/dist/pyth/PriceServiceConnection.mjs +1 -2
  91. package/dist/pyth/PriceServiceConnection.mjs.map +1 -1
  92. package/dist/pyth/pyth-helpers.mjs +1 -1
  93. package/dist/pyth/pyth-helpers.mjs.map +1 -1
  94. package/dist/pyth/pyth.mjs +8 -6
  95. package/dist/pyth/pyth.mjs.map +1 -1
  96. package/dist/types.d.mts.map +1 -1
  97. package/package.json +8 -9
  98. package/src/constants.ts +19 -19
  99. package/src/contracts/haneulns/admin.ts +2 -2
  100. package/src/contracts/haneulns/config.ts +18 -18
  101. package/src/contracts/haneulns/controller.ts +95 -1
  102. package/src/contracts/haneulns/core_config.ts +19 -19
  103. package/src/contracts/haneulns/domain.ts +18 -20
  104. package/src/contracts/haneulns/haneulns.ts +5 -5
  105. package/src/contracts/haneulns/name_record.ts +22 -27
  106. package/src/contracts/haneulns/payment.ts +23 -23
  107. package/src/contracts/haneulns/pricing_config.ts +16 -16
  108. package/src/contracts/haneulns/registry.ts +53 -67
  109. package/src/contracts/haneulns_coupons/coupon_house.ts +13 -13
  110. package/src/contracts/haneulns_coupons/range.ts +7 -7
  111. package/src/contracts/haneulns_coupons/rules.ts +27 -27
  112. package/src/contracts/haneulns_discounts/discounts.ts +7 -7
  113. package/src/contracts/haneulns_discounts/free_claims.ts +7 -7
  114. package/src/contracts/haneulns_payments/payments.ts +13 -13
  115. package/src/contracts/utils/index.ts +185 -24
@@ -1,43 +1,15 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/haneulns_coupons/deps/haneul/bag.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- /**
9
- * A bag is a heterogeneous map-like collection. The collection is similar to
10
- * `haneul::table` in that its keys and values are not stored within the `Bag` value,
11
- * but instead are stored using Haneul's object system. The `Bag` struct acts only as
12
- * a handle into the object system to retrieve those keys and values. Note that
13
- * this means that `Bag` values with exactly the same key-value mapping will not be
14
- * equal, with `==`, at runtime. For example
15
- *
16
- * ```
17
- * let bag1 = bag::new();
18
- * let bag2 = bag::new();
19
- * bag::add(&mut bag1, 0, false);
20
- * bag::add(&mut bag1, 1, true);
21
- * bag::add(&mut bag2, 0, false);
22
- * bag::add(&mut bag2, 1, true);
23
- * // bag1 does not equal bag2, despite having the same entries
24
- * assert!(&bag1 != &bag2);
25
- * ```
26
- *
27
- * At it's core, `haneul::bag` is a wrapper around `UID` that allows for access to
28
- * `haneul::dynamic_field` while preventing accidentally stranding field values. A
29
- * `UID` can be deleted, even if it has dynamic fields associated with it, but a
30
- * bag, on the other hand, must be empty to be destroyed.
31
- */
32
- const $moduleName = "0x2::bag";
33
3
  const Bag = new MoveStruct({
34
- name: `${$moduleName}::Bag`,
4
+ name: `0x2::bag::Bag`,
35
5
  fields: {
6
+ /** the ID of this bag */
36
7
  id: bcs.Address,
8
+ /** the number of key-value pairs in the bag */
37
9
  size: bcs.u64()
38
10
  }
39
11
  });
40
-
41
12
  //#endregion
42
13
  export { Bag };
14
+
43
15
  //# sourceMappingURL=bag.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bag.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_coupons/deps/haneul/bag.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A bag is a heterogeneous map-like collection. The collection is similar to\n * `haneul::table` in that its keys and values are not stored within the `Bag` value,\n * but instead are stored using Haneul's object system. The `Bag` struct acts only as\n * a handle into the object system to retrieve those keys and values. Note that\n * this means that `Bag` values with exactly the same key-value mapping will not be\n * equal, with `==`, at runtime. For example\n *\n * ```\n * let bag1 = bag::new();\n * let bag2 = bag::new();\n * bag::add(&mut bag1, 0, false);\n * bag::add(&mut bag1, 1, true);\n * bag::add(&mut bag2, 0, false);\n * bag::add(&mut bag2, 1, true);\n * // bag1 does not equal bag2, despite having the same entries\n * assert!(&bag1 != &bag2);\n * ```\n *\n * At it's core, `haneul::bag` is a wrapper around `UID` that allows for access to\n * `haneul::dynamic_field` while preventing accidentally stranding field values. A\n * `UID` can be deleted, even if it has dynamic fields associated with it, but a\n * bag, on the other hand, must be empty to be destroyed.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::bag';\nexport const Bag = new MoveStruct({\n\tname: `${$moduleName}::Bag`,\n\tfields: {\n\t\t/** the ID of this bag */\n\t\tid: bcs.Address,\n\t\t/** the number of key-value pairs in the bag */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BA,MAAM,cAAc;AACpB,MAAa,MAAM,IAAI,WAAW;CACjC,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,IAAI,IAAI;EAER,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}
1
+ {"version":3,"file":"bag.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_coupons/deps/haneul/bag.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A bag is a heterogeneous map-like collection. The collection is similar to\n * `haneul::table` in that its keys and values are not stored within the `Bag` value,\n * but instead are stored using Haneul's object system. The `Bag` struct acts only as\n * a handle into the object system to retrieve those keys and values. Note that\n * this means that `Bag` values with exactly the same key-value mapping will not be\n * equal, with `==`, at runtime. For example\n *\n * ```\n * let bag1 = bag::new();\n * let bag2 = bag::new();\n * bag::add(&mut bag1, 0, false);\n * bag::add(&mut bag1, 1, true);\n * bag::add(&mut bag2, 0, false);\n * bag::add(&mut bag2, 1, true);\n * // bag1 does not equal bag2, despite having the same entries\n * assert!(&bag1 != &bag2);\n * ```\n *\n * At it's core, `haneul::bag` is a wrapper around `UID` that allows for access to\n * `haneul::dynamic_field` while preventing accidentally stranding field values. A\n * `UID` can be deleted, even if it has dynamic fields associated with it, but a\n * bag, on the other hand, must be empty to be destroyed.\n */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::bag';\nexport const Bag = new MoveStruct({\n\tname: `${$moduleName}::Bag`,\n\tfields: {\n\t\t/** the ID of this bag */\n\t\tid: bcs.Address,\n\t\t/** the number of key-value pairs in the bag */\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;AAgCA,MAAa,MAAM,IAAI,WAAW;CACjC,MAAM;CACN,QAAQ;;EAEP,IAAI,IAAI;;EAER,MAAM,IAAI,IAAI;CACf;AACD,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
3
  //#region src/contracts/haneulns_discounts/deps/haneul/linked_table.ts
5
4
  /**************************************************************
6
5
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
@@ -14,14 +13,18 @@ function LinkedTable(...typeParameters) {
14
13
  return new MoveStruct({
15
14
  name: `${$moduleName}::LinkedTable<${typeParameters[0].name}, phantom V>`,
16
15
  fields: {
16
+ /** the ID of this table */
17
17
  id: bcs.Address,
18
+ /** the number of key-value pairs in the table */
18
19
  size: bcs.u64(),
20
+ /** the front of the table, i.e. the key of the first entry */
19
21
  head: bcs.option(typeParameters[0]),
22
+ /** the back of the table, i.e. the key of the last entry */
20
23
  tail: bcs.option(typeParameters[0])
21
24
  }
22
25
  });
23
26
  }
24
-
25
27
  //#endregion
26
28
  export { LinkedTable };
29
+
27
30
  //# sourceMappingURL=linked_table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"linked_table.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_discounts/deps/haneul/linked_table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Similar to `haneul::table` but the values are linked together, allowing for ordered\n * insertion and removal\n */\n\nimport { type BcsType, bcs } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::linked_table';\nexport function LinkedTable<K extends BcsType<any>>(...typeParameters: [K]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::LinkedTable<${typeParameters[0].name as K['name']}, phantom V>`,\n\t\tfields: {\n\t\t\t/** the ID of this table */\n\t\t\tid: bcs.Address,\n\t\t\t/** the number of key-value pairs in the table */\n\t\t\tsize: bcs.u64(),\n\t\t\t/** the front of the table, i.e. the key of the first entry */\n\t\t\thead: bcs.option(typeParameters[0]),\n\t\t\t/** the back of the table, i.e. the key of the last entry */\n\t\t\ttail: bcs.option(typeParameters[0]),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;;AAWA,MAAM,cAAc;AACpB,SAAgB,YAAoC,GAAG,gBAAqB;AAC3E,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,gBAAgB,eAAe,GAAG,KAAkB;EACzE,QAAQ;GAEP,IAAI,IAAI;GAER,MAAM,IAAI,KAAK;GAEf,MAAM,IAAI,OAAO,eAAe,GAAG;GAEnC,MAAM,IAAI,OAAO,eAAe,GAAG;GACnC;EACD,CAAC"}
1
+ {"version":3,"file":"linked_table.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_discounts/deps/haneul/linked_table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * Similar to `haneul::table` but the values are linked together, allowing for ordered\n * insertion and removal\n */\n\nimport { type BcsType, bcs } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::linked_table';\nexport function LinkedTable<K extends BcsType<any>>(...typeParameters: [K]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::LinkedTable<${typeParameters[0].name as K['name']}, phantom V>`,\n\t\tfields: {\n\t\t\t/** the ID of this table */\n\t\t\tid: bcs.Address,\n\t\t\t/** the number of key-value pairs in the table */\n\t\t\tsize: bcs.u64(),\n\t\t\t/** the front of the table, i.e. the key of the first entry */\n\t\t\thead: bcs.option(typeParameters[0]),\n\t\t\t/** the back of the table, i.e. the key of the last entry */\n\t\t\ttail: bcs.option(typeParameters[0]),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;;;;AAWA,MAAM,cAAc;AACpB,SAAgB,YAAoC,GAAG,gBAAqB;CAC3E,OAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,gBAAgB,eAAe,EAAE,CAAC,KAAkB;EACzE,QAAQ;;GAEP,IAAI,IAAI;;GAER,MAAM,IAAI,IAAI;;GAEd,MAAM,IAAI,OAAO,eAAe,EAAE;;GAElC,MAAM,IAAI,OAAO,eAAe,EAAE;EACnC;CACD,CAAC;AACF"}
@@ -1,16 +1,10 @@
1
1
  import { MoveTuple } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/haneulns_discounts/deps/haneulns/pricing_config.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- const $moduleName = "haneulns::pricing_config";
9
3
  const Range = new MoveTuple({
10
- name: `${$moduleName}::Range`,
4
+ name: `haneulns::pricing_config::Range`,
11
5
  fields: [bcs.u64(), bcs.u64()]
12
6
  });
13
-
14
7
  //#endregion
15
8
  export { Range };
9
+
16
10
  //# sourceMappingURL=pricing_config.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"pricing_config.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_discounts/deps/haneulns/pricing_config.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveTuple } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = 'haneulns::pricing_config';\nexport const Range = new MoveTuple({\n\tname: `${$moduleName}::Range`,\n\tfields: [bcs.u64(), bcs.u64()],\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,UAAU;CAClC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,EAAE,IAAI,KAAK,CAAC;CAC9B,CAAC"}
1
+ {"version":3,"file":"pricing_config.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_discounts/deps/haneulns/pricing_config.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveTuple } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = 'haneulns::pricing_config';\nexport const Range = new MoveTuple({\n\tname: `${$moduleName}::Range`,\n\tfields: [bcs.u64(), bcs.u64()],\n});\n"],"mappings":";;AAMA,MAAa,QAAQ,IAAI,UAAU;CAClC,MAAM;CACN,QAAQ,CAAC,IAAI,IAAI,GAAG,IAAI,IAAI,CAAC;AAC9B,CAAC"}
@@ -1,6 +1,5 @@
1
1
  import { MoveTuple, normalizeMoveArguments } from "../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
3
  //#region src/contracts/haneulns_discounts/discounts.ts
5
4
  /**************************************************************
6
5
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
@@ -14,11 +13,11 @@ import { bcs } from "@haneullabs/haneul/bcs";
14
13
  * / deactivation happens through PTBs.
15
14
  */
16
15
  const $moduleName = "@haneulns/discounts::discounts";
17
- const RegularDiscountsApp = new MoveTuple({
16
+ new MoveTuple({
18
17
  name: `${$moduleName}::RegularDiscountsApp`,
19
18
  fields: [bcs.bool()]
20
19
  });
21
- const DiscountKey = new MoveTuple({
20
+ new MoveTuple({
22
21
  name: `${$moduleName}::DiscountKey<phantom T>`,
23
22
  fields: [bcs.bool()]
24
23
  });
@@ -45,7 +44,7 @@ function applyPercentageDiscount(options) {
45
44
  typeArguments: options.typeArguments
46
45
  });
47
46
  }
48
-
49
47
  //#endregion
50
48
  export { applyPercentageDiscount };
49
+
51
50
  //# sourceMappingURL=discounts.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"discounts.mjs","names":[],"sources":["../../../src/contracts/haneulns_discounts/discounts.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A module that allows purchasing names in a different price by presenting a\n * reference of type T. Each `T` can have a separate configuration for a discount\n * percentage. If a `T` doesn't exist, registration will fail.\n *\n * Can be called only when promotions are active for a specific type T. Activation\n * / deactivation happens through PTBs.\n */\n\nimport { MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs, type BcsType } from '@haneullabs/haneul/bcs';\nimport { type Transaction } from '@haneullabs/haneul/transactions';\nconst $moduleName = '@haneulns/discounts::discounts';\nexport const RegularDiscountsApp = new MoveTuple({\n\tname: `${$moduleName}::RegularDiscountsApp`,\n\tfields: [bcs.bool()],\n});\nexport const DiscountKey = new MoveTuple({\n\tname: `${$moduleName}::DiscountKey<phantom T>`,\n\tfields: [bcs.bool()],\n});\nexport interface ApplyPercentageDiscountArguments<T extends BcsType<any>> {\n\tself: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<T>;\n}\nexport interface ApplyPercentageDiscountOptions<T extends BcsType<any>> {\n\tpackage?: string;\n\targuments:\n\t\t| ApplyPercentageDiscountArguments<T>\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<T>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** A function to register a name with a discount using type `T`. */\nexport function applyPercentageDiscount<T extends BcsType<any>>(\n\toptions: ApplyPercentageDiscountOptions<T>,\n) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, `${options.typeArguments[0]}`] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = ['self', 'intent', 'haneulns', '_'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'apply_percentage_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ApplyDayOneDiscountArguments {\n\tself: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\tdayOne: RawTransactionArgument<string>;\n}\nexport interface ApplyDayOneDiscountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ApplyDayOneDiscountArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tdayOne: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * A special function for DayOne registration. We separate it from the normal\n * registration flow because we only want it to be usable for activated DayOnes.\n */\nexport function applyDayOneDiscount(options: ApplyDayOneDiscountOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'intent', 'haneulns', 'dayOne'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'apply_day_one_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AuthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n\tpricingConfig: RawTransactionArgument<string>;\n}\nexport interface AuthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AuthorizeTypeArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<string>,\n\t\t\t\tpricingConfig: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * An admin action to authorize a type T for special pricing.\n *\n * When authorizing, we reuse the core `PricingConfig` struct, and only accept it\n * if all the values are in the [0, 100] range. make sure that all the percentages\n * are in the [0, 99] range. We can use `free_claims` to giveaway free names.\n */\nexport function authorizeType(options: AuthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_', 'pricingConfig'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'authorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeauthorizeTypeArguments {\n\t_: RawTransactionArgument<string>;\n\tself: RawTransactionArgument<string>;\n}\nexport interface DeauthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeauthorizeTypeArguments\n\t\t| [_: RawTransactionArgument<string>, self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** An admin action to deauthorize type T from getting discounts. */\nexport function deauthorizeType(options: DeauthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['_', 'self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'deauthorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;AAgBA,MAAM,cAAc;AACpB,MAAa,sBAAsB,IAAI,UAAU;CAChD,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,MAAM,CAAC;CACpB,CAAC;AACF,MAAa,cAAc,IAAI,UAAU;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,MAAM,CAAC;CACpB,CAAC;;AAoBF,SAAgB,wBACf,SACC;CACD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM,GAAG,QAAQ,cAAc;EAAK;CAIxE,MAAM,iBAAiB;EAAC;EAAQ;EAAU;EAAY;EAAI;AAC1D,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
1
+ {"version":3,"file":"discounts.mjs","names":[],"sources":["../../../src/contracts/haneulns_discounts/discounts.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A module that allows purchasing names in a different price by presenting a\n * reference of type T. Each `T` can have a separate configuration for a discount\n * percentage. If a `T` doesn't exist, registration will fail.\n *\n * Can be called only when promotions are active for a specific type T. Activation\n * / deactivation happens through PTBs.\n */\n\nimport { MoveTuple, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';\nimport { bcs, type BcsType } from '@haneullabs/haneul/bcs';\nimport { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';\nconst $moduleName = '@haneulns/discounts::discounts';\nexport const RegularDiscountsApp = new MoveTuple({\n\tname: `${$moduleName}::RegularDiscountsApp`,\n\tfields: [bcs.bool()],\n});\nexport const DiscountKey = new MoveTuple({\n\tname: `${$moduleName}::DiscountKey<phantom T>`,\n\tfields: [bcs.bool()],\n});\nexport interface ApplyPercentageDiscountArguments<T extends BcsType<any>> {\n\tself: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\thaneulns: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<T>;\n}\nexport interface ApplyPercentageDiscountOptions<T extends BcsType<any>> {\n\tpackage?: string;\n\targuments:\n\t\t| ApplyPercentageDiscountArguments<T>\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<T>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** A function to register a name with a discount using type `T`. */\nexport function applyPercentageDiscount<T extends BcsType<any>>(\n\toptions: ApplyPercentageDiscountOptions<T>,\n) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, `${options.typeArguments[0]}`] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = ['self', 'intent', 'haneulns', '_'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'apply_percentage_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface ApplyDayOneDiscountArguments {\n\tself: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\thaneulns: RawTransactionArgument<string>;\n\tdayOne: RawTransactionArgument<string>;\n}\nexport interface ApplyDayOneDiscountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| ApplyDayOneDiscountArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tdayOne: RawTransactionArgument<string>,\n\t\t ];\n}\n/**\n * A special function for DayOne registration. We separate it from the normal\n * registration flow because we only want it to be usable for activated DayOnes.\n */\nexport function applyDayOneDiscount(options: ApplyDayOneDiscountOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'intent', 'haneulns', 'dayOne'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'apply_day_one_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AuthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n\tpricingConfig: TransactionArgument;\n}\nexport interface AuthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AuthorizeTypeArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<string>,\n\t\t\t\tpricingConfig: TransactionArgument,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * An admin action to authorize a type T for special pricing.\n *\n * When authorizing, we reuse the core `PricingConfig` struct, and only accept it\n * if all the values are in the [0, 100] range. make sure that all the percentages\n * are in the [0, 99] range. We can use `free_claims` to giveaway free names.\n */\nexport function authorizeType(options: AuthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_', 'pricingConfig'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'authorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeauthorizeTypeArguments {\n\t_: RawTransactionArgument<string>;\n\tself: RawTransactionArgument<string>;\n}\nexport interface DeauthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeauthorizeTypeArguments\n\t\t| [_: RawTransactionArgument<string>, self: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** An admin action to deauthorize type T from getting discounts. */\nexport function deauthorizeType(options: DeauthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['_', 'self'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'discounts',\n\t\t\tfunction: 'deauthorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;AAgBA,MAAM,cAAc;AACe,IAAI,UAAU;CAChD,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC;AAC0B,IAAI,UAAU;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC;;AAoBD,SAAgB,wBACf,SACC;CACD,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM,GAAG,QAAQ,cAAc;CAAI;CAIvE,MAAM,iBAAiB;EAAC;EAAQ;EAAU;EAAY;CAAG;CACzD,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH"}
@@ -2,7 +2,6 @@ import { MoveStruct, MoveTuple, normalizeMoveArguments } from "../utils/index.mj
2
2
  import { Range } from "./deps/haneulns/pricing_config.mjs";
3
3
  import { LinkedTable } from "./deps/haneul/linked_table.mjs";
4
4
  import { bcs } from "@haneullabs/haneul/bcs";
5
-
6
5
  //#region src/contracts/haneulns_discounts/free_claims.ts
7
6
  /**************************************************************
8
7
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
@@ -16,15 +15,15 @@ import { bcs } from "@haneullabs/haneul/bcs";
16
15
  * / deactivation happens through PTBs.
17
16
  */
18
17
  const $moduleName = "@haneulns/discounts::free_claims";
19
- const FreeClaimsApp = new MoveTuple({
18
+ new MoveTuple({
20
19
  name: `${$moduleName}::FreeClaimsApp`,
21
20
  fields: [bcs.bool()]
22
21
  });
23
- const FreeClaimsKey = new MoveTuple({
22
+ new MoveTuple({
24
23
  name: `${$moduleName}::FreeClaimsKey<phantom T>`,
25
24
  fields: [bcs.bool()]
26
25
  });
27
- const FreeClaimsConfig = new MoveStruct({
26
+ new MoveStruct({
28
27
  name: `${$moduleName}::FreeClaimsConfig`,
29
28
  fields: {
30
29
  domain_length_range: Range,
@@ -54,7 +53,7 @@ function freeClaim(options) {
54
53
  typeArguments: options.typeArguments
55
54
  });
56
55
  }
57
-
58
56
  //#endregion
59
57
  export { freeClaim };
58
+
60
59
  //# sourceMappingURL=free_claims.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"free_claims.mjs","names":["pricing_config.Range","linked_table.LinkedTable"],"sources":["../../../src/contracts/haneulns_discounts/free_claims.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A module that allows claiming names of a set length for free by presenting an\n * object T. Each `T` can have a separate configuration for a discount percentage.\n * If a `T` doesn't exist, registration will fail.\n *\n * Can be called only when promotions are active for a specific type T. Activation\n * / deactivation happens through PTBs.\n */\n\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs, type BcsType } from '@haneullabs/haneul/bcs';\nimport { type Transaction } from '@haneullabs/haneul/transactions';\nimport * as pricing_config from './deps/haneulns/pricing_config.js';\nimport * as linked_table from './deps/haneul/linked_table.js';\nconst $moduleName = '@haneulns/discounts::free_claims';\nexport const FreeClaimsApp = new MoveTuple({\n\tname: `${$moduleName}::FreeClaimsApp`,\n\tfields: [bcs.bool()],\n});\nexport const FreeClaimsKey = new MoveTuple({\n\tname: `${$moduleName}::FreeClaimsKey<phantom T>`,\n\tfields: [bcs.bool()],\n});\nexport const FreeClaimsConfig = new MoveStruct({\n\tname: `${$moduleName}::FreeClaimsConfig`,\n\tfields: {\n\t\tdomain_length_range: pricing_config.Range,\n\t\tused_objects: linked_table.LinkedTable(bcs.Address),\n\t},\n});\nexport interface FreeClaimArguments<T extends BcsType<any>> {\n\tself: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\tobject: RawTransactionArgument<T>;\n}\nexport interface FreeClaimOptions<T extends BcsType<any>> {\n\tpackage?: string;\n\targuments:\n\t\t| FreeClaimArguments<T>\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\tobject: RawTransactionArgument<T>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** A function to register a name with a discount using type `T`. */\nexport function freeClaim<T extends BcsType<any>>(options: FreeClaimOptions<T>) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, `${options.typeArguments[0]}`] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = ['self', 'haneulns', 'intent', 'object'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'free_claim',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface FreeClaimWithDayOneArguments {\n\tself: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\tdayOne: RawTransactionArgument<string>;\n}\nexport interface FreeClaimWithDayOneOptions {\n\tpackage?: string;\n\targuments:\n\t\t| FreeClaimWithDayOneArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\tdayOne: RawTransactionArgument<string>,\n\t\t ];\n}\nexport function freeClaimWithDayOne(options: FreeClaimWithDayOneOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'haneulns', 'intent', 'dayOne'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'free_claim_with_day_one',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AuthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n\tdomainLengthRange: RawTransactionArgument<string>;\n}\nexport interface AuthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AuthorizeTypeArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<string>,\n\t\t\t\tdomainLengthRange: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * An admin action to authorize a type T for free claiming of names by presenting\n * an object of type `T`.\n */\nexport function authorizeType(options: AuthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_', 'domainLengthRange'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'authorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeauthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n}\nexport interface DeauthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeauthorizeTypeArguments\n\t\t| [self: RawTransactionArgument<string>, _: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Force-deauthorize type T from free claims. Drops the linked_table. */\nexport function deauthorizeType(options: DeauthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'deauthorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc;AACpB,MAAa,gBAAgB,IAAI,UAAU;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,MAAM,CAAC;CACpB,CAAC;AACF,MAAa,gBAAgB,IAAI,UAAU;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,MAAM,CAAC;CACpB,CAAC;AACF,MAAa,mBAAmB,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,qBAAqBA;EACrB,cAAcC,YAAyB,IAAI,QAAQ;EACnD;CACD,CAAC;;AAoBF,SAAgB,UAAkC,SAA8B;CAC/E,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM,GAAG,QAAQ,cAAc;EAAK;CAIxE,MAAM,iBAAiB;EAAC;EAAQ;EAAY;EAAU;EAAS;AAC/D,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
1
+ {"version":3,"file":"free_claims.mjs","names":["pricing_config.Range","linked_table.LinkedTable"],"sources":["../../../src/contracts/haneulns_discounts/free_claims.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/**\n * A module that allows claiming names of a set length for free by presenting an\n * object T. Each `T` can have a separate configuration for a discount percentage.\n * If a `T` doesn't exist, registration will fail.\n *\n * Can be called only when promotions are active for a specific type T. Activation\n * / deactivation happens through PTBs.\n */\n\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs, type BcsType } from '@haneullabs/haneul/bcs';\nimport { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';\nimport * as pricing_config from './deps/haneulns/pricing_config.js';\nimport * as linked_table from './deps/haneul/linked_table.js';\nconst $moduleName = '@haneulns/discounts::free_claims';\nexport const FreeClaimsApp = new MoveTuple({\n\tname: `${$moduleName}::FreeClaimsApp`,\n\tfields: [bcs.bool()],\n});\nexport const FreeClaimsKey = new MoveTuple({\n\tname: `${$moduleName}::FreeClaimsKey<phantom T>`,\n\tfields: [bcs.bool()],\n});\nexport const FreeClaimsConfig = new MoveStruct({\n\tname: `${$moduleName}::FreeClaimsConfig`,\n\tfields: {\n\t\tdomain_length_range: pricing_config.Range,\n\t\tused_objects: linked_table.LinkedTable(bcs.Address),\n\t},\n});\nexport interface FreeClaimArguments<T extends BcsType<any>> {\n\tself: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\tobject: RawTransactionArgument<T>;\n}\nexport interface FreeClaimOptions<T extends BcsType<any>> {\n\tpackage?: string;\n\targuments:\n\t\t| FreeClaimArguments<T>\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\tobject: RawTransactionArgument<T>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** A function to register a name with a discount using type `T`. */\nexport function freeClaim<T extends BcsType<any>>(options: FreeClaimOptions<T>) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, `${options.typeArguments[0]}`] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = ['self', 'haneulns', 'intent', 'object'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'free_claim',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface FreeClaimWithDayOneArguments {\n\tself: RawTransactionArgument<string>;\n\thaneulns: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\tdayOne: RawTransactionArgument<string>;\n}\nexport interface FreeClaimWithDayOneOptions {\n\tpackage?: string;\n\targuments:\n\t\t| FreeClaimWithDayOneArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\tdayOne: RawTransactionArgument<string>,\n\t\t ];\n}\nexport function freeClaimWithDayOne(options: FreeClaimWithDayOneOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', 'haneulns', 'intent', 'dayOne'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'free_claim_with_day_one',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\nexport interface AuthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n\tdomainLengthRange: TransactionArgument;\n}\nexport interface AuthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| AuthorizeTypeArguments\n\t\t| [\n\t\t\t\tself: RawTransactionArgument<string>,\n\t\t\t\t_: RawTransactionArgument<string>,\n\t\t\t\tdomainLengthRange: TransactionArgument,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * An admin action to authorize a type T for free claiming of names by presenting\n * an object of type `T`.\n */\nexport function authorizeType(options: AuthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_', 'domainLengthRange'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'authorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface DeauthorizeTypeArguments {\n\tself: RawTransactionArgument<string>;\n\t_: RawTransactionArgument<string>;\n}\nexport interface DeauthorizeTypeOptions {\n\tpackage?: string;\n\targuments:\n\t\t| DeauthorizeTypeArguments\n\t\t| [self: RawTransactionArgument<string>, _: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\n/** Force-deauthorize type T from free claims. Drops the linked_table. */\nexport function deauthorizeType(options: DeauthorizeTypeOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/discounts';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['self', '_'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'free_claims',\n\t\t\tfunction: 'deauthorize_type',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAuBA,MAAM,cAAc;AACS,IAAI,UAAU;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC;AAC4B,IAAI,UAAU;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC;AAC+B,IAAI,WAAW;CAC9C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,qBAAqBA;EACrB,cAAcC,YAAyB,IAAI,OAAO;CACnD;AACD,CAAC;;AAoBD,SAAgB,UAAkC,SAA8B;CAC/E,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM,GAAG,QAAQ,cAAc;CAAI;CAIvE,MAAM,iBAAiB;EAAC;EAAQ;EAAY;EAAU;CAAQ;CAC9D,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH"}
@@ -1,6 +1,5 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
3
  //#region src/contracts/haneulns_payments/deps/haneul/vec_map.ts
5
4
  /**************************************************************
6
5
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
@@ -31,7 +30,7 @@ function VecMap(...typeParameters) {
31
30
  fields: { contents: bcs.vector(Entry(typeParameters[0], typeParameters[1])) }
32
31
  });
33
32
  }
34
-
35
33
  //#endregion
36
34
  export { VecMap };
35
+
37
36
  //# sourceMappingURL=vec_map.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"vec_map.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_payments/deps/haneul/vec_map.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { type BcsType, bcs } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_map';\n/** An entry in the map */\nexport function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tkey: typeParameters[0],\n\t\t\tvalue: typeParameters[1],\n\t\t},\n\t});\n}\n/**\n * A map data structure backed by a vector. The map is guaranteed not to contain\n * duplicate keys, but entries are _not_ sorted by key--entries are included in\n * insertion order. All operations are O(N) in the size of the map--the intention\n * of this data structure is only to provide the convenience of programming against\n * a map API. Large maps should use handwritten parent/child relationships instead.\n * Maps that need sorted iteration rather than insertion order iteration should\n * also be handwritten.\n */\nexport function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(Entry(typeParameters[0], typeParameters[1])),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;;AAEpB,SAAgB,MAAsD,GAAG,gBAAwB;AAChG,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,UAAU,eAAe,GAAG,KAAkB,IAAI,eAAe,GAAG,KAAkB;EAC3G,QAAQ;GACP,KAAK,eAAe;GACpB,OAAO,eAAe;GACtB;EACD,CAAC;;;;;;;;;;;AAWH,SAAgB,OAAuD,GAAG,gBAAwB;AACjG,QAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,WAAW,eAAe,GAAG,KAAkB,IAAI,eAAe,GAAG,KAAkB;EAC5G,QAAQ,EACP,UAAU,IAAI,OAAO,MAAM,eAAe,IAAI,eAAe,GAAG,CAAC,EACjE;EACD,CAAC"}
1
+ {"version":3,"file":"vec_map.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_payments/deps/haneul/vec_map.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { type BcsType, bcs } from '@haneullabs/haneul/bcs';\nimport { MoveStruct } from '../../../utils/index.js';\nconst $moduleName = '0x2::vec_map';\n/** An entry in the map */\nexport function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::Entry<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tkey: typeParameters[0],\n\t\t\tvalue: typeParameters[1],\n\t\t},\n\t});\n}\n/**\n * A map data structure backed by a vector. The map is guaranteed not to contain\n * duplicate keys, but entries are _not_ sorted by key--entries are included in\n * insertion order. All operations are O(N) in the size of the map--the intention\n * of this data structure is only to provide the convenience of programming against\n * a map API. Large maps should use handwritten parent/child relationships instead.\n * Maps that need sorted iteration rather than insertion order iteration should\n * also be handwritten.\n */\nexport function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]) {\n\treturn new MoveStruct({\n\t\tname: `${$moduleName}::VecMap<${typeParameters[0].name as K['name']}, ${typeParameters[1].name as V['name']}>`,\n\t\tfields: {\n\t\t\tcontents: bcs.vector(Entry(typeParameters[0], typeParameters[1])),\n\t\t},\n\t});\n}\n"],"mappings":";;;;;;AAKA,MAAM,cAAc;;AAEpB,SAAgB,MAAsD,GAAG,gBAAwB;CAChG,OAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,UAAU,eAAe,EAAE,CAAC,KAAkB,IAAI,eAAe,EAAE,CAAC,KAAkB;EAC3G,QAAQ;GACP,KAAK,eAAe;GACpB,OAAO,eAAe;EACvB;CACD,CAAC;AACF;;;;;;;;;;AAUA,SAAgB,OAAuD,GAAG,gBAAwB;CACjG,OAAO,IAAI,WAAW;EACrB,MAAM,GAAG,YAAY,WAAW,eAAe,EAAE,CAAC,KAAkB,IAAI,eAAe,EAAE,CAAC,KAAkB;EAC5G,QAAQ,EACP,UAAU,IAAI,OAAO,MAAM,eAAe,IAAI,eAAe,EAAE,CAAC,EACjE;CACD,CAAC;AACF"}
@@ -1,17 +1,20 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/haneulns_payments/deps/std/type_name.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- /** Functionality for converting Move types into values. Use with care! */
9
- const $moduleName = "std::type_name";
10
3
  const TypeName = new MoveStruct({
11
- name: `${$moduleName}::TypeName`,
12
- fields: { name: bcs.string() }
4
+ name: `std::type_name::TypeName`,
5
+ fields: {
6
+ /**
7
+ * String representation of the type. All types are represented using their source
8
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
9
+ * Struct types are represented as fully qualified type names; e.g.
10
+ * `00000000000000000000000000000001::string::String` or
11
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
12
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
13
+ * 32 depending on the Move platform)
14
+ */
15
+ name: bcs.string() }
13
16
  });
14
-
15
17
  //#endregion
16
18
  export { TypeName };
19
+
17
20
  //# sourceMappingURL=type_name.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"type_name.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_payments/deps/std/type_name.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Functionality for converting Move types into values. Use with care! */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = 'std::type_name';\nexport const TypeName = new MoveStruct({\n\tname: `${$moduleName}::TypeName`,\n\tfields: {\n\t\t/**\n\t\t * String representation of the type. All types are represented using their source\n\t\t * syntax: \"u8\", \"u64\", \"bool\", \"address\", \"vector\", and so on for primitive types.\n\t\t * Struct types are represented as fully qualified type names; e.g.\n\t\t * `00000000000000000000000000000001::string::String` or\n\t\t * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`\n\t\t * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or\n\t\t * 32 depending on the Move platform)\n\t\t */\n\t\tname: bcs.string(),\n\t},\n});\n"],"mappings":";;;;;;;;AAQA,MAAM,cAAc;AACpB,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM,GAAG,YAAY;CACrB,QAAQ,EAUP,MAAM,IAAI,QAAQ,EAClB;CACD,CAAC"}
1
+ {"version":3,"file":"type_name.mjs","names":[],"sources":["../../../../../src/contracts/haneulns_payments/deps/std/type_name.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\n\n/** Functionality for converting Move types into values. Use with care! */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = 'std::type_name';\nexport const TypeName = new MoveStruct({\n\tname: `${$moduleName}::TypeName`,\n\tfields: {\n\t\t/**\n\t\t * String representation of the type. All types are represented using their source\n\t\t * syntax: \"u8\", \"u64\", \"bool\", \"address\", \"vector\", and so on for primitive types.\n\t\t * Struct types are represented as fully qualified type names; e.g.\n\t\t * `00000000000000000000000000000001::string::String` or\n\t\t * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`\n\t\t * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or\n\t\t * 32 depending on the Move platform)\n\t\t */\n\t\tname: bcs.string(),\n\t},\n});\n"],"mappings":";;AASA,MAAa,WAAW,IAAI,WAAW;CACtC,MAAM;CACN,QAAQ;;;;;;;;;;AAUP,MAAM,IAAI,OAAO,EAClB;AACD,CAAC"}
@@ -2,19 +2,19 @@ import { MoveStruct, MoveTuple, normalizeMoveArguments } from "../utils/index.mj
2
2
  import { TypeName } from "./deps/std/type_name.mjs";
3
3
  import { VecMap } from "./deps/haneul/vec_map.mjs";
4
4
  import { bcs } from "@haneullabs/haneul/bcs";
5
-
6
5
  //#region src/contracts/haneulns_payments/payments.ts
7
6
  /**************************************************************
8
7
  * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
9
8
  **************************************************************/
10
9
  const $moduleName = "@haneulns/payments::payments";
11
- const PaymentsApp = new MoveTuple({
10
+ new MoveTuple({
12
11
  name: `${$moduleName}::PaymentsApp`,
13
12
  fields: [bcs.bool()]
14
13
  });
15
14
  const CoinTypeData = new MoveStruct({
16
15
  name: `${$moduleName}::CoinTypeData`,
17
16
  fields: {
17
+ /** The coin's decimals. */
18
18
  decimals: bcs.u8(),
19
19
  discount_percentage: bcs.u8(),
20
20
  price_feed_id: bcs.vector(bcs.u8()),
@@ -27,6 +27,7 @@ const PaymentsConfig = new MoveStruct({
27
27
  currencies: VecMap(TypeName, CoinTypeData),
28
28
  base_currency: TypeName,
29
29
  max_age: bcs.u64(),
30
+ /** The percentage of the payment that gets burned, in basis points. */
30
31
  burn_bps: bcs.u64()
31
32
  }
32
33
  });
@@ -139,7 +140,7 @@ function calculatePriceAfterDiscount(options) {
139
140
  typeArguments: options.typeArguments
140
141
  });
141
142
  }
142
-
143
143
  //#endregion
144
144
  export { PaymentsConfig, calculatePrice, calculatePriceAfterDiscount, handleBasePayment, handlePayment };
145
+
145
146
  //# sourceMappingURL=payments.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"payments.mjs","names":["type_name.TypeName","vec_map.VecMap"],"sources":["../../../src/contracts/haneulns_payments/payments.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport { type Transaction } from '@haneullabs/haneul/transactions';\nimport * as type_name from './deps/std/type_name.js';\nimport * as vec_map from './deps/haneul/vec_map.js';\nconst $moduleName = '@haneulns/payments::payments';\nexport const PaymentsApp = new MoveTuple({\n\tname: `${$moduleName}::PaymentsApp`,\n\tfields: [bcs.bool()],\n});\nexport const CoinTypeData = new MoveStruct({\n\tname: `${$moduleName}::CoinTypeData`,\n\tfields: {\n\t\t/** The coin's decimals. */\n\t\tdecimals: bcs.u8(),\n\t\tdiscount_percentage: bcs.u8(),\n\t\tprice_feed_id: bcs.vector(bcs.u8()),\n\t\ttype_name: type_name.TypeName,\n\t},\n});\nexport const PaymentsConfig = new MoveStruct({\n\tname: `${$moduleName}::PaymentsConfig`,\n\tfields: {\n\t\tcurrencies: vec_map.VecMap(type_name.TypeName, CoinTypeData),\n\t\tbase_currency: type_name.TypeName,\n\t\tmax_age: bcs.u64(),\n\t\t/** The percentage of the payment that gets burned, in basis points. */\n\t\tburn_bps: bcs.u64(),\n\t},\n});\nexport interface HandleBasePaymentArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbbbVault: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface HandleBasePaymentOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HandleBasePaymentArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbbbVault: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\tpayment: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * This has to be called with our base payment currency. The payment has to be\n * equal to the base price of the domain. We do not need to check the price feed\n * for the base currency.\n */\nexport function handleBasePayment(options: HandleBasePaymentOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'bbbVault', 'intent', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'handle_base_payment',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface HandlePaymentArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbbbVault: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n\tpayment: RawTransactionArgument<string>;\n\tpriceInfoObject: RawTransactionArgument<string>;\n\tuserPriceGuard: RawTransactionArgument<number | bigint>;\n}\nexport interface HandlePaymentOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HandlePaymentArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbbbVault: RawTransactionArgument<string>,\n\t\t\t\tintent: RawTransactionArgument<string>,\n\t\t\t\tpayment: RawTransactionArgument<string>,\n\t\t\t\tpriceInfoObject: RawTransactionArgument<string>,\n\t\t\t\tuserPriceGuard: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Handles a payment done for a non-base currency payment. E.g. HANEUL, NS.\n *\n * The payment amount is derived from the base currency price and the Pyth price\n * feed.\n *\n * The `user_price_guard` is a value that the user expects to pay. If the payment\n * amount is higher than this value, the payment will be rejected. This is to\n * protect the user from paying more than they expected on their FEs. Ideally, this\n * number should be calculated on the FE based on the price that is being displayed\n * to the user (with a buffer determined by the FE).\n */\nexport function handlePayment(options: HandlePaymentOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null, null, null, '0x2::clock::Clock', null, 'u64'] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = [\n\t\t'haneulns',\n\t\t'bbbVault',\n\t\t'intent',\n\t\t'payment',\n\t\t'priceInfoObject',\n\t\t'userPriceGuard',\n\t];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'handle_payment',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CalculatePriceArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbaseAmount: RawTransactionArgument<number | bigint>;\n\tpriceInfoObject: RawTransactionArgument<string>;\n}\nexport interface CalculatePriceOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CalculatePriceArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbaseAmount: RawTransactionArgument<number | bigint>,\n\t\t\t\tpriceInfoObject: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Calculates the amount that has to be paid in the target currency.\n *\n * Can be used to split the payment amount in a single PTB.\n *\n * 1. const intent = function_to_get_intent();\n * 2. const price = calculate_price<HANEUL>(haneulns, intent, ...);\n * 3. const coin = txb.splitCoins(baseCoin, [price])\n * 4. handle_payment<HANEUL>(haneulns, intent, coin, ...);\n */\nexport function calculatePrice(options: CalculatePriceOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, 'u64', '0x2::clock::Clock', null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'baseAmount', 'priceInfoObject'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'calculate_price',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CalculatePriceAfterDiscountArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tintent: RawTransactionArgument<string>;\n}\nexport interface CalculatePriceAfterDiscountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CalculatePriceAfterDiscountArguments\n\t\t| [haneulns: RawTransactionArgument<string>, intent: RawTransactionArgument<string>];\n\ttypeArguments: [string];\n}\nexport function calculatePriceAfterDiscount(options: CalculatePriceAfterDiscountOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'intent'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'calculate_price_after_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface NewCoinTypeDataArguments {\n\tcoinMetadata: RawTransactionArgument<string>;\n\tdiscountPercentage: RawTransactionArgument<number>;\n\tpriceFeedId: RawTransactionArgument<number[]>;\n}\nexport interface NewCoinTypeDataOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewCoinTypeDataArguments\n\t\t| [\n\t\t\t\tcoinMetadata: RawTransactionArgument<string>,\n\t\t\t\tdiscountPercentage: RawTransactionArgument<number>,\n\t\t\t\tpriceFeedId: RawTransactionArgument<number[]>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** Creates a new CoinTypeData struct. Leave price_feed_id empty for base currency. */\nexport function newCoinTypeData(options: NewCoinTypeDataOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, 'u8', 'vector<u8>'] satisfies (string | null)[];\n\tconst parameterNames = ['coinMetadata', 'discountPercentage', 'priceFeedId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'new_coin_type_data',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface NewPaymentsConfigArguments {\n\tsetups: RawTransactionArgument<string[]>;\n\tbaseCurrency: RawTransactionArgument<string>;\n\tmaxAge: RawTransactionArgument<number | bigint>;\n\tburnBps: RawTransactionArgument<number | bigint>;\n}\nexport interface NewPaymentsConfigOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewPaymentsConfigArguments\n\t\t| [\n\t\t\t\tsetups: RawTransactionArgument<string[]>,\n\t\t\t\tbaseCurrency: RawTransactionArgument<string>,\n\t\t\t\tmaxAge: RawTransactionArgument<number | bigint>,\n\t\t\t\tburnBps: RawTransactionArgument<number | bigint>,\n\t\t ];\n}\n/**\n * Creates a new PaymentsConfig struct. Can be attached by the Admin to HaneulNS to\n * allow the payments module to work.\n */\nexport function newPaymentsConfig(options: NewPaymentsConfigOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = ['vector<null>', null, 'u64', 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['setups', 'baseCurrency', 'maxAge', 'burnBps'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'new_payments_config',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;;AAaA,MAAM,cAAc;AACpB,MAAa,cAAc,IAAI,UAAU;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,MAAM,CAAC;CACpB,CAAC;AACF,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;EAEP,UAAU,IAAI,IAAI;EAClB,qBAAqB,IAAI,IAAI;EAC7B,eAAe,IAAI,OAAO,IAAI,IAAI,CAAC;EACnC,WAAWA;EACX;CACD,CAAC;AACF,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,YAAYC,OAAeD,UAAoB,aAAa;EAC5D,eAAeA;EACf,SAAS,IAAI,KAAK;EAElB,UAAU,IAAI,KAAK;EACnB;CACD,CAAC;;;;;;AAwBF,SAAgB,kBAAkB,SAAmC;CACpE,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM;EAAK;CAC/C,MAAM,iBAAiB;EAAC;EAAY;EAAY;EAAU;EAAU;AACpE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;;;;;;;;;;;;AAoCJ,SAAgB,cAAc,SAA+B;CAC5D,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM;EAAM;EAAqB;EAAM;EAAM;CAIjF,MAAM,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;AACD,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;;;;;;;;;;;AA4BJ,SAAgB,eAAe,SAAgC;CAC9D,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAO;EAAqB;EAAK;CAC/D,MAAM,iBAAiB;EAAC;EAAY;EAAc;EAAkB;AACpE,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC;;AAaJ,SAAgB,4BAA4B,SAA6C;CACxF,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,KAAK;CACnC,MAAM,iBAAiB,CAAC,YAAY,SAAS;AAC7C,SAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,eAAe;EACpF,eAAe,QAAQ;EACvB,CAAC"}
1
+ {"version":3,"file":"payments.mjs","names":["type_name.TypeName","vec_map.VecMap"],"sources":["../../../src/contracts/haneulns_payments/payments.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport {\n\tMoveTuple,\n\tMoveStruct,\n\tnormalizeMoveArguments,\n\ttype RawTransactionArgument,\n} from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';\nimport * as type_name from './deps/std/type_name.js';\nimport * as vec_map from './deps/haneul/vec_map.js';\nconst $moduleName = '@haneulns/payments::payments';\nexport const PaymentsApp = new MoveTuple({\n\tname: `${$moduleName}::PaymentsApp`,\n\tfields: [bcs.bool()],\n});\nexport const CoinTypeData = new MoveStruct({\n\tname: `${$moduleName}::CoinTypeData`,\n\tfields: {\n\t\t/** The coin's decimals. */\n\t\tdecimals: bcs.u8(),\n\t\tdiscount_percentage: bcs.u8(),\n\t\tprice_feed_id: bcs.vector(bcs.u8()),\n\t\ttype_name: type_name.TypeName,\n\t},\n});\nexport const PaymentsConfig = new MoveStruct({\n\tname: `${$moduleName}::PaymentsConfig`,\n\tfields: {\n\t\tcurrencies: vec_map.VecMap(type_name.TypeName, CoinTypeData),\n\t\tbase_currency: type_name.TypeName,\n\t\tmax_age: bcs.u64(),\n\t\t/** The percentage of the payment that gets burned, in basis points. */\n\t\tburn_bps: bcs.u64(),\n\t},\n});\nexport interface HandleBasePaymentArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbbbVault: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\tpayment: RawTransactionArgument<string>;\n}\nexport interface HandleBasePaymentOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HandleBasePaymentArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbbbVault: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\tpayment: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * This has to be called with our base payment currency. The payment has to be\n * equal to the base price of the domain. We do not need to check the price feed\n * for the base currency.\n */\nexport function handleBasePayment(options: HandleBasePaymentOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null, null, null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'bbbVault', 'intent', 'payment'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'handle_base_payment',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface HandlePaymentArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbbbVault: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n\tpayment: RawTransactionArgument<string>;\n\tpriceInfoObject: RawTransactionArgument<string>;\n\tuserPriceGuard: RawTransactionArgument<number | bigint>;\n}\nexport interface HandlePaymentOptions {\n\tpackage?: string;\n\targuments:\n\t\t| HandlePaymentArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbbbVault: RawTransactionArgument<string>,\n\t\t\t\tintent: TransactionArgument,\n\t\t\t\tpayment: RawTransactionArgument<string>,\n\t\t\t\tpriceInfoObject: RawTransactionArgument<string>,\n\t\t\t\tuserPriceGuard: RawTransactionArgument<number | bigint>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Handles a payment done for a non-base currency payment. E.g. HANEUL, NS.\n *\n * The payment amount is derived from the base currency price and the Pyth price\n * feed.\n *\n * The `user_price_guard` is a value that the user expects to pay. If the payment\n * amount is higher than this value, the payment will be rejected. This is to\n * protect the user from paying more than they expected on their FEs. Ideally, this\n * number should be calculated on the FE based on the price that is being displayed\n * to the user (with a buffer determined by the FE).\n */\nexport function handlePayment(options: HandlePaymentOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null, null, null, '0x2::clock::Clock', null, 'u64'] satisfies (\n\t\t| string\n\t\t| null\n\t)[];\n\tconst parameterNames = [\n\t\t'haneulns',\n\t\t'bbbVault',\n\t\t'intent',\n\t\t'payment',\n\t\t'priceInfoObject',\n\t\t'userPriceGuard',\n\t];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'handle_payment',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CalculatePriceArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tbaseAmount: RawTransactionArgument<number | bigint>;\n\tpriceInfoObject: RawTransactionArgument<string>;\n}\nexport interface CalculatePriceOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CalculatePriceArguments\n\t\t| [\n\t\t\t\thaneulns: RawTransactionArgument<string>,\n\t\t\t\tbaseAmount: RawTransactionArgument<number | bigint>,\n\t\t\t\tpriceInfoObject: RawTransactionArgument<string>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/**\n * Calculates the amount that has to be paid in the target currency.\n *\n * Can be used to split the payment amount in a single PTB.\n *\n * 1. const intent = function_to_get_intent();\n * 2. const price = calculate_price<HANEUL>(haneulns, intent, ...);\n * 3. const coin = txb.splitCoins(baseCoin, [price])\n * 4. handle_payment<HANEUL>(haneulns, intent, coin, ...);\n */\nexport function calculatePrice(options: CalculatePriceOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, 'u64', '0x2::clock::Clock', null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'baseAmount', 'priceInfoObject'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'calculate_price',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface CalculatePriceAfterDiscountArguments {\n\thaneulns: RawTransactionArgument<string>;\n\tintent: TransactionArgument;\n}\nexport interface CalculatePriceAfterDiscountOptions {\n\tpackage?: string;\n\targuments:\n\t\t| CalculatePriceAfterDiscountArguments\n\t\t| [haneulns: RawTransactionArgument<string>, intent: TransactionArgument];\n\ttypeArguments: [string];\n}\nexport function calculatePriceAfterDiscount(options: CalculatePriceAfterDiscountOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, null] satisfies (string | null)[];\n\tconst parameterNames = ['haneulns', 'intent'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'calculate_price_after_discount',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface NewCoinTypeDataArguments {\n\tcoinMetadata: RawTransactionArgument<string>;\n\tdiscountPercentage: RawTransactionArgument<number>;\n\tpriceFeedId: RawTransactionArgument<Array<number>>;\n}\nexport interface NewCoinTypeDataOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewCoinTypeDataArguments\n\t\t| [\n\t\t\t\tcoinMetadata: RawTransactionArgument<string>,\n\t\t\t\tdiscountPercentage: RawTransactionArgument<number>,\n\t\t\t\tpriceFeedId: RawTransactionArgument<Array<number>>,\n\t\t ];\n\ttypeArguments: [string];\n}\n/** Creates a new CoinTypeData struct. Leave price_feed_id empty for base currency. */\nexport function newCoinTypeData(options: NewCoinTypeDataOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = [null, 'u8', 'vector<u8>'] satisfies (string | null)[];\n\tconst parameterNames = ['coinMetadata', 'discountPercentage', 'priceFeedId'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'new_coin_type_data',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t\ttypeArguments: options.typeArguments,\n\t\t});\n}\nexport interface NewPaymentsConfigArguments {\n\tsetups: TransactionArgument;\n\tbaseCurrency: TransactionArgument;\n\tmaxAge: RawTransactionArgument<number | bigint>;\n\tburnBps: RawTransactionArgument<number | bigint>;\n}\nexport interface NewPaymentsConfigOptions {\n\tpackage?: string;\n\targuments:\n\t\t| NewPaymentsConfigArguments\n\t\t| [\n\t\t\t\tsetups: TransactionArgument,\n\t\t\t\tbaseCurrency: TransactionArgument,\n\t\t\t\tmaxAge: RawTransactionArgument<number | bigint>,\n\t\t\t\tburnBps: RawTransactionArgument<number | bigint>,\n\t\t ];\n}\n/**\n * Creates a new PaymentsConfig struct. Can be attached by the Admin to HaneulNS to\n * allow the payments module to work.\n */\nexport function newPaymentsConfig(options: NewPaymentsConfigOptions) {\n\tconst packageAddress = options.package ?? '@haneulns/payments';\n\tconst argumentsTypes = ['vector<null>', null, 'u64', 'u64'] satisfies (string | null)[];\n\tconst parameterNames = ['setups', 'baseCurrency', 'maxAge', 'burnBps'];\n\treturn (tx: Transaction) =>\n\t\ttx.moveCall({\n\t\t\tpackage: packageAddress,\n\t\t\tmodule: 'payments',\n\t\t\tfunction: 'new_payments_config',\n\t\t\targuments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),\n\t\t});\n}\n"],"mappings":";;;;;;;;AAaA,MAAM,cAAc;AACO,IAAI,UAAU;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ,CAAC,IAAI,KAAK,CAAC;AACpB,CAAC;AACD,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ;;EAEP,UAAU,IAAI,GAAG;EACjB,qBAAqB,IAAI,GAAG;EAC5B,eAAe,IAAI,OAAO,IAAI,GAAG,CAAC;EAClC,WAAWA;CACZ;AACD,CAAC;AACD,MAAa,iBAAiB,IAAI,WAAW;CAC5C,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,YAAYC,OAAeD,UAAoB,YAAY;EAC3D,eAAeA;EACf,SAAS,IAAI,IAAI;;EAEjB,UAAU,IAAI,IAAI;CACnB;AACD,CAAC;;;;;;AAwBD,SAAgB,kBAAkB,SAAmC;CACpE,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM;CAAI;CAC9C,MAAM,iBAAiB;EAAC;EAAY;EAAY;EAAU;CAAS;CACnE,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH;;;;;;;;;;;;;AAmCA,SAAgB,cAAc,SAA+B;CAC5D,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAM;EAAM;EAAM;EAAqB;EAAM;CAAK;CAIhF,MAAM,iBAAiB;EACtB;EACA;EACA;EACA;EACA;EACA;CACD;CACA,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH;;;;;;;;;;;AA2BA,SAAgB,eAAe,SAAgC;CAC9D,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB;EAAC;EAAM;EAAO;EAAqB;CAAI;CAC9D,MAAM,iBAAiB;EAAC;EAAY;EAAc;CAAiB;CACnE,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH;AAYA,SAAgB,4BAA4B,SAA6C;CACxF,MAAM,iBAAiB,QAAQ,WAAW;CAC1C,MAAM,iBAAiB,CAAC,MAAM,IAAI;CAClC,MAAM,iBAAiB,CAAC,YAAY,QAAQ;CAC5C,QAAQ,OACP,GAAG,SAAS;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,WAAW,uBAAuB,QAAQ,WAAW,gBAAgB,cAAc;EACnF,eAAe,QAAQ;CACxB,CAAC;AACH"}
@@ -1,20 +1,14 @@
1
1
  import { MoveStruct } from "../utils/index.mjs";
2
2
  import { ExternalAddress } from "./deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs";
3
3
  import { bcs } from "@haneullabs/haneul/bcs";
4
-
5
- //#region src/contracts/pyth/data_source.ts
6
- /**************************************************************
7
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
8
- **************************************************************/
9
- const $moduleName = "0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837::data_source";
10
4
  const DataSource = new MoveStruct({
11
- name: `${$moduleName}::DataSource`,
5
+ name: `0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837::data_source::DataSource`,
12
6
  fields: {
13
7
  emitter_chain: bcs.u64(),
14
8
  emitter_address: ExternalAddress
15
9
  }
16
10
  });
17
-
18
11
  //#endregion
19
12
  export { DataSource };
13
+
20
14
  //# sourceMappingURL=data_source.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"data_source.mjs","names":["external_address.ExternalAddress"],"sources":["../../../src/contracts/pyth/data_source.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as external_address from './deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.js';\nconst $moduleName =\n\t'0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837::data_source';\nexport const DataSource = new MoveStruct({\n\tname: `${$moduleName}::DataSource`,\n\tfields: {\n\t\temitter_chain: bcs.u64(),\n\t\temitter_address: external_address.ExternalAddress,\n\t},\n});\n"],"mappings":";;;;;;;;AAMA,MAAM,cACL;AACD,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,eAAe,IAAI,KAAK;EACxB,iBAAiBA;EACjB;CACD,CAAC"}
1
+ {"version":3,"file":"data_source.mjs","names":["external_address.ExternalAddress"],"sources":["../../../src/contracts/pyth/data_source.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as external_address from './deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.js';\nconst $moduleName =\n\t'0xabf837e98c26087cba0883c0a7a28326b1fa3c5e1e2c5abdb486f9e8f594c837::data_source';\nexport const DataSource = new MoveStruct({\n\tname: `${$moduleName}::DataSource`,\n\tfields: {\n\t\temitter_chain: bcs.u64(),\n\t\temitter_address: external_address.ExternalAddress,\n\t},\n});\n"],"mappings":";;;AAQA,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM;CACN,QAAQ;EACP,eAAe,IAAI,IAAI;EACvB,iBAAiBA;CAClB;AACD,CAAC"}
@@ -1,13 +1,7 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- const $moduleName = "0x2::package";
9
3
  const UpgradeCap = new MoveStruct({
10
- name: `${$moduleName}::UpgradeCap`,
4
+ name: `0x2::package::UpgradeCap`,
11
5
  fields: {
12
6
  id: bcs.Address,
13
7
  package: bcs.Address,
@@ -15,7 +9,7 @@ const UpgradeCap = new MoveStruct({
15
9
  policy: bcs.u8()
16
10
  }
17
11
  });
18
-
19
12
  //#endregion
20
13
  export { UpgradeCap };
14
+
21
15
  //# sourceMappingURL=package.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::package';\nexport const UpgradeCap = new MoveStruct({\n\tname: `${$moduleName}::UpgradeCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tpackage: bcs.Address,\n\t\tversion: bcs.u64(),\n\t\tpolicy: bcs.u8(),\n\t},\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;AACpB,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,SAAS,IAAI;EACb,SAAS,IAAI,KAAK;EAClB,QAAQ,IAAI,IAAI;EAChB;CACD,CAAC"}
1
+ {"version":3,"file":"package.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::package';\nexport const UpgradeCap = new MoveStruct({\n\tname: `${$moduleName}::UpgradeCap`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tpackage: bcs.Address,\n\t\tversion: bcs.u64(),\n\t\tpolicy: bcs.u8(),\n\t},\n});\n"],"mappings":";;AAMA,MAAa,aAAa,IAAI,WAAW;CACxC,MAAM;CACN,QAAQ;EACP,IAAI,IAAI;EACR,SAAS,IAAI;EACb,SAAS,IAAI,IAAI;EACjB,QAAQ,IAAI,GAAG;CAChB;AACD,CAAC"}
@@ -1,19 +1,13 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- const $moduleName = "0x2::table";
9
3
  const Table = new MoveStruct({
10
- name: `${$moduleName}::Table<phantom T0, phantom T1>`,
4
+ name: `0x2::table::Table<phantom T0, phantom T1>`,
11
5
  fields: {
12
6
  id: bcs.Address,
13
7
  size: bcs.u64()
14
8
  }
15
9
  });
16
-
17
10
  //#endregion
18
11
  export { Table };
12
+
19
13
  //# sourceMappingURL=table.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"table.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::table';\nexport const Table = new MoveStruct({\n\tname: `${$moduleName}::Table<phantom T0, phantom T1>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;AACpB,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM,GAAG,YAAY;CACrB,QAAQ;EACP,IAAI,IAAI;EACR,MAAM,IAAI,KAAK;EACf;CACD,CAAC"}
1
+ {"version":3,"file":"table.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::table';\nexport const Table = new MoveStruct({\n\tname: `${$moduleName}::Table<phantom T0, phantom T1>`,\n\tfields: {\n\t\tid: bcs.Address,\n\t\tsize: bcs.u64(),\n\t},\n});\n"],"mappings":";;AAMA,MAAa,QAAQ,IAAI,WAAW;CACnC,MAAM;CACN,QAAQ;EACP,IAAI,IAAI;EACR,MAAM,IAAI,IAAI;CACf;AACD,CAAC"}
@@ -1,16 +1,10 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { bcs } from "@haneullabs/haneul/bcs";
3
-
4
- //#region src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- const $moduleName = "0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::bytes32";
9
3
  const Bytes32 = new MoveStruct({
10
- name: `${$moduleName}::Bytes32`,
4
+ name: `0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::bytes32::Bytes32`,
11
5
  fields: { data: bcs.vector(bcs.u8()) }
12
6
  });
13
-
14
7
  //#endregion
15
8
  export { Bytes32 };
9
+
16
10
  //# sourceMappingURL=bytes32.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bytes32.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::bytes32';\nexport const Bytes32 = new MoveStruct({\n\tname: `${$moduleName}::Bytes32`,\n\tfields: {\n\t\tdata: bcs.vector(bcs.u8()),\n\t},\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cAAc;AACpB,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,MAAM,IAAI,OAAO,IAAI,IAAI,CAAC,EAC1B;CACD,CAAC"}
1
+ {"version":3,"file":"bytes32.mjs","names":[],"sources":["../../../../../src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::bytes32';\nexport const Bytes32 = new MoveStruct({\n\tname: `${$moduleName}::Bytes32`,\n\tfields: {\n\t\tdata: bcs.vector(bcs.u8()),\n\t},\n});\n"],"mappings":";;AAMA,MAAa,UAAU,IAAI,WAAW;CACrC,MAAM;CACN,QAAQ,EACP,MAAM,IAAI,OAAO,IAAI,GAAG,CAAC,EAC1B;AACD,CAAC"}
@@ -1,16 +1,10 @@
1
1
  import { MoveStruct } from "../../../utils/index.mjs";
2
2
  import { Set } from "./set.mjs";
3
-
4
- //#region src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.ts
5
- /**************************************************************
6
- * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
7
- **************************************************************/
8
- const $moduleName = "0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::consumed_vaas";
9
3
  const ConsumedVAAs = new MoveStruct({
10
- name: `${$moduleName}::ConsumedVAAs`,
4
+ name: `0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::consumed_vaas::ConsumedVAAs`,
11
5
  fields: { hashes: Set }
12
6
  });
13
-
14
7
  //#endregion
15
8
  export { ConsumedVAAs };
9
+
16
10
  //# sourceMappingURL=consumed_vaas.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"consumed_vaas.mjs","names":["set.Set"],"sources":["../../../../../src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport * as set from './set.js';\nconst $moduleName =\n\t'0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::consumed_vaas';\nexport const ConsumedVAAs = new MoveStruct({\n\tname: `${$moduleName}::ConsumedVAAs`,\n\tfields: {\n\t\thashes: set.Set,\n\t},\n});\n"],"mappings":";;;;;;;AAKA,MAAM,cACL;AACD,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM,GAAG,YAAY;CACrB,QAAQ,EACP,QAAQA,KACR;CACD,CAAC"}
1
+ {"version":3,"file":"consumed_vaas.mjs","names":["set.Set"],"sources":["../../../../../src/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.ts"],"sourcesContent":["/**************************************************************\n * THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *\n **************************************************************/\nimport { MoveStruct } from '../../../utils/index.js';\nimport * as set from './set.js';\nconst $moduleName =\n\t'0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94::consumed_vaas';\nexport const ConsumedVAAs = new MoveStruct({\n\tname: `${$moduleName}::ConsumedVAAs`,\n\tfields: {\n\t\thashes: set.Set,\n\t},\n});\n"],"mappings":";;AAOA,MAAa,eAAe,IAAI,WAAW;CAC1C,MAAM;CACN,QAAQ,EACP,QAAQA,IACT;AACD,CAAC"}