@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.
- package/CHANGELOG.md +108 -0
- 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 +11 -8
- 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.map +1 -1
- package/dist/haneulns-client.mjs +1 -2
- package/dist/haneulns-client.mjs.map +1 -1
- package/dist/haneulns-transaction.d.mts +1 -2
- package/dist/haneulns-transaction.d.mts.map +1 -1
- package/dist/haneulns-transaction.mjs +1 -2
- 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.mjs +1 -2
- 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.map +1 -1
- package/package.json +8 -9
- package/src/constants.ts +19 -19
- package/src/contracts/haneulns/admin.ts +2 -2
- package/src/contracts/haneulns/config.ts +18 -18
- 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 +5 -5
- package/src/contracts/haneulns/name_record.ts +22 -27
- package/src/contracts/haneulns/payment.ts +23 -23
- package/src/contracts/haneulns/pricing_config.ts +16 -16
- package/src/contracts/haneulns/registry.ts +53 -67
- package/src/contracts/haneulns_coupons/coupon_house.ts +13 -13
- 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
|
@@ -79,7 +79,7 @@ export function reserveDomain(options: ReserveDomainOptions) {
|
|
|
79
79
|
export interface ReserveDomainsArguments {
|
|
80
80
|
_: RawTransactionArgument<string>;
|
|
81
81
|
haneulns: RawTransactionArgument<string>;
|
|
82
|
-
domains: RawTransactionArgument<string
|
|
82
|
+
domains: RawTransactionArgument<Array<string>>;
|
|
83
83
|
noYears: RawTransactionArgument<number>;
|
|
84
84
|
}
|
|
85
85
|
export interface ReserveDomainsOptions {
|
|
@@ -89,7 +89,7 @@ export interface ReserveDomainsOptions {
|
|
|
89
89
|
| [
|
|
90
90
|
_: RawTransactionArgument<string>,
|
|
91
91
|
haneulns: RawTransactionArgument<string>,
|
|
92
|
-
domains: RawTransactionArgument<string
|
|
92
|
+
domains: RawTransactionArgument<Array<string>>,
|
|
93
93
|
noYears: RawTransactionArgument<number>,
|
|
94
94
|
];
|
|
95
95
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
5
5
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
6
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
6
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
7
7
|
const $moduleName = '@haneulns/core::config';
|
|
8
8
|
export const Config = new MoveStruct({
|
|
9
9
|
name: `${$moduleName}::Config`,
|
|
@@ -15,7 +15,7 @@ export const Config = new MoveStruct({
|
|
|
15
15
|
},
|
|
16
16
|
});
|
|
17
17
|
export interface NewArguments {
|
|
18
|
-
PublicKey: RawTransactionArgument<number
|
|
18
|
+
PublicKey: RawTransactionArgument<Array<number>>;
|
|
19
19
|
ThreeCharPrice: RawTransactionArgument<number | bigint>;
|
|
20
20
|
FourCharPrice: RawTransactionArgument<number | bigint>;
|
|
21
21
|
FivePlusCharPrice: RawTransactionArgument<number | bigint>;
|
|
@@ -25,7 +25,7 @@ export interface NewOptions {
|
|
|
25
25
|
arguments:
|
|
26
26
|
| NewArguments
|
|
27
27
|
| [
|
|
28
|
-
PublicKey: RawTransactionArgument<number
|
|
28
|
+
PublicKey: RawTransactionArgument<Array<number>>,
|
|
29
29
|
ThreeCharPrice: RawTransactionArgument<number | bigint>,
|
|
30
30
|
FourCharPrice: RawTransactionArgument<number | bigint>,
|
|
31
31
|
FivePlusCharPrice: RawTransactionArgument<number | bigint>,
|
|
@@ -49,7 +49,7 @@ export function _new(options: NewOptions) {
|
|
|
49
49
|
}
|
|
50
50
|
export interface SetPublicKeyOptions {
|
|
51
51
|
package?: string;
|
|
52
|
-
arguments: [_:
|
|
52
|
+
arguments: [_: TransactionArgument, _: RawTransactionArgument<Array<number>>];
|
|
53
53
|
}
|
|
54
54
|
export function setPublicKey(options: SetPublicKeyOptions) {
|
|
55
55
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -64,7 +64,7 @@ export function setPublicKey(options: SetPublicKeyOptions) {
|
|
|
64
64
|
}
|
|
65
65
|
export interface SetThreeCharPriceOptions {
|
|
66
66
|
package?: string;
|
|
67
|
-
arguments: [_:
|
|
67
|
+
arguments: [_: TransactionArgument, _: RawTransactionArgument<number | bigint>];
|
|
68
68
|
}
|
|
69
69
|
export function setThreeCharPrice(options: SetThreeCharPriceOptions) {
|
|
70
70
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -79,7 +79,7 @@ export function setThreeCharPrice(options: SetThreeCharPriceOptions) {
|
|
|
79
79
|
}
|
|
80
80
|
export interface SetFourCharPriceOptions {
|
|
81
81
|
package?: string;
|
|
82
|
-
arguments: [_:
|
|
82
|
+
arguments: [_: TransactionArgument, _: RawTransactionArgument<number | bigint>];
|
|
83
83
|
}
|
|
84
84
|
export function setFourCharPrice(options: SetFourCharPriceOptions) {
|
|
85
85
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -94,7 +94,7 @@ export function setFourCharPrice(options: SetFourCharPriceOptions) {
|
|
|
94
94
|
}
|
|
95
95
|
export interface SetFivePlusCharPriceOptions {
|
|
96
96
|
package?: string;
|
|
97
|
-
arguments: [_:
|
|
97
|
+
arguments: [_: TransactionArgument, _: RawTransactionArgument<number | bigint>];
|
|
98
98
|
}
|
|
99
99
|
export function setFivePlusCharPrice(options: SetFivePlusCharPriceOptions) {
|
|
100
100
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -110,7 +110,7 @@ export function setFivePlusCharPrice(options: SetFivePlusCharPriceOptions) {
|
|
|
110
110
|
export interface CalculatePriceOptions {
|
|
111
111
|
package?: string;
|
|
112
112
|
arguments: [
|
|
113
|
-
_:
|
|
113
|
+
_: TransactionArgument,
|
|
114
114
|
_: RawTransactionArgument<number>,
|
|
115
115
|
_: RawTransactionArgument<number>,
|
|
116
116
|
];
|
|
@@ -127,11 +127,11 @@ export function calculatePrice(options: CalculatePriceOptions) {
|
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
129
|
export interface PublicKeyArguments {
|
|
130
|
-
_:
|
|
130
|
+
_: TransactionArgument;
|
|
131
131
|
}
|
|
132
132
|
export interface PublicKeyOptions {
|
|
133
133
|
package?: string;
|
|
134
|
-
arguments: PublicKeyArguments | [_:
|
|
134
|
+
arguments: PublicKeyArguments | [_: TransactionArgument];
|
|
135
135
|
}
|
|
136
136
|
export function publicKey(options: PublicKeyOptions) {
|
|
137
137
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -146,11 +146,11 @@ export function publicKey(options: PublicKeyOptions) {
|
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
148
|
export interface ThreeCharPriceArguments {
|
|
149
|
-
_:
|
|
149
|
+
_: TransactionArgument;
|
|
150
150
|
}
|
|
151
151
|
export interface ThreeCharPriceOptions {
|
|
152
152
|
package?: string;
|
|
153
|
-
arguments: ThreeCharPriceArguments | [_:
|
|
153
|
+
arguments: ThreeCharPriceArguments | [_: TransactionArgument];
|
|
154
154
|
}
|
|
155
155
|
export function threeCharPrice(options: ThreeCharPriceOptions) {
|
|
156
156
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -165,11 +165,11 @@ export function threeCharPrice(options: ThreeCharPriceOptions) {
|
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
167
|
export interface FourCharPriceArguments {
|
|
168
|
-
_:
|
|
168
|
+
_: TransactionArgument;
|
|
169
169
|
}
|
|
170
170
|
export interface FourCharPriceOptions {
|
|
171
171
|
package?: string;
|
|
172
|
-
arguments: FourCharPriceArguments | [_:
|
|
172
|
+
arguments: FourCharPriceArguments | [_: TransactionArgument];
|
|
173
173
|
}
|
|
174
174
|
export function fourCharPrice(options: FourCharPriceOptions) {
|
|
175
175
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -184,11 +184,11 @@ export function fourCharPrice(options: FourCharPriceOptions) {
|
|
|
184
184
|
});
|
|
185
185
|
}
|
|
186
186
|
export interface FivePlusCharPriceArguments {
|
|
187
|
-
_:
|
|
187
|
+
_: TransactionArgument;
|
|
188
188
|
}
|
|
189
189
|
export interface FivePlusCharPriceOptions {
|
|
190
190
|
package?: string;
|
|
191
|
-
arguments: FivePlusCharPriceArguments | [_:
|
|
191
|
+
arguments: FivePlusCharPriceArguments | [_: TransactionArgument];
|
|
192
192
|
}
|
|
193
193
|
export function fivePlusCharPrice(options: FivePlusCharPriceOptions) {
|
|
194
194
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -203,11 +203,11 @@ export function fivePlusCharPrice(options: FivePlusCharPriceOptions) {
|
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
export interface AssertValidUserRegisterableDomainArguments {
|
|
206
|
-
_:
|
|
206
|
+
_: TransactionArgument;
|
|
207
207
|
}
|
|
208
208
|
export interface AssertValidUserRegisterableDomainOptions {
|
|
209
209
|
package?: string;
|
|
210
|
-
arguments: AssertValidUserRegisterableDomainArguments | [_:
|
|
210
|
+
arguments: AssertValidUserRegisterableDomainArguments | [_: TransactionArgument];
|
|
211
211
|
}
|
|
212
212
|
export function assertValidUserRegisterableDomain(
|
|
213
213
|
options: AssertValidUserRegisterableDomainOptions,
|
|
@@ -2,14 +2,22 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import {
|
|
5
|
-
MoveTuple,
|
|
6
5
|
MoveStruct,
|
|
6
|
+
MoveTuple,
|
|
7
7
|
normalizeMoveArguments,
|
|
8
8
|
type RawTransactionArgument,
|
|
9
9
|
} from '../utils/index.js';
|
|
10
10
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
11
11
|
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
12
|
+
import * as domain from './domain.js';
|
|
12
13
|
const $moduleName = '@haneulns/core::controller';
|
|
14
|
+
export const SubnamePrunedEvent = new MoveStruct({
|
|
15
|
+
name: `${$moduleName}::SubnamePrunedEvent`,
|
|
16
|
+
fields: {
|
|
17
|
+
subdomain: domain.Domain,
|
|
18
|
+
parent_domain: domain.Domain,
|
|
19
|
+
},
|
|
20
|
+
});
|
|
13
21
|
export const ControllerV2 = new MoveTuple({
|
|
14
22
|
name: `${$moduleName}::ControllerV2`,
|
|
15
23
|
fields: [bcs.bool()],
|
|
@@ -267,3 +275,89 @@ export function burnExpiredSubname(options: BurnExpiredSubnameOptions) {
|
|
|
267
275
|
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
268
276
|
});
|
|
269
277
|
}
|
|
278
|
+
export interface PruneExpiredSubnameArguments {
|
|
279
|
+
haneulns: RawTransactionArgument<string>;
|
|
280
|
+
parent: RawTransactionArgument<string>;
|
|
281
|
+
subdomainName: RawTransactionArgument<string>;
|
|
282
|
+
}
|
|
283
|
+
export interface PruneExpiredSubnameOptions {
|
|
284
|
+
package?: string;
|
|
285
|
+
arguments:
|
|
286
|
+
| PruneExpiredSubnameArguments
|
|
287
|
+
| [
|
|
288
|
+
haneulns: RawTransactionArgument<string>,
|
|
289
|
+
parent: RawTransactionArgument<string>,
|
|
290
|
+
subdomainName: RawTransactionArgument<string>,
|
|
291
|
+
];
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Prunes an expired subdomain record from the registry by name, gated by ownership
|
|
295
|
+
* of the parent. This allows the parent holder to clean up expired subdomain
|
|
296
|
+
* records even when they don't possess the SubDomainRegistration object. After
|
|
297
|
+
* pruning, the subdomain name becomes available for re-registration. The orphaned
|
|
298
|
+
* SubDomainRegistration object (if it still exists) becomes useless.
|
|
299
|
+
*
|
|
300
|
+
* Use this when you control the parent domain but someone else holds the expired
|
|
301
|
+
* subdomain NFT.
|
|
302
|
+
*/
|
|
303
|
+
export function pruneExpiredSubname(options: PruneExpiredSubnameOptions) {
|
|
304
|
+
const packageAddress = options.package ?? '@haneulns/core';
|
|
305
|
+
const argumentsTypes = [null, null, '0x1::string::String', '0x2::clock::Clock'] satisfies (
|
|
306
|
+
| string
|
|
307
|
+
| null
|
|
308
|
+
)[];
|
|
309
|
+
const parameterNames = ['haneulns', 'parent', 'subdomainName'];
|
|
310
|
+
return (tx: Transaction) =>
|
|
311
|
+
tx.moveCall({
|
|
312
|
+
package: packageAddress,
|
|
313
|
+
module: 'controller',
|
|
314
|
+
function: 'prune_expired_subname',
|
|
315
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
export interface PruneExpiredSubnamesArguments {
|
|
319
|
+
haneulns: RawTransactionArgument<string>;
|
|
320
|
+
parent: RawTransactionArgument<string>;
|
|
321
|
+
subdomainNames: RawTransactionArgument<Array<string>>;
|
|
322
|
+
}
|
|
323
|
+
export interface PruneExpiredSubnamesOptions {
|
|
324
|
+
package?: string;
|
|
325
|
+
arguments:
|
|
326
|
+
| PruneExpiredSubnamesArguments
|
|
327
|
+
| [
|
|
328
|
+
haneulns: RawTransactionArgument<string>,
|
|
329
|
+
parent: RawTransactionArgument<string>,
|
|
330
|
+
subdomainNames: RawTransactionArgument<Array<string>>,
|
|
331
|
+
];
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Best-effort pruning of multiple expired subdomain records for a given parent.
|
|
335
|
+
*
|
|
336
|
+
* This function does **not** abort if individual entries are:
|
|
337
|
+
*
|
|
338
|
+
* - not subdomains,
|
|
339
|
+
* - not direct children of the parent,
|
|
340
|
+
* - missing from the registry,
|
|
341
|
+
* - not expired,
|
|
342
|
+
* - leaf records.
|
|
343
|
+
*
|
|
344
|
+
* It prunes what it can, emitting `SubnamePrunedEvent` for each successfully
|
|
345
|
+
* pruned record, and returns the total count of pruned entries.
|
|
346
|
+
*/
|
|
347
|
+
export function pruneExpiredSubnames(options: PruneExpiredSubnamesOptions) {
|
|
348
|
+
const packageAddress = options.package ?? '@haneulns/core';
|
|
349
|
+
const argumentsTypes = [
|
|
350
|
+
null,
|
|
351
|
+
null,
|
|
352
|
+
'vector<0x1::string::String>',
|
|
353
|
+
'0x2::clock::Clock',
|
|
354
|
+
] satisfies (string | null)[];
|
|
355
|
+
const parameterNames = ['haneulns', 'parent', 'subdomainNames'];
|
|
356
|
+
return (tx: Transaction) =>
|
|
357
|
+
tx.moveCall({
|
|
358
|
+
package: packageAddress,
|
|
359
|
+
module: 'controller',
|
|
360
|
+
function: 'prune_expired_subnames',
|
|
361
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
362
|
+
});
|
|
363
|
+
}
|
|
@@ -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({
|
|
@@ -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
|
}
|