@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
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A stake whose rewards are irrevocably routed to its parent's royalty pool.
|
|
6
|
+
*
|
|
7
|
+
* A `RoutedStake<StakeShare, PoolShare>` is a derived object of any UID-bearing
|
|
8
|
+
* parent (same pattern as `RoyaltyPool`). It wraps a `Stake<StakeShare>` — shares
|
|
9
|
+
* of some other asset that the parent owns — and commits the rewards that stake
|
|
10
|
+
* earns to the parent's own `RoyaltyPool<PoolShare, Currency>`: `sweep` is the
|
|
11
|
+
* only reachable claim path, and it deposits straight into the pool derived from
|
|
12
|
+
* the same parent. The wrapper exists precisely so the raw `Stake` is never
|
|
13
|
+
* exposed — a bare shared `Stake` would let any caller claim its rewards and keep
|
|
14
|
+
* them.
|
|
15
|
+
*
|
|
16
|
+
* Because the route is fixed, the wrapper is safe to share: `sweep` is
|
|
17
|
+
* permissionless, and it does not matter who calls it, since the money can only go
|
|
18
|
+
* one place. Lifecycle operations (`register`, `unregister`, `unstake`, `restake`)
|
|
19
|
+
* instead require the parent's `&mut UID` as the credential — cap-gating happens
|
|
20
|
+
* at the parent, exactly as with `RoyaltyPool` creation. `register`/`unregister`
|
|
21
|
+
* are gated because a stake registers at most once per `Currency`: a
|
|
22
|
+
* permissionless register could grief by binding the stake to a garbage same-typed
|
|
23
|
+
* pool, permanently blocking the real one for that currency.
|
|
24
|
+
*
|
|
25
|
+
* The derivation key encodes only `StakeShare` — at most one routed stake per
|
|
26
|
+
* `(parent, StakeShare)` pair, whatever `PoolShare` it used (the same
|
|
27
|
+
* burned-by-first-claim consequence as `RoyaltyPoolKey`; the parent's cap-gated
|
|
28
|
+
* extension is expected to pin `PoolShare` to the parent's own share type). For
|
|
29
|
+
* the same reason the wrapper is never deleted: `unstake` empties it and `restake`
|
|
30
|
+
* refills it, so the one derived address per pair stays usable forever.
|
|
31
|
+
*/
|
|
32
|
+
import { MoveStruct, MoveTuple, type RawTransactionArgument } from '../utils/index.js';
|
|
33
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
34
|
+
export declare const RoutedStake: MoveStruct<{
|
|
35
|
+
id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
36
|
+
/**
|
|
37
|
+
* The wrapped position. `None` between `unstake` and `restake`; the wrapper itself
|
|
38
|
+
* persists because its derived address can never be re-claimed.
|
|
39
|
+
*/
|
|
40
|
+
stake: import("@mysten/sui/bcs").BcsType<{
|
|
41
|
+
id: string;
|
|
42
|
+
balance: {
|
|
43
|
+
value: string;
|
|
44
|
+
};
|
|
45
|
+
registrations: {
|
|
46
|
+
contents: {
|
|
47
|
+
key: {
|
|
48
|
+
name: string;
|
|
49
|
+
};
|
|
50
|
+
value: {
|
|
51
|
+
pool_id: string;
|
|
52
|
+
last_claim_index: string;
|
|
53
|
+
};
|
|
54
|
+
}[];
|
|
55
|
+
};
|
|
56
|
+
} | null, {
|
|
57
|
+
id: string | Uint8Array<ArrayBufferLike>;
|
|
58
|
+
balance: {
|
|
59
|
+
value: string | number | bigint;
|
|
60
|
+
};
|
|
61
|
+
registrations: {
|
|
62
|
+
contents: Iterable<{
|
|
63
|
+
key: {
|
|
64
|
+
name: string;
|
|
65
|
+
};
|
|
66
|
+
value: {
|
|
67
|
+
pool_id: string | Uint8Array<ArrayBufferLike>;
|
|
68
|
+
last_claim_index: string | number | bigint;
|
|
69
|
+
};
|
|
70
|
+
}> & {
|
|
71
|
+
length: number;
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
} | null | undefined, "Option<royalty_pool::stake::Stake<phantom Share>>">;
|
|
75
|
+
}, "@local-pkg/routed_stake::routed_stake::RoutedStake<phantom StakeShare, phantom PoolShare>">;
|
|
76
|
+
export declare const RoutedStakeKey: MoveTuple<readonly [import("@mysten/sui/bcs").BcsType<boolean, boolean, "bool">], "@local-pkg/routed_stake::routed_stake::RoutedStakeKey<phantom StakeShare>">;
|
|
77
|
+
export declare const RoutedStakeCreatedEvent: MoveStruct<{
|
|
78
|
+
routed_stake_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
79
|
+
parent_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
80
|
+
staked_value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
81
|
+
}, "@local-pkg/routed_stake::routed_stake::RoutedStakeCreatedEvent<phantom StakeShare, phantom PoolShare>">;
|
|
82
|
+
export declare const RoutedStakeSweptEvent: MoveStruct<{
|
|
83
|
+
routed_stake_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
84
|
+
parent_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
85
|
+
value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
86
|
+
}, "@local-pkg/routed_stake::routed_stake::RoutedStakeSweptEvent<phantom StakeShare, phantom PoolShare, phantom Currency>">;
|
|
87
|
+
export declare const RoutedStakeUnstakedEvent: MoveStruct<{
|
|
88
|
+
routed_stake_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
89
|
+
parent_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
90
|
+
unstaked_value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
91
|
+
}, "@local-pkg/routed_stake::routed_stake::RoutedStakeUnstakedEvent<phantom StakeShare, phantom PoolShare>">;
|
|
92
|
+
export declare const RoutedStakeRestakedEvent: MoveStruct<{
|
|
93
|
+
routed_stake_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
94
|
+
parent_id: import("@mysten/sui/bcs").BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
95
|
+
staked_value: import("@mysten/sui/bcs").BcsType<string, string | number | bigint, "u64">;
|
|
96
|
+
}, "@local-pkg/routed_stake::routed_stake::RoutedStakeRestakedEvent<phantom StakeShare, phantom PoolShare>">;
|
|
97
|
+
export interface NewArguments {
|
|
98
|
+
parent: RawTransactionArgument<string>;
|
|
99
|
+
balance: TransactionArgument;
|
|
100
|
+
}
|
|
101
|
+
export interface NewOptions {
|
|
102
|
+
package?: string;
|
|
103
|
+
arguments: NewArguments | [
|
|
104
|
+
parent: RawTransactionArgument<string>,
|
|
105
|
+
balance: TransactionArgument
|
|
106
|
+
];
|
|
107
|
+
typeArguments: [
|
|
108
|
+
string,
|
|
109
|
+
string
|
|
110
|
+
];
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Construct a routed stake as a derived object of `parent`, wrapping `balance` as
|
|
114
|
+
* its staked position. Aborts (in `stake::new`) on a zero balance, and (in
|
|
115
|
+
* `derived_object::claim`) if the `(parent, StakeShare)` address was already
|
|
116
|
+
* claimed.
|
|
117
|
+
*
|
|
118
|
+
* Cap-gating happens at the parent: callers must obtain `&mut UID` via whatever
|
|
119
|
+
* cap-gated accessor the parent exposes.
|
|
120
|
+
*/
|
|
121
|
+
export declare function _new(options: NewOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
122
|
+
export interface ShareArguments {
|
|
123
|
+
self: RawTransactionArgument<string>;
|
|
124
|
+
}
|
|
125
|
+
export interface ShareOptions {
|
|
126
|
+
package?: string;
|
|
127
|
+
arguments: ShareArguments | [
|
|
128
|
+
self: RawTransactionArgument<string>
|
|
129
|
+
];
|
|
130
|
+
typeArguments: [
|
|
131
|
+
string,
|
|
132
|
+
string
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
/** Share the routed stake so anyone can `sweep` it. */
|
|
136
|
+
export declare function share(options: ShareOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
137
|
+
export interface RegisterArguments {
|
|
138
|
+
self: RawTransactionArgument<string>;
|
|
139
|
+
parent: RawTransactionArgument<string>;
|
|
140
|
+
stakePool: RawTransactionArgument<string>;
|
|
141
|
+
}
|
|
142
|
+
export interface RegisterOptions {
|
|
143
|
+
package?: string;
|
|
144
|
+
arguments: RegisterArguments | [
|
|
145
|
+
self: RawTransactionArgument<string>,
|
|
146
|
+
parent: RawTransactionArgument<string>,
|
|
147
|
+
stakePool: RawTransactionArgument<string>
|
|
148
|
+
];
|
|
149
|
+
typeArguments: [
|
|
150
|
+
string,
|
|
151
|
+
string,
|
|
152
|
+
string
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Register the wrapped stake with the pool it earns from, so future deposits
|
|
157
|
+
* accrue to it. Which same-typed pool is the _correct_ one is the caller's concern
|
|
158
|
+
* — the parent's extension is expected to pin it (e.g. by derivation from the
|
|
159
|
+
* asset object) before delegating here.
|
|
160
|
+
*/
|
|
161
|
+
export declare function register(options: RegisterOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
162
|
+
export interface UnregisterArguments {
|
|
163
|
+
self: RawTransactionArgument<string>;
|
|
164
|
+
parent: RawTransactionArgument<string>;
|
|
165
|
+
stakePool: RawTransactionArgument<string>;
|
|
166
|
+
}
|
|
167
|
+
export interface UnregisterOptions {
|
|
168
|
+
package?: string;
|
|
169
|
+
arguments: UnregisterArguments | [
|
|
170
|
+
self: RawTransactionArgument<string>,
|
|
171
|
+
parent: RawTransactionArgument<string>,
|
|
172
|
+
stakePool: RawTransactionArgument<string>
|
|
173
|
+
];
|
|
174
|
+
typeArguments: [
|
|
175
|
+
string,
|
|
176
|
+
string,
|
|
177
|
+
string
|
|
178
|
+
];
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Unregister the wrapped stake from a pool it earns from. The pool requires
|
|
182
|
+
* claimable rewards to be drained to zero first — i.e. a final `sweep` — so
|
|
183
|
+
* accrued rewards provably reach the parent's pool before the position can move.
|
|
184
|
+
*/
|
|
185
|
+
export declare function unregister(options: UnregisterOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
186
|
+
export interface UnstakeArguments {
|
|
187
|
+
self: RawTransactionArgument<string>;
|
|
188
|
+
parent: RawTransactionArgument<string>;
|
|
189
|
+
}
|
|
190
|
+
export interface UnstakeOptions {
|
|
191
|
+
package?: string;
|
|
192
|
+
arguments: UnstakeArguments | [
|
|
193
|
+
self: RawTransactionArgument<string>,
|
|
194
|
+
parent: RawTransactionArgument<string>
|
|
195
|
+
];
|
|
196
|
+
typeArguments: [
|
|
197
|
+
string,
|
|
198
|
+
string
|
|
199
|
+
];
|
|
200
|
+
}
|
|
201
|
+
/**
|
|
202
|
+
* Remove the staked position and return its principal. Aborts (in
|
|
203
|
+
* `stake::destroy`) while any pool registrations remain. The emptied wrapper
|
|
204
|
+
* persists — its derived address is burned forever, so deleting it would
|
|
205
|
+
* permanently destroy the parent's ability to route-stake this share type;
|
|
206
|
+
* `restake` refills it instead.
|
|
207
|
+
*/
|
|
208
|
+
export declare function unstake(options: UnstakeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
209
|
+
export interface RestakeArguments {
|
|
210
|
+
self: RawTransactionArgument<string>;
|
|
211
|
+
parent: RawTransactionArgument<string>;
|
|
212
|
+
balance: TransactionArgument;
|
|
213
|
+
}
|
|
214
|
+
export interface RestakeOptions {
|
|
215
|
+
package?: string;
|
|
216
|
+
arguments: RestakeArguments | [
|
|
217
|
+
self: RawTransactionArgument<string>,
|
|
218
|
+
parent: RawTransactionArgument<string>,
|
|
219
|
+
balance: TransactionArgument
|
|
220
|
+
];
|
|
221
|
+
typeArguments: [
|
|
222
|
+
string,
|
|
223
|
+
string
|
|
224
|
+
];
|
|
225
|
+
}
|
|
226
|
+
/**
|
|
227
|
+
* Refill an emptied wrapper with a new staked position. Aborts if a position is
|
|
228
|
+
* already present.
|
|
229
|
+
*/
|
|
230
|
+
export declare function restake(options: RestakeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
231
|
+
export interface SweepArguments {
|
|
232
|
+
self: RawTransactionArgument<string>;
|
|
233
|
+
stakePool: RawTransactionArgument<string>;
|
|
234
|
+
routedPool: RawTransactionArgument<string>;
|
|
235
|
+
parentId: RawTransactionArgument<string>;
|
|
236
|
+
}
|
|
237
|
+
export interface SweepOptions {
|
|
238
|
+
package?: string;
|
|
239
|
+
arguments: SweepArguments | [
|
|
240
|
+
self: RawTransactionArgument<string>,
|
|
241
|
+
stakePool: RawTransactionArgument<string>,
|
|
242
|
+
routedPool: RawTransactionArgument<string>,
|
|
243
|
+
parentId: RawTransactionArgument<string>
|
|
244
|
+
];
|
|
245
|
+
typeArguments: [
|
|
246
|
+
string,
|
|
247
|
+
string,
|
|
248
|
+
string
|
|
249
|
+
];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Claim the wrapped stake's accrued rewards from `stake_pool` and deposit them
|
|
253
|
+
* into `routed_pool` — the parent's own pool. Permissionless: the caller supplies
|
|
254
|
+
* `parent_id`, but cannot lie, because both the wrapper's own address and
|
|
255
|
+
* `routed_pool`'s address must derive from it. A zero reward is a no-op (no
|
|
256
|
+
* event), so the call composes safely into batch PTBs; a positive reward aborts
|
|
257
|
+
* (in `royalty_pool::pool`) if `routed_pool` has no registered stakes — the reward
|
|
258
|
+
* stays claimable here until it does.
|
|
259
|
+
*/
|
|
260
|
+
export declare function sweep(options: SweepOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
261
|
+
export interface IdArguments {
|
|
262
|
+
self: RawTransactionArgument<string>;
|
|
263
|
+
}
|
|
264
|
+
export interface IdOptions {
|
|
265
|
+
package?: string;
|
|
266
|
+
arguments: IdArguments | [
|
|
267
|
+
self: RawTransactionArgument<string>
|
|
268
|
+
];
|
|
269
|
+
typeArguments: [
|
|
270
|
+
string,
|
|
271
|
+
string
|
|
272
|
+
];
|
|
273
|
+
}
|
|
274
|
+
export declare function id(options: IdOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
275
|
+
export interface HasStakeArguments {
|
|
276
|
+
self: RawTransactionArgument<string>;
|
|
277
|
+
}
|
|
278
|
+
export interface HasStakeOptions {
|
|
279
|
+
package?: string;
|
|
280
|
+
arguments: HasStakeArguments | [
|
|
281
|
+
self: RawTransactionArgument<string>
|
|
282
|
+
];
|
|
283
|
+
typeArguments: [
|
|
284
|
+
string,
|
|
285
|
+
string
|
|
286
|
+
];
|
|
287
|
+
}
|
|
288
|
+
export declare function hasStake(options: HasStakeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
289
|
+
export interface ValueArguments {
|
|
290
|
+
self: RawTransactionArgument<string>;
|
|
291
|
+
}
|
|
292
|
+
export interface ValueOptions {
|
|
293
|
+
package?: string;
|
|
294
|
+
arguments: ValueArguments | [
|
|
295
|
+
self: RawTransactionArgument<string>
|
|
296
|
+
];
|
|
297
|
+
typeArguments: [
|
|
298
|
+
string,
|
|
299
|
+
string
|
|
300
|
+
];
|
|
301
|
+
}
|
|
302
|
+
/** Staked principal, or 0 while the wrapper is empty. */
|
|
303
|
+
export declare function value(options: ValueOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
304
|
+
export interface StakeArguments {
|
|
305
|
+
self: RawTransactionArgument<string>;
|
|
306
|
+
}
|
|
307
|
+
export interface StakeOptions {
|
|
308
|
+
package?: string;
|
|
309
|
+
arguments: StakeArguments | [
|
|
310
|
+
self: RawTransactionArgument<string>
|
|
311
|
+
];
|
|
312
|
+
typeArguments: [
|
|
313
|
+
string,
|
|
314
|
+
string
|
|
315
|
+
];
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Read-only access to the wrapped stake, e.g. for `pool::pending_rewards`. Aborts
|
|
319
|
+
* while the wrapper is empty (`has_stake` to guard).
|
|
320
|
+
*/
|
|
321
|
+
export declare function stake(options: StakeOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
322
|
+
export interface DerivedAddressArguments {
|
|
323
|
+
parentId: RawTransactionArgument<string>;
|
|
324
|
+
}
|
|
325
|
+
export interface DerivedAddressOptions {
|
|
326
|
+
package?: string;
|
|
327
|
+
arguments: DerivedAddressArguments | [
|
|
328
|
+
parentId: RawTransactionArgument<string>
|
|
329
|
+
];
|
|
330
|
+
typeArguments: [
|
|
331
|
+
string
|
|
332
|
+
];
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Compute the deterministic address of a routed stake given its parent ID and
|
|
336
|
+
* `StakeShare` type parameter.
|
|
337
|
+
*/
|
|
338
|
+
export declare function derivedAddress(options: DerivedAddressOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
339
|
+
export interface AssertDerivedFromArguments {
|
|
340
|
+
self: RawTransactionArgument<string>;
|
|
341
|
+
parentId: RawTransactionArgument<string>;
|
|
342
|
+
}
|
|
343
|
+
export interface AssertDerivedFromOptions {
|
|
344
|
+
package?: string;
|
|
345
|
+
arguments: AssertDerivedFromArguments | [
|
|
346
|
+
self: RawTransactionArgument<string>,
|
|
347
|
+
parentId: RawTransactionArgument<string>
|
|
348
|
+
];
|
|
349
|
+
typeArguments: [
|
|
350
|
+
string,
|
|
351
|
+
string
|
|
352
|
+
];
|
|
353
|
+
}
|
|
354
|
+
/** Verify the routed stake was derived from the given parent ID. */
|
|
355
|
+
export declare function assertDerivedFrom(options: AssertDerivedFromOptions): (tx: Transaction) => import("@mysten/sui/transactions").TransactionResult;
|
|
356
|
+
//# sourceMappingURL=routed_stake.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed_stake.d.ts","sourceRoot":"","sources":["../../../src/contracts/routed_stake/routed_stake.ts"],"names":[],"mappings":"AAAA;;gEAEgE;AAGhE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAA0B,KAAK,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE/G,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGtF,eAAO,MAAM,WAAW;;IAEhB;;;OAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+FAEH,CAAC;AACT,eAAO,MAAM,cAAc,gKAAsG,CAAC;AAClI,eAAO,MAAM,uBAAuB;;;;2GAI5B,CAAC;AACT,eAAO,MAAM,qBAAqB;;;;2HAI1B,CAAC;AACT,eAAO,MAAM,wBAAwB;;;;4GAI7B,CAAC;AACT,eAAO,MAAM,wBAAwB;;;;4GAI7B,CAAC;AACT,MAAM,WAAW,YAAY;IACzB,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACvC,OAAO,EAAE,mBAAmB,CAAC;CAChC;AACD,MAAM,WAAW,UAAU;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,YAAY,GAAG;QACtB,MAAM,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACtC,OAAO,EAAE,mBAAmB;KAC/B,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD;;;;;;;;GAQG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,UAAU,IAO5B,IAAI,WAAW,0DAO1B;AACD,MAAM,WAAW,cAAc;IAC3B,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC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,0DAO1B;AACD,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;IACrC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC,CAAC;CAC5C;AACD,MAAM,WAAW,wBAAwB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,0BAA0B,GAAG;QACpC,IAAI,EAAE,sBAAsB,CAAC,MAAM,CAAC;QACpC,QAAQ,EAAE,sBAAsB,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,aAAa,EAAE;QACX,MAAM;QACN,MAAM;KACT,CAAC;CACL;AACD,oEAAoE;AACpE,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,IAOvD,IAAI,WAAW,0DAO1B"}
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
/**
|
|
5
|
+
* A stake whose rewards are irrevocably routed to its parent's royalty pool.
|
|
6
|
+
*
|
|
7
|
+
* A `RoutedStake<StakeShare, PoolShare>` is a derived object of any UID-bearing
|
|
8
|
+
* parent (same pattern as `RoyaltyPool`). It wraps a `Stake<StakeShare>` — shares
|
|
9
|
+
* of some other asset that the parent owns — and commits the rewards that stake
|
|
10
|
+
* earns to the parent's own `RoyaltyPool<PoolShare, Currency>`: `sweep` is the
|
|
11
|
+
* only reachable claim path, and it deposits straight into the pool derived from
|
|
12
|
+
* the same parent. The wrapper exists precisely so the raw `Stake` is never
|
|
13
|
+
* exposed — a bare shared `Stake` would let any caller claim its rewards and keep
|
|
14
|
+
* them.
|
|
15
|
+
*
|
|
16
|
+
* Because the route is fixed, the wrapper is safe to share: `sweep` is
|
|
17
|
+
* permissionless, and it does not matter who calls it, since the money can only go
|
|
18
|
+
* one place. Lifecycle operations (`register`, `unregister`, `unstake`, `restake`)
|
|
19
|
+
* instead require the parent's `&mut UID` as the credential — cap-gating happens
|
|
20
|
+
* at the parent, exactly as with `RoyaltyPool` creation. `register`/`unregister`
|
|
21
|
+
* are gated because a stake registers at most once per `Currency`: a
|
|
22
|
+
* permissionless register could grief by binding the stake to a garbage same-typed
|
|
23
|
+
* pool, permanently blocking the real one for that currency.
|
|
24
|
+
*
|
|
25
|
+
* The derivation key encodes only `StakeShare` — at most one routed stake per
|
|
26
|
+
* `(parent, StakeShare)` pair, whatever `PoolShare` it used (the same
|
|
27
|
+
* burned-by-first-claim consequence as `RoyaltyPoolKey`; the parent's cap-gated
|
|
28
|
+
* extension is expected to pin `PoolShare` to the parent's own share type). For
|
|
29
|
+
* the same reason the wrapper is never deleted: `unstake` empties it and `restake`
|
|
30
|
+
* refills it, so the one derived address per pair stays usable forever.
|
|
31
|
+
*/
|
|
32
|
+
import { MoveStruct, MoveTuple, normalizeMoveArguments } from '../utils/index.js';
|
|
33
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
34
|
+
import {} from '@mysten/sui/transactions';
|
|
35
|
+
import * as stake_1 from './deps/royalty_pool/stake.js';
|
|
36
|
+
const $moduleName = '@local-pkg/routed_stake::routed_stake';
|
|
37
|
+
export const RoutedStake = new MoveStruct({ name: `${$moduleName}::RoutedStake<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
38
|
+
id: bcs.Address,
|
|
39
|
+
/**
|
|
40
|
+
* The wrapped position. `None` between `unstake` and `restake`; the wrapper itself
|
|
41
|
+
* persists because its derived address can never be re-claimed.
|
|
42
|
+
*/
|
|
43
|
+
stake: bcs.option(stake_1.Stake)
|
|
44
|
+
} });
|
|
45
|
+
export const RoutedStakeKey = new MoveTuple({ name: `${$moduleName}::RoutedStakeKey<phantom StakeShare>`, fields: [bcs.bool()] });
|
|
46
|
+
export const RoutedStakeCreatedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeCreatedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
47
|
+
routed_stake_id: bcs.Address,
|
|
48
|
+
parent_id: bcs.Address,
|
|
49
|
+
staked_value: bcs.u64()
|
|
50
|
+
} });
|
|
51
|
+
export const RoutedStakeSweptEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeSweptEvent<phantom StakeShare, phantom PoolShare, phantom Currency>`, fields: {
|
|
52
|
+
routed_stake_id: bcs.Address,
|
|
53
|
+
parent_id: bcs.Address,
|
|
54
|
+
value: bcs.u64()
|
|
55
|
+
} });
|
|
56
|
+
export const RoutedStakeUnstakedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeUnstakedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
57
|
+
routed_stake_id: bcs.Address,
|
|
58
|
+
parent_id: bcs.Address,
|
|
59
|
+
unstaked_value: bcs.u64()
|
|
60
|
+
} });
|
|
61
|
+
export const RoutedStakeRestakedEvent = new MoveStruct({ name: `${$moduleName}::RoutedStakeRestakedEvent<phantom StakeShare, phantom PoolShare>`, fields: {
|
|
62
|
+
routed_stake_id: bcs.Address,
|
|
63
|
+
parent_id: bcs.Address,
|
|
64
|
+
staked_value: bcs.u64()
|
|
65
|
+
} });
|
|
66
|
+
/**
|
|
67
|
+
* Construct a routed stake as a derived object of `parent`, wrapping `balance` as
|
|
68
|
+
* its staked position. Aborts (in `stake::new`) on a zero balance, and (in
|
|
69
|
+
* `derived_object::claim`) if the `(parent, StakeShare)` address was already
|
|
70
|
+
* claimed.
|
|
71
|
+
*
|
|
72
|
+
* Cap-gating happens at the parent: callers must obtain `&mut UID` via whatever
|
|
73
|
+
* cap-gated accessor the parent exposes.
|
|
74
|
+
*/
|
|
75
|
+
export function _new(options) {
|
|
76
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
77
|
+
const argumentsTypes = [
|
|
78
|
+
'0x2::object::ID',
|
|
79
|
+
null
|
|
80
|
+
];
|
|
81
|
+
const parameterNames = ["parent", "balance"];
|
|
82
|
+
return (tx) => tx.moveCall({
|
|
83
|
+
package: packageAddress,
|
|
84
|
+
module: 'routed_stake',
|
|
85
|
+
function: 'new',
|
|
86
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
87
|
+
typeArguments: options.typeArguments
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Share the routed stake so anyone can `sweep` it. */
|
|
91
|
+
export function share(options) {
|
|
92
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
93
|
+
const argumentsTypes = [
|
|
94
|
+
null
|
|
95
|
+
];
|
|
96
|
+
const parameterNames = ["self"];
|
|
97
|
+
return (tx) => tx.moveCall({
|
|
98
|
+
package: packageAddress,
|
|
99
|
+
module: 'routed_stake',
|
|
100
|
+
function: 'share',
|
|
101
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
102
|
+
typeArguments: options.typeArguments
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Register the wrapped stake with the pool it earns from, so future deposits
|
|
107
|
+
* accrue to it. Which same-typed pool is the _correct_ one is the caller's concern
|
|
108
|
+
* — the parent's extension is expected to pin it (e.g. by derivation from the
|
|
109
|
+
* asset object) before delegating here.
|
|
110
|
+
*/
|
|
111
|
+
export function register(options) {
|
|
112
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
113
|
+
const argumentsTypes = [
|
|
114
|
+
null,
|
|
115
|
+
'0x2::object::ID',
|
|
116
|
+
null
|
|
117
|
+
];
|
|
118
|
+
const parameterNames = ["self", "parent", "stakePool"];
|
|
119
|
+
return (tx) => tx.moveCall({
|
|
120
|
+
package: packageAddress,
|
|
121
|
+
module: 'routed_stake',
|
|
122
|
+
function: 'register',
|
|
123
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
124
|
+
typeArguments: options.typeArguments
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Unregister the wrapped stake from a pool it earns from. The pool requires
|
|
129
|
+
* claimable rewards to be drained to zero first — i.e. a final `sweep` — so
|
|
130
|
+
* accrued rewards provably reach the parent's pool before the position can move.
|
|
131
|
+
*/
|
|
132
|
+
export function unregister(options) {
|
|
133
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
134
|
+
const argumentsTypes = [
|
|
135
|
+
null,
|
|
136
|
+
'0x2::object::ID',
|
|
137
|
+
null
|
|
138
|
+
];
|
|
139
|
+
const parameterNames = ["self", "parent", "stakePool"];
|
|
140
|
+
return (tx) => tx.moveCall({
|
|
141
|
+
package: packageAddress,
|
|
142
|
+
module: 'routed_stake',
|
|
143
|
+
function: 'unregister',
|
|
144
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
145
|
+
typeArguments: options.typeArguments
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Remove the staked position and return its principal. Aborts (in
|
|
150
|
+
* `stake::destroy`) while any pool registrations remain. The emptied wrapper
|
|
151
|
+
* persists — its derived address is burned forever, so deleting it would
|
|
152
|
+
* permanently destroy the parent's ability to route-stake this share type;
|
|
153
|
+
* `restake` refills it instead.
|
|
154
|
+
*/
|
|
155
|
+
export function unstake(options) {
|
|
156
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
157
|
+
const argumentsTypes = [
|
|
158
|
+
null,
|
|
159
|
+
'0x2::object::ID'
|
|
160
|
+
];
|
|
161
|
+
const parameterNames = ["self", "parent"];
|
|
162
|
+
return (tx) => tx.moveCall({
|
|
163
|
+
package: packageAddress,
|
|
164
|
+
module: 'routed_stake',
|
|
165
|
+
function: 'unstake',
|
|
166
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
167
|
+
typeArguments: options.typeArguments
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Refill an emptied wrapper with a new staked position. Aborts if a position is
|
|
172
|
+
* already present.
|
|
173
|
+
*/
|
|
174
|
+
export function restake(options) {
|
|
175
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
176
|
+
const argumentsTypes = [
|
|
177
|
+
null,
|
|
178
|
+
'0x2::object::ID',
|
|
179
|
+
null
|
|
180
|
+
];
|
|
181
|
+
const parameterNames = ["self", "parent", "balance"];
|
|
182
|
+
return (tx) => tx.moveCall({
|
|
183
|
+
package: packageAddress,
|
|
184
|
+
module: 'routed_stake',
|
|
185
|
+
function: 'restake',
|
|
186
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
187
|
+
typeArguments: options.typeArguments
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Claim the wrapped stake's accrued rewards from `stake_pool` and deposit them
|
|
192
|
+
* into `routed_pool` — the parent's own pool. Permissionless: the caller supplies
|
|
193
|
+
* `parent_id`, but cannot lie, because both the wrapper's own address and
|
|
194
|
+
* `routed_pool`'s address must derive from it. A zero reward is a no-op (no
|
|
195
|
+
* event), so the call composes safely into batch PTBs; a positive reward aborts
|
|
196
|
+
* (in `royalty_pool::pool`) if `routed_pool` has no registered stakes — the reward
|
|
197
|
+
* stays claimable here until it does.
|
|
198
|
+
*/
|
|
199
|
+
export function sweep(options) {
|
|
200
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
201
|
+
const argumentsTypes = [
|
|
202
|
+
null,
|
|
203
|
+
null,
|
|
204
|
+
null,
|
|
205
|
+
'0x2::object::ID'
|
|
206
|
+
];
|
|
207
|
+
const parameterNames = ["self", "stakePool", "routedPool", "parentId"];
|
|
208
|
+
return (tx) => tx.moveCall({
|
|
209
|
+
package: packageAddress,
|
|
210
|
+
module: 'routed_stake',
|
|
211
|
+
function: 'sweep',
|
|
212
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
213
|
+
typeArguments: options.typeArguments
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
export function id(options) {
|
|
217
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
218
|
+
const argumentsTypes = [
|
|
219
|
+
null
|
|
220
|
+
];
|
|
221
|
+
const parameterNames = ["self"];
|
|
222
|
+
return (tx) => tx.moveCall({
|
|
223
|
+
package: packageAddress,
|
|
224
|
+
module: 'routed_stake',
|
|
225
|
+
function: 'id',
|
|
226
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
227
|
+
typeArguments: options.typeArguments
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
export function hasStake(options) {
|
|
231
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
232
|
+
const argumentsTypes = [
|
|
233
|
+
null
|
|
234
|
+
];
|
|
235
|
+
const parameterNames = ["self"];
|
|
236
|
+
return (tx) => tx.moveCall({
|
|
237
|
+
package: packageAddress,
|
|
238
|
+
module: 'routed_stake',
|
|
239
|
+
function: 'has_stake',
|
|
240
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
241
|
+
typeArguments: options.typeArguments
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
/** Staked principal, or 0 while the wrapper is empty. */
|
|
245
|
+
export function value(options) {
|
|
246
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
247
|
+
const argumentsTypes = [
|
|
248
|
+
null
|
|
249
|
+
];
|
|
250
|
+
const parameterNames = ["self"];
|
|
251
|
+
return (tx) => tx.moveCall({
|
|
252
|
+
package: packageAddress,
|
|
253
|
+
module: 'routed_stake',
|
|
254
|
+
function: 'value',
|
|
255
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
256
|
+
typeArguments: options.typeArguments
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Read-only access to the wrapped stake, e.g. for `pool::pending_rewards`. Aborts
|
|
261
|
+
* while the wrapper is empty (`has_stake` to guard).
|
|
262
|
+
*/
|
|
263
|
+
export function stake(options) {
|
|
264
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
265
|
+
const argumentsTypes = [
|
|
266
|
+
null
|
|
267
|
+
];
|
|
268
|
+
const parameterNames = ["self"];
|
|
269
|
+
return (tx) => tx.moveCall({
|
|
270
|
+
package: packageAddress,
|
|
271
|
+
module: 'routed_stake',
|
|
272
|
+
function: 'stake',
|
|
273
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
274
|
+
typeArguments: options.typeArguments
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Compute the deterministic address of a routed stake given its parent ID and
|
|
279
|
+
* `StakeShare` type parameter.
|
|
280
|
+
*/
|
|
281
|
+
export function derivedAddress(options) {
|
|
282
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
283
|
+
const argumentsTypes = [
|
|
284
|
+
'0x2::object::ID'
|
|
285
|
+
];
|
|
286
|
+
const parameterNames = ["parentId"];
|
|
287
|
+
return (tx) => tx.moveCall({
|
|
288
|
+
package: packageAddress,
|
|
289
|
+
module: 'routed_stake',
|
|
290
|
+
function: 'derived_address',
|
|
291
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
292
|
+
typeArguments: options.typeArguments
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
/** Verify the routed stake was derived from the given parent ID. */
|
|
296
|
+
export function assertDerivedFrom(options) {
|
|
297
|
+
const packageAddress = options.package ?? '@local-pkg/routed_stake';
|
|
298
|
+
const argumentsTypes = [
|
|
299
|
+
null,
|
|
300
|
+
'0x2::object::ID'
|
|
301
|
+
];
|
|
302
|
+
const parameterNames = ["self", "parentId"];
|
|
303
|
+
return (tx) => tx.moveCall({
|
|
304
|
+
package: packageAddress,
|
|
305
|
+
module: 'routed_stake',
|
|
306
|
+
function: 'assert_derived_from',
|
|
307
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
308
|
+
typeArguments: options.typeArguments
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
//# sourceMappingURL=routed_stake.js.map
|