@haneullabs/payment-kit 0.1.0

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 (96) hide show
  1. package/README.md +123 -0
  2. package/dist/cjs/calls.d.ts +71 -0
  3. package/dist/cjs/calls.js +207 -0
  4. package/dist/cjs/calls.js.map +7 -0
  5. package/dist/cjs/client.d.ts +36 -0
  6. package/dist/cjs/client.js +123 -0
  7. package/dist/cjs/client.js.map +7 -0
  8. package/dist/cjs/constants.d.ts +11 -0
  9. package/dist/cjs/constants.js +40 -0
  10. package/dist/cjs/constants.js.map +7 -0
  11. package/dist/cjs/contracts/payment_kit/config.d.ts +14 -0
  12. package/dist/cjs/contracts/payment_kit/config.js +50 -0
  13. package/dist/cjs/contracts/payment_kit/config.js.map +7 -0
  14. package/dist/cjs/contracts/payment_kit/deps/std/type_name.d.ts +14 -0
  15. package/dist/cjs/contracts/payment_kit/deps/std/type_name.js +42 -0
  16. package/dist/cjs/contracts/payment_kit/deps/std/type_name.js.map +7 -0
  17. package/dist/cjs/contracts/payment_kit/deps/sui/object.d.ts +5 -0
  18. package/dist/cjs/contracts/payment_kit/deps/sui/object.js +33 -0
  19. package/dist/cjs/contracts/payment_kit/deps/sui/object.js.map +7 -0
  20. package/dist/cjs/contracts/payment_kit/deps/sui/vec_map.d.ts +27 -0
  21. package/dist/cjs/contracts/payment_kit/deps/sui/vec_map.js +45 -0
  22. package/dist/cjs/contracts/payment_kit/deps/sui/vec_map.js.map +7 -0
  23. package/dist/cjs/contracts/payment_kit/payment_kit.d.ts +233 -0
  24. package/dist/cjs/contracts/payment_kit/payment_kit.js +252 -0
  25. package/dist/cjs/contracts/payment_kit/payment_kit.js.map +7 -0
  26. package/dist/cjs/contracts/utils/index.d.ts +12 -0
  27. package/dist/cjs/contracts/utils/index.js +151 -0
  28. package/dist/cjs/contracts/utils/index.js.map +7 -0
  29. package/dist/cjs/error.d.ts +4 -0
  30. package/dist/cjs/error.js +29 -0
  31. package/dist/cjs/error.js.map +7 -0
  32. package/dist/cjs/index.d.ts +5 -0
  33. package/dist/cjs/index.js +35 -0
  34. package/dist/cjs/index.js.map +7 -0
  35. package/dist/cjs/package.json +5 -0
  36. package/dist/cjs/transactions.d.ts +73 -0
  37. package/dist/cjs/transactions.js +131 -0
  38. package/dist/cjs/transactions.js.map +7 -0
  39. package/dist/cjs/types.d.ts +62 -0
  40. package/dist/cjs/types.js +17 -0
  41. package/dist/cjs/types.js.map +7 -0
  42. package/dist/cjs/uri.d.ts +27 -0
  43. package/dist/cjs/uri.js +131 -0
  44. package/dist/cjs/uri.js.map +7 -0
  45. package/dist/cjs/utils.d.ts +1 -0
  46. package/dist/cjs/utils.js +34 -0
  47. package/dist/cjs/utils.js.map +7 -0
  48. package/dist/esm/calls.d.ts +71 -0
  49. package/dist/esm/calls.js +196 -0
  50. package/dist/esm/calls.js.map +7 -0
  51. package/dist/esm/client.d.ts +36 -0
  52. package/dist/esm/client.js +106 -0
  53. package/dist/esm/client.js.map +7 -0
  54. package/dist/esm/constants.d.ts +11 -0
  55. package/dist/esm/constants.js +20 -0
  56. package/dist/esm/constants.js.map +7 -0
  57. package/dist/esm/contracts/payment_kit/config.d.ts +14 -0
  58. package/dist/esm/contracts/payment_kit/config.js +20 -0
  59. package/dist/esm/contracts/payment_kit/config.js.map +7 -0
  60. package/dist/esm/contracts/payment_kit/deps/std/type_name.d.ts +14 -0
  61. package/dist/esm/contracts/payment_kit/deps/std/type_name.js +22 -0
  62. package/dist/esm/contracts/payment_kit/deps/std/type_name.js.map +7 -0
  63. package/dist/esm/contracts/payment_kit/deps/sui/object.d.ts +5 -0
  64. package/dist/esm/contracts/payment_kit/deps/sui/object.js +13 -0
  65. package/dist/esm/contracts/payment_kit/deps/sui/object.js.map +7 -0
  66. package/dist/esm/contracts/payment_kit/deps/sui/vec_map.d.ts +27 -0
  67. package/dist/esm/contracts/payment_kit/deps/sui/vec_map.js +25 -0
  68. package/dist/esm/contracts/payment_kit/deps/sui/vec_map.js.map +7 -0
  69. package/dist/esm/contracts/payment_kit/payment_kit.d.ts +233 -0
  70. package/dist/esm/contracts/payment_kit/payment_kit.js +222 -0
  71. package/dist/esm/contracts/payment_kit/payment_kit.js.map +7 -0
  72. package/dist/esm/contracts/utils/index.d.ts +12 -0
  73. package/dist/esm/contracts/utils/index.js +131 -0
  74. package/dist/esm/contracts/utils/index.js.map +7 -0
  75. package/dist/esm/error.d.ts +4 -0
  76. package/dist/esm/error.js +9 -0
  77. package/dist/esm/error.js.map +7 -0
  78. package/dist/esm/index.d.ts +5 -0
  79. package/dist/esm/index.js +15 -0
  80. package/dist/esm/index.js.map +7 -0
  81. package/dist/esm/package.json +5 -0
  82. package/dist/esm/transactions.d.ts +73 -0
  83. package/dist/esm/transactions.js +111 -0
  84. package/dist/esm/transactions.js.map +7 -0
  85. package/dist/esm/types.d.ts +62 -0
  86. package/dist/esm/types.js +1 -0
  87. package/dist/esm/types.js.map +7 -0
  88. package/dist/esm/uri.d.ts +27 -0
  89. package/dist/esm/uri.js +111 -0
  90. package/dist/esm/uri.js.map +7 -0
  91. package/dist/esm/utils.d.ts +1 -0
  92. package/dist/esm/utils.js +14 -0
  93. package/dist/esm/utils.js.map +7 -0
  94. package/dist/tsconfig.esm.tsbuildinfo +1 -0
  95. package/dist/tsconfig.tsbuildinfo +1 -0
  96. package/package.json +49 -0
