@misofm/sdk 0.12.0 → 0.12.2
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 +11 -32
- package/dist/client.d.ts +3 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -0
- package/dist/client.js.map +1 -1
- package/dist/contracts/party_wallet/party_wallet.d.ts +214 -0
- package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -0
- package/dist/contracts/party_wallet/party_wallet.js +214 -0
- package/dist/contracts/party_wallet/party_wallet.js.map +1 -0
- package/dist/contracts/party_wallet/witness.d.ts +6 -0
- package/dist/contracts/party_wallet/witness.d.ts.map +1 -0
- package/dist/contracts/party_wallet/witness.js +8 -0
- package/dist/contracts/party_wallet/witness.js.map +1 -0
- package/dist/contracts/royalty_pool/stake.d.ts +6 -0
- package/dist/contracts/royalty_pool/stake.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/stake.js +6 -0
- package/dist/contracts/royalty_pool/stake.js.map +1 -1
- package/dist/contracts/vault/vault.d.ts +2 -1
- package/dist/contracts/vault/vault.d.ts.map +1 -1
- package/dist/contracts/vault/vault.js +2 -1
- package/dist/contracts/vault/vault.js.map +1 -1
- package/dist/contracts.d.ts +1 -0
- package/dist/contracts.d.ts.map +1 -1
- package/dist/contracts.js +1 -0
- package/dist/contracts.js.map +1 -1
- package/dist/deployments.d.ts +82 -6
- package/dist/deployments.d.ts.map +1 -1
- package/dist/deployments.js +46 -5
- package/dist/deployments.js.map +1 -1
- package/dist/read/client.d.ts +2 -3
- package/dist/read/client.d.ts.map +1 -1
- package/dist/read/client.js +1 -2
- package/dist/read/client.js.map +1 -1
- package/dist/read/config.d.ts +1 -5
- package/dist/read/config.d.ts.map +1 -1
- package/dist/read/config.js +29 -11
- package/dist/read/config.js.map +1 -1
- package/package.json +4 -4
- package/src/client.ts +10 -0
- package/src/contracts/party_wallet/party_wallet.ts +350 -0
- package/src/contracts/party_wallet/witness.ts +7 -0
- package/src/contracts/royalty_pool/stake.ts +8 -2
- package/src/contracts/vault/vault.ts +2 -1
- package/src/contracts.ts +1 -0
- package/src/deployments.ts +52 -5
- package/src/read/client.ts +2 -3
- package/src/read/config.ts +30 -13
package/dist/deployments.js
CHANGED
|
@@ -1,14 +1,55 @@
|
|
|
1
1
|
// Copyright (c) Miso Labs, Inc.
|
|
2
2
|
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
import { MISO_DEPLOYMENTS } from "@misonetwork/sdk/deployments";
|
|
3
4
|
/**
|
|
4
5
|
* Platform deployments bundled with this SDK release.
|
|
5
6
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* is an incompatible ABI and must not be selected by accident. The admin-cli
|
|
9
|
-
* deployment flow injects verified IDs in a follow-up change.
|
|
7
|
+
* IDs come only from the verified output of the Ledger-backed deployment run.
|
|
8
|
+
* Consumers may still pass an explicit complete deployment for custom networks.
|
|
10
9
|
*/
|
|
11
|
-
export const MISO_PLATFORM_DEPLOYMENTS = {
|
|
10
|
+
export const MISO_PLATFORM_DEPLOYMENTS = {
|
|
11
|
+
testnet: {
|
|
12
|
+
network: "testnet",
|
|
13
|
+
chainIdentifier: "69WiPg3DAQiwdxfncX6wYQ2siKwAe6L9BZthQea3JNMD",
|
|
14
|
+
protocol: MISO_DEPLOYMENTS.testnet,
|
|
15
|
+
packages: {
|
|
16
|
+
pressing: "0x95fba53c968978f75d6ca8a5e6f0f3ba83fdc3af301bc8419be354a3990af5b9",
|
|
17
|
+
record: "0x6150c474200f63bf73072642564886e5ecb1a4c0498ede31acd7908d94dbc83b",
|
|
18
|
+
minato: "0x8466e9864c1d947888e73b0e349b035bc22805579eef18f132966f56c8efe1d2",
|
|
19
|
+
credit: "0x20d8e38f49445cbae45fd66c262c2cbc4bf4cccab487b3fb443a491dc24071cd",
|
|
20
|
+
compositionCredits: "0x8b376967e9c32169727ec5341890f28c66d8577d7bfcecb83aa78aec3e84dce5",
|
|
21
|
+
recordingCredits: "0x7096a47b0ba12063c037d6d417bffade758665a3f313574c8ba218823cfb159a",
|
|
22
|
+
releaseCredits: "0xbe293700ef758c95b69838df6cfa8377b9cad1dd59cbf933974f68b1766d87b5",
|
|
23
|
+
royaltyPool: "0xbeddbcfc2c42ed1bcaa74dc241957621b48241451e10af136c20cdc7df8266b8",
|
|
24
|
+
vault: "0x7075ce4bfc2c738e774c94f1eeb7dc532a5f11ead9b4e3815d90dc16053eae9c",
|
|
25
|
+
compositionRoyaltyPoolPlugin: "0x8d61aecceb597441a0d675b44291706742859c8ff7755b3ed143823daa430c50",
|
|
26
|
+
recordingRoyaltyPoolPlugin: "0x6de70d4e87a328259f00f354227fb329c63fbf50efb87f057c5da26d6908e1d1",
|
|
27
|
+
partyWalletPlugin: "0xccf17215193d1ae64a47480c83df9af2881ffdb75e5ac842ab3898cadd9eeca0",
|
|
28
|
+
routedStake: "0x7a55b1841043efea865d65a6601e057400a79a0aa7bb11e781a25dbe622cbe5f",
|
|
29
|
+
compositionRoutedStakePlugin: "0x54fb4befa1be03f7457abfddcfb9334c20a8df3e01c44aa257f1c3d718cd57ee",
|
|
30
|
+
coverArt: "0x2dae28058b89df93224bacfb9af42fd3ab41f001c2c815fd57fd575024d9a50b",
|
|
31
|
+
releaseCoverArt: "0x649b18f2bb3d94f6a611a8e4ad3a29dcf8b7bba3f684056d60897a8a5e835106",
|
|
32
|
+
genre: "0x978d5f67a4fdc3eb688ed3aeb23c6c3c37ae44e358fb709001e6ab21e6f19f34",
|
|
33
|
+
releaseDescription: "0x3e26e4c4c5b3f51070d6d7bb1527eaa304f34ae5dfde078661e180e7594d6d28",
|
|
34
|
+
releaseDspLink: "0xd9f9e7240c397a82e4af1ecb9ec75b29a91ef4084127eabcf22fbf24e72cab2f",
|
|
35
|
+
releaseGenre: "0xc1012f9768f178ca908ef4a6cfd150ad33baaa3587dc2154ea9852858243cd57",
|
|
36
|
+
releaseKind: "0x3e74c960d9446ae2ebf228456ddc1b099d2090501c9cbcd284a999aa2e774e12",
|
|
37
|
+
releaseRevenueDistributorPlugin: "0x42a22b24129988a5ce8069a1f78eb31d9aa5edf360d729ae3c2c0b8ed18876e1",
|
|
38
|
+
recordingAdvisory: "0x28e0e72c5b892fc888a9007afa59ebe04ed8e47f12632ddb42cd685d09c4af2e",
|
|
39
|
+
recordingLanguage: "0x4b284a9435cf4f48e3785e4485d16be2fcbcef5beaa2b44b6556d9c1028e2c0d",
|
|
40
|
+
recordingMasterReference: "0x2b06ab58f2d5a915b42fc5879d52241fc72e804b3da782fa752b2d2f242170c0",
|
|
41
|
+
recordingPreview: "0x449aafe29707adf249df7e90355ecb19d939ea77d9e19fd3e2fdb220e73e74f0",
|
|
42
|
+
ori: "0x340057f2174fb59e4626742dd2b46c662237837b6187450cb59e4976ce7eac78",
|
|
43
|
+
},
|
|
44
|
+
objects: {
|
|
45
|
+
releaseRegistry: "0xf5941ae9640f6f24b75e921da16c95fd23d776b9e6518c275a50a5ce6337c8ba",
|
|
46
|
+
genreRegistry: "0xad34d6b717b8c59ed9ac47a520feab31324f0c04d70fd31922be45d8209fce1c",
|
|
47
|
+
},
|
|
48
|
+
legacy: {
|
|
49
|
+
releaseCoverArtPackages: [],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
};
|
|
12
53
|
/** Resolve a bundled platform deployment, failing closed when it is unavailable. */
|
|
13
54
|
export function getMisoPlatformDeployment(network) {
|
|
14
55
|
const deployment = MISO_PLATFORM_DEPLOYMENTS[network];
|
package/dist/deployments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;
|
|
1
|
+
{"version":3,"file":"deployments.js","sourceRoot":"","sources":["../src/deployments.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AAMtC,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AA4DhE;;;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I,KAAK,CACb,iEAAiE,OAAO,KAAK;YAC3E,4DAA4D,CAC/D,CAAC;IACJ,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC"}
|
package/dist/read/client.d.ts
CHANGED
|
@@ -27,12 +27,11 @@ export interface MisoClient {
|
|
|
27
27
|
export interface CreateMisoClientOptions extends MisoConfigOverrides {
|
|
28
28
|
/** "testnet" | "mainnet". A bare string (e.g. a Worker's `NETWORK` var) is accepted. */
|
|
29
29
|
network?: Network | string;
|
|
30
|
-
/** Complete verified configuration
|
|
30
|
+
/** Complete verified configuration for a custom or unbundled deployment. */
|
|
31
31
|
config?: MisoConfig;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* Build the client from a complete verified
|
|
35
|
-
* shortcut remains for a future bundled deployment, but currently fails closed.
|
|
34
|
+
* Build the client from a bundled network or a complete verified custom config.
|
|
36
35
|
*/
|
|
37
36
|
export declare function createMisoClient(options?: CreateMisoClientOptions): MisoClient;
|
|
38
37
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/read/client.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAQ,KAAK,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAA2B,KAAK,UAAU,EAAE,KAAK,mBAAmB,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAM/G;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,cAAc,kBAAkB,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC,CAAC;AAE7F,oFAAoF;AACpF,MAAM,MAAM,qBAAqB,GAAG,gBAAgB,CAAC;AAErD,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,UAAU,CAAC;I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OAAO,GAAG,MAAM,CAAC;IAC3B,4EAA4E;IAC5E,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,UAAU,CA0BlF"}
|
package/dist/read/client.js
CHANGED
|
@@ -23,8 +23,7 @@ function definedOverrides(value) {
|
|
|
23
23
|
return Object.fromEntries(Object.entries(value).filter(([, item]) => item !== undefined));
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
|
-
* Build the client from a complete verified
|
|
27
|
-
* shortcut remains for a future bundled deployment, but currently fails closed.
|
|
26
|
+
* Build the client from a bundled network or a complete verified custom config.
|
|
28
27
|
*/
|
|
29
28
|
export function createMisoClient(options = {}) {
|
|
30
29
|
const { network, config: providedConfig, ...overrides } = options;
|
package/dist/read/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/read/client.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AACtC,EAAE;AACF,sDAAsD;AACtD,EAAE;AACF,8CAA8C;AAC9C,6EAA6E;AAC7E,6DAA6D;AAC7D,iFAAiF;AACjF,iFAAiF;AACjF,yEAAyE;AACzE,EAAE;AACF,mFAAmF;AACnF,6DAA6D;AAC7D,EAAE;AACF,gFAAgF;AAChF,0DAA0D;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,IAAI,EAA2B,MAAM,yBAAyB,CAAC;AACxE,OAAO,EAAE,UAAU,EAAE,WAAW,EAA2D,MAAM,aAAa,CAAC;AAE/G,SAAS,gBAAgB,CAAmB,KAAQ;IAClD,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,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AAC;IAC5C,IAAI,OAAO,KAAK,SAAS,IAAI,MAAM,CAAC,OAAO,KAAK,gBAAgB,EAAE,CAAC;QACjE,MAAM,IAAI,KAAK,CACb,4CAA4C,MAAM,CAAC,OAAO,SAAS,gBAAgB,GAAG,CACvF,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,GAAG,IAAI,aAAa,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IACrF,MAAM,UAAU,GAAG,IAAI,gBAAgB,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC;IAE7F,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAElE,OAAO;QACL,MAAM;QACN,GAAG;QACH,QAAQ,EAAE,GAAgC;QAC1C,OAAO,EAAE,UAA8C;QACvD,UAAU;KACX,CAAC;AACJ,CAAC"}
|
package/dist/read/config.d.ts
CHANGED
|
@@ -55,10 +55,6 @@ export interface DiscoverSale {
|
|
|
55
55
|
}
|
|
56
56
|
/** Fields a deployment may override without forking the whole config (endpoints, shelf). */
|
|
57
57
|
export type MisoConfigOverrides = Partial<Pick<MisoConfig, "grpcUrl" | "graphqlUrl" | "walrusAggregatorUrl" | "apiBaseUrl" | "discoverSales">>;
|
|
58
|
-
/**
|
|
59
|
-
* Bundled read configuration is disabled until the admin-cli publish flow has
|
|
60
|
-
* recorded every new immutable package and singleton object. This is fail-closed
|
|
61
|
-
* by design: old testnet types cannot be mistaken for the current ABI.
|
|
62
|
-
*/
|
|
58
|
+
/** The config for `network`, derived from this SDK's verified deployment map. */
|
|
63
59
|
export declare function misoConfig(network: Network, overrides?: MisoConfigOverrides): MisoConfig;
|
|
64
60
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGnE,MAAM,MAAM,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;AAE5C,qFAAqF;AACrF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAI9D;AAED,wFAAwF;AACxF,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,CAAC;IACjB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;IACf,yDAAyD;IACzD,eAAe,EAAE,MAAM,CAAC;IACxB,kFAAkF;IAClF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,gFAAgF;AAChF,MAAM,WAAW,QAAQ;IACvB,sEAAsE;IACtE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,UAAU;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,qEAAqE;IACrE,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,QAAQ,CAAC;IAChB,0DAA0D;IAC1D,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,mBAAmB,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB,wEAAwE;IACxE,aAAa,EAAE,SAAS,YAAY,EAAE,CAAC;CACxC;AAED,oFAAoF;AACpF,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,4FAA4F;AAC5F,MAAM,MAAM,mBAAmB,GAAG,OAAO,CACvC,IAAI,CAAC,UAAU,EAAE,SAAS,GAAG,YAAY,GAAG,qBAAqB,GAAG,YAAY,GAAG,eAAe,CAAC,CACpG,CAAC;AAEF,iFAAiF;AACjF,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,mBAAwB,GAAG,UAAU,CA0B5F"}
|
package/dist/read/config.js
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
// `lib/money.ts`, `lib/pressing.ts`) lives here instead, so a redeploy is a change
|
|
8
8
|
// in ONE file that every surface picks up.
|
|
9
9
|
//
|
|
10
|
-
//
|
|
11
|
-
//
|
|
12
|
-
//
|
|
10
|
+
// Testnet values are derived from the same verified deployment record exported
|
|
11
|
+
// by the platform SDK. Mainnet remains deliberately unavailable until a complete
|
|
12
|
+
// deployment is bundled for it.
|
|
13
|
+
import { getMisoPlatformDeployment } from "../deployments.js";
|
|
13
14
|
/** Missing defaults to Testnet for local development; invalid values fail closed. */
|
|
14
15
|
export function networkFrom(value) {
|
|
15
16
|
if (value === undefined || value === "testnet")
|
|
@@ -18,15 +19,32 @@ export function networkFrom(value) {
|
|
|
18
19
|
return "mainnet";
|
|
19
20
|
throw new Error(`@misofm/sdk/read: unsupported network "${value}".`);
|
|
20
21
|
}
|
|
21
|
-
/**
|
|
22
|
-
* Bundled read configuration is disabled until the admin-cli publish flow has
|
|
23
|
-
* recorded every new immutable package and singleton object. This is fail-closed
|
|
24
|
-
* by design: old testnet types cannot be mistaken for the current ABI.
|
|
25
|
-
*/
|
|
22
|
+
/** The config for `network`, derived from this SDK's verified deployment map. */
|
|
26
23
|
export function misoConfig(network, overrides = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
const platform = getMisoPlatformDeployment(network);
|
|
25
|
+
const config = {
|
|
26
|
+
network,
|
|
27
|
+
deployment: platform.protocol,
|
|
28
|
+
protocol: {
|
|
29
|
+
pressing: platform.packages.pressing,
|
|
30
|
+
record: platform.packages.record,
|
|
31
|
+
releaseCoverArt: platform.packages.releaseCoverArt,
|
|
32
|
+
compositionCredits: platform.packages.compositionCredits,
|
|
33
|
+
recordingCredits: platform.packages.recordingCredits,
|
|
34
|
+
releaseCredits: platform.packages.releaseCredits,
|
|
35
|
+
credit: platform.packages.credit,
|
|
36
|
+
},
|
|
37
|
+
money: {
|
|
38
|
+
usdCoinType: "0x77774cb7b8cb5622b4ef2658101bf5f1e965418297fe874b683df8f760b6e749::fakeusd::FakeUsd",
|
|
39
|
+
usdDecimals: 6,
|
|
40
|
+
},
|
|
41
|
+
grpcUrl: "https://fullnode.testnet.sui.io",
|
|
42
|
+
graphqlUrl: "https://graphql.testnet.sui.io/graphql",
|
|
43
|
+
walrusAggregatorUrl: "https://aggregator.walrus-testnet.walrus.space",
|
|
44
|
+
apiBaseUrl: "https://api.testnet.miso.fm",
|
|
45
|
+
discoverSales: [],
|
|
46
|
+
};
|
|
47
|
+
return { ...config, ...stripUndefined(overrides) };
|
|
30
48
|
}
|
|
31
49
|
/** `{ a: undefined }` must not clobber a real default when spread. */
|
|
32
50
|
function stripUndefined(o) {
|
package/dist/read/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,sCAAsC;AACtC,EAAE;AACF,iFAAiF;AACjF,+EAA+E;AAC/E,yEAAyE;AACzE,mFAAmF;AACnF,2CAA2C;AAC3C,EAAE;AACF
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/read/config.ts"],"names":[],"mappings":"AAAA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,UAAU,EAAE,6BAA6B;QACzC,aAAa,EAAE,EAAE;KAClB,CAAC;IACF,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,cAAc,CAAC,SAAS,CAAC,EAAE,CAAC;AACrD,CAAC;AAED,sEAAsE;AACtE,SAAS,cAAc,CAAmB,CAAI;IAC5C,OAAO,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAe,CAAC;AAChG,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@misofm/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.2",
|
|
4
4
|
"packageManager": "bun@1.4.0",
|
|
5
5
|
"description": "Complete client SDK for the Miso platform on Sui — high-level reads, pressings, listings, records, and work publishing.",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -112,7 +112,7 @@
|
|
|
112
112
|
],
|
|
113
113
|
"scripts": {
|
|
114
114
|
"codegen": "sui-ts-codegen generate",
|
|
115
|
-
"codegen:check": "bun run codegen && perl -pi -e 's/[ \\t]+$//' src/contracts/royalty_pool/pool.ts && git diff --exit-code -- src/contracts",
|
|
115
|
+
"codegen:check": "bun run codegen && perl -pi -e 's/[ \\t]+$//' src/contracts/royalty_pool/pool.ts src/contracts/royalty_pool/stake.ts src/contracts/party_wallet/party_wallet.ts && git diff --exit-code -- src/contracts",
|
|
116
116
|
"typecheck": "tsc --noEmit",
|
|
117
117
|
"test": "bun test",
|
|
118
118
|
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
@@ -120,14 +120,14 @@
|
|
|
120
120
|
"prepare": "rm -rf dist && tsc -p tsconfig.build.json --noCheck"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
|
-
"@misonetwork/sdk": "^0.9.
|
|
123
|
+
"@misonetwork/sdk": "^0.9.1",
|
|
124
124
|
"@mysten/codegen": "^0.11.14",
|
|
125
125
|
"@mysten/move-bytecode-template": "^0.4.0",
|
|
126
126
|
"@mysten/sui": "^2.24.0",
|
|
127
127
|
"@types/bun": "^1.3.14"
|
|
128
128
|
},
|
|
129
129
|
"peerDependencies": {
|
|
130
|
-
"@misonetwork/sdk": "^0.9.
|
|
130
|
+
"@misonetwork/sdk": "^0.9.1",
|
|
131
131
|
"@mysten/move-bytecode-template": "^0.4.0",
|
|
132
132
|
"@mysten/sui": "^2.4.0",
|
|
133
133
|
"typescript": "^5"
|
package/src/client.ts
CHANGED
|
@@ -49,6 +49,7 @@ import * as releaseRevenueDistributorContract from "./contracts/release_revenue_
|
|
|
49
49
|
import * as vaultContract from "./contracts/vault/vault.ts";
|
|
50
50
|
import * as compositionRoyaltyPoolContract from "./contracts/composition_royalty_pool/composition_royalty_pool.ts";
|
|
51
51
|
import * as recordingRoyaltyPoolContract from "./contracts/recording_royalty_pool/recording_royalty_pool.ts";
|
|
52
|
+
import * as partyWalletContract from "./contracts/party_wallet/party_wallet.ts";
|
|
52
53
|
import * as compositionRoutedStakeContract from "./contracts/composition_routed_stake/composition_routed_stake.ts";
|
|
53
54
|
import * as routedStakeContract from "./contracts/routed_stake/routed_stake.ts";
|
|
54
55
|
import * as royaltyPoolContract from "./contracts/royalty_pool/pool.ts";
|
|
@@ -203,6 +204,7 @@ export interface MisoPlatformConfig {
|
|
|
203
204
|
/** Vault plugins, deliberately separate from data-extension package ids. */
|
|
204
205
|
compositionRoyaltyPoolPluginPackageId?: string;
|
|
205
206
|
recordingRoyaltyPoolPluginPackageId?: string;
|
|
207
|
+
partyWalletPluginPackageId?: string;
|
|
206
208
|
compositionRoutedStakePluginPackageId?: string;
|
|
207
209
|
routedStakePackageId?: string;
|
|
208
210
|
releaseRevenueDistributorPluginPackageId?: string;
|
|
@@ -600,6 +602,13 @@ export class MisoPlatformClient {
|
|
|
600
602
|
["install", "uninstall", "initializePool", "receiveAndDeposit", "redeemAndDeposit", "isInstalled", "poolAddress"] as const,
|
|
601
603
|
)
|
|
602
604
|
: undefined,
|
|
605
|
+
partyWallet: this.#config.partyWalletPluginPackageId
|
|
606
|
+
? bindModulePackage(
|
|
607
|
+
partyWalletContract,
|
|
608
|
+
this.#config.partyWalletPluginPackageId,
|
|
609
|
+
["install", "uninstall", "receiveObject", "receiveObjects", "receiveCoins", "redeemCoin", "isInstalled", "inboxAddress", "settledFunds"] as const,
|
|
610
|
+
)
|
|
611
|
+
: undefined,
|
|
603
612
|
compositionRoutedStake: this.#config.compositionRoutedStakePluginPackageId
|
|
604
613
|
? bindModulePackage(
|
|
605
614
|
compositionRoutedStakeContract,
|
|
@@ -701,6 +710,7 @@ export function miso<const Name extends string = "miso">(
|
|
|
701
710
|
deployment.packages.compositionRoyaltyPoolPlugin,
|
|
702
711
|
recordingRoyaltyPoolPluginPackageId:
|
|
703
712
|
deployment.packages.recordingRoyaltyPoolPlugin,
|
|
713
|
+
partyWalletPluginPackageId: deployment.packages.partyWalletPlugin,
|
|
704
714
|
compositionRoutedStakePluginPackageId:
|
|
705
715
|
deployment.packages.compositionRoutedStakePlugin,
|
|
706
716
|
routedStakePackageId: deployment.packages.routedStake,
|
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Vault-authorized withdrawals from a Party's object inbox and funds accumulator.
|
|
8
|
+
*
|
|
9
|
+
* Anyone may address objects or funds to a Party ID. This plugin is the bounded
|
|
10
|
+
* withdrawal door: it temporarily leases the matching `PartyAdminCap`, uses it
|
|
11
|
+
* only to reach that Party's UID, returns it to the Vault, and then transfers the
|
|
12
|
+
* withdrawn object or coin to the recipient selected by the Vault administrator.
|
|
13
|
+
*
|
|
14
|
+
* Installation alone never makes withdrawals permissionless. Every production
|
|
15
|
+
* withdrawal is an `entry fun` requiring the matching `VaultAdminCap`, and no
|
|
16
|
+
* endpoint returns the leased capability, its borrow receipt, or a privileged
|
|
17
|
+
* reference. The Party itself stores no plugin data.
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
import { MoveStruct, normalizeMoveArguments, type RawTransactionArgument } from '../utils/index.js';
|
|
21
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
22
|
+
import { type Transaction, type TransactionArgument } from '@mysten/sui/transactions';
|
|
23
|
+
const $moduleName = '@local-pkg/party_wallet::party_wallet';
|
|
24
|
+
export const ObjectReceivedEvent = new MoveStruct({ name: `${$moduleName}::ObjectReceivedEvent`, fields: {
|
|
25
|
+
party_id: bcs.Address,
|
|
26
|
+
object_id: bcs.Address
|
|
27
|
+
} });
|
|
28
|
+
export const CoinsReceivedEvent = new MoveStruct({ name: `${$moduleName}::CoinsReceivedEvent<phantom Currency>`, fields: {
|
|
29
|
+
party_id: bcs.Address,
|
|
30
|
+
amount: bcs.u64(),
|
|
31
|
+
coins: bcs.u64()
|
|
32
|
+
} });
|
|
33
|
+
export const FundsRedeemedEvent = new MoveStruct({ name: `${$moduleName}::FundsRedeemedEvent<phantom Currency>`, fields: {
|
|
34
|
+
party_id: bcs.Address,
|
|
35
|
+
amount: bcs.u64()
|
|
36
|
+
} });
|
|
37
|
+
export interface InstallArguments {
|
|
38
|
+
vault: RawTransactionArgument<string>;
|
|
39
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
40
|
+
}
|
|
41
|
+
export interface InstallOptions {
|
|
42
|
+
package?: string;
|
|
43
|
+
arguments: InstallArguments | [
|
|
44
|
+
vault: RawTransactionArgument<string>,
|
|
45
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
/** Authorize this package on a Party capability Vault. */
|
|
49
|
+
export function install(options: InstallOptions) {
|
|
50
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
51
|
+
const argumentsTypes = [
|
|
52
|
+
null,
|
|
53
|
+
null
|
|
54
|
+
] satisfies (string | null)[];
|
|
55
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
56
|
+
return (tx: Transaction) => tx.moveCall({
|
|
57
|
+
package: packageAddress,
|
|
58
|
+
module: 'party_wallet',
|
|
59
|
+
function: 'install',
|
|
60
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
export interface UninstallArguments {
|
|
64
|
+
vault: RawTransactionArgument<string>;
|
|
65
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
66
|
+
}
|
|
67
|
+
export interface UninstallOptions {
|
|
68
|
+
package?: string;
|
|
69
|
+
arguments: UninstallArguments | [
|
|
70
|
+
vault: RawTransactionArgument<string>,
|
|
71
|
+
vaultAdminCap: RawTransactionArgument<string>
|
|
72
|
+
];
|
|
73
|
+
}
|
|
74
|
+
/** Revoke this package from a Party capability Vault. */
|
|
75
|
+
export function uninstall(options: UninstallOptions) {
|
|
76
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
77
|
+
const argumentsTypes = [
|
|
78
|
+
null,
|
|
79
|
+
null
|
|
80
|
+
] satisfies (string | null)[];
|
|
81
|
+
const parameterNames = ["vault", "vaultAdminCap"];
|
|
82
|
+
return (tx: Transaction) => tx.moveCall({
|
|
83
|
+
package: packageAddress,
|
|
84
|
+
module: 'party_wallet',
|
|
85
|
+
function: 'uninstall',
|
|
86
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
export interface ReceiveObjectArguments {
|
|
90
|
+
vault: RawTransactionArgument<string>;
|
|
91
|
+
party: RawTransactionArgument<string>;
|
|
92
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
93
|
+
objectToReceive: TransactionArgument;
|
|
94
|
+
recipient: RawTransactionArgument<string>;
|
|
95
|
+
}
|
|
96
|
+
export interface ReceiveObjectOptions {
|
|
97
|
+
package?: string;
|
|
98
|
+
arguments: ReceiveObjectArguments | [
|
|
99
|
+
vault: RawTransactionArgument<string>,
|
|
100
|
+
party: RawTransactionArgument<string>,
|
|
101
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
102
|
+
objectToReceive: TransactionArgument,
|
|
103
|
+
recipient: RawTransactionArgument<string>
|
|
104
|
+
];
|
|
105
|
+
typeArguments: [
|
|
106
|
+
string
|
|
107
|
+
];
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Receive one `key + store` object addressed to the Party and transfer it to
|
|
111
|
+
* `recipient`.
|
|
112
|
+
*
|
|
113
|
+
* Aborts if the Vault administrator is wrong, the plugin is not installed, the
|
|
114
|
+
* Vault contains another Party's cap, or the receiving ticket is invalid for the
|
|
115
|
+
* supplied Party.
|
|
116
|
+
*/
|
|
117
|
+
export function receiveObject(options: ReceiveObjectOptions) {
|
|
118
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
119
|
+
const argumentsTypes = [
|
|
120
|
+
null,
|
|
121
|
+
null,
|
|
122
|
+
null,
|
|
123
|
+
null,
|
|
124
|
+
'address'
|
|
125
|
+
] satisfies (string | null)[];
|
|
126
|
+
const parameterNames = ["vault", "party", "vaultAdminCap", "objectToReceive", "recipient"];
|
|
127
|
+
return (tx: Transaction) => tx.moveCall({
|
|
128
|
+
package: packageAddress,
|
|
129
|
+
module: 'party_wallet',
|
|
130
|
+
function: 'receive_object',
|
|
131
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
132
|
+
typeArguments: options.typeArguments
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
export interface ReceiveObjectsArguments {
|
|
136
|
+
vault: RawTransactionArgument<string>;
|
|
137
|
+
party: RawTransactionArgument<string>;
|
|
138
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
139
|
+
objectsToReceive: TransactionArgument;
|
|
140
|
+
recipient: RawTransactionArgument<string>;
|
|
141
|
+
}
|
|
142
|
+
export interface ReceiveObjectsOptions {
|
|
143
|
+
package?: string;
|
|
144
|
+
arguments: ReceiveObjectsArguments | [
|
|
145
|
+
vault: RawTransactionArgument<string>,
|
|
146
|
+
party: RawTransactionArgument<string>,
|
|
147
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
148
|
+
objectsToReceive: TransactionArgument,
|
|
149
|
+
recipient: RawTransactionArgument<string>
|
|
150
|
+
];
|
|
151
|
+
typeArguments: [
|
|
152
|
+
string
|
|
153
|
+
];
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Receive several `key + store` objects of one type and transfer each to
|
|
157
|
+
* `recipient` in input order.
|
|
158
|
+
*
|
|
159
|
+
* Aborts with `ENothingToReceive` if `objects_to_receive` is empty. It also aborts
|
|
160
|
+
* under the authorization and receiving conditions documented by `receive_object`.
|
|
161
|
+
*/
|
|
162
|
+
export function receiveObjects(options: ReceiveObjectsOptions) {
|
|
163
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
164
|
+
const argumentsTypes = [
|
|
165
|
+
null,
|
|
166
|
+
null,
|
|
167
|
+
null,
|
|
168
|
+
'vector<null>',
|
|
169
|
+
'address'
|
|
170
|
+
] satisfies (string | null)[];
|
|
171
|
+
const parameterNames = ["vault", "party", "vaultAdminCap", "objectsToReceive", "recipient"];
|
|
172
|
+
return (tx: Transaction) => tx.moveCall({
|
|
173
|
+
package: packageAddress,
|
|
174
|
+
module: 'party_wallet',
|
|
175
|
+
function: 'receive_objects',
|
|
176
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
177
|
+
typeArguments: options.typeArguments
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
export interface ReceiveCoinsArguments {
|
|
181
|
+
vault: RawTransactionArgument<string>;
|
|
182
|
+
party: RawTransactionArgument<string>;
|
|
183
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
184
|
+
coins: TransactionArgument;
|
|
185
|
+
recipient: RawTransactionArgument<string>;
|
|
186
|
+
}
|
|
187
|
+
export interface ReceiveCoinsOptions {
|
|
188
|
+
package?: string;
|
|
189
|
+
arguments: ReceiveCoinsArguments | [
|
|
190
|
+
vault: RawTransactionArgument<string>,
|
|
191
|
+
party: RawTransactionArgument<string>,
|
|
192
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
193
|
+
coins: TransactionArgument,
|
|
194
|
+
recipient: RawTransactionArgument<string>
|
|
195
|
+
];
|
|
196
|
+
typeArguments: [
|
|
197
|
+
string
|
|
198
|
+
];
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Receive coin objects of one currency, merge them, and transfer the resulting
|
|
202
|
+
* Coin to `recipient`.
|
|
203
|
+
*
|
|
204
|
+
* Aborts with `ENothingToReceive` if `coins` is empty. It also aborts if the Vault
|
|
205
|
+
* administrator, plugin installation, Party capability, or a receiving ticket is
|
|
206
|
+
* invalid.
|
|
207
|
+
*/
|
|
208
|
+
export function receiveCoins(options: ReceiveCoinsOptions) {
|
|
209
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
210
|
+
const argumentsTypes = [
|
|
211
|
+
null,
|
|
212
|
+
null,
|
|
213
|
+
null,
|
|
214
|
+
'vector<null>',
|
|
215
|
+
'address'
|
|
216
|
+
] satisfies (string | null)[];
|
|
217
|
+
const parameterNames = ["vault", "party", "vaultAdminCap", "coins", "recipient"];
|
|
218
|
+
return (tx: Transaction) => tx.moveCall({
|
|
219
|
+
package: packageAddress,
|
|
220
|
+
module: 'party_wallet',
|
|
221
|
+
function: 'receive_coins',
|
|
222
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
223
|
+
typeArguments: options.typeArguments
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
export interface RedeemCoinArguments {
|
|
227
|
+
vault: RawTransactionArgument<string>;
|
|
228
|
+
party: RawTransactionArgument<string>;
|
|
229
|
+
vaultAdminCap: RawTransactionArgument<string>;
|
|
230
|
+
value: RawTransactionArgument<number | bigint>;
|
|
231
|
+
recipient: RawTransactionArgument<string>;
|
|
232
|
+
}
|
|
233
|
+
export interface RedeemCoinOptions {
|
|
234
|
+
package?: string;
|
|
235
|
+
arguments: RedeemCoinArguments | [
|
|
236
|
+
vault: RawTransactionArgument<string>,
|
|
237
|
+
party: RawTransactionArgument<string>,
|
|
238
|
+
vaultAdminCap: RawTransactionArgument<string>,
|
|
239
|
+
value: RawTransactionArgument<number | bigint>,
|
|
240
|
+
recipient: RawTransactionArgument<string>
|
|
241
|
+
];
|
|
242
|
+
typeArguments: [
|
|
243
|
+
string
|
|
244
|
+
];
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Redeem `value` from the Party's accumulator balance, create a Coin, and transfer
|
|
248
|
+
* it to `recipient`.
|
|
249
|
+
*
|
|
250
|
+
* Aborts if the Vault administrator is wrong, the plugin is not installed, the
|
|
251
|
+
* Vault contains another Party's cap, `value` is zero, or the accumulator cannot
|
|
252
|
+
* cover the requested amount.
|
|
253
|
+
*/
|
|
254
|
+
export function redeemCoin(options: RedeemCoinOptions) {
|
|
255
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
256
|
+
const argumentsTypes = [
|
|
257
|
+
null,
|
|
258
|
+
null,
|
|
259
|
+
null,
|
|
260
|
+
'u64',
|
|
261
|
+
'address'
|
|
262
|
+
] satisfies (string | null)[];
|
|
263
|
+
const parameterNames = ["vault", "party", "vaultAdminCap", "value", "recipient"];
|
|
264
|
+
return (tx: Transaction) => tx.moveCall({
|
|
265
|
+
package: packageAddress,
|
|
266
|
+
module: 'party_wallet',
|
|
267
|
+
function: 'redeem_coin',
|
|
268
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
269
|
+
typeArguments: options.typeArguments
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
export interface IsInstalledArguments {
|
|
273
|
+
vault: RawTransactionArgument<string>;
|
|
274
|
+
}
|
|
275
|
+
export interface IsInstalledOptions {
|
|
276
|
+
package?: string;
|
|
277
|
+
arguments: IsInstalledArguments | [
|
|
278
|
+
vault: RawTransactionArgument<string>
|
|
279
|
+
];
|
|
280
|
+
}
|
|
281
|
+
/** Return whether this plugin is installed on `vault`. */
|
|
282
|
+
export function isInstalled(options: IsInstalledOptions) {
|
|
283
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
284
|
+
const argumentsTypes = [
|
|
285
|
+
null
|
|
286
|
+
] satisfies (string | null)[];
|
|
287
|
+
const parameterNames = ["vault"];
|
|
288
|
+
return (tx: Transaction) => tx.moveCall({
|
|
289
|
+
package: packageAddress,
|
|
290
|
+
module: 'party_wallet',
|
|
291
|
+
function: 'is_installed',
|
|
292
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
export interface InboxAddressArguments {
|
|
296
|
+
party: RawTransactionArgument<string>;
|
|
297
|
+
}
|
|
298
|
+
export interface InboxAddressOptions {
|
|
299
|
+
package?: string;
|
|
300
|
+
arguments: InboxAddressArguments | [
|
|
301
|
+
party: RawTransactionArgument<string>
|
|
302
|
+
];
|
|
303
|
+
}
|
|
304
|
+
/** Return the Party ID as the address to which objects or funds may be sent. */
|
|
305
|
+
export function inboxAddress(options: InboxAddressOptions) {
|
|
306
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
307
|
+
const argumentsTypes = [
|
|
308
|
+
null
|
|
309
|
+
] satisfies (string | null)[];
|
|
310
|
+
const parameterNames = ["party"];
|
|
311
|
+
return (tx: Transaction) => tx.moveCall({
|
|
312
|
+
package: packageAddress,
|
|
313
|
+
module: 'party_wallet',
|
|
314
|
+
function: 'inbox_address',
|
|
315
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
316
|
+
});
|
|
317
|
+
}
|
|
318
|
+
export interface SettledFundsArguments {
|
|
319
|
+
root: RawTransactionArgument<string>;
|
|
320
|
+
party: RawTransactionArgument<string>;
|
|
321
|
+
}
|
|
322
|
+
export interface SettledFundsOptions {
|
|
323
|
+
package?: string;
|
|
324
|
+
arguments: SettledFundsArguments | [
|
|
325
|
+
root: RawTransactionArgument<string>,
|
|
326
|
+
party: RawTransactionArgument<string>
|
|
327
|
+
];
|
|
328
|
+
typeArguments: [
|
|
329
|
+
string
|
|
330
|
+
];
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Return the Party's accumulator balance settled at the start of the current
|
|
334
|
+
* consensus commit.
|
|
335
|
+
*/
|
|
336
|
+
export function settledFunds(options: SettledFundsOptions) {
|
|
337
|
+
const packageAddress = options.package ?? '@local-pkg/party_wallet';
|
|
338
|
+
const argumentsTypes = [
|
|
339
|
+
null,
|
|
340
|
+
null
|
|
341
|
+
] satisfies (string | null)[];
|
|
342
|
+
const parameterNames = ["root", "party"];
|
|
343
|
+
return (tx: Transaction) => tx.moveCall({
|
|
344
|
+
package: packageAddress,
|
|
345
|
+
module: 'party_wallet',
|
|
346
|
+
function: 'settled_funds',
|
|
347
|
+
arguments: normalizeMoveArguments(options.arguments, argumentsTypes, parameterNames),
|
|
348
|
+
typeArguments: options.typeArguments
|
|
349
|
+
});
|
|
350
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**************************************************************
|
|
2
|
+
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
3
|
+
**************************************************************/
|
|
4
|
+
import { MoveTuple } from '../utils/index.js';
|
|
5
|
+
import { bcs } from '@mysten/sui/bcs';
|
|
6
|
+
const $moduleName = '@local-pkg/party_wallet::witness';
|
|
7
|
+
export const Witness = new MoveTuple({ name: `${$moduleName}::Witness`, fields: [bcs.bool()] });
|