@misofm/sdk 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -56
- package/dist/client.d.ts +121 -18
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +200 -44
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts +205 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js +184 -0
- package/dist/contracts/composition_routed_stake/composition_routed_stake.js.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts +7 -0
- package/dist/contracts/composition_routed_stake/witness.d.ts.map +1 -0
- package/dist/contracts/composition_routed_stake/witness.js +9 -0
- package/dist/contracts/composition_routed_stake/witness.js.map +1 -0
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +89 -28
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +84 -23
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/composition_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/composition_royalty_pool/witness.js +8 -0
- package/dist/contracts/composition_royalty_pool/witness.js.map +1 -0
- package/dist/contracts/genre/genre.d.ts +96 -0
- package/dist/contracts/genre/genre.d.ts.map +1 -0
- package/dist/contracts/genre/genre.js +107 -0
- package/dist/contracts/genre/genre.js.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts +194 -0
- package/dist/contracts/recording_advisory/recording_advisory.d.ts.map +1 -0
- package/dist/contracts/recording_advisory/recording_advisory.js +204 -0
- package/dist/contracts/recording_advisory/recording_advisory.js.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts +6 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.d.ts.map +1 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js +8 -0
- package/dist/contracts/recording_language/deps/language_code/language_code.js.map +1 -0
- package/dist/contracts/recording_language/recording_language.d.ts +152 -0
- package/dist/contracts/recording_language/recording_language.d.ts.map +1 -0
- package/dist/contracts/recording_language/recording_language.js +149 -0
- package/dist/contracts/recording_language/recording_language.js.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_master_reference/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts +131 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.d.ts.map +1 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js +121 -0
- package/dist/contracts/recording_master_reference/recording_master_reference.js.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts +52 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.d.ts.map +1 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js +37 -0
- package/dist/contracts/recording_preview/deps/ori/walrus_data.js.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts +104 -0
- package/dist/contracts/recording_preview/recording_preview.d.ts.map +1 -0
- package/dist/contracts/recording_preview/recording_preview.js +94 -0
- package/dist/contracts/recording_preview/recording_preview.js.map +1 -0
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +90 -28
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +84 -23
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/witness.d.ts +6 -0
- package/dist/contracts/recording_royalty_pool/witness.d.ts.map +1 -0
- package/dist/contracts/recording_royalty_pool/witness.js +8 -0
- package/dist/contracts/recording_royalty_pool/witness.js.map +1 -0
- package/dist/contracts/release_description/release_description.d.ts +112 -0
- package/dist/contracts/release_description/release_description.d.ts.map +1 -0
- package/dist/contracts/release_description/release_description.js +123 -0
- package/dist/contracts/release_description/release_description.js.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts +644 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.d.ts.map +1 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js +556 -0
- package/dist/contracts/release_dsp_link/release_dsp_link.js.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts +33 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.d.ts.map +1 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js +32 -0
- package/dist/contracts/release_genre/deps/per_track/per_track.js.map +1 -0
- package/dist/contracts/release_genre/release_genre.d.ts +193 -0
- package/dist/contracts/release_genre/release_genre.d.ts.map +1 -0
- package/dist/contracts/release_genre/release_genre.js +207 -0
- package/dist/contracts/release_genre/release_genre.js.map +1 -0
- package/dist/contracts/release_kind/release_kind.d.ts +98 -0
- package/dist/contracts/release_kind/release_kind.d.ts.map +1 -0
- package/dist/contracts/release_kind/release_kind.js +109 -0
- package/dist/contracts/release_kind/release_kind.js.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts +106 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js +113 -0
- package/dist/contracts/release_revenue_distributor/release_revenue_distributor.js.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts +7 -0
- package/dist/contracts/release_revenue_distributor/witness.d.ts.map +1 -0
- package/dist/contracts/release_revenue_distributor/witness.js +9 -0
- package/dist/contracts/release_revenue_distributor/witness.js.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts +54 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js +37 -0
- package/dist/contracts/routed_stake/deps/royalty_pool/stake.js.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts +18 -0
- package/dist/contracts/routed_stake/deps/std/type_name.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js +20 -0
- package/dist/contracts/routed_stake/deps/std/type_name.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts +13 -0
- package/dist/contracts/routed_stake/deps/sui/balance.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js +15 -0
- package/dist/contracts/routed_stake/deps/sui/balance.js.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts +37 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js +28 -0
- package/dist/contracts/routed_stake/deps/sui/vec_map.js.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts +356 -0
- package/dist/contracts/routed_stake/routed_stake.d.ts.map +1 -0
- package/dist/contracts/routed_stake/routed_stake.js +311 -0
- package/dist/contracts/routed_stake/routed_stake.js.map +1 -0
- package/dist/contracts/royalty_pool/pool.d.ts +27 -17
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +26 -17
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/contracts/vault/deps/sui/bag.d.ts +35 -0
- package/dist/contracts/vault/deps/sui/bag.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/bag.js +37 -0
- package/dist/contracts/vault/deps/sui/bag.js.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts +20 -0
- package/dist/contracts/vault/deps/sui/borrow.d.ts.map +1 -0
- package/dist/contracts/vault/deps/sui/borrow.js +21 -0
- package/dist/contracts/vault/deps/sui/borrow.js.map +1 -0
- package/dist/contracts/vault/vault.d.ts +276 -0
- package/dist/contracts/vault/vault.d.ts.map +1 -0
- package/dist/contracts/vault/vault.js +274 -0
- package/dist/contracts/vault/vault.js.map +1 -0
- package/dist/contracts.d.ts +13 -2
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +15 -7
- package/dist/contracts.js.map +1 -1
- package/dist/cover.d.ts +17 -3
- package/dist/cover.d.ts.map +1 -1
- package/dist/cover.js +43 -20
- package/dist/cover.js.map +1 -1
- package/dist/credits.d.ts +31 -12
- package/dist/credits.d.ts.map +1 -1
- package/dist/credits.js +41 -25
- package/dist/credits.js.map +1 -1
- package/dist/deployments.d.ts +30 -57
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +5 -53
- package/dist/deployments.js.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/pressing.d.ts +8 -7
- package/dist/pressing.d.ts.map +1 -1
- package/dist/pressing.js +91 -32
- package/dist/pressing.js.map +1 -1
- package/dist/read/artist.js +3 -3
- package/dist/read/artist.js.map +1 -1
- package/dist/read/catalog.d.ts +14 -9
- package/dist/read/catalog.d.ts.map +1 -1
- package/dist/read/catalog.js +71 -37
- package/dist/read/catalog.js.map +1 -1
- package/dist/read/client.d.ts +4 -2
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +15 -4
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +14 -11
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +10 -37
- package/dist/read/config.js.map +1 -1
- package/dist/read/index.d.ts +2 -2
- package/dist/read/index.d.ts.map +1 -1
- package/dist/read/index.js +1 -1
- package/dist/read/index.js.map +1 -1
- package/dist/read/receipts.d.ts +24 -7
- package/dist/read/receipts.d.ts.map +1 -1
- package/dist/read/receipts.js +78 -25
- package/dist/read/receipts.js.map +1 -1
- package/dist/read/types.d.ts +43 -25
- package/dist/read/types.d.ts.map +1 -1
- package/dist/read/types.js +2 -2
- package/dist/read/types.js.map +1 -1
- package/dist/recording-extensions.d.ts +37 -0
- package/dist/recording-extensions.d.ts.map +1 -0
- package/dist/recording-extensions.js +61 -0
- package/dist/recording-extensions.js.map +1 -0
- package/dist/release-extensions.d.ts +84 -0
- package/dist/release-extensions.d.ts.map +1 -0
- package/dist/release-extensions.js +160 -0
- package/dist/release-extensions.js.map +1 -0
- package/dist/release-graph.d.ts +17 -26
- package/dist/release-graph.d.ts.map +1 -1
- package/dist/release-graph.js +55 -49
- package/dist/release-graph.js.map +1 -1
- package/dist/transactions.d.ts +43 -24
- package/dist/transactions.d.ts.map +1 -1
- package/dist/transactions.js +48 -27
- package/dist/transactions.js.map +1 -1
- package/dist/vault.d.ts +268 -0
- package/dist/vault.d.ts.map +1 -0
- package/dist/vault.js +389 -0
- package/dist/vault.js.map +1 -0
- package/package.json +17 -11
- package/src/client.ts +399 -61
- package/src/contracts/composition_routed_stake/composition_routed_stake.ts +346 -0
- package/src/contracts/composition_routed_stake/witness.ts +11 -0
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +151 -35
- package/src/contracts/composition_royalty_pool/witness.ts +7 -0
- package/src/contracts/genre/genre.ts +151 -0
- package/src/contracts/recording_advisory/recording_advisory.ts +315 -0
- package/src/contracts/recording_language/deps/language_code/language_code.ts +7 -0
- package/src/contracts/recording_language/recording_language.ts +237 -0
- package/src/contracts/recording_master_reference/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_master_reference/recording_master_reference.ts +181 -0
- package/src/contracts/recording_preview/deps/ori/walrus_data.ts +36 -0
- package/src/contracts/recording_preview/recording_preview.ts +154 -0
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +152 -35
- package/src/contracts/recording_royalty_pool/witness.ts +7 -0
- package/src/contracts/release_description/release_description.ts +167 -0
- package/src/contracts/release_dsp_link/release_dsp_link.ts +813 -0
- package/src/contracts/release_genre/deps/per_track/per_track.ts +36 -0
- package/src/contracts/release_genre/release_genre.ts +314 -0
- package/src/contracts/release_kind/release_kind.ts +153 -0
- package/src/contracts/release_revenue_distributor/release_revenue_distributor.ts +178 -0
- package/src/contracts/release_revenue_distributor/witness.ts +11 -0
- package/src/contracts/routed_stake/deps/royalty_pool/stake.ts +39 -0
- package/src/contracts/routed_stake/deps/std/type_name.ts +22 -0
- package/src/contracts/routed_stake/deps/sui/balance.ts +17 -0
- package/src/contracts/routed_stake/deps/sui/vec_map.ts +33 -0
- package/src/contracts/routed_stake/routed_stake.ts +508 -0
- package/src/contracts/royalty_pool/pool.ts +34 -24
- package/src/contracts/vault/deps/sui/bag.ts +39 -0
- package/src/contracts/vault/deps/sui/borrow.ts +25 -0
- package/src/contracts/vault/vault.ts +454 -0
- package/src/contracts.ts +16 -9
- package/src/cover.ts +62 -37
- package/src/credits.ts +64 -51
- package/src/deployments.ts +35 -97
- package/src/index.ts +11 -5
- package/src/pressing.ts +135 -39
- package/src/read/artist.ts +3 -3
- package/src/read/catalog.ts +99 -44
- package/src/read/client.ts +20 -4
- package/src/read/config.ts +23 -49
- package/src/read/index.ts +3 -1
- package/src/read/receipts.ts +103 -26
- package/src/read/types.ts +44 -27
- package/src/recording-extensions.ts +102 -0
- package/src/release-extensions.ts +261 -0
- package/src/release-graph.ts +68 -81
- package/src/transactions.ts +79 -53
- package/src/vault.ts +777 -0
- package/dist/contracts/miso_drop/drop.d.ts +0 -550
- package/dist/contracts/miso_drop/drop.d.ts.map +0 -1
- package/dist/contracts/miso_drop/drop.js +0 -523
- package/dist/contracts/miso_drop/drop.js.map +0 -1
- package/dist/contracts/release_registry/release_registry.d.ts +0 -114
- package/dist/contracts/release_registry/release_registry.d.ts.map +0 -1
- package/dist/contracts/release_registry/release_registry.js +0 -119
- package/dist/contracts/release_registry/release_registry.js.map +0 -1
- package/dist/drop.d.ts +0 -127
- package/dist/drop.d.ts.map +0 -1
- package/dist/drop.js +0 -202
- package/dist/drop.js.map +0 -1
- package/dist/extensions/royalty-pool.d.ts +0 -32
- package/dist/extensions/royalty-pool.d.ts.map +0 -1
- package/dist/extensions/royalty-pool.js +0 -33
- package/dist/extensions/royalty-pool.js.map +0 -1
- package/src/contracts/miso_drop/drop.ts +0 -798
- package/src/contracts/release_registry/release_registry.ts +0 -160
- package/src/drop.ts +0 -376
- package/src/extensions/royalty-pool.ts +0 -90
|
@@ -1,798 +0,0 @@
|
|
|
1
|
-
/**************************************************************
|
|
2
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
-
**************************************************************/
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* A primary record sale — a _Drop_.
|
|
8
|
-
*
|
|
9
|
-
* A `Drop` is a shared object that mints and sells numbered `Record` copies of a
|
|
10
|
-
* release, forwarding each payment to the release's address. Each purchase mints a
|
|
11
|
-
* `Record` whose UID is _derived_ off the `Drop`'s own UID (keyed by the 1-based
|
|
12
|
-
* serial number it was sold at), so every copy is deterministically addressable
|
|
13
|
-
* from its drop and can be minted at most once.
|
|
14
|
-
*
|
|
15
|
-
* # Scarcity is the artist's choice
|
|
16
|
-
*
|
|
17
|
-
* A drop's terms are three enums, each fixed at creation:
|
|
18
|
-
*
|
|
19
|
-
* - `Price` — `Fixed` (pay exactly) or `Floor` (pay at least; overpayment kept);
|
|
20
|
-
* - `Supply` — `Uncapped`, or `Capped { max }` ("1000 records only");
|
|
21
|
-
* - `Window` — `Unbounded { start }`, or `Bounded { start, end }` ("two weeks
|
|
22
|
-
* only").
|
|
23
|
-
*
|
|
24
|
-
* Scarcity is a per-edition decision by the artist, not a protocol stance — and it
|
|
25
|
-
* is never a dead end: fans who miss a drop can always be answered with a new
|
|
26
|
-
* edition. What a drop never has is an access gate: no allowlists, auctions, or
|
|
27
|
-
* raffles — while a drop is live, anyone may buy.
|
|
28
|
-
*
|
|
29
|
-
* # Editions — one live drop per release
|
|
30
|
-
*
|
|
31
|
-
* A release sells through at most ONE drop at a time. `new` opens edition `0`;
|
|
32
|
-
* `new_edition` opens edition `n + 1` by CONSUMING edition `n` — the predecessor
|
|
33
|
-
* shared object is destroyed, so two editions can never sell side by side, and the
|
|
34
|
-
* edition sequence is gap-free by construction (you must hold edition `n` to open
|
|
35
|
-
* `n + 1`). Because a drop is immutable once created, `new_edition` is also the
|
|
36
|
-
* only way to change anything: a new price, a new currency, a fresh run after a
|
|
37
|
-
* sell-out or a closed window — each is simply the next edition.
|
|
38
|
-
*
|
|
39
|
-
* The RELEASE is the parent: drop UIDs are _derived_ off the release's UID (via
|
|
40
|
-
* its cap-gated `uid_mut` extension surface), keyed by `DropKey(edition)`. Every
|
|
41
|
-
* edition's address is therefore computable from the release id alone — and since
|
|
42
|
-
* claim markers outlive the objects they name, a destroyed edition's key can never
|
|
43
|
-
* be claimed again. The release's UID also carries a `CurrentDropKey → ID` dynamic
|
|
44
|
-
* field pointing at the live drop (superseded drops are deleted, so the pointer —
|
|
45
|
-
* not address probing — is how clients find the current edition).
|
|
46
|
-
*
|
|
47
|
-
* # Records
|
|
48
|
-
*
|
|
49
|
-
* Serial numbers restart at 1 each edition: a record is "edition `e`, number `n`
|
|
50
|
-
* (of `max`)", and it stamps the `Currency` and the exact amount paid. A record
|
|
51
|
-
* from a destroyed edition remains verifiable — `record::is_derived_from` is pure
|
|
52
|
-
* address math and does not need the drop object alive.
|
|
53
|
-
*
|
|
54
|
-
* # Authority
|
|
55
|
-
*
|
|
56
|
-
* Opening edition 0 needs the release's `ReleaseAdminCap` (enforced by the
|
|
57
|
-
* protocol's `release::uid_mut`); opening edition `n + 1` needs the cap AND the
|
|
58
|
-
* predecessor drop. Minting is authorized separately: this package presents its
|
|
59
|
-
* `MintWitness`, whose type must be on `miso_record`'s `Settings` allowlist. A
|
|
60
|
-
* different shop with different mechanics is just another package with its own
|
|
61
|
-
* witness — same `Record`, no `miso_record` redeploy.
|
|
62
|
-
*/
|
|
63
|
-
|
|
64
|
-
import { MoveTuple, MoveStruct, MoveEnum, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
65
|
-
import { bcs } from '@mysten/sui/bcs';
|
|
66
|
-
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
67
|
-
const $moduleName = '@local-pkg/miso_drop::drop';
|
|
68
|
-
export const DropKey = new MoveTuple({ name: `${$moduleName}::DropKey`, fields: [bcs.u32()] });
|
|
69
|
-
export const CurrentDropKey = new MoveTuple({ name: `${$moduleName}::CurrentDropKey`, fields: [bcs.bool()] });
|
|
70
|
-
export const MintWitness = new MoveStruct({ name: `${$moduleName}::MintWitness`, fields: {
|
|
71
|
-
dummy_field: bcs.bool()
|
|
72
|
-
} });
|
|
73
|
-
/** Pricing policy for a drop. */
|
|
74
|
-
export const Price = new MoveEnum({ name: `${$moduleName}::Price`, fields: {
|
|
75
|
-
/** Pay exactly `amount`. */
|
|
76
|
-
Fixed: new MoveStruct({ name: `Price.Fixed`, fields: {
|
|
77
|
-
amount: bcs.u64()
|
|
78
|
-
} }),
|
|
79
|
-
/** Pay at least `amount`; overpayment is forwarded to the release, not refunded. */
|
|
80
|
-
Floor: new MoveStruct({ name: `Price.Floor`, fields: {
|
|
81
|
-
amount: bcs.u64()
|
|
82
|
-
} })
|
|
83
|
-
} });
|
|
84
|
-
/** Supply policy for a drop. */
|
|
85
|
-
export const Supply = new MoveEnum({ name: `${$moduleName}::Supply`, fields: {
|
|
86
|
-
/** No quantity limit — the edition never sells out. */
|
|
87
|
-
Uncapped: null,
|
|
88
|
-
/** Sells out after `max` records. */
|
|
89
|
-
Capped: new MoveStruct({ name: `Supply.Capped`, fields: {
|
|
90
|
-
max: bcs.u64()
|
|
91
|
-
} })
|
|
92
|
-
} });
|
|
93
|
-
/** When a drop sells. `buy` rejects purchases outside the window. */
|
|
94
|
-
export const Window = new MoveEnum({ name: `${$moduleName}::Window`, fields: {
|
|
95
|
-
/**
|
|
96
|
-
* Opens at `start_timestamp_ms` (Unix ms; may be in the future — a scheduled drop)
|
|
97
|
-
* and never closes.
|
|
98
|
-
*/
|
|
99
|
-
Unbounded: new MoveStruct({ name: `Window.Unbounded`, fields: {
|
|
100
|
-
start_timestamp_ms: bcs.u64()
|
|
101
|
-
} }),
|
|
102
|
-
/** Sells only within `[start_timestamp_ms, end_timestamp_ms]` (Unix ms). */
|
|
103
|
-
Bounded: new MoveStruct({ name: `Window.Bounded`, fields: {
|
|
104
|
-
start_timestamp_ms: bcs.u64(),
|
|
105
|
-
end_timestamp_ms: bcs.u64()
|
|
106
|
-
} })
|
|
107
|
-
} });
|
|
108
|
-
export const Drop = new MoveStruct({ name: `${$moduleName}::Drop<phantom Currency>`, fields: {
|
|
109
|
-
id: bcs.Address,
|
|
110
|
-
/** The release these records are copies of. */
|
|
111
|
-
release_id: bcs.Address,
|
|
112
|
-
/** Which edition of the release this is (0 = first drop). */
|
|
113
|
-
edition: bcs.u32(),
|
|
114
|
-
/** How much a buyer must pay per record. */
|
|
115
|
-
price: Price,
|
|
116
|
-
/** How many records this edition may ever sell. */
|
|
117
|
-
supply: Supply,
|
|
118
|
-
/** Records sold so far; also the most recently sold record's number. */
|
|
119
|
-
quantity_sold: bcs.u64(),
|
|
120
|
-
/** When this edition sells. */
|
|
121
|
-
window: Window
|
|
122
|
-
} });
|
|
123
|
-
export const DropCreatedEvent = new MoveStruct({ name: `${$moduleName}::DropCreatedEvent<phantom Currency>`, fields: {
|
|
124
|
-
drop_id: bcs.Address,
|
|
125
|
-
release_id: bcs.Address,
|
|
126
|
-
edition: bcs.u32(),
|
|
127
|
-
price: Price,
|
|
128
|
-
supply: Supply,
|
|
129
|
-
window: Window
|
|
130
|
-
} });
|
|
131
|
-
export const RecordSoldEvent = new MoveStruct({ name: `${$moduleName}::RecordSoldEvent<phantom Currency>`, fields: {
|
|
132
|
-
drop_id: bcs.Address,
|
|
133
|
-
release_id: bcs.Address,
|
|
134
|
-
edition: bcs.u32(),
|
|
135
|
-
record_id: bcs.Address,
|
|
136
|
-
number: bcs.u64(),
|
|
137
|
-
paid: bcs.u64(),
|
|
138
|
-
buyer: bcs.Address
|
|
139
|
-
} });
|
|
140
|
-
export interface NewFixedPriceArguments {
|
|
141
|
-
amount: RawTransactionArgument<number | bigint>;
|
|
142
|
-
}
|
|
143
|
-
export interface NewFixedPriceOptions {
|
|
144
|
-
package?: string;
|
|
145
|
-
arguments: NewFixedPriceArguments | [
|
|
146
|
-
amount: RawTransactionArgument<number | bigint>
|
|
147
|
-
];
|
|
148
|
-
}
|
|
149
|
-
/** A fixed price: a buyer must pay exactly `amount`. */
|
|
150
|
-
export function newFixedPrice(options: NewFixedPriceOptions) {
|
|
151
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
152
|
-
const argumentsTypes = [
|
|
153
|
-
'u64'
|
|
154
|
-
] satisfies (string | null)[];
|
|
155
|
-
const parameterNames = ["amount"];
|
|
156
|
-
return (tx: Transaction) => tx.moveCall({
|
|
157
|
-
package: packageAddress,
|
|
158
|
-
module: 'drop',
|
|
159
|
-
function: 'new_fixed_price',
|
|
160
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
161
|
-
});
|
|
162
|
-
}
|
|
163
|
-
export interface NewFloorPriceArguments {
|
|
164
|
-
amount: RawTransactionArgument<number | bigint>;
|
|
165
|
-
}
|
|
166
|
-
export interface NewFloorPriceOptions {
|
|
167
|
-
package?: string;
|
|
168
|
-
arguments: NewFloorPriceArguments | [
|
|
169
|
-
amount: RawTransactionArgument<number | bigint>
|
|
170
|
-
];
|
|
171
|
-
}
|
|
172
|
-
/** A floor price: a buyer must pay at least `amount`; overpayment is kept. */
|
|
173
|
-
export function newFloorPrice(options: NewFloorPriceOptions) {
|
|
174
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
175
|
-
const argumentsTypes = [
|
|
176
|
-
'u64'
|
|
177
|
-
] satisfies (string | null)[];
|
|
178
|
-
const parameterNames = ["amount"];
|
|
179
|
-
return (tx: Transaction) => tx.moveCall({
|
|
180
|
-
package: packageAddress,
|
|
181
|
-
module: 'drop',
|
|
182
|
-
function: 'new_floor_price',
|
|
183
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
184
|
-
});
|
|
185
|
-
}
|
|
186
|
-
export interface NewUncappedSupplyOptions {
|
|
187
|
-
package?: string;
|
|
188
|
-
arguments?: [
|
|
189
|
-
];
|
|
190
|
-
}
|
|
191
|
-
/** An uncapped supply: the edition never sells out. */
|
|
192
|
-
export function newUncappedSupply(options: NewUncappedSupplyOptions = {}) {
|
|
193
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
194
|
-
return (tx: Transaction) => tx.moveCall({
|
|
195
|
-
package: packageAddress,
|
|
196
|
-
module: 'drop',
|
|
197
|
-
function: 'new_uncapped_supply',
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
export interface NewCappedSupplyArguments {
|
|
201
|
-
max: RawTransactionArgument<number | bigint>;
|
|
202
|
-
}
|
|
203
|
-
export interface NewCappedSupplyOptions {
|
|
204
|
-
package?: string;
|
|
205
|
-
arguments: NewCappedSupplyArguments | [
|
|
206
|
-
max: RawTransactionArgument<number | bigint>
|
|
207
|
-
];
|
|
208
|
-
}
|
|
209
|
-
/**
|
|
210
|
-
* A capped supply: the edition sells out after `max` records. `max` must be at
|
|
211
|
-
* least 1.
|
|
212
|
-
*/
|
|
213
|
-
export function newCappedSupply(options: NewCappedSupplyOptions) {
|
|
214
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
215
|
-
const argumentsTypes = [
|
|
216
|
-
'u64'
|
|
217
|
-
] satisfies (string | null)[];
|
|
218
|
-
const parameterNames = ["max"];
|
|
219
|
-
return (tx: Transaction) => tx.moveCall({
|
|
220
|
-
package: packageAddress,
|
|
221
|
-
module: 'drop',
|
|
222
|
-
function: 'new_capped_supply',
|
|
223
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
export interface NewUnboundedWindowArguments {
|
|
227
|
-
startTimestampMs: RawTransactionArgument<number | bigint>;
|
|
228
|
-
}
|
|
229
|
-
export interface NewUnboundedWindowOptions {
|
|
230
|
-
package?: string;
|
|
231
|
-
arguments: NewUnboundedWindowArguments | [
|
|
232
|
-
startTimestampMs: RawTransactionArgument<number | bigint>
|
|
233
|
-
];
|
|
234
|
-
}
|
|
235
|
-
/**
|
|
236
|
-
* A window that opens at `start_timestamp_ms` (may be in the future) and never
|
|
237
|
-
* closes.
|
|
238
|
-
*/
|
|
239
|
-
export function newUnboundedWindow(options: NewUnboundedWindowOptions) {
|
|
240
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
241
|
-
const argumentsTypes = [
|
|
242
|
-
'u64'
|
|
243
|
-
] satisfies (string | null)[];
|
|
244
|
-
const parameterNames = ["startTimestampMs"];
|
|
245
|
-
return (tx: Transaction) => tx.moveCall({
|
|
246
|
-
package: packageAddress,
|
|
247
|
-
module: 'drop',
|
|
248
|
-
function: 'new_unbounded_window',
|
|
249
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
export interface NewBoundedWindowArguments {
|
|
253
|
-
startTimestampMs: RawTransactionArgument<number | bigint>;
|
|
254
|
-
endTimestampMs: RawTransactionArgument<number | bigint>;
|
|
255
|
-
}
|
|
256
|
-
export interface NewBoundedWindowOptions {
|
|
257
|
-
package?: string;
|
|
258
|
-
arguments: NewBoundedWindowArguments | [
|
|
259
|
-
startTimestampMs: RawTransactionArgument<number | bigint>,
|
|
260
|
-
endTimestampMs: RawTransactionArgument<number | bigint>
|
|
261
|
-
];
|
|
262
|
-
}
|
|
263
|
-
/**
|
|
264
|
-
* A window selling only within `[start_timestamp_ms, end_timestamp_ms]`. The close
|
|
265
|
-
* must be strictly after the open.
|
|
266
|
-
*/
|
|
267
|
-
export function newBoundedWindow(options: NewBoundedWindowOptions) {
|
|
268
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
269
|
-
const argumentsTypes = [
|
|
270
|
-
'u64',
|
|
271
|
-
'u64'
|
|
272
|
-
] satisfies (string | null)[];
|
|
273
|
-
const parameterNames = ["startTimestampMs", "endTimestampMs"];
|
|
274
|
-
return (tx: Transaction) => tx.moveCall({
|
|
275
|
-
package: packageAddress,
|
|
276
|
-
module: 'drop',
|
|
277
|
-
function: 'new_bounded_window',
|
|
278
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
279
|
-
});
|
|
280
|
-
}
|
|
281
|
-
export interface NewArguments {
|
|
282
|
-
release: RawTransactionArgument<string>;
|
|
283
|
-
cap: RawTransactionArgument<string>;
|
|
284
|
-
price: TransactionArgument;
|
|
285
|
-
supply: TransactionArgument;
|
|
286
|
-
window: TransactionArgument;
|
|
287
|
-
}
|
|
288
|
-
export interface NewOptions {
|
|
289
|
-
package?: string;
|
|
290
|
-
arguments: NewArguments | [
|
|
291
|
-
release: RawTransactionArgument<string>,
|
|
292
|
-
cap: RawTransactionArgument<string>,
|
|
293
|
-
price: TransactionArgument,
|
|
294
|
-
supply: TransactionArgument,
|
|
295
|
-
window: TransactionArgument
|
|
296
|
-
];
|
|
297
|
-
typeArguments: [
|
|
298
|
-
string
|
|
299
|
-
];
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* Create and share a release's FIRST drop — edition `0` — selling copies on the
|
|
303
|
-
* given `price` / `supply` / `window` terms. Authorized by the release's admin cap
|
|
304
|
-
* (enforced by `release::uid_mut`). The drop is immutable once created; every
|
|
305
|
-
* later change (price, currency, a fresh run) is `new_edition`.
|
|
306
|
-
*
|
|
307
|
-
* Edition 0's key can only ever be claimed once, so a release's edition sequence
|
|
308
|
-
* can only ever start here — calling `new` twice for the same release aborts.
|
|
309
|
-
*
|
|
310
|
-
* Term validity is enforced at construction (`new_capped_supply`,
|
|
311
|
-
* `new_bounded_window`); the one check left here is temporal — a bounded window
|
|
312
|
-
* must not already be elapsed against the `Clock`.
|
|
313
|
-
*/
|
|
314
|
-
export function _new(options: NewOptions) {
|
|
315
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
316
|
-
const argumentsTypes = [
|
|
317
|
-
null,
|
|
318
|
-
null,
|
|
319
|
-
null,
|
|
320
|
-
null,
|
|
321
|
-
null,
|
|
322
|
-
'0x2::clock::Clock'
|
|
323
|
-
] satisfies (string | null)[];
|
|
324
|
-
const parameterNames = ["release", "cap", "price", "supply", "window"];
|
|
325
|
-
return (tx: Transaction) => tx.moveCall({
|
|
326
|
-
package: packageAddress,
|
|
327
|
-
module: 'drop',
|
|
328
|
-
function: 'new',
|
|
329
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
330
|
-
typeArguments: options.typeArguments
|
|
331
|
-
});
|
|
332
|
-
}
|
|
333
|
-
export interface NewEditionArguments {
|
|
334
|
-
release: RawTransactionArgument<string>;
|
|
335
|
-
old: RawTransactionArgument<string>;
|
|
336
|
-
cap: RawTransactionArgument<string>;
|
|
337
|
-
price: TransactionArgument;
|
|
338
|
-
supply: TransactionArgument;
|
|
339
|
-
window: TransactionArgument;
|
|
340
|
-
}
|
|
341
|
-
export interface NewEditionOptions {
|
|
342
|
-
package?: string;
|
|
343
|
-
arguments: NewEditionArguments | [
|
|
344
|
-
release: RawTransactionArgument<string>,
|
|
345
|
-
old: RawTransactionArgument<string>,
|
|
346
|
-
cap: RawTransactionArgument<string>,
|
|
347
|
-
price: TransactionArgument,
|
|
348
|
-
supply: TransactionArgument,
|
|
349
|
-
window: TransactionArgument
|
|
350
|
-
];
|
|
351
|
-
typeArguments: [
|
|
352
|
-
string,
|
|
353
|
-
string
|
|
354
|
-
];
|
|
355
|
-
}
|
|
356
|
-
/**
|
|
357
|
-
* Open the NEXT edition of a release's drop, CONSUMING the current one. The
|
|
358
|
-
* predecessor shared object is destroyed — so at most one drop per release is ever
|
|
359
|
-
* live, and this is the one way to change terms: a new price, a new `Currency`, a
|
|
360
|
-
* new supply or window. It may be called while the predecessor is still selling (a
|
|
361
|
-
* cutover) or after it sold out / closed (a fresh run for fans who missed it).
|
|
362
|
-
*
|
|
363
|
-
* Records already sold by the predecessor are untouched and remain verifiable
|
|
364
|
-
* against its (now deleted) id. Serial numbers restart at 1 for the new edition.
|
|
365
|
-
*/
|
|
366
|
-
export function newEdition(options: NewEditionOptions) {
|
|
367
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
368
|
-
const argumentsTypes = [
|
|
369
|
-
null,
|
|
370
|
-
null,
|
|
371
|
-
null,
|
|
372
|
-
null,
|
|
373
|
-
null,
|
|
374
|
-
null,
|
|
375
|
-
'0x2::clock::Clock'
|
|
376
|
-
] satisfies (string | null)[];
|
|
377
|
-
const parameterNames = ["release", "old", "cap", "price", "supply", "window"];
|
|
378
|
-
return (tx: Transaction) => tx.moveCall({
|
|
379
|
-
package: packageAddress,
|
|
380
|
-
module: 'drop',
|
|
381
|
-
function: 'new_edition',
|
|
382
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
383
|
-
typeArguments: options.typeArguments
|
|
384
|
-
});
|
|
385
|
-
}
|
|
386
|
-
export interface BuyArguments {
|
|
387
|
-
self: RawTransactionArgument<string>;
|
|
388
|
-
payment: RawTransactionArgument<string>;
|
|
389
|
-
settings: RawTransactionArgument<string>;
|
|
390
|
-
}
|
|
391
|
-
export interface BuyOptions {
|
|
392
|
-
package?: string;
|
|
393
|
-
arguments: BuyArguments | [
|
|
394
|
-
self: RawTransactionArgument<string>,
|
|
395
|
-
payment: RawTransactionArgument<string>,
|
|
396
|
-
settings: RawTransactionArgument<string>
|
|
397
|
-
];
|
|
398
|
-
typeArguments: [
|
|
399
|
-
string
|
|
400
|
-
];
|
|
401
|
-
}
|
|
402
|
-
/**
|
|
403
|
-
* Buy one record from a live drop — one inside its window with supply left.
|
|
404
|
-
*
|
|
405
|
-
* `payment` must satisfy the price (exactly, for `Fixed`; at least, for `Floor`).
|
|
406
|
-
* The ENTIRE payment is forwarded to the release's address — under `Floor`,
|
|
407
|
-
* anything paid above the floor is kept (a pay-what-you-want tip), not refunded.
|
|
408
|
-
* The sold record's number is the 1-based `quantity_sold` count, its UID is
|
|
409
|
-
* derived off the drop, and it records the drop's `edition`, the `Currency`, and
|
|
410
|
-
* the amount paid. `settings` must authorize this package's `MintWitness`.
|
|
411
|
-
*/
|
|
412
|
-
export function buy(options: BuyOptions) {
|
|
413
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
414
|
-
const argumentsTypes = [
|
|
415
|
-
null,
|
|
416
|
-
null,
|
|
417
|
-
null,
|
|
418
|
-
'0x2::clock::Clock'
|
|
419
|
-
] satisfies (string | null)[];
|
|
420
|
-
const parameterNames = ["self", "payment", "settings"];
|
|
421
|
-
return (tx: Transaction) => tx.moveCall({
|
|
422
|
-
package: packageAddress,
|
|
423
|
-
module: 'drop',
|
|
424
|
-
function: 'buy',
|
|
425
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
426
|
-
typeArguments: options.typeArguments
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
export interface IdArguments {
|
|
430
|
-
self: RawTransactionArgument<string>;
|
|
431
|
-
}
|
|
432
|
-
export interface IdOptions {
|
|
433
|
-
package?: string;
|
|
434
|
-
arguments: IdArguments | [
|
|
435
|
-
self: RawTransactionArgument<string>
|
|
436
|
-
];
|
|
437
|
-
typeArguments: [
|
|
438
|
-
string
|
|
439
|
-
];
|
|
440
|
-
}
|
|
441
|
-
export function id(options: IdOptions) {
|
|
442
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
443
|
-
const argumentsTypes = [
|
|
444
|
-
null
|
|
445
|
-
] satisfies (string | null)[];
|
|
446
|
-
const parameterNames = ["self"];
|
|
447
|
-
return (tx: Transaction) => tx.moveCall({
|
|
448
|
-
package: packageAddress,
|
|
449
|
-
module: 'drop',
|
|
450
|
-
function: 'id',
|
|
451
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
452
|
-
typeArguments: options.typeArguments
|
|
453
|
-
});
|
|
454
|
-
}
|
|
455
|
-
export interface ReleaseIdArguments {
|
|
456
|
-
self: RawTransactionArgument<string>;
|
|
457
|
-
}
|
|
458
|
-
export interface ReleaseIdOptions {
|
|
459
|
-
package?: string;
|
|
460
|
-
arguments: ReleaseIdArguments | [
|
|
461
|
-
self: RawTransactionArgument<string>
|
|
462
|
-
];
|
|
463
|
-
typeArguments: [
|
|
464
|
-
string
|
|
465
|
-
];
|
|
466
|
-
}
|
|
467
|
-
export function releaseId(options: ReleaseIdOptions) {
|
|
468
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
469
|
-
const argumentsTypes = [
|
|
470
|
-
null
|
|
471
|
-
] satisfies (string | null)[];
|
|
472
|
-
const parameterNames = ["self"];
|
|
473
|
-
return (tx: Transaction) => tx.moveCall({
|
|
474
|
-
package: packageAddress,
|
|
475
|
-
module: 'drop',
|
|
476
|
-
function: 'release_id',
|
|
477
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
478
|
-
typeArguments: options.typeArguments
|
|
479
|
-
});
|
|
480
|
-
}
|
|
481
|
-
export interface EditionArguments {
|
|
482
|
-
self: RawTransactionArgument<string>;
|
|
483
|
-
}
|
|
484
|
-
export interface EditionOptions {
|
|
485
|
-
package?: string;
|
|
486
|
-
arguments: EditionArguments | [
|
|
487
|
-
self: RawTransactionArgument<string>
|
|
488
|
-
];
|
|
489
|
-
typeArguments: [
|
|
490
|
-
string
|
|
491
|
-
];
|
|
492
|
-
}
|
|
493
|
-
export function edition(options: EditionOptions) {
|
|
494
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
495
|
-
const argumentsTypes = [
|
|
496
|
-
null
|
|
497
|
-
] satisfies (string | null)[];
|
|
498
|
-
const parameterNames = ["self"];
|
|
499
|
-
return (tx: Transaction) => tx.moveCall({
|
|
500
|
-
package: packageAddress,
|
|
501
|
-
module: 'drop',
|
|
502
|
-
function: 'edition',
|
|
503
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
504
|
-
typeArguments: options.typeArguments
|
|
505
|
-
});
|
|
506
|
-
}
|
|
507
|
-
export interface QuantitySoldArguments {
|
|
508
|
-
self: RawTransactionArgument<string>;
|
|
509
|
-
}
|
|
510
|
-
export interface QuantitySoldOptions {
|
|
511
|
-
package?: string;
|
|
512
|
-
arguments: QuantitySoldArguments | [
|
|
513
|
-
self: RawTransactionArgument<string>
|
|
514
|
-
];
|
|
515
|
-
typeArguments: [
|
|
516
|
-
string
|
|
517
|
-
];
|
|
518
|
-
}
|
|
519
|
-
export function quantitySold(options: QuantitySoldOptions) {
|
|
520
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
521
|
-
const argumentsTypes = [
|
|
522
|
-
null
|
|
523
|
-
] satisfies (string | null)[];
|
|
524
|
-
const parameterNames = ["self"];
|
|
525
|
-
return (tx: Transaction) => tx.moveCall({
|
|
526
|
-
package: packageAddress,
|
|
527
|
-
module: 'drop',
|
|
528
|
-
function: 'quantity_sold',
|
|
529
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
530
|
-
typeArguments: options.typeArguments
|
|
531
|
-
});
|
|
532
|
-
}
|
|
533
|
-
export interface PriceArguments {
|
|
534
|
-
self: RawTransactionArgument<string>;
|
|
535
|
-
}
|
|
536
|
-
export interface PriceOptions {
|
|
537
|
-
package?: string;
|
|
538
|
-
arguments: PriceArguments | [
|
|
539
|
-
self: RawTransactionArgument<string>
|
|
540
|
-
];
|
|
541
|
-
typeArguments: [
|
|
542
|
-
string
|
|
543
|
-
];
|
|
544
|
-
}
|
|
545
|
-
export function price(options: PriceOptions) {
|
|
546
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
547
|
-
const argumentsTypes = [
|
|
548
|
-
null
|
|
549
|
-
] satisfies (string | null)[];
|
|
550
|
-
const parameterNames = ["self"];
|
|
551
|
-
return (tx: Transaction) => tx.moveCall({
|
|
552
|
-
package: packageAddress,
|
|
553
|
-
module: 'drop',
|
|
554
|
-
function: 'price',
|
|
555
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
556
|
-
typeArguments: options.typeArguments
|
|
557
|
-
});
|
|
558
|
-
}
|
|
559
|
-
export interface SupplyArguments {
|
|
560
|
-
self: RawTransactionArgument<string>;
|
|
561
|
-
}
|
|
562
|
-
export interface SupplyOptions {
|
|
563
|
-
package?: string;
|
|
564
|
-
arguments: SupplyArguments | [
|
|
565
|
-
self: RawTransactionArgument<string>
|
|
566
|
-
];
|
|
567
|
-
typeArguments: [
|
|
568
|
-
string
|
|
569
|
-
];
|
|
570
|
-
}
|
|
571
|
-
export function supply(options: SupplyOptions) {
|
|
572
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
573
|
-
const argumentsTypes = [
|
|
574
|
-
null
|
|
575
|
-
] satisfies (string | null)[];
|
|
576
|
-
const parameterNames = ["self"];
|
|
577
|
-
return (tx: Transaction) => tx.moveCall({
|
|
578
|
-
package: packageAddress,
|
|
579
|
-
module: 'drop',
|
|
580
|
-
function: 'supply',
|
|
581
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
582
|
-
typeArguments: options.typeArguments
|
|
583
|
-
});
|
|
584
|
-
}
|
|
585
|
-
export interface WindowArguments {
|
|
586
|
-
self: RawTransactionArgument<string>;
|
|
587
|
-
}
|
|
588
|
-
export interface WindowOptions {
|
|
589
|
-
package?: string;
|
|
590
|
-
arguments: WindowArguments | [
|
|
591
|
-
self: RawTransactionArgument<string>
|
|
592
|
-
];
|
|
593
|
-
typeArguments: [
|
|
594
|
-
string
|
|
595
|
-
];
|
|
596
|
-
}
|
|
597
|
-
export function window(options: WindowOptions) {
|
|
598
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
599
|
-
const argumentsTypes = [
|
|
600
|
-
null
|
|
601
|
-
] satisfies (string | null)[];
|
|
602
|
-
const parameterNames = ["self"];
|
|
603
|
-
return (tx: Transaction) => tx.moveCall({
|
|
604
|
-
package: packageAddress,
|
|
605
|
-
module: 'drop',
|
|
606
|
-
function: 'window',
|
|
607
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
608
|
-
typeArguments: options.typeArguments
|
|
609
|
-
});
|
|
610
|
-
}
|
|
611
|
-
export interface MaxSupplyArguments {
|
|
612
|
-
self: RawTransactionArgument<string>;
|
|
613
|
-
}
|
|
614
|
-
export interface MaxSupplyOptions {
|
|
615
|
-
package?: string;
|
|
616
|
-
arguments: MaxSupplyArguments | [
|
|
617
|
-
self: RawTransactionArgument<string>
|
|
618
|
-
];
|
|
619
|
-
typeArguments: [
|
|
620
|
-
string
|
|
621
|
-
];
|
|
622
|
-
}
|
|
623
|
-
/** Flat projection of `supply`: the cap, or `none` if uncapped. */
|
|
624
|
-
export function maxSupply(options: MaxSupplyOptions) {
|
|
625
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
626
|
-
const argumentsTypes = [
|
|
627
|
-
null
|
|
628
|
-
] satisfies (string | null)[];
|
|
629
|
-
const parameterNames = ["self"];
|
|
630
|
-
return (tx: Transaction) => tx.moveCall({
|
|
631
|
-
package: packageAddress,
|
|
632
|
-
module: 'drop',
|
|
633
|
-
function: 'max_supply',
|
|
634
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
635
|
-
typeArguments: options.typeArguments
|
|
636
|
-
});
|
|
637
|
-
}
|
|
638
|
-
export interface StartTimestampMsArguments {
|
|
639
|
-
self: RawTransactionArgument<string>;
|
|
640
|
-
}
|
|
641
|
-
export interface StartTimestampMsOptions {
|
|
642
|
-
package?: string;
|
|
643
|
-
arguments: StartTimestampMsArguments | [
|
|
644
|
-
self: RawTransactionArgument<string>
|
|
645
|
-
];
|
|
646
|
-
typeArguments: [
|
|
647
|
-
string
|
|
648
|
-
];
|
|
649
|
-
}
|
|
650
|
-
/** Flat projection of `window`: when the drop opens. */
|
|
651
|
-
export function startTimestampMs(options: StartTimestampMsOptions) {
|
|
652
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
653
|
-
const argumentsTypes = [
|
|
654
|
-
null
|
|
655
|
-
] satisfies (string | null)[];
|
|
656
|
-
const parameterNames = ["self"];
|
|
657
|
-
return (tx: Transaction) => tx.moveCall({
|
|
658
|
-
package: packageAddress,
|
|
659
|
-
module: 'drop',
|
|
660
|
-
function: 'start_timestamp_ms',
|
|
661
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
662
|
-
typeArguments: options.typeArguments
|
|
663
|
-
});
|
|
664
|
-
}
|
|
665
|
-
export interface EndTimestampMsArguments {
|
|
666
|
-
self: RawTransactionArgument<string>;
|
|
667
|
-
}
|
|
668
|
-
export interface EndTimestampMsOptions {
|
|
669
|
-
package?: string;
|
|
670
|
-
arguments: EndTimestampMsArguments | [
|
|
671
|
-
self: RawTransactionArgument<string>
|
|
672
|
-
];
|
|
673
|
-
typeArguments: [
|
|
674
|
-
string
|
|
675
|
-
];
|
|
676
|
-
}
|
|
677
|
-
/** Flat projection of `window`: the close, or `none` if unbounded. */
|
|
678
|
-
export function endTimestampMs(options: EndTimestampMsOptions) {
|
|
679
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
680
|
-
const argumentsTypes = [
|
|
681
|
-
null
|
|
682
|
-
] satisfies (string | null)[];
|
|
683
|
-
const parameterNames = ["self"];
|
|
684
|
-
return (tx: Transaction) => tx.moveCall({
|
|
685
|
-
package: packageAddress,
|
|
686
|
-
module: 'drop',
|
|
687
|
-
function: 'end_timestamp_ms',
|
|
688
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
689
|
-
typeArguments: options.typeArguments
|
|
690
|
-
});
|
|
691
|
-
}
|
|
692
|
-
export interface IsSoldOutArguments {
|
|
693
|
-
self: RawTransactionArgument<string>;
|
|
694
|
-
}
|
|
695
|
-
export interface IsSoldOutOptions {
|
|
696
|
-
package?: string;
|
|
697
|
-
arguments: IsSoldOutArguments | [
|
|
698
|
-
self: RawTransactionArgument<string>
|
|
699
|
-
];
|
|
700
|
-
typeArguments: [
|
|
701
|
-
string
|
|
702
|
-
];
|
|
703
|
-
}
|
|
704
|
-
/**
|
|
705
|
-
* Whether the drop has sold every one of its `Capped { max }` records (always
|
|
706
|
-
* `false` for an uncapped drop).
|
|
707
|
-
*/
|
|
708
|
-
export function isSoldOut(options: IsSoldOutOptions) {
|
|
709
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
710
|
-
const argumentsTypes = [
|
|
711
|
-
null
|
|
712
|
-
] satisfies (string | null)[];
|
|
713
|
-
const parameterNames = ["self"];
|
|
714
|
-
return (tx: Transaction) => tx.moveCall({
|
|
715
|
-
package: packageAddress,
|
|
716
|
-
module: 'drop',
|
|
717
|
-
function: 'is_sold_out',
|
|
718
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
719
|
-
typeArguments: options.typeArguments
|
|
720
|
-
});
|
|
721
|
-
}
|
|
722
|
-
export interface IsLiveArguments {
|
|
723
|
-
self: RawTransactionArgument<string>;
|
|
724
|
-
}
|
|
725
|
-
export interface IsLiveOptions {
|
|
726
|
-
package?: string;
|
|
727
|
-
arguments: IsLiveArguments | [
|
|
728
|
-
self: RawTransactionArgument<string>
|
|
729
|
-
];
|
|
730
|
-
typeArguments: [
|
|
731
|
-
string
|
|
732
|
-
];
|
|
733
|
-
}
|
|
734
|
-
/** Whether `buy` would be accepted right now: inside the window and not sold out. */
|
|
735
|
-
export function isLive(options: IsLiveOptions) {
|
|
736
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
737
|
-
const argumentsTypes = [
|
|
738
|
-
null,
|
|
739
|
-
'0x2::clock::Clock'
|
|
740
|
-
] satisfies (string | null)[];
|
|
741
|
-
const parameterNames = ["self"];
|
|
742
|
-
return (tx: Transaction) => tx.moveCall({
|
|
743
|
-
package: packageAddress,
|
|
744
|
-
module: 'drop',
|
|
745
|
-
function: 'is_live',
|
|
746
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
747
|
-
typeArguments: options.typeArguments
|
|
748
|
-
});
|
|
749
|
-
}
|
|
750
|
-
export interface CurrentDropIdArguments {
|
|
751
|
-
release: RawTransactionArgument<string>;
|
|
752
|
-
}
|
|
753
|
-
export interface CurrentDropIdOptions {
|
|
754
|
-
package?: string;
|
|
755
|
-
arguments: CurrentDropIdArguments | [
|
|
756
|
-
release: RawTransactionArgument<string>
|
|
757
|
-
];
|
|
758
|
-
}
|
|
759
|
-
/**
|
|
760
|
-
* The `ID` of a release's live drop, or `none` if the release has never dropped.
|
|
761
|
-
* (There is always at most one: `new_edition` destroys the predecessor.)
|
|
762
|
-
*/
|
|
763
|
-
export function currentDropId(options: CurrentDropIdOptions) {
|
|
764
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
765
|
-
const argumentsTypes = [
|
|
766
|
-
null
|
|
767
|
-
] satisfies (string | null)[];
|
|
768
|
-
const parameterNames = ["release"];
|
|
769
|
-
return (tx: Transaction) => tx.moveCall({
|
|
770
|
-
package: packageAddress,
|
|
771
|
-
module: 'drop',
|
|
772
|
-
function: 'current_drop_id',
|
|
773
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
export interface AmountArguments {
|
|
777
|
-
self: TransactionArgument;
|
|
778
|
-
}
|
|
779
|
-
export interface AmountOptions {
|
|
780
|
-
package?: string;
|
|
781
|
-
arguments: AmountArguments | [
|
|
782
|
-
self: TransactionArgument
|
|
783
|
-
];
|
|
784
|
-
}
|
|
785
|
-
/** The price amount (the fixed price, or the floor). */
|
|
786
|
-
export function amount(options: AmountOptions) {
|
|
787
|
-
const packageAddress = options.package ?? '@local-pkg/miso_drop';
|
|
788
|
-
const argumentsTypes = [
|
|
789
|
-
null
|
|
790
|
-
] satisfies (string | null)[];
|
|
791
|
-
const parameterNames = ["self"];
|
|
792
|
-
return (tx: Transaction) => tx.moveCall({
|
|
793
|
-
package: packageAddress,
|
|
794
|
-
module: 'drop',
|
|
795
|
-
function: 'amount',
|
|
796
|
-
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
797
|
-
});
|
|
798
|
-
}
|