@haneullabs/haneulns 1.0.2 → 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.
- package/CHANGELOG.md +108 -0
- package/dist/constants.d.mts +0 -1
- package/dist/constants.d.mts.map +1 -1
- package/dist/constants.mjs +20 -20
- package/dist/constants.mjs.map +1 -1
- package/dist/contracts/haneulns/controller.mjs +11 -4
- package/dist/contracts/haneulns/controller.mjs.map +1 -1
- package/dist/contracts/haneulns/deps/haneul/balance.mjs +2 -13
- package/dist/contracts/haneulns/deps/haneul/balance.mjs.map +1 -1
- package/dist/contracts/haneulns/deps/haneul/vec_map.mjs +1 -2
- package/dist/contracts/haneulns/deps/haneul/vec_map.mjs.map +1 -1
- package/dist/contracts/haneulns/deps/std/type_name.mjs +13 -10
- package/dist/contracts/haneulns/deps/std/type_name.mjs.map +1 -1
- package/dist/contracts/haneulns/domain.mjs +11 -16
- package/dist/contracts/haneulns/domain.mjs.map +1 -1
- package/dist/contracts/haneulns/haneulns.mjs +12 -9
- package/dist/contracts/haneulns/haneulns.mjs.map +1 -1
- package/dist/contracts/haneulns/name_record.mjs +14 -13
- package/dist/contracts/haneulns/name_record.mjs.map +1 -1
- package/dist/contracts/haneulns/payment.mjs +16 -17
- package/dist/contracts/haneulns/payment.mjs.map +1 -1
- package/dist/contracts/haneulns/pricing_config.mjs +1 -2
- package/dist/contracts/haneulns/pricing_config.mjs.map +1 -1
- package/dist/contracts/haneulns_coupons/coupon_house.mjs +4 -5
- package/dist/contracts/haneulns_coupons/coupon_house.mjs.map +1 -1
- package/dist/contracts/haneulns_coupons/data.mjs +2 -8
- package/dist/contracts/haneulns_coupons/data.mjs.map +1 -1
- package/dist/contracts/haneulns_coupons/deps/haneul/bag.mjs +4 -32
- package/dist/contracts/haneulns_coupons/deps/haneul/bag.mjs.map +1 -1
- package/dist/contracts/haneulns_discounts/deps/haneul/linked_table.mjs +5 -2
- package/dist/contracts/haneulns_discounts/deps/haneul/linked_table.mjs.map +1 -1
- package/dist/contracts/haneulns_discounts/deps/haneulns/pricing_config.mjs +2 -8
- package/dist/contracts/haneulns_discounts/deps/haneulns/pricing_config.mjs.map +1 -1
- package/dist/contracts/haneulns_discounts/discounts.mjs +3 -4
- package/dist/contracts/haneulns_discounts/discounts.mjs.map +1 -1
- package/dist/contracts/haneulns_discounts/free_claims.mjs +4 -5
- package/dist/contracts/haneulns_discounts/free_claims.mjs.map +1 -1
- package/dist/contracts/haneulns_payments/deps/haneul/vec_map.mjs +1 -2
- package/dist/contracts/haneulns_payments/deps/haneul/vec_map.mjs.map +1 -1
- package/dist/contracts/haneulns_payments/deps/std/type_name.mjs +13 -10
- package/dist/contracts/haneulns_payments/deps/std/type_name.mjs.map +1 -1
- package/dist/contracts/haneulns_payments/payments.mjs +4 -3
- package/dist/contracts/haneulns_payments/payments.mjs.map +1 -1
- package/dist/contracts/pyth/data_source.mjs +2 -8
- package/dist/contracts/pyth/data_source.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +2 -8
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +2 -8
- package/dist/contracts/pyth/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs +2 -8
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/bytes32.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs +2 -8
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/consumed_vaas.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs +2 -8
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/external_address.mjs.map +1 -1
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs +2 -8
- package/dist/contracts/pyth/deps/0xf47329f4344f3bf0f8e436e2f7b485466cff300f12a166563995d3888c296a94/set.mjs.map +1 -1
- package/dist/contracts/pyth/state.mjs +2 -8
- package/dist/contracts/pyth/state.mjs.map +1 -1
- package/dist/contracts/utils/index.mjs +97 -12
- package/dist/contracts/utils/index.mjs.map +1 -1
- package/dist/contracts/wormhole/bytes32.mjs +2 -8
- package/dist/contracts/wormhole/bytes32.mjs.map +1 -1
- package/dist/contracts/wormhole/consumed_vaas.mjs +2 -8
- package/dist/contracts/wormhole/consumed_vaas.mjs.map +1 -1
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +2 -8
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -1
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs +2 -8
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/package.mjs.map +1 -1
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs +2 -8
- package/dist/contracts/wormhole/deps/0x0000000000000000000000000000000000000000000000000000000000000002/table.mjs.map +1 -1
- package/dist/contracts/wormhole/external_address.mjs +2 -8
- package/dist/contracts/wormhole/external_address.mjs.map +1 -1
- package/dist/contracts/wormhole/fee_collector.mjs +2 -8
- package/dist/contracts/wormhole/fee_collector.mjs.map +1 -1
- package/dist/contracts/wormhole/set.mjs +2 -8
- package/dist/contracts/wormhole/set.mjs.map +1 -1
- package/dist/contracts/wormhole/state.mjs +2 -8
- package/dist/contracts/wormhole/state.mjs.map +1 -1
- package/dist/haneulns-client.d.mts +10 -10
- package/dist/haneulns-client.d.mts.map +1 -1
- package/dist/haneulns-client.mjs +9 -10
- package/dist/haneulns-client.mjs.map +1 -1
- package/dist/haneulns-transaction.d.mts +7 -8
- package/dist/haneulns-transaction.d.mts.map +1 -1
- package/dist/haneulns-transaction.mjs +4 -5
- package/dist/haneulns-transaction.mjs.map +1 -1
- package/dist/helpers.d.mts.map +1 -1
- package/dist/helpers.mjs +1 -2
- package/dist/helpers.mjs.map +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.mjs +3 -4
- package/dist/pyth/PriceServiceConnection.mjs +1 -2
- package/dist/pyth/PriceServiceConnection.mjs.map +1 -1
- package/dist/pyth/pyth-helpers.mjs +1 -1
- package/dist/pyth/pyth-helpers.mjs.map +1 -1
- package/dist/pyth/pyth.mjs +8 -6
- package/dist/pyth/pyth.mjs.map +1 -1
- package/dist/types.d.mts +3 -3
- package/dist/types.d.mts.map +1 -1
- package/package.json +11 -12
- package/src/constants.ts +19 -19
- package/src/contracts/haneulns/admin.ts +2 -2
- package/src/contracts/haneulns/auction.ts +2 -2
- package/src/contracts/haneulns/config.ts +18 -18
- package/src/contracts/haneulns/constants.ts +4 -4
- package/src/contracts/haneulns/controller.ts +95 -1
- package/src/contracts/haneulns/core_config.ts +19 -19
- package/src/contracts/haneulns/domain.ts +18 -20
- package/src/contracts/haneulns/haneulns.ts +7 -7
- package/src/contracts/haneulns/haneulns_registration.ts +11 -11
- package/src/contracts/haneulns/name_record.ts +24 -29
- package/src/contracts/haneulns/payment.ts +23 -23
- package/src/contracts/haneulns/pricing_config.ts +16 -16
- package/src/contracts/haneulns/registry.ts +61 -75
- package/src/contracts/haneulns/subdomain_registration.ts +2 -2
- package/src/contracts/haneulns_coupons/coupon_house.ts +19 -19
- package/src/contracts/haneulns_coupons/range.ts +7 -7
- package/src/contracts/haneulns_coupons/rules.ts +27 -27
- package/src/contracts/haneulns_discounts/discounts.ts +7 -7
- package/src/contracts/haneulns_discounts/free_claims.ts +7 -7
- package/src/contracts/haneulns_payments/payments.ts +13 -13
- package/src/contracts/utils/index.ts +185 -24
- package/src/haneulns-client.ts +14 -14
- package/src/haneulns-transaction.ts +5 -5
- package/src/index.ts +3 -3
- package/src/types.ts +2 -2
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
15
15
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
16
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
16
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
17
17
|
import * as vec_set from './deps/haneul/vec_set.js';
|
|
18
18
|
import * as vec_map from './deps/haneul/vec_map.js';
|
|
19
19
|
const $moduleName = '@haneulns/core::core_config';
|
|
@@ -39,26 +39,26 @@ export const CoreConfig = new MoveStruct({
|
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
41
|
export interface NewArguments {
|
|
42
|
-
publicKey: RawTransactionArgument<number
|
|
42
|
+
publicKey: RawTransactionArgument<Array<number>>;
|
|
43
43
|
minLabelLength: RawTransactionArgument<number>;
|
|
44
44
|
maxLabelLength: RawTransactionArgument<number>;
|
|
45
45
|
paymentsVersion: RawTransactionArgument<number>;
|
|
46
46
|
maxYears: RawTransactionArgument<number>;
|
|
47
|
-
validTlds: RawTransactionArgument<string
|
|
48
|
-
extra:
|
|
47
|
+
validTlds: RawTransactionArgument<Array<string>>;
|
|
48
|
+
extra: TransactionArgument;
|
|
49
49
|
}
|
|
50
50
|
export interface NewOptions {
|
|
51
51
|
package?: string;
|
|
52
52
|
arguments:
|
|
53
53
|
| NewArguments
|
|
54
54
|
| [
|
|
55
|
-
publicKey: RawTransactionArgument<number
|
|
55
|
+
publicKey: RawTransactionArgument<Array<number>>,
|
|
56
56
|
minLabelLength: RawTransactionArgument<number>,
|
|
57
57
|
maxLabelLength: RawTransactionArgument<number>,
|
|
58
58
|
paymentsVersion: RawTransactionArgument<number>,
|
|
59
59
|
maxYears: RawTransactionArgument<number>,
|
|
60
|
-
validTlds: RawTransactionArgument<string
|
|
61
|
-
extra:
|
|
60
|
+
validTlds: RawTransactionArgument<Array<string>>,
|
|
61
|
+
extra: TransactionArgument,
|
|
62
62
|
];
|
|
63
63
|
}
|
|
64
64
|
export function _new(options: NewOptions) {
|
|
@@ -90,11 +90,11 @@ export function _new(options: NewOptions) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
export interface PublicKeyArguments {
|
|
93
|
-
config:
|
|
93
|
+
config: TransactionArgument;
|
|
94
94
|
}
|
|
95
95
|
export interface PublicKeyOptions {
|
|
96
96
|
package?: string;
|
|
97
|
-
arguments: PublicKeyArguments | [config:
|
|
97
|
+
arguments: PublicKeyArguments | [config: TransactionArgument];
|
|
98
98
|
}
|
|
99
99
|
export function publicKey(options: PublicKeyOptions) {
|
|
100
100
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -109,11 +109,11 @@ export function publicKey(options: PublicKeyOptions) {
|
|
|
109
109
|
});
|
|
110
110
|
}
|
|
111
111
|
export interface MinLabelLengthArguments {
|
|
112
|
-
config:
|
|
112
|
+
config: TransactionArgument;
|
|
113
113
|
}
|
|
114
114
|
export interface MinLabelLengthOptions {
|
|
115
115
|
package?: string;
|
|
116
|
-
arguments: MinLabelLengthArguments | [config:
|
|
116
|
+
arguments: MinLabelLengthArguments | [config: TransactionArgument];
|
|
117
117
|
}
|
|
118
118
|
export function minLabelLength(options: MinLabelLengthOptions) {
|
|
119
119
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -128,11 +128,11 @@ export function minLabelLength(options: MinLabelLengthOptions) {
|
|
|
128
128
|
});
|
|
129
129
|
}
|
|
130
130
|
export interface MaxLabelLengthArguments {
|
|
131
|
-
config:
|
|
131
|
+
config: TransactionArgument;
|
|
132
132
|
}
|
|
133
133
|
export interface MaxLabelLengthOptions {
|
|
134
134
|
package?: string;
|
|
135
|
-
arguments: MaxLabelLengthArguments | [config:
|
|
135
|
+
arguments: MaxLabelLengthArguments | [config: TransactionArgument];
|
|
136
136
|
}
|
|
137
137
|
export function maxLabelLength(options: MaxLabelLengthOptions) {
|
|
138
138
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -147,14 +147,14 @@ export function maxLabelLength(options: MaxLabelLengthOptions) {
|
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
149
|
export interface IsValidTldArguments {
|
|
150
|
-
config:
|
|
150
|
+
config: TransactionArgument;
|
|
151
151
|
tld: RawTransactionArgument<string>;
|
|
152
152
|
}
|
|
153
153
|
export interface IsValidTldOptions {
|
|
154
154
|
package?: string;
|
|
155
155
|
arguments:
|
|
156
156
|
| IsValidTldArguments
|
|
157
|
-
| [config:
|
|
157
|
+
| [config: TransactionArgument, tld: RawTransactionArgument<string>];
|
|
158
158
|
}
|
|
159
159
|
export function isValidTld(options: IsValidTldOptions) {
|
|
160
160
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -169,11 +169,11 @@ export function isValidTld(options: IsValidTldOptions) {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
export interface PaymentsVersionArguments {
|
|
172
|
-
config:
|
|
172
|
+
config: TransactionArgument;
|
|
173
173
|
}
|
|
174
174
|
export interface PaymentsVersionOptions {
|
|
175
175
|
package?: string;
|
|
176
|
-
arguments: PaymentsVersionArguments | [config:
|
|
176
|
+
arguments: PaymentsVersionArguments | [config: TransactionArgument];
|
|
177
177
|
}
|
|
178
178
|
export function paymentsVersion(options: PaymentsVersionOptions) {
|
|
179
179
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -188,11 +188,11 @@ export function paymentsVersion(options: PaymentsVersionOptions) {
|
|
|
188
188
|
});
|
|
189
189
|
}
|
|
190
190
|
export interface MaxYearsArguments {
|
|
191
|
-
config:
|
|
191
|
+
config: TransactionArgument;
|
|
192
192
|
}
|
|
193
193
|
export interface MaxYearsOptions {
|
|
194
194
|
package?: string;
|
|
195
|
-
arguments: MaxYearsArguments | [config:
|
|
195
|
+
arguments: MaxYearsArguments | [config: TransactionArgument];
|
|
196
196
|
}
|
|
197
197
|
export function maxYears(options: MaxYearsOptions) {
|
|
198
198
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
14
14
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
15
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
15
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
16
16
|
const $moduleName = '@haneulns/core::domain';
|
|
17
17
|
export const Domain = new MoveStruct({
|
|
18
18
|
name: `${$moduleName}::Domain`,
|
|
@@ -47,11 +47,11 @@ export function _new(options: NewOptions) {
|
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
export interface ToStringArguments {
|
|
50
|
-
self:
|
|
50
|
+
self: TransactionArgument;
|
|
51
51
|
}
|
|
52
52
|
export interface ToStringOptions {
|
|
53
53
|
package?: string;
|
|
54
|
-
arguments: ToStringArguments | [self:
|
|
54
|
+
arguments: ToStringArguments | [self: TransactionArgument];
|
|
55
55
|
}
|
|
56
56
|
/** Converts a domain into a fully-qualified string representation. */
|
|
57
57
|
export function toString(options: ToStringOptions) {
|
|
@@ -67,14 +67,14 @@ export function toString(options: ToStringOptions) {
|
|
|
67
67
|
});
|
|
68
68
|
}
|
|
69
69
|
export interface LabelArguments {
|
|
70
|
-
self:
|
|
70
|
+
self: TransactionArgument;
|
|
71
71
|
level: RawTransactionArgument<number | bigint>;
|
|
72
72
|
}
|
|
73
73
|
export interface LabelOptions {
|
|
74
74
|
package?: string;
|
|
75
75
|
arguments:
|
|
76
76
|
| LabelArguments
|
|
77
|
-
| [self:
|
|
77
|
+
| [self: TransactionArgument, level: RawTransactionArgument<number | bigint>];
|
|
78
78
|
}
|
|
79
79
|
/**
|
|
80
80
|
* Returns the `label` in a domain specified by `level`.
|
|
@@ -100,11 +100,11 @@ export function label(options: LabelOptions) {
|
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
export interface TldArguments {
|
|
103
|
-
self:
|
|
103
|
+
self: TransactionArgument;
|
|
104
104
|
}
|
|
105
105
|
export interface TldOptions {
|
|
106
106
|
package?: string;
|
|
107
|
-
arguments: TldArguments | [self:
|
|
107
|
+
arguments: TldArguments | [self: TransactionArgument];
|
|
108
108
|
}
|
|
109
109
|
/**
|
|
110
110
|
* Returns the TLD (Top-Level Domain) of a `Domain`.
|
|
@@ -124,11 +124,11 @@ export function tld(options: TldOptions) {
|
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
export interface SldArguments {
|
|
127
|
-
self:
|
|
127
|
+
self: TransactionArgument;
|
|
128
128
|
}
|
|
129
129
|
export interface SldOptions {
|
|
130
130
|
package?: string;
|
|
131
|
-
arguments: SldArguments | [self:
|
|
131
|
+
arguments: SldArguments | [self: TransactionArgument];
|
|
132
132
|
}
|
|
133
133
|
/**
|
|
134
134
|
* Returns the SLD (Second-Level Domain) of a `Domain`.
|
|
@@ -148,11 +148,11 @@ export function sld(options: SldOptions) {
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
export interface NumberOfLevelsArguments {
|
|
151
|
-
self:
|
|
151
|
+
self: TransactionArgument;
|
|
152
152
|
}
|
|
153
153
|
export interface NumberOfLevelsOptions {
|
|
154
154
|
package?: string;
|
|
155
|
-
arguments: NumberOfLevelsArguments | [self:
|
|
155
|
+
arguments: NumberOfLevelsArguments | [self: TransactionArgument];
|
|
156
156
|
}
|
|
157
157
|
export function numberOfLevels(options: NumberOfLevelsOptions) {
|
|
158
158
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -167,11 +167,11 @@ export function numberOfLevels(options: NumberOfLevelsOptions) {
|
|
|
167
167
|
});
|
|
168
168
|
}
|
|
169
169
|
export interface IsSubdomainArguments {
|
|
170
|
-
domain:
|
|
170
|
+
domain: TransactionArgument;
|
|
171
171
|
}
|
|
172
172
|
export interface IsSubdomainOptions {
|
|
173
173
|
package?: string;
|
|
174
|
-
arguments: IsSubdomainArguments | [domain:
|
|
174
|
+
arguments: IsSubdomainArguments | [domain: TransactionArgument];
|
|
175
175
|
}
|
|
176
176
|
export function isSubdomain(options: IsSubdomainOptions) {
|
|
177
177
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -186,11 +186,11 @@ export function isSubdomain(options: IsSubdomainOptions) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
export interface ParentArguments {
|
|
189
|
-
domain:
|
|
189
|
+
domain: TransactionArgument;
|
|
190
190
|
}
|
|
191
191
|
export interface ParentOptions {
|
|
192
192
|
package?: string;
|
|
193
|
-
arguments: ParentArguments | [domain:
|
|
193
|
+
arguments: ParentArguments | [domain: TransactionArgument];
|
|
194
194
|
}
|
|
195
195
|
/** Derive the parent of a subdomain. e.g. `subdomain.example.haneul` -> `example.haneul` */
|
|
196
196
|
export function parent(options: ParentOptions) {
|
|
@@ -206,14 +206,12 @@ export function parent(options: ParentOptions) {
|
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
export interface IsParentOfArguments {
|
|
209
|
-
parent:
|
|
210
|
-
child:
|
|
209
|
+
parent: TransactionArgument;
|
|
210
|
+
child: TransactionArgument;
|
|
211
211
|
}
|
|
212
212
|
export interface IsParentOfOptions {
|
|
213
213
|
package?: string;
|
|
214
|
-
arguments:
|
|
215
|
-
| IsParentOfArguments
|
|
216
|
-
| [parent: RawTransactionArgument<string>, child: RawTransactionArgument<string>];
|
|
214
|
+
arguments: IsParentOfArguments | [parent: TransactionArgument, child: TransactionArgument];
|
|
217
215
|
}
|
|
218
216
|
/** Checks if `parent` domain is a valid parent for `child`. */
|
|
219
217
|
export function isParentOf(options: IsParentOfOptions) {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
|
|
30
30
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
31
31
|
import { bcs, type BcsType } from '@haneullabs/haneul/bcs';
|
|
32
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
32
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
33
33
|
import * as balance from './deps/haneul/balance.js';
|
|
34
34
|
const $moduleName = '@haneulns/core::haneulns';
|
|
35
35
|
export const AdminCap = new MoveStruct({
|
|
@@ -49,8 +49,8 @@ export const HaneulNS = new MoveStruct({
|
|
|
49
49
|
balance: balance.Balance,
|
|
50
50
|
},
|
|
51
51
|
});
|
|
52
|
-
export const
|
|
53
|
-
name: `${$moduleName}::
|
|
52
|
+
export const HANEULNS = new MoveStruct({
|
|
53
|
+
name: `${$moduleName}::HANEULNS`,
|
|
54
54
|
fields: {
|
|
55
55
|
dummy_field: bcs.bool(),
|
|
56
56
|
},
|
|
@@ -231,7 +231,7 @@ export function assertAppIsAuthorized(options: AssertAppIsAuthorizedOptions) {
|
|
|
231
231
|
export interface AppAddBalanceArguments<App extends BcsType<any>> {
|
|
232
232
|
_: RawTransactionArgument<App>;
|
|
233
233
|
self: RawTransactionArgument<string>;
|
|
234
|
-
balance:
|
|
234
|
+
balance: TransactionArgument;
|
|
235
235
|
}
|
|
236
236
|
export interface AppAddBalanceOptions<App extends BcsType<any>> {
|
|
237
237
|
package?: string;
|
|
@@ -240,7 +240,7 @@ export interface AppAddBalanceOptions<App extends BcsType<any>> {
|
|
|
240
240
|
| [
|
|
241
241
|
_: RawTransactionArgument<App>,
|
|
242
242
|
self: RawTransactionArgument<string>,
|
|
243
|
-
balance:
|
|
243
|
+
balance: TransactionArgument,
|
|
244
244
|
];
|
|
245
245
|
typeArguments: [string];
|
|
246
246
|
}
|
|
@@ -261,7 +261,7 @@ export function appAddBalance<App extends BcsType<any>>(options: AppAddBalanceOp
|
|
|
261
261
|
export interface AppAddCustomBalanceArguments<App extends BcsType<any>> {
|
|
262
262
|
self: RawTransactionArgument<string>;
|
|
263
263
|
_: RawTransactionArgument<App>;
|
|
264
|
-
balance:
|
|
264
|
+
balance: TransactionArgument;
|
|
265
265
|
}
|
|
266
266
|
export interface AppAddCustomBalanceOptions<App extends BcsType<any>> {
|
|
267
267
|
package?: string;
|
|
@@ -270,7 +270,7 @@ export interface AppAddCustomBalanceOptions<App extends BcsType<any>> {
|
|
|
270
270
|
| [
|
|
271
271
|
self: RawTransactionArgument<string>,
|
|
272
272
|
_: RawTransactionArgument<App>,
|
|
273
|
-
balance:
|
|
273
|
+
balance: TransactionArgument,
|
|
274
274
|
];
|
|
275
275
|
typeArguments: [string, string];
|
|
276
276
|
}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
* Handles creation of the `
|
|
7
|
-
* `
|
|
6
|
+
* Handles creation of the `HaneulnsRegistration`s. Separates the logic of creating a
|
|
7
|
+
* `HaneulnsRegistration`. New `HaneulnsRegistration`s can be created only by the
|
|
8
8
|
* `registry` and this module is tightly coupled with it.
|
|
9
9
|
*
|
|
10
10
|
* When reviewing the module, make sure that:
|
|
@@ -18,8 +18,8 @@ import { bcs } from '@haneullabs/haneul/bcs';
|
|
|
18
18
|
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
19
19
|
import * as domain_1 from './domain.js';
|
|
20
20
|
const $moduleName = '@haneulns/core::haneulns_registration';
|
|
21
|
-
export const
|
|
22
|
-
name: `${$moduleName}::
|
|
21
|
+
export const HaneulnsRegistration = new MoveStruct({
|
|
22
|
+
name: `${$moduleName}::HaneulnsRegistration`,
|
|
23
23
|
fields: {
|
|
24
24
|
id: bcs.Address,
|
|
25
25
|
/** The parsed domain. */
|
|
@@ -40,7 +40,7 @@ export interface HasExpiredOptions {
|
|
|
40
40
|
arguments: HasExpiredArguments | [self: RawTransactionArgument<string>];
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
43
|
-
* Check whether the `
|
|
43
|
+
* Check whether the `HaneulnsRegistration` has expired by comparing the expiration
|
|
44
44
|
* timeout with the current time.
|
|
45
45
|
*/
|
|
46
46
|
export function hasExpired(options: HasExpiredOptions) {
|
|
@@ -63,7 +63,7 @@ export interface HasExpiredPastGracePeriodOptions {
|
|
|
63
63
|
arguments: HasExpiredPastGracePeriodArguments | [self: RawTransactionArgument<string>];
|
|
64
64
|
}
|
|
65
65
|
/**
|
|
66
|
-
* Check whether the `
|
|
66
|
+
* Check whether the `HaneulnsRegistration` has expired by comparing the expiration
|
|
67
67
|
* timeout with the current time. This function also takes into account the grace
|
|
68
68
|
* period.
|
|
69
69
|
*/
|
|
@@ -86,7 +86,7 @@ export interface DomainOptions {
|
|
|
86
86
|
package?: string;
|
|
87
87
|
arguments: DomainArguments | [self: RawTransactionArgument<string>];
|
|
88
88
|
}
|
|
89
|
-
/** Get the `domain` field of the `
|
|
89
|
+
/** Get the `domain` field of the `HaneulnsRegistration`. */
|
|
90
90
|
export function domain(options: DomainOptions) {
|
|
91
91
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
92
92
|
const argumentsTypes = [null] satisfies (string | null)[];
|
|
@@ -106,7 +106,7 @@ export interface DomainNameOptions {
|
|
|
106
106
|
package?: string;
|
|
107
107
|
arguments: DomainNameArguments | [self: RawTransactionArgument<string>];
|
|
108
108
|
}
|
|
109
|
-
/** Get the `domain_name` field of the `
|
|
109
|
+
/** Get the `domain_name` field of the `HaneulnsRegistration`. */
|
|
110
110
|
export function domainName(options: DomainNameOptions) {
|
|
111
111
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
112
112
|
const argumentsTypes = [null] satisfies (string | null)[];
|
|
@@ -126,7 +126,7 @@ export interface ExpirationTimestampMsOptions {
|
|
|
126
126
|
package?: string;
|
|
127
127
|
arguments: ExpirationTimestampMsArguments | [self: RawTransactionArgument<string>];
|
|
128
128
|
}
|
|
129
|
-
/** Get the `expiration_timestamp_ms` field of the `
|
|
129
|
+
/** Get the `expiration_timestamp_ms` field of the `HaneulnsRegistration`. */
|
|
130
130
|
export function expirationTimestampMs(options: ExpirationTimestampMsOptions) {
|
|
131
131
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
132
132
|
const argumentsTypes = [null] satisfies (string | null)[];
|
|
@@ -146,7 +146,7 @@ export interface ImageUrlOptions {
|
|
|
146
146
|
package?: string;
|
|
147
147
|
arguments: ImageUrlArguments | [self: RawTransactionArgument<string>];
|
|
148
148
|
}
|
|
149
|
-
/** Get the `image_url` field of the `
|
|
149
|
+
/** Get the `image_url` field of the `HaneulnsRegistration`. */
|
|
150
150
|
export function imageUrl(options: ImageUrlOptions) {
|
|
151
151
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
152
152
|
const argumentsTypes = [null] satisfies (string | null)[];
|
|
@@ -185,7 +185,7 @@ export interface UidMutOptions {
|
|
|
185
185
|
package?: string;
|
|
186
186
|
arguments: UidMutArguments | [self: RawTransactionArgument<string>];
|
|
187
187
|
}
|
|
188
|
-
/** Get the mutable `id` field of the `
|
|
188
|
+
/** Get the mutable `id` field of the `HaneulnsRegistration`. */
|
|
189
189
|
export function uidMut(options: UidMutOptions) {
|
|
190
190
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
191
191
|
const argumentsTypes = [null] satisfies (string | null)[];
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
|
|
11
11
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
12
12
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
13
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
13
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
14
14
|
import * as vec_map from './deps/haneul/vec_map.js';
|
|
15
15
|
const $moduleName = '@haneulns/core::name_record';
|
|
16
16
|
export const NameRecord = new MoveStruct({
|
|
17
17
|
name: `${$moduleName}::NameRecord`,
|
|
18
18
|
fields: {
|
|
19
19
|
/**
|
|
20
|
-
* The ID of the `
|
|
20
|
+
* The ID of the `HaneulnsRegistration` assigned to this record.
|
|
21
21
|
*
|
|
22
|
-
* The owner of the corresponding `
|
|
22
|
+
* The owner of the corresponding `HaneulnsRegistration` has the rights to be able to
|
|
23
23
|
* change and adjust the `target_address` of this domain.
|
|
24
24
|
*
|
|
25
25
|
* It is possible that the ID changes if the record expires and is purchased by
|
|
@@ -90,14 +90,12 @@ export function newLeaf(options: NewLeafOptions) {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
export interface SetDataArguments {
|
|
93
|
-
self:
|
|
94
|
-
data:
|
|
93
|
+
self: TransactionArgument;
|
|
94
|
+
data: TransactionArgument;
|
|
95
95
|
}
|
|
96
96
|
export interface SetDataOptions {
|
|
97
97
|
package?: string;
|
|
98
|
-
arguments:
|
|
99
|
-
| SetDataArguments
|
|
100
|
-
| [self: RawTransactionArgument<string>, data: RawTransactionArgument<string>];
|
|
98
|
+
arguments: SetDataArguments | [self: TransactionArgument, data: TransactionArgument];
|
|
101
99
|
}
|
|
102
100
|
/**
|
|
103
101
|
* Set data as a vec_map directly overriding the data set in the registration self.
|
|
@@ -126,14 +124,14 @@ export function setData(options: SetDataOptions) {
|
|
|
126
124
|
});
|
|
127
125
|
}
|
|
128
126
|
export interface SetTargetAddressArguments {
|
|
129
|
-
self:
|
|
127
|
+
self: TransactionArgument;
|
|
130
128
|
newAddress: RawTransactionArgument<string | null>;
|
|
131
129
|
}
|
|
132
130
|
export interface SetTargetAddressOptions {
|
|
133
131
|
package?: string;
|
|
134
132
|
arguments:
|
|
135
133
|
| SetTargetAddressArguments
|
|
136
|
-
| [self:
|
|
134
|
+
| [self: TransactionArgument, newAddress: RawTransactionArgument<string | null>];
|
|
137
135
|
}
|
|
138
136
|
/** Set the `target_address` field of the `NameRecord`. */
|
|
139
137
|
export function setTargetAddress(options: SetTargetAddressOptions) {
|
|
@@ -149,17 +147,14 @@ export function setTargetAddress(options: SetTargetAddressOptions) {
|
|
|
149
147
|
});
|
|
150
148
|
}
|
|
151
149
|
export interface SetExpirationTimestampMsArguments {
|
|
152
|
-
self:
|
|
150
|
+
self: TransactionArgument;
|
|
153
151
|
expirationTimestampMs: RawTransactionArgument<number | bigint>;
|
|
154
152
|
}
|
|
155
153
|
export interface SetExpirationTimestampMsOptions {
|
|
156
154
|
package?: string;
|
|
157
155
|
arguments:
|
|
158
156
|
| SetExpirationTimestampMsArguments
|
|
159
|
-
| [
|
|
160
|
-
self: RawTransactionArgument<string>,
|
|
161
|
-
expirationTimestampMs: RawTransactionArgument<number | bigint>,
|
|
162
|
-
];
|
|
157
|
+
| [self: TransactionArgument, expirationTimestampMs: RawTransactionArgument<number | bigint>];
|
|
163
158
|
}
|
|
164
159
|
export function setExpirationTimestampMs(options: SetExpirationTimestampMsOptions) {
|
|
165
160
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -174,11 +169,11 @@ export function setExpirationTimestampMs(options: SetExpirationTimestampMsOption
|
|
|
174
169
|
});
|
|
175
170
|
}
|
|
176
171
|
export interface HasExpiredArguments {
|
|
177
|
-
self:
|
|
172
|
+
self: TransactionArgument;
|
|
178
173
|
}
|
|
179
174
|
export interface HasExpiredOptions {
|
|
180
175
|
package?: string;
|
|
181
|
-
arguments: HasExpiredArguments | [self:
|
|
176
|
+
arguments: HasExpiredArguments | [self: TransactionArgument];
|
|
182
177
|
}
|
|
183
178
|
/** Check if the record has expired. */
|
|
184
179
|
export function hasExpired(options: HasExpiredOptions) {
|
|
@@ -194,11 +189,11 @@ export function hasExpired(options: HasExpiredOptions) {
|
|
|
194
189
|
});
|
|
195
190
|
}
|
|
196
191
|
export interface HasExpiredPastGracePeriodArguments {
|
|
197
|
-
self:
|
|
192
|
+
self: TransactionArgument;
|
|
198
193
|
}
|
|
199
194
|
export interface HasExpiredPastGracePeriodOptions {
|
|
200
195
|
package?: string;
|
|
201
|
-
arguments: HasExpiredPastGracePeriodArguments | [self:
|
|
196
|
+
arguments: HasExpiredPastGracePeriodArguments | [self: TransactionArgument];
|
|
202
197
|
}
|
|
203
198
|
/** Check if the record has expired, taking into account the grace period. */
|
|
204
199
|
export function hasExpiredPastGracePeriod(options: HasExpiredPastGracePeriodOptions) {
|
|
@@ -214,11 +209,11 @@ export function hasExpiredPastGracePeriod(options: HasExpiredPastGracePeriodOpti
|
|
|
214
209
|
});
|
|
215
210
|
}
|
|
216
211
|
export interface IsLeafRecordArguments {
|
|
217
|
-
self:
|
|
212
|
+
self: TransactionArgument;
|
|
218
213
|
}
|
|
219
214
|
export interface IsLeafRecordOptions {
|
|
220
215
|
package?: string;
|
|
221
|
-
arguments: IsLeafRecordArguments | [self:
|
|
216
|
+
arguments: IsLeafRecordArguments | [self: TransactionArgument];
|
|
222
217
|
}
|
|
223
218
|
/** Checks whether a name_record is a `leaf` record. */
|
|
224
219
|
export function isLeafRecord(options: IsLeafRecordOptions) {
|
|
@@ -234,11 +229,11 @@ export function isLeafRecord(options: IsLeafRecordOptions) {
|
|
|
234
229
|
});
|
|
235
230
|
}
|
|
236
231
|
export interface DataArguments {
|
|
237
|
-
self:
|
|
232
|
+
self: TransactionArgument;
|
|
238
233
|
}
|
|
239
234
|
export interface DataOptions {
|
|
240
235
|
package?: string;
|
|
241
|
-
arguments: DataArguments | [self:
|
|
236
|
+
arguments: DataArguments | [self: TransactionArgument];
|
|
242
237
|
}
|
|
243
238
|
/** Read the `data` field from the `NameRecord`. */
|
|
244
239
|
export function data(options: DataOptions) {
|
|
@@ -254,11 +249,11 @@ export function data(options: DataOptions) {
|
|
|
254
249
|
});
|
|
255
250
|
}
|
|
256
251
|
export interface TargetAddressArguments {
|
|
257
|
-
self:
|
|
252
|
+
self: TransactionArgument;
|
|
258
253
|
}
|
|
259
254
|
export interface TargetAddressOptions {
|
|
260
255
|
package?: string;
|
|
261
|
-
arguments: TargetAddressArguments | [self:
|
|
256
|
+
arguments: TargetAddressArguments | [self: TransactionArgument];
|
|
262
257
|
}
|
|
263
258
|
/** Read the `target_address` field from the `NameRecord`. */
|
|
264
259
|
export function targetAddress(options: TargetAddressOptions) {
|
|
@@ -274,11 +269,11 @@ export function targetAddress(options: TargetAddressOptions) {
|
|
|
274
269
|
});
|
|
275
270
|
}
|
|
276
271
|
export interface NftIdArguments {
|
|
277
|
-
self:
|
|
272
|
+
self: TransactionArgument;
|
|
278
273
|
}
|
|
279
274
|
export interface NftIdOptions {
|
|
280
275
|
package?: string;
|
|
281
|
-
arguments: NftIdArguments | [self:
|
|
276
|
+
arguments: NftIdArguments | [self: TransactionArgument];
|
|
282
277
|
}
|
|
283
278
|
/** Read the `nft_id` field from the `NameRecord`. */
|
|
284
279
|
export function nftId(options: NftIdOptions) {
|
|
@@ -294,11 +289,11 @@ export function nftId(options: NftIdOptions) {
|
|
|
294
289
|
});
|
|
295
290
|
}
|
|
296
291
|
export interface ExpirationTimestampMsArguments {
|
|
297
|
-
self:
|
|
292
|
+
self: TransactionArgument;
|
|
298
293
|
}
|
|
299
294
|
export interface ExpirationTimestampMsOptions {
|
|
300
295
|
package?: string;
|
|
301
|
-
arguments: ExpirationTimestampMsArguments | [self:
|
|
296
|
+
arguments: ExpirationTimestampMsArguments | [self: TransactionArgument];
|
|
302
297
|
}
|
|
303
298
|
/** Read the `expiration_timestamp_ms` field from the `NameRecord`. */
|
|
304
299
|
export function expirationTimestampMs(options: ExpirationTimestampMsOptions) {
|