@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
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type RawTransactionArgument,
|
|
9
9
|
} from '../utils/index.js';
|
|
10
10
|
import { bcs, type BcsType } from '@haneullabs/haneul/bcs';
|
|
11
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
11
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
12
12
|
import * as domain_1 from './domain.js';
|
|
13
13
|
import * as vec_map from './deps/haneul/vec_map.js';
|
|
14
14
|
import * as type_name from './deps/std/type_name.js';
|
|
@@ -92,7 +92,7 @@ export const Receipt = new MoveEnum({
|
|
|
92
92
|
},
|
|
93
93
|
});
|
|
94
94
|
export interface ApplyPercentageDiscountArguments<A extends BcsType<any>> {
|
|
95
|
-
intent:
|
|
95
|
+
intent: TransactionArgument;
|
|
96
96
|
haneulns: RawTransactionArgument<string>;
|
|
97
97
|
_: RawTransactionArgument<A>;
|
|
98
98
|
discountKey: RawTransactionArgument<string>;
|
|
@@ -104,7 +104,7 @@ export interface ApplyPercentageDiscountOptions<A extends BcsType<any>> {
|
|
|
104
104
|
arguments:
|
|
105
105
|
| ApplyPercentageDiscountArguments<A>
|
|
106
106
|
| [
|
|
107
|
-
intent:
|
|
107
|
+
intent: TransactionArgument,
|
|
108
108
|
haneulns: RawTransactionArgument<string>,
|
|
109
109
|
_: RawTransactionArgument<A>,
|
|
110
110
|
discountKey: RawTransactionArgument<string>,
|
|
@@ -148,7 +148,7 @@ export function applyPercentageDiscount<A extends BcsType<any>>(
|
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
export interface FinalizePaymentArguments<A extends BcsType<any>> {
|
|
151
|
-
intent:
|
|
151
|
+
intent: TransactionArgument;
|
|
152
152
|
haneulns: RawTransactionArgument<string>;
|
|
153
153
|
app: RawTransactionArgument<A>;
|
|
154
154
|
coin: RawTransactionArgument<string>;
|
|
@@ -158,7 +158,7 @@ export interface FinalizePaymentOptions<A extends BcsType<any>> {
|
|
|
158
158
|
arguments:
|
|
159
159
|
| FinalizePaymentArguments<A>
|
|
160
160
|
| [
|
|
161
|
-
intent:
|
|
161
|
+
intent: TransactionArgument,
|
|
162
162
|
haneulns: RawTransactionArgument<string>,
|
|
163
163
|
app: RawTransactionArgument<A>,
|
|
164
164
|
coin: RawTransactionArgument<string>,
|
|
@@ -246,14 +246,14 @@ export function initRenewal(options: InitRenewalOptions) {
|
|
|
246
246
|
});
|
|
247
247
|
}
|
|
248
248
|
export interface RegisterArguments {
|
|
249
|
-
receipt:
|
|
249
|
+
receipt: TransactionArgument;
|
|
250
250
|
haneulns: RawTransactionArgument<string>;
|
|
251
251
|
}
|
|
252
252
|
export interface RegisterOptions {
|
|
253
253
|
package?: string;
|
|
254
254
|
arguments:
|
|
255
255
|
| RegisterArguments
|
|
256
|
-
| [receipt:
|
|
256
|
+
| [receipt: TransactionArgument, haneulns: RawTransactionArgument<string>];
|
|
257
257
|
}
|
|
258
258
|
/**
|
|
259
259
|
* Register a domain with the given receipt. This is a hot-potato and can only be
|
|
@@ -272,7 +272,7 @@ export function register(options: RegisterOptions) {
|
|
|
272
272
|
});
|
|
273
273
|
}
|
|
274
274
|
export interface RenewArguments {
|
|
275
|
-
receipt:
|
|
275
|
+
receipt: TransactionArgument;
|
|
276
276
|
haneulns: RawTransactionArgument<string>;
|
|
277
277
|
nft: RawTransactionArgument<string>;
|
|
278
278
|
}
|
|
@@ -281,7 +281,7 @@ export interface RenewOptions {
|
|
|
281
281
|
arguments:
|
|
282
282
|
| RenewArguments
|
|
283
283
|
| [
|
|
284
|
-
receipt:
|
|
284
|
+
receipt: TransactionArgument,
|
|
285
285
|
haneulns: RawTransactionArgument<string>,
|
|
286
286
|
nft: RawTransactionArgument<string>,
|
|
287
287
|
];
|
|
@@ -303,11 +303,11 @@ export function renew(options: RenewOptions) {
|
|
|
303
303
|
});
|
|
304
304
|
}
|
|
305
305
|
export interface RequestDataArguments {
|
|
306
|
-
intent:
|
|
306
|
+
intent: TransactionArgument;
|
|
307
307
|
}
|
|
308
308
|
export interface RequestDataOptions {
|
|
309
309
|
package?: string;
|
|
310
|
-
arguments: RequestDataArguments | [intent:
|
|
310
|
+
arguments: RequestDataArguments | [intent: TransactionArgument];
|
|
311
311
|
}
|
|
312
312
|
/** Getters */
|
|
313
313
|
export function requestData(options: RequestDataOptions) {
|
|
@@ -323,11 +323,11 @@ export function requestData(options: RequestDataOptions) {
|
|
|
323
323
|
});
|
|
324
324
|
}
|
|
325
325
|
export interface YearsArguments {
|
|
326
|
-
self:
|
|
326
|
+
self: TransactionArgument;
|
|
327
327
|
}
|
|
328
328
|
export interface YearsOptions {
|
|
329
329
|
package?: string;
|
|
330
|
-
arguments: YearsArguments | [self:
|
|
330
|
+
arguments: YearsArguments | [self: TransactionArgument];
|
|
331
331
|
}
|
|
332
332
|
export function years(options: YearsOptions) {
|
|
333
333
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -342,11 +342,11 @@ export function years(options: YearsOptions) {
|
|
|
342
342
|
});
|
|
343
343
|
}
|
|
344
344
|
export interface BaseAmountArguments {
|
|
345
|
-
self:
|
|
345
|
+
self: TransactionArgument;
|
|
346
346
|
}
|
|
347
347
|
export interface BaseAmountOptions {
|
|
348
348
|
package?: string;
|
|
349
|
-
arguments: BaseAmountArguments | [self:
|
|
349
|
+
arguments: BaseAmountArguments | [self: TransactionArgument];
|
|
350
350
|
}
|
|
351
351
|
export function baseAmount(options: BaseAmountOptions) {
|
|
352
352
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -361,11 +361,11 @@ export function baseAmount(options: BaseAmountOptions) {
|
|
|
361
361
|
});
|
|
362
362
|
}
|
|
363
363
|
export interface DomainArguments {
|
|
364
|
-
self:
|
|
364
|
+
self: TransactionArgument;
|
|
365
365
|
}
|
|
366
366
|
export interface DomainOptions {
|
|
367
367
|
package?: string;
|
|
368
|
-
arguments: DomainArguments | [self:
|
|
368
|
+
arguments: DomainArguments | [self: TransactionArgument];
|
|
369
369
|
}
|
|
370
370
|
export function domain(options: DomainOptions) {
|
|
371
371
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -380,11 +380,11 @@ export function domain(options: DomainOptions) {
|
|
|
380
380
|
});
|
|
381
381
|
}
|
|
382
382
|
export interface DiscountAppliedArguments {
|
|
383
|
-
self:
|
|
383
|
+
self: TransactionArgument;
|
|
384
384
|
}
|
|
385
385
|
export interface DiscountAppliedOptions {
|
|
386
386
|
package?: string;
|
|
387
|
-
arguments: DiscountAppliedArguments | [self:
|
|
387
|
+
arguments: DiscountAppliedArguments | [self: TransactionArgument];
|
|
388
388
|
}
|
|
389
389
|
/** Returns true if at least one discount has been applied to the payment intent. */
|
|
390
390
|
export function discountApplied(options: DiscountAppliedOptions) {
|
|
@@ -400,11 +400,11 @@ export function discountApplied(options: DiscountAppliedOptions) {
|
|
|
400
400
|
});
|
|
401
401
|
}
|
|
402
402
|
export interface DiscountsAppliedArguments {
|
|
403
|
-
self:
|
|
403
|
+
self: TransactionArgument;
|
|
404
404
|
}
|
|
405
405
|
export interface DiscountsAppliedOptions {
|
|
406
406
|
package?: string;
|
|
407
|
-
arguments: DiscountsAppliedArguments | [self:
|
|
407
|
+
arguments: DiscountsAppliedArguments | [self: TransactionArgument];
|
|
408
408
|
}
|
|
409
409
|
/** A list of discounts that have been applied to the payment intent. */
|
|
410
410
|
export function discountsApplied(options: DiscountsAppliedOptions) {
|
|
@@ -420,14 +420,14 @@ export function discountsApplied(options: DiscountsAppliedOptions) {
|
|
|
420
420
|
});
|
|
421
421
|
}
|
|
422
422
|
export interface CalculateTotalAfterDiscountArguments {
|
|
423
|
-
data:
|
|
423
|
+
data: TransactionArgument;
|
|
424
424
|
discount: RawTransactionArgument<number>;
|
|
425
425
|
}
|
|
426
426
|
export interface CalculateTotalAfterDiscountOptions {
|
|
427
427
|
package?: string;
|
|
428
428
|
arguments:
|
|
429
429
|
| CalculateTotalAfterDiscountArguments
|
|
430
|
-
| [data:
|
|
430
|
+
| [data: TransactionArgument, discount: RawTransactionArgument<number>];
|
|
431
431
|
}
|
|
432
432
|
/** Public helper to calculate price after a percentage discount has been applied. */
|
|
433
433
|
export function calculateTotalAfterDiscount(options: CalculateTotalAfterDiscountOptions) {
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
type RawTransactionArgument,
|
|
9
9
|
} from '../utils/index.js';
|
|
10
10
|
import { bcs } from '@haneullabs/haneul/bcs';
|
|
11
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
11
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
12
12
|
import * as vec_map from './deps/haneul/vec_map.js';
|
|
13
13
|
const $moduleName = '@haneulns/core::pricing_config';
|
|
14
14
|
export const Range = new MoveTuple({
|
|
@@ -28,14 +28,14 @@ export const RenewalConfig = new MoveStruct({
|
|
|
28
28
|
},
|
|
29
29
|
});
|
|
30
30
|
export interface CalculateBasePriceArguments {
|
|
31
|
-
config:
|
|
31
|
+
config: TransactionArgument;
|
|
32
32
|
length: RawTransactionArgument<number | bigint>;
|
|
33
33
|
}
|
|
34
34
|
export interface CalculateBasePriceOptions {
|
|
35
35
|
package?: string;
|
|
36
36
|
arguments:
|
|
37
37
|
| CalculateBasePriceArguments
|
|
38
|
-
| [config:
|
|
38
|
+
| [config: TransactionArgument, length: RawTransactionArgument<number | bigint>];
|
|
39
39
|
}
|
|
40
40
|
/**
|
|
41
41
|
* Calculates the base price for a given length.
|
|
@@ -58,14 +58,14 @@ export function calculateBasePrice(options: CalculateBasePriceOptions) {
|
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
export interface NewArguments {
|
|
61
|
-
ranges:
|
|
62
|
-
prices: RawTransactionArgument<number | bigint
|
|
61
|
+
ranges: TransactionArgument;
|
|
62
|
+
prices: RawTransactionArgument<Array<number | bigint>>;
|
|
63
63
|
}
|
|
64
64
|
export interface NewOptions {
|
|
65
65
|
package?: string;
|
|
66
66
|
arguments:
|
|
67
67
|
| NewArguments
|
|
68
|
-
| [ranges:
|
|
68
|
+
| [ranges: TransactionArgument, prices: RawTransactionArgument<Array<number | bigint>>];
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Creates a new PricingConfig with the given ranges and prices.
|
|
@@ -88,14 +88,14 @@ export function _new(options: NewOptions) {
|
|
|
88
88
|
});
|
|
89
89
|
}
|
|
90
90
|
export interface IsBetweenInclusiveArguments {
|
|
91
|
-
range:
|
|
91
|
+
range: TransactionArgument;
|
|
92
92
|
length: RawTransactionArgument<number | bigint>;
|
|
93
93
|
}
|
|
94
94
|
export interface IsBetweenInclusiveOptions {
|
|
95
95
|
package?: string;
|
|
96
96
|
arguments:
|
|
97
97
|
| IsBetweenInclusiveArguments
|
|
98
|
-
| [range:
|
|
98
|
+
| [range: TransactionArgument, length: RawTransactionArgument<number | bigint>];
|
|
99
99
|
}
|
|
100
100
|
/** Checks if the value is between the range (inclusive). */
|
|
101
101
|
export function isBetweenInclusive(options: IsBetweenInclusiveOptions) {
|
|
@@ -111,11 +111,11 @@ export function isBetweenInclusive(options: IsBetweenInclusiveOptions) {
|
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
export interface PricingArguments {
|
|
114
|
-
config:
|
|
114
|
+
config: TransactionArgument;
|
|
115
115
|
}
|
|
116
116
|
export interface PricingOptions {
|
|
117
117
|
package?: string;
|
|
118
|
-
arguments: PricingArguments | [config:
|
|
118
|
+
arguments: PricingArguments | [config: TransactionArgument];
|
|
119
119
|
}
|
|
120
120
|
/** Returns the pricing config for usage in external apps. */
|
|
121
121
|
export function pricing(options: PricingOptions) {
|
|
@@ -131,11 +131,11 @@ export function pricing(options: PricingOptions) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
export interface NewRenewalConfigArguments {
|
|
134
|
-
config:
|
|
134
|
+
config: TransactionArgument;
|
|
135
135
|
}
|
|
136
136
|
export interface NewRenewalConfigOptions {
|
|
137
137
|
package?: string;
|
|
138
|
-
arguments: NewRenewalConfigArguments | [config:
|
|
138
|
+
arguments: NewRenewalConfigArguments | [config: TransactionArgument];
|
|
139
139
|
}
|
|
140
140
|
/** Constructor for Renewal<T> that initializes it with a PricingConfig. */
|
|
141
141
|
export function newRenewalConfig(options: NewRenewalConfigOptions) {
|
|
@@ -151,11 +151,11 @@ export function newRenewalConfig(options: NewRenewalConfigOptions) {
|
|
|
151
151
|
});
|
|
152
152
|
}
|
|
153
153
|
export interface NewRangeArguments {
|
|
154
|
-
range: RawTransactionArgument<number | bigint
|
|
154
|
+
range: RawTransactionArgument<Array<number | bigint>>;
|
|
155
155
|
}
|
|
156
156
|
export interface NewRangeOptions {
|
|
157
157
|
package?: string;
|
|
158
|
-
arguments: NewRangeArguments | [range: RawTransactionArgument<number | bigint
|
|
158
|
+
arguments: NewRangeArguments | [range: RawTransactionArgument<Array<number | bigint>>];
|
|
159
159
|
}
|
|
160
160
|
export function newRange(options: NewRangeOptions) {
|
|
161
161
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -170,11 +170,11 @@ export function newRange(options: NewRangeOptions) {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
export interface ConfigArguments {
|
|
173
|
-
renewal:
|
|
173
|
+
renewal: TransactionArgument;
|
|
174
174
|
}
|
|
175
175
|
export interface ConfigOptions {
|
|
176
176
|
package?: string;
|
|
177
|
-
arguments: ConfigArguments | [renewal:
|
|
177
|
+
arguments: ConfigArguments | [renewal: TransactionArgument];
|
|
178
178
|
}
|
|
179
179
|
export function config(options: ConfigOptions) {
|
|
180
180
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
3
|
**************************************************************/
|
|
4
4
|
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
5
|
-
import { type Transaction } from '@haneullabs/haneul/transactions';
|
|
5
|
+
import { type Transaction, type TransactionArgument } from '@haneullabs/haneul/transactions';
|
|
6
6
|
import * as table from './deps/haneul/table.js';
|
|
7
7
|
const $moduleName = '@haneulns/core::registry';
|
|
8
8
|
export const Registry = new MoveStruct({
|
|
@@ -40,8 +40,8 @@ export function _new(options: NewOptions) {
|
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
export interface AddRecordIgnoringGracePeriodArguments {
|
|
43
|
-
self:
|
|
44
|
-
domain:
|
|
43
|
+
self: TransactionArgument;
|
|
44
|
+
domain: TransactionArgument;
|
|
45
45
|
noYears: RawTransactionArgument<number>;
|
|
46
46
|
}
|
|
47
47
|
export interface AddRecordIgnoringGracePeriodOptions {
|
|
@@ -49,15 +49,15 @@ export interface AddRecordIgnoringGracePeriodOptions {
|
|
|
49
49
|
arguments:
|
|
50
50
|
| AddRecordIgnoringGracePeriodArguments
|
|
51
51
|
| [
|
|
52
|
-
self:
|
|
53
|
-
domain:
|
|
52
|
+
self: TransactionArgument,
|
|
53
|
+
domain: TransactionArgument,
|
|
54
54
|
noYears: RawTransactionArgument<number>,
|
|
55
55
|
];
|
|
56
56
|
}
|
|
57
57
|
/**
|
|
58
58
|
* Attempts to add a new record to the registry without looking at the grace
|
|
59
59
|
* period. Currently used for subdomains where there's no grace period to respect.
|
|
60
|
-
* Returns a `
|
|
60
|
+
* Returns a `HaneulnsRegistration` upon success.
|
|
61
61
|
*/
|
|
62
62
|
export function addRecordIgnoringGracePeriod(options: AddRecordIgnoringGracePeriodOptions) {
|
|
63
63
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -72,8 +72,8 @@ export function addRecordIgnoringGracePeriod(options: AddRecordIgnoringGracePeri
|
|
|
72
72
|
});
|
|
73
73
|
}
|
|
74
74
|
export interface AddRecordArguments {
|
|
75
|
-
self:
|
|
76
|
-
domain:
|
|
75
|
+
self: TransactionArgument;
|
|
76
|
+
domain: TransactionArgument;
|
|
77
77
|
noYears: RawTransactionArgument<number>;
|
|
78
78
|
}
|
|
79
79
|
export interface AddRecordOptions {
|
|
@@ -81,13 +81,13 @@ export interface AddRecordOptions {
|
|
|
81
81
|
arguments:
|
|
82
82
|
| AddRecordArguments
|
|
83
83
|
| [
|
|
84
|
-
self:
|
|
85
|
-
domain:
|
|
84
|
+
self: TransactionArgument,
|
|
85
|
+
domain: TransactionArgument,
|
|
86
86
|
noYears: RawTransactionArgument<number>,
|
|
87
87
|
];
|
|
88
88
|
}
|
|
89
89
|
/**
|
|
90
|
-
* Attempts to add a new record to the registry and returns a `
|
|
90
|
+
* Attempts to add a new record to the registry and returns a `HaneulnsRegistration`
|
|
91
91
|
* upon success. Only use with second-level names. Enforces a `grace_period` by
|
|
92
92
|
* default. Not suitable for subdomains (unless a grace period is needed).
|
|
93
93
|
*/
|
|
@@ -104,14 +104,14 @@ export function addRecord(options: AddRecordOptions) {
|
|
|
104
104
|
});
|
|
105
105
|
}
|
|
106
106
|
export interface BurnRegistrationObjectArguments {
|
|
107
|
-
self:
|
|
107
|
+
self: TransactionArgument;
|
|
108
108
|
nft: RawTransactionArgument<string>;
|
|
109
109
|
}
|
|
110
110
|
export interface BurnRegistrationObjectOptions {
|
|
111
111
|
package?: string;
|
|
112
112
|
arguments:
|
|
113
113
|
| BurnRegistrationObjectArguments
|
|
114
|
-
| [self:
|
|
114
|
+
| [self: TransactionArgument, nft: RawTransactionArgument<string>];
|
|
115
115
|
}
|
|
116
116
|
/**
|
|
117
117
|
* Attempts to burn an NFT and get storage rebates. Only works if the NFT has
|
|
@@ -130,14 +130,12 @@ export function burnRegistrationObject(options: BurnRegistrationObjectOptions) {
|
|
|
130
130
|
});
|
|
131
131
|
}
|
|
132
132
|
export interface WrapSubdomainArguments {
|
|
133
|
-
_:
|
|
133
|
+
_: TransactionArgument;
|
|
134
134
|
nft: RawTransactionArgument<string>;
|
|
135
135
|
}
|
|
136
136
|
export interface WrapSubdomainOptions {
|
|
137
137
|
package?: string;
|
|
138
|
-
arguments:
|
|
139
|
-
| WrapSubdomainArguments
|
|
140
|
-
| [_: RawTransactionArgument<string>, nft: RawTransactionArgument<string>];
|
|
138
|
+
arguments: WrapSubdomainArguments | [_: TransactionArgument, nft: RawTransactionArgument<string>];
|
|
141
139
|
}
|
|
142
140
|
/** Allow creation of subdomain wrappers only to authorized modules. */
|
|
143
141
|
export function wrapSubdomain(options: WrapSubdomainOptions) {
|
|
@@ -153,14 +151,14 @@ export function wrapSubdomain(options: WrapSubdomainOptions) {
|
|
|
153
151
|
});
|
|
154
152
|
}
|
|
155
153
|
export interface BurnSubdomainObjectArguments {
|
|
156
|
-
self:
|
|
154
|
+
self: TransactionArgument;
|
|
157
155
|
nft: RawTransactionArgument<string>;
|
|
158
156
|
}
|
|
159
157
|
export interface BurnSubdomainObjectOptions {
|
|
160
158
|
package?: string;
|
|
161
159
|
arguments:
|
|
162
160
|
| BurnSubdomainObjectArguments
|
|
163
|
-
| [self:
|
|
161
|
+
| [self: TransactionArgument, nft: RawTransactionArgument<string>];
|
|
164
162
|
}
|
|
165
163
|
/**
|
|
166
164
|
* Attempts to burn a subdomain registration object, and also invalidates any
|
|
@@ -179,8 +177,8 @@ export function burnSubdomainObject(options: BurnSubdomainObjectOptions) {
|
|
|
179
177
|
});
|
|
180
178
|
}
|
|
181
179
|
export interface AddLeafRecordArguments {
|
|
182
|
-
self:
|
|
183
|
-
domain:
|
|
180
|
+
self: TransactionArgument;
|
|
181
|
+
domain: TransactionArgument;
|
|
184
182
|
target: RawTransactionArgument<string>;
|
|
185
183
|
}
|
|
186
184
|
export interface AddLeafRecordOptions {
|
|
@@ -188,16 +186,16 @@ export interface AddLeafRecordOptions {
|
|
|
188
186
|
arguments:
|
|
189
187
|
| AddLeafRecordArguments
|
|
190
188
|
| [
|
|
191
|
-
self:
|
|
192
|
-
domain:
|
|
189
|
+
self: TransactionArgument,
|
|
190
|
+
domain: TransactionArgument,
|
|
193
191
|
target: RawTransactionArgument<string>,
|
|
194
192
|
];
|
|
195
193
|
}
|
|
196
194
|
/**
|
|
197
195
|
* Adds a `leaf` record to the registry. A `leaf` record is a record that is a
|
|
198
|
-
* subdomain and doesn't have an equivalent `
|
|
196
|
+
* subdomain and doesn't have an equivalent `HaneulnsRegistration` object.
|
|
199
197
|
*
|
|
200
|
-
* Instead, the parent's `
|
|
198
|
+
* Instead, the parent's `HaneulnsRegistration` object is used to manage
|
|
201
199
|
* target_address & remove it / determine expiration.
|
|
202
200
|
*
|
|
203
201
|
* 1. Leaf records can't have children. They only work as a resolving mechanism.
|
|
@@ -222,18 +220,16 @@ export function addLeafRecord(options: AddLeafRecordOptions) {
|
|
|
222
220
|
});
|
|
223
221
|
}
|
|
224
222
|
export interface RemoveLeafRecordArguments {
|
|
225
|
-
self:
|
|
226
|
-
domain:
|
|
223
|
+
self: TransactionArgument;
|
|
224
|
+
domain: TransactionArgument;
|
|
227
225
|
}
|
|
228
226
|
export interface RemoveLeafRecordOptions {
|
|
229
227
|
package?: string;
|
|
230
|
-
arguments:
|
|
231
|
-
| RemoveLeafRecordArguments
|
|
232
|
-
| [self: RawTransactionArgument<string>, domain: RawTransactionArgument<string>];
|
|
228
|
+
arguments: RemoveLeafRecordArguments | [self: TransactionArgument, domain: TransactionArgument];
|
|
233
229
|
}
|
|
234
230
|
/**
|
|
235
231
|
* Can be used to remove a leaf record. Leaf records do not have any symmetrical
|
|
236
|
-
* `
|
|
232
|
+
* `HaneulnsRegistration` object. Authorization of who calls this is delegated to the
|
|
237
233
|
* authorized module that calls this.
|
|
238
234
|
*/
|
|
239
235
|
export function removeLeafRecord(options: RemoveLeafRecordOptions) {
|
|
@@ -249,8 +245,8 @@ export function removeLeafRecord(options: RemoveLeafRecordOptions) {
|
|
|
249
245
|
});
|
|
250
246
|
}
|
|
251
247
|
export interface SetTargetAddressArguments {
|
|
252
|
-
self:
|
|
253
|
-
domain:
|
|
248
|
+
self: TransactionArgument;
|
|
249
|
+
domain: TransactionArgument;
|
|
254
250
|
newTarget: RawTransactionArgument<string | null>;
|
|
255
251
|
}
|
|
256
252
|
export interface SetTargetAddressOptions {
|
|
@@ -258,8 +254,8 @@ export interface SetTargetAddressOptions {
|
|
|
258
254
|
arguments:
|
|
259
255
|
| SetTargetAddressArguments
|
|
260
256
|
| [
|
|
261
|
-
self:
|
|
262
|
-
domain:
|
|
257
|
+
self: TransactionArgument,
|
|
258
|
+
domain: TransactionArgument,
|
|
263
259
|
newTarget: RawTransactionArgument<string | null>,
|
|
264
260
|
];
|
|
265
261
|
}
|
|
@@ -276,14 +272,14 @@ export function setTargetAddress(options: SetTargetAddressOptions) {
|
|
|
276
272
|
});
|
|
277
273
|
}
|
|
278
274
|
export interface UnsetReverseLookupArguments {
|
|
279
|
-
self:
|
|
275
|
+
self: TransactionArgument;
|
|
280
276
|
address: RawTransactionArgument<string>;
|
|
281
277
|
}
|
|
282
278
|
export interface UnsetReverseLookupOptions {
|
|
283
279
|
package?: string;
|
|
284
280
|
arguments:
|
|
285
281
|
| UnsetReverseLookupArguments
|
|
286
|
-
| [self:
|
|
282
|
+
| [self: TransactionArgument, address: RawTransactionArgument<string>];
|
|
287
283
|
}
|
|
288
284
|
export function unsetReverseLookup(options: UnsetReverseLookupOptions) {
|
|
289
285
|
const packageAddress = options.package ?? '@haneulns/core';
|
|
@@ -298,18 +294,18 @@ export function unsetReverseLookup(options: UnsetReverseLookupOptions) {
|
|
|
298
294
|
});
|
|
299
295
|
}
|
|
300
296
|
export interface SetReverseLookupArguments {
|
|
301
|
-
self:
|
|
297
|
+
self: TransactionArgument;
|
|
302
298
|
address: RawTransactionArgument<string>;
|
|
303
|
-
domain:
|
|
299
|
+
domain: TransactionArgument;
|
|
304
300
|
}
|
|
305
301
|
export interface SetReverseLookupOptions {
|
|
306
302
|
package?: string;
|
|
307
303
|
arguments:
|
|
308
304
|
| SetReverseLookupArguments
|
|
309
305
|
| [
|
|
310
|
-
self:
|
|
306
|
+
self: TransactionArgument,
|
|
311
307
|
address: RawTransactionArgument<string>,
|
|
312
|
-
domain:
|
|
308
|
+
domain: TransactionArgument,
|
|
313
309
|
];
|
|
314
310
|
}
|
|
315
311
|
/** Reverse lookup can only be set for the record that has the target address. */
|
|
@@ -326,9 +322,9 @@ export function setReverseLookup(options: SetReverseLookupOptions) {
|
|
|
326
322
|
});
|
|
327
323
|
}
|
|
328
324
|
export interface SetExpirationTimestampMsArguments {
|
|
329
|
-
self:
|
|
325
|
+
self: TransactionArgument;
|
|
330
326
|
nft: RawTransactionArgument<string>;
|
|
331
|
-
domain:
|
|
327
|
+
domain: TransactionArgument;
|
|
332
328
|
expirationTimestampMs: RawTransactionArgument<number | bigint>;
|
|
333
329
|
}
|
|
334
330
|
export interface SetExpirationTimestampMsOptions {
|
|
@@ -336,15 +332,15 @@ export interface SetExpirationTimestampMsOptions {
|
|
|
336
332
|
arguments:
|
|
337
333
|
| SetExpirationTimestampMsArguments
|
|
338
334
|
| [
|
|
339
|
-
self:
|
|
335
|
+
self: TransactionArgument,
|
|
340
336
|
nft: RawTransactionArgument<string>,
|
|
341
|
-
domain:
|
|
337
|
+
domain: TransactionArgument,
|
|
342
338
|
expirationTimestampMs: RawTransactionArgument<number | bigint>,
|
|
343
339
|
];
|
|
344
340
|
}
|
|
345
341
|
/**
|
|
346
|
-
* Update the `expiration_timestamp_ms` of the given `
|
|
347
|
-
* `NameRecord`. Requires the `
|
|
342
|
+
* Update the `expiration_timestamp_ms` of the given `HaneulnsRegistration` and
|
|
343
|
+
* `NameRecord`. Requires the `HaneulnsRegistration` to make sure that both timestamps
|
|
348
344
|
* are in sync.
|
|
349
345
|
*/
|
|
350
346
|
export function setExpirationTimestampMs(options: SetExpirationTimestampMsOptions) {
|
|
@@ -360,22 +356,18 @@ export function setExpirationTimestampMs(options: SetExpirationTimestampMsOption
|
|
|
360
356
|
});
|
|
361
357
|
}
|
|
362
358
|
export interface SetDataArguments {
|
|
363
|
-
self:
|
|
364
|
-
domain:
|
|
365
|
-
data:
|
|
359
|
+
self: TransactionArgument;
|
|
360
|
+
domain: TransactionArgument;
|
|
361
|
+
data: TransactionArgument;
|
|
366
362
|
}
|
|
367
363
|
export interface SetDataOptions {
|
|
368
364
|
package?: string;
|
|
369
365
|
arguments:
|
|
370
366
|
| SetDataArguments
|
|
371
|
-
| [
|
|
372
|
-
self: RawTransactionArgument<string>,
|
|
373
|
-
domain: RawTransactionArgument<string>,
|
|
374
|
-
data: RawTransactionArgument<string>,
|
|
375
|
-
];
|
|
367
|
+
| [self: TransactionArgument, domain: TransactionArgument, data: TransactionArgument];
|
|
376
368
|
}
|
|
377
369
|
/**
|
|
378
|
-
* Update the `data` of the given `NameRecord` using a `
|
|
370
|
+
* Update the `data` of the given `NameRecord` using a `HaneulnsRegistration`. Use
|
|
379
371
|
* with caution and validate(!!) that any system fields are not removed
|
|
380
372
|
* (accidentally), when building authorized packages that can write the metadata
|
|
381
373
|
* field.
|
|
@@ -393,14 +385,12 @@ export function setData(options: SetDataOptions) {
|
|
|
393
385
|
});
|
|
394
386
|
}
|
|
395
387
|
export interface HasRecordArguments {
|
|
396
|
-
self:
|
|
397
|
-
domain:
|
|
388
|
+
self: TransactionArgument;
|
|
389
|
+
domain: TransactionArgument;
|
|
398
390
|
}
|
|
399
391
|
export interface HasRecordOptions {
|
|
400
392
|
package?: string;
|
|
401
|
-
arguments:
|
|
402
|
-
| HasRecordArguments
|
|
403
|
-
| [self: RawTransactionArgument<string>, domain: RawTransactionArgument<string>];
|
|
393
|
+
arguments: HasRecordArguments | [self: TransactionArgument, domain: TransactionArgument];
|
|
404
394
|
}
|
|
405
395
|
/** Check whether the given `domain` is registered in the `Registry`. */
|
|
406
396
|
export function hasRecord(options: HasRecordOptions) {
|
|
@@ -416,14 +406,12 @@ export function hasRecord(options: HasRecordOptions) {
|
|
|
416
406
|
});
|
|
417
407
|
}
|
|
418
408
|
export interface LookupArguments {
|
|
419
|
-
self:
|
|
420
|
-
domain:
|
|
409
|
+
self: TransactionArgument;
|
|
410
|
+
domain: TransactionArgument;
|
|
421
411
|
}
|
|
422
412
|
export interface LookupOptions {
|
|
423
413
|
package?: string;
|
|
424
|
-
arguments:
|
|
425
|
-
| LookupArguments
|
|
426
|
-
| [self: RawTransactionArgument<string>, domain: RawTransactionArgument<string>];
|
|
414
|
+
arguments: LookupArguments | [self: TransactionArgument, domain: TransactionArgument];
|
|
427
415
|
}
|
|
428
416
|
/** Returns the `NameRecord` associated with the given domain or None. */
|
|
429
417
|
export function lookup(options: LookupOptions) {
|
|
@@ -439,14 +427,14 @@ export function lookup(options: LookupOptions) {
|
|
|
439
427
|
});
|
|
440
428
|
}
|
|
441
429
|
export interface ReverseLookupArguments {
|
|
442
|
-
self:
|
|
430
|
+
self: TransactionArgument;
|
|
443
431
|
address: RawTransactionArgument<string>;
|
|
444
432
|
}
|
|
445
433
|
export interface ReverseLookupOptions {
|
|
446
434
|
package?: string;
|
|
447
435
|
arguments:
|
|
448
436
|
| ReverseLookupArguments
|
|
449
|
-
| [self:
|
|
437
|
+
| [self: TransactionArgument, address: RawTransactionArgument<string>];
|
|
450
438
|
}
|
|
451
439
|
/** Returns the `domain_name` associated with the given address or None. */
|
|
452
440
|
export function reverseLookup(options: ReverseLookupOptions) {
|
|
@@ -462,14 +450,14 @@ export function reverseLookup(options: ReverseLookupOptions) {
|
|
|
462
450
|
});
|
|
463
451
|
}
|
|
464
452
|
export interface AssertNftIsAuthorizedArguments {
|
|
465
|
-
self:
|
|
453
|
+
self: TransactionArgument;
|
|
466
454
|
nft: RawTransactionArgument<string>;
|
|
467
455
|
}
|
|
468
456
|
export interface AssertNftIsAuthorizedOptions {
|
|
469
457
|
package?: string;
|
|
470
458
|
arguments:
|
|
471
459
|
| AssertNftIsAuthorizedArguments
|
|
472
|
-
| [self:
|
|
460
|
+
| [self: TransactionArgument, nft: RawTransactionArgument<string>];
|
|
473
461
|
}
|
|
474
462
|
/**
|
|
475
463
|
* Asserts that the provided NFT:
|
|
@@ -490,14 +478,12 @@ export function assertNftIsAuthorized(options: AssertNftIsAuthorizedOptions) {
|
|
|
490
478
|
});
|
|
491
479
|
}
|
|
492
480
|
export interface GetDataArguments {
|
|
493
|
-
self:
|
|
494
|
-
domain:
|
|
481
|
+
self: TransactionArgument;
|
|
482
|
+
domain: TransactionArgument;
|
|
495
483
|
}
|
|
496
484
|
export interface GetDataOptions {
|
|
497
485
|
package?: string;
|
|
498
|
-
arguments:
|
|
499
|
-
| GetDataArguments
|
|
500
|
-
| [self: RawTransactionArgument<string>, domain: RawTransactionArgument<string>];
|
|
486
|
+
arguments: GetDataArguments | [self: TransactionArgument, domain: TransactionArgument];
|
|
501
487
|
}
|
|
502
488
|
/** Returns the `data` associated with the given `Domain`. */
|
|
503
489
|
export function getData(options: GetDataOptions) {
|