@@ -0,0 +1,14 @@
1
+ import { MoveEnum } from '../utils/index.js';
2
+ export declare const Value: MoveEnum<{
3
+ U64: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
4
+ Address: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
5
+ String: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
6
+ AsciiString: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
7
+ Bool: import("@haneullabs/haneul/bcs").BcsType<boolean, boolean, "bool">;
8
+ Bytes: import("@haneullabs/haneul/bcs").BcsType<number[], Iterable<number> & {
9
+ length: number;
10
+ }, string>;
11
+ Type: import("../utils/index.js").MoveStruct<{
12
+ name: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
13
+ }, "std::type_name::TypeName">;
14
+ }, "@haneullabs/payment-kit::config::Value">;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var config_exports = {};
30
+ __export(config_exports, {
31
+ Value: () => Value
32
+ });
33
+ module.exports = __toCommonJS(config_exports);
34
+ var import_utils = require("../utils/index.js");
35
+ var import_bcs = require("@haneullabs/haneul/bcs");
36
+ var type_name = __toESM(require("./deps/std/type_name.js"));
37
+ const $moduleName = "@haneullabs/payment-kit::config";
38
+ const Value = new import_utils.MoveEnum({
39
+ name: `${$moduleName}::Value`,
40
+ fields: {
41
+ U64: import_bcs.bcs.u64(),
42
+ Address: import_bcs.bcs.Address,
43
+ String: import_bcs.bcs.string(),
44
+ AsciiString: import_bcs.bcs.string(),
45
+ Bool: import_bcs.bcs.bool(),
46
+ Bytes: import_bcs.bcs.vector(import_bcs.bcs.u8()),
47
+ Type: type_name.TypeName
48
+ }
49
+ });
50
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/contracts/payment_kit/config.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { MoveEnum } from '../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport * as type_name from './deps/std/type_name.js';\nconst $moduleName = '@haneullabs/payment-kit::config';\nexport const Value = new MoveEnum({\n\tname: `${$moduleName}::Value`,\n\tfields: {\n\t\tU64: bcs.u64(),\n\t\tAddress: bcs.Address,\n\t\tString: bcs.string(),\n\t\tAsciiString: bcs.string(),\n\t\tBool: bcs.bool(),\n\t\tBytes: bcs.vector(bcs.u8()),\n\t\tType: type_name.TypeName,\n\t},\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,mBAAyB;AACzB,iBAAoB;AACpB,gBAA2B;AAC3B,MAAM,cAAc;AACb,MAAM,QAAQ,IAAI,sBAAS;AAAA,EACjC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,KAAK,eAAI,IAAI;AAAA,IACb,SAAS,eAAI;AAAA,IACb,QAAQ,eAAI,OAAO;AAAA,IACnB,aAAa,eAAI,OAAO;AAAA,IACxB,MAAM,eAAI,KAAK;AAAA,IACf,OAAO,eAAI,OAAO,eAAI,GAAG,CAAC;AAAA,IAC1B,MAAM,UAAU;AAAA,EACjB;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,14 @@
1
+ /** Functionality for converting Move types into values. Use with care! */
2
+ import { MoveStruct } from '../../../utils/index.js';
3
+ export declare const TypeName: MoveStruct<{
4
+ /**
5
+ * String representation of the type. All types are represented using their source
6
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
7
+ * Struct types are represented as fully qualified type names; e.g.
8
+ * `00000000000000000000000000000001::string::String` or
9
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
10
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
11
+ * 32 depending on the Move platform)
12
+ */
13
+ name: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
14
+ }, "std::type_name::TypeName">;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var type_name_exports = {};
20
+ __export(type_name_exports, {
21
+ TypeName: () => TypeName
22
+ });
23
+ module.exports = __toCommonJS(type_name_exports);
24
+ var import_utils = require("../../../utils/index.js");
25
+ var import_bcs = require("@haneullabs/haneul/bcs");
26
+ const $moduleName = "std::type_name";
27
+ const TypeName = new import_utils.MoveStruct({
28
+ name: `${$moduleName}::TypeName`,
29
+ fields: {
30
+ /**
31
+ * String representation of the type. All types are represented using their source
32
+ * syntax: "u8", "u64", "bool", "address", "vector", and so on for primitive types.
33
+ * Struct types are represented as fully qualified type names; e.g.
34
+ * `00000000000000000000000000000001::string::String` or
35
+ * `0000000000000000000000000000000a::module_name1::type_name1<0000000000000000000000000000000a::module_name2::type_name2<u64>>`
36
+ * Addresses are hex-encoded lowercase values of length ADDRESS_LENGTH (16, 20, or
37
+ * 32 depending on the Move platform)
38
+ */
39
+ name: import_bcs.bcs.string()
40
+ }
41
+ });
42
+ //# sourceMappingURL=type_name.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/contracts/payment_kit/deps/std/type_name.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAA2B;AAC3B,iBAAoB;AACpB,MAAM,cAAc;AACb,MAAM,WAAW,IAAI,wBAAW;AAAA,EACtC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAUP,MAAM,eAAI,OAAO;AAAA,EAClB;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,5 @@
1
+ /** Sui object identifiers */
2
+ import { MoveStruct } from '../../../utils/index.js';
3
+ export declare const UID: MoveStruct<{
4
+ id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
5
+ }, "0x2::object::UID">;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var object_exports = {};
20
+ __export(object_exports, {
21
+ UID: () => UID
22
+ });
23
+ module.exports = __toCommonJS(object_exports);
24
+ var import_utils = require("../../../utils/index.js");
25
+ var import_bcs = require("@haneullabs/haneul/bcs");
26
+ const $moduleName = "0x2::object";
27
+ const UID = new import_utils.MoveStruct({
28
+ name: `${$moduleName}::UID`,
29
+ fields: {
30
+ id: import_bcs.bcs.Address
31
+ }
32
+ });
33
+ //# sourceMappingURL=object.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/contracts/payment_kit/deps/sui/object.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\n/** Sui object identifiers */\n\nimport { MoveStruct } from '../../../utils/index.js';\nimport { bcs } from '@haneullabs/haneul/bcs';\nconst $moduleName = '0x2::object';\nexport const UID = new MoveStruct({\n\tname: `${$moduleName}::UID`,\n\tfields: {\n\t\tid: bcs.Address,\n\t},\n});\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAKA,mBAA2B;AAC3B,iBAAoB;AACpB,MAAM,cAAc;AACb,MAAM,MAAM,IAAI,wBAAW;AAAA,EACjC,MAAM,GAAG,WAAW;AAAA,EACpB,QAAQ;AAAA,IACP,IAAI,eAAI;AAAA,EACT;AACD,CAAC;",
6
+ "names": []
7
+ }
@@ -0,0 +1,27 @@
1
+ import type { BcsType } from '@haneullabs/haneul/bcs';
2
+ import { MoveStruct } from '../../../utils/index.js';
3
+ /** An entry in the map */
4
+ export declare function Entry<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]): MoveStruct<{
5
+ key: K;
6
+ value: V;
7
+ }, `0x2::vec_map::Entry<${K["name"]}, ${V["name"]}>`>;
8
+ /**
9
+ * A map data structure backed by a vector. The map is guaranteed not to contain
10
+ * duplicate keys, but entries are _not_ sorted by key--entries are included in
11
+ * insertion order. All operations are O(N) in the size of the map--the intention
12
+ * of this data structure is only to provide the convenience of programming against
13
+ * a map API. Large maps should use handwritten parent/child relationships instead.
14
+ * Maps that need sorted iteration rather than insertion order iteration should
15
+ * also be handwritten.
16
+ */
17
+ export declare function VecMap<K extends BcsType<any>, V extends BcsType<any>>(...typeParameters: [K, V]): MoveStruct<{
18
+ contents: BcsType<{
19
+ key: K extends BcsType<infer U, any, string> ? U : never;
20
+ value: V extends BcsType<infer U, any, string> ? U : never;
21
+ }[], Iterable<{
22
+ key: K extends BcsType<any, infer U_1, string> ? U_1 : never;
23
+ value: V extends BcsType<any, infer U_1, string> ? U_1 : never;
24
+ }> & {
25
+ length: number;
26
+ }, string>;
27
+ }, `0x2::vec_map::VecMap<${K["name"]}, ${V["name"]}>`>;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var vec_map_exports = {};
20
+ __export(vec_map_exports, {
21
+ Entry: () => Entry,
22
+ VecMap: () => VecMap
23
+ });
24
+ module.exports = __toCommonJS(vec_map_exports);
25
+ var import_bcs = require("@haneullabs/haneul/bcs");
26
+ var import_utils = require("../../../utils/index.js");
27
+ const $moduleName = "0x2::vec_map";
28
+ function Entry(...typeParameters) {
29
+ return new import_utils.MoveStruct({
30
+ name: `${$moduleName}::Entry<${typeParameters[0].name}, ${typeParameters[1].name}>`,
31
+ fields: {
32
+ key: typeParameters[0],
33
+ value: typeParameters[1]
34
+ }
35
+ });
36
+ }
37
+ function VecMap(...typeParameters) {
38
+ return new import_utils.MoveStruct({
39
+ name: `${$moduleName}::VecMap<${typeParameters[0].name}, ${typeParameters[1].name}>`,
40
+ fields: {
41
+ contents: import_bcs.bcs.vector(Entry(typeParameters[0], typeParameters[1]))
42
+ }
43
+ });
44
+ }
45
+ //# sourceMappingURL=vec_map.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../src/contracts/payment_kit/deps/sui/vec_map.ts"],
4
+ "sourcesContent": ["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\nimport { bcs } from '@haneullabs/haneul/bcs';\nimport type { BcsType } 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"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,iBAAoB;AAEpB,mBAA2B;AAC3B,MAAM,cAAc;AAEb,SAAS,SAAyD,gBAAwB;AAChG,SAAO,IAAI,wBAAW;AAAA,IACrB,MAAM,GAAG,WAAW,WAAW,eAAe,CAAC,EAAE,IAAiB,KAAK,eAAe,CAAC,EAAE,IAAiB;AAAA,IAC1G,QAAQ;AAAA,MACP,KAAK,eAAe,CAAC;AAAA,MACrB,OAAO,eAAe,CAAC;AAAA,IACxB;AAAA,EACD,CAAC;AACF;AAUO,SAAS,UAA0D,gBAAwB;AACjG,SAAO,IAAI,wBAAW;AAAA,IACrB,MAAM,GAAG,WAAW,YAAY,eAAe,CAAC,EAAE,IAAiB,KAAK,eAAe,CAAC,EAAE,IAAiB;AAAA,IAC3G,QAAQ;AAAA,MACP,UAAU,eAAI,OAAO,MAAM,eAAe,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC;AAAA,IACjE;AAAA,EACD,CAAC;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,233 @@
1
+ import { MoveStruct, MoveEnum, MoveTuple } from '../utils/index.js';
2
+ import type { RawTransactionArgument } from '../utils/index.js';
3
+ import type { Transaction } from '@haneullabs/haneul/transactions';
4
+ export declare const Namespace: MoveStruct<{
5
+ id: MoveStruct<{
6
+ id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
7
+ }, "0x2::object::UID">;
8
+ }, "@haneullabs/payment-kit::payment_kit::Namespace">;
9
+ export declare const PaymentRegistry: MoveStruct<{
10
+ id: MoveStruct<{
11
+ id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
12
+ }, "0x2::object::UID">;
13
+ cap_id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
14
+ config: MoveStruct<{
15
+ contents: import("@haneullabs/haneul/bcs").BcsType<{
16
+ key: string;
17
+ value: import("@haneullabs/bcs").EnumOutputShapeWithKeys<{
18
+ U64: string;
19
+ Address: string;
20
+ String: string;
21
+ AsciiString: string;
22
+ Bool: boolean;
23
+ Bytes: number[];
24
+ Type: {
25
+ name: string;
26
+ };
27
+ }, "String" | "U64" | "Address" | "AsciiString" | "Bool" | "Bytes" | "Type">;
28
+ }[], Iterable<{
29
+ key: string;
30
+ value: import("@haneullabs/bcs").EnumInputShape<{
31
+ U64: string | number | bigint;
32
+ Address: string | Uint8Array<ArrayBufferLike>;
33
+ String: string;
34
+ AsciiString: string;
35
+ Bool: boolean;
36
+ Bytes: Iterable<number> & {
37
+ length: number;
38
+ };
39
+ Type: {
40
+ name: string;
41
+ };
42
+ }>;
43
+ }> & {
44
+ length: number;
45
+ }, string>;
46
+ }, "0x2::vec_map::VecMap<string, @haneullabs/payment-kit::config::Value>">;
47
+ version: import("@haneullabs/haneul/bcs").BcsType<number, number, "u16">;
48
+ }, "@haneullabs/payment-kit::payment_kit::PaymentRegistry">;
49
+ export declare const RegistryAdminCap: MoveStruct<{
50
+ id: MoveStruct<{
51
+ id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
52
+ }, "0x2::object::UID">;
53
+ registry_id: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
54
+ }, "@haneullabs/payment-kit::payment_kit::RegistryAdminCap">;
55
+ /**
56
+ * Enum representing the type of payment: Ephemeral (one-time) or Registry (tracked
57
+ * in a registry).
58
+ */
59
+ export declare const PaymentType: MoveEnum<{
60
+ Ephemeral: null;
61
+ Registry: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
62
+ }, "@haneullabs/payment-kit::payment_kit::PaymentType">;
63
+ export declare const PaymentReceipt: MoveStruct<{
64
+ payment_type: MoveEnum<{
65
+ Ephemeral: null;
66
+ Registry: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
67
+ }, "@haneullabs/payment-kit::payment_kit::PaymentType">;
68
+ nonce: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
69
+ payment_amount: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
70
+ receiver: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
71
+ coin_type: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
72
+ timestamp_ms: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
73
+ }, "@haneullabs/payment-kit::payment_kit::PaymentReceipt">;
74
+ export declare const PaymentKey: MoveStruct<{
75
+ nonce: import("@haneullabs/haneul/bcs").BcsType<string, string, "string">;
76
+ payment_amount: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
77
+ receiver: import("@haneullabs/haneul/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
78
+ }, "@haneullabs/payment-kit::payment_kit::PaymentKey">;
79
+ export declare const PaymentRecord: MoveStruct<{
80
+ epoch_at_time_of_record: import("@haneullabs/haneul/bcs").BcsType<string, string | number | bigint, "u64">;
81
+ }, "@haneullabs/payment-kit::payment_kit::PaymentRecord">;
82
+ export declare const BalanceKey: MoveTuple<import("@haneullabs/haneul/bcs").BcsType<boolean, boolean, "bool">[], "@haneullabs/payment-kit::payment_kit::BalanceKey">;
83
+ export interface CreateRegistryArguments {
84
+ namespace: RawTransactionArgument<string>;
85
+ name: RawTransactionArgument<string>;
86
+ }
87
+ export interface CreateRegistryOptions {
88
+ package?: string;
89
+ arguments: CreateRegistryArguments | [namespace: RawTransactionArgument<string>, name: RawTransactionArgument<string>];
90
+ }
91
+ /**
92
+ * Creates a new payment registry with a supplied label. Label is used to derive
93
+ * the registry's ID.
94
+ */
95
+ export declare function createRegistry(options: CreateRegistryOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
96
+ export interface ProcessEphemeralPaymentArguments {
97
+ nonce: RawTransactionArgument<string>;
98
+ paymentAmount: RawTransactionArgument<number | bigint>;
99
+ coin: RawTransactionArgument<string>;
100
+ receiver: RawTransactionArgument<string>;
101
+ }
102
+ export interface ProcessEphemeralPaymentOptions {
103
+ package?: string;
104
+ arguments: ProcessEphemeralPaymentArguments | [
105
+ nonce: RawTransactionArgument<string>,
106
+ paymentAmount: RawTransactionArgument<number | bigint>,
107
+ coin: RawTransactionArgument<string>,
108
+ receiver: RawTransactionArgument<string>
109
+ ];
110
+ typeArguments: [string];
111
+ }
112
+ /**
113
+ * Processes a payment (without the use of a Registry), emitting a payment receipt
114
+ * event.
115
+ */
116
+ export declare function processEphemeralPayment(options: ProcessEphemeralPaymentOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
117
+ export interface ProcessRegistryPaymentArguments {
118
+ registry: RawTransactionArgument<string>;
119
+ nonce: RawTransactionArgument<string>;
120
+ paymentAmount: RawTransactionArgument<number | bigint>;
121
+ coin: RawTransactionArgument<string>;
122
+ receiver: RawTransactionArgument<string | null>;
123
+ }
124
+ export interface ProcessRegistryPaymentOptions {
125
+ package?: string;
126
+ arguments: ProcessRegistryPaymentArguments | [
127
+ registry: RawTransactionArgument<string>,
128
+ nonce: RawTransactionArgument<string>,
129
+ paymentAmount: RawTransactionArgument<number | bigint>,
130
+ coin: RawTransactionArgument<string>,
131
+ receiver: RawTransactionArgument<string | null>
132
+ ];
133
+ typeArguments: [string];
134
+ }
135
+ /**
136
+ * Processes a payment via a payment registry, writing a receipt to the registry
137
+ * and protecting from double spending for the same key.
138
+ */
139
+ export declare function processRegistryPayment(options: ProcessRegistryPaymentOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
140
+ export interface WithdrawFromRegistryArguments {
141
+ registry: RawTransactionArgument<string>;
142
+ cap: RawTransactionArgument<string>;
143
+ }
144
+ export interface WithdrawFromRegistryOptions {
145
+ package?: string;
146
+ arguments: WithdrawFromRegistryArguments | [registry: RawTransactionArgument<string>, cap: RawTransactionArgument<string>];
147
+ typeArguments: [string];
148
+ }
149
+ /**
150
+ * If the registry is configured to manage funds, withdraw all funds of the
151
+ * specified coin from the registry.
152
+ */
153
+ export declare function withdrawFromRegistry(options: WithdrawFromRegistryOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
154
+ export interface DeletePaymentRecordArguments {
155
+ registry: RawTransactionArgument<string>;
156
+ paymentKey: RawTransactionArgument<string>;
157
+ }
158
+ export interface DeletePaymentRecordOptions {
159
+ package?: string;
160
+ arguments: DeletePaymentRecordArguments | [registry: RawTransactionArgument<string>, paymentKey: RawTransactionArgument<string>];
161
+ typeArguments: [string];
162
+ }
163
+ /** Removes an expired Payment Record from the Registry. */
164
+ export declare function deletePaymentRecord(options: DeletePaymentRecordOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
165
+ export interface CreatePaymentKeyArguments {
166
+ nonce: RawTransactionArgument<string>;
167
+ paymentAmount: RawTransactionArgument<number | bigint>;
168
+ receiver: RawTransactionArgument<string>;
169
+ }
170
+ export interface CreatePaymentKeyOptions {
171
+ package?: string;
172
+ arguments: CreatePaymentKeyArguments | [
173
+ nonce: RawTransactionArgument<string>,
174
+ paymentAmount: RawTransactionArgument<number | bigint>,
175
+ receiver: RawTransactionArgument<string>
176
+ ];
177
+ typeArguments: [string];
178
+ }
179
+ /** Creates a PaymentKey from payment parameters. */
180
+ export declare function createPaymentKey(options: CreatePaymentKeyOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
181
+ export interface SetConfigEpochExpirationDurationArguments {
182
+ registry: RawTransactionArgument<string>;
183
+ cap: RawTransactionArgument<string>;
184
+ epochExpirationDuration: RawTransactionArgument<number | bigint>;
185
+ }
186
+ export interface SetConfigEpochExpirationDurationOptions {
187
+ package?: string;
188
+ arguments: SetConfigEpochExpirationDurationArguments | [
189
+ registry: RawTransactionArgument<string>,
190
+ cap: RawTransactionArgument<string>,
191
+ epochExpirationDuration: RawTransactionArgument<number | bigint>
192
+ ];
193
+ }
194
+ /**
195
+ * Sets the epoch expiration duration configuration for the registry. If set,
196
+ * payment records will expire after the specified number of epochs. If not set,
197
+ * payment records will expire 30 epochs after their creation.
198
+ */
199
+ export declare function setConfigEpochExpirationDuration(options: SetConfigEpochExpirationDurationOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
200
+ export interface SetConfigRegistryManagedFundsArguments {
201
+ registry: RawTransactionArgument<string>;
202
+ cap: RawTransactionArgument<string>;
203
+ registryManagedFunds: RawTransactionArgument<boolean>;
204
+ }
205
+ export interface SetConfigRegistryManagedFundsOptions {
206
+ package?: string;
207
+ arguments: SetConfigRegistryManagedFundsArguments | [
208
+ registry: RawTransactionArgument<string>,
209
+ cap: RawTransactionArgument<string>,
210
+ registryManagedFunds: RawTransactionArgument<boolean>
211
+ ];
212
+ }
213
+ /**
214
+ * Sets whether the registry should manage funds itself. If true, payments
215
+ * processed via the registry will be collected into the registry's balance. If
216
+ * false, payments will be transferred directly to the specified receiver.
217
+ */
218
+ export declare function setConfigRegistryManagedFunds(options: SetConfigRegistryManagedFundsOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;
219
+ export interface ShareArguments {
220
+ registry: RawTransactionArgument<string>;
221
+ }
222
+ export interface ShareOptions {
223
+ package?: string;
224
+ arguments: ShareArguments | [registry: RawTransactionArgument<string>];
225
+ }
226
+ /**
227
+ * Enforce that a registry will always be shared.
228
+ *
229
+ * # Parameters
230
+ *
231
+ * - `registry` - The PaymentRegistry to share
232
+ */
233
+ export declare function share(options: ShareOptions): (tx: Transaction) => import("@haneullabs/haneul/transactions").TransactionResult;