@misofm/sdk 0.15.3 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +11 -0
- package/dist/client.d.ts +4 -4
- package/dist/client.js +4 -4
- package/dist/client.js.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts +11 -8
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js +9 -6
- package/dist/contracts/composition_royalty_pool/composition_royalty_pool.js.map +1 -1
- package/dist/contracts/miso_pressing/certificate.d.ts +1 -1
- package/dist/contracts/miso_pressing/certificate.d.ts.map +1 -1
- package/dist/contracts/miso_pressing/certificate.js +1 -1
- package/dist/contracts/miso_pressing/certificate.js.map +1 -1
- package/dist/contracts/miso_pressing/listing.d.ts +5 -5
- package/dist/contracts/miso_pressing/listing.js +5 -5
- package/dist/contracts/miso_pressing/pressing.d.ts +10 -10
- package/dist/contracts/miso_pressing/pressing.js +7 -7
- package/dist/contracts/party_wallet/party_wallet.d.ts +42 -17
- package/dist/contracts/party_wallet/party_wallet.d.ts.map +1 -1
- package/dist/contracts/party_wallet/party_wallet.js +40 -15
- package/dist/contracts/party_wallet/party_wallet.js.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts +13 -8
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.d.ts.map +1 -1
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js +11 -6
- package/dist/contracts/recording_royalty_pool/recording_royalty_pool.js.map +1 -1
- package/dist/contracts/royalty_pool/pool.d.ts +14 -10
- package/dist/contracts/royalty_pool/pool.d.ts.map +1 -1
- package/dist/contracts/royalty_pool/pool.js +12 -8
- package/dist/contracts/royalty_pool/pool.js.map +1 -1
- package/dist/deployments.d.ts +4 -4
- package/dist/deployments.js +4 -4
- package/dist/vault.d.ts +27 -10
- package/dist/vault.d.ts.map +1 -1
- package/dist/vault.js +53 -7
- package/dist/vault.js.map +1 -1
- package/package.json +1 -1
- package/src/client.ts +4 -4
- package/src/contracts/composition_royalty_pool/composition_royalty_pool.ts +14 -11
- package/src/contracts/miso_pressing/certificate.ts +1 -1
- package/src/contracts/miso_pressing/listing.ts +5 -5
- package/src/contracts/miso_pressing/pressing.ts +7 -7
- package/src/contracts/party_wallet/party_wallet.ts +63 -24
- package/src/contracts/recording_royalty_pool/recording_royalty_pool.ts +16 -11
- package/src/contracts/royalty_pool/pool.ts +17 -13
- package/src/deployments.ts +4 -4
- package/src/vault.ts +95 -14
package/src/vault.ts
CHANGED
|
@@ -284,6 +284,7 @@ export interface CompositionRoyaltyPoolCrankParams {
|
|
|
284
284
|
readonly vault: TransactionObjectArgument;
|
|
285
285
|
readonly composition: TransactionObjectArgument;
|
|
286
286
|
readonly pool: TransactionObjectArgument;
|
|
287
|
+
readonly accumulatorRoot: TransactionObjectArgument;
|
|
287
288
|
readonly compositionShareType: string;
|
|
288
289
|
readonly currencyType: string;
|
|
289
290
|
readonly pluginPackageId: string;
|
|
@@ -307,16 +308,16 @@ export function asU64(name: string, value: U64Input): bigint {
|
|
|
307
308
|
return parsed;
|
|
308
309
|
}
|
|
309
310
|
|
|
310
|
-
/** Permissionless crank:
|
|
311
|
-
export function
|
|
311
|
+
/** Permissionless crank: sweep settled address funds into the canonical pool. */
|
|
312
|
+
export function sweepCompositionRoyaltyPool(
|
|
312
313
|
tx: Transaction,
|
|
313
|
-
params: CompositionRoyaltyPoolCrankParams
|
|
314
|
+
params: CompositionRoyaltyPoolCrankParams,
|
|
314
315
|
): void {
|
|
315
316
|
tx.add(
|
|
316
|
-
compositionRoyaltyPool.
|
|
317
|
+
compositionRoyaltyPool.sweepAndDeposit({
|
|
317
318
|
package: params.pluginPackageId,
|
|
318
319
|
typeArguments: [params.compositionShareType, params.currencyType],
|
|
319
|
-
arguments: [params.vault, params.composition, params.pool,
|
|
320
|
+
arguments: [params.vault, params.composition, params.pool, params.accumulatorRoot],
|
|
320
321
|
}),
|
|
321
322
|
);
|
|
322
323
|
}
|
|
@@ -361,14 +362,16 @@ export function installRecordingRoyaltyPoolPlugin(
|
|
|
361
362
|
);
|
|
362
363
|
}
|
|
363
364
|
|
|
365
|
+
export interface PartyWalletPluginParams {
|
|
366
|
+
readonly vault: TransactionObjectArgument;
|
|
367
|
+
readonly vaultAdminCap: TransactionObjectArgument;
|
|
368
|
+
readonly pluginPackageId: string;
|
|
369
|
+
}
|
|
370
|
+
|
|
364
371
|
/** Install the Party wallet plugin; its canonical witness stays internal. */
|
|
365
372
|
export function installPartyWalletPlugin(
|
|
366
373
|
tx: Transaction,
|
|
367
|
-
params:
|
|
368
|
-
readonly vault: TransactionObjectArgument;
|
|
369
|
-
readonly vaultAdminCap: TransactionObjectArgument;
|
|
370
|
-
readonly pluginPackageId: string;
|
|
371
|
-
},
|
|
374
|
+
params: PartyWalletPluginParams,
|
|
372
375
|
): void {
|
|
373
376
|
tx.add(
|
|
374
377
|
partyWallet.install({
|
|
@@ -378,6 +381,82 @@ export function installPartyWalletPlugin(
|
|
|
378
381
|
);
|
|
379
382
|
}
|
|
380
383
|
|
|
384
|
+
export function uninstallPartyWalletPlugin(
|
|
385
|
+
tx: Transaction,
|
|
386
|
+
params: PartyWalletPluginParams,
|
|
387
|
+
): void {
|
|
388
|
+
tx.add(
|
|
389
|
+
partyWallet.uninstall({
|
|
390
|
+
package: params.pluginPackageId,
|
|
391
|
+
arguments: [params.vault, params.vaultAdminCap],
|
|
392
|
+
}),
|
|
393
|
+
);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
export interface PartyWalletFundsParams extends PartyWalletPluginParams {
|
|
397
|
+
readonly party: TransactionObjectArgument;
|
|
398
|
+
readonly currencyType: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/** Receive selected Party-owned coins and return their merged Balance. */
|
|
402
|
+
export function receivePartyWalletBalance(
|
|
403
|
+
tx: Transaction,
|
|
404
|
+
params: PartyWalletFundsParams & { readonly coins: readonly ReceivingObjectRef[] },
|
|
405
|
+
): TransactionArgument {
|
|
406
|
+
return tx.add(
|
|
407
|
+
partyWallet.receiveCoins({
|
|
408
|
+
package: params.pluginPackageId,
|
|
409
|
+
typeArguments: [params.currencyType],
|
|
410
|
+
arguments: [
|
|
411
|
+
params.vault,
|
|
412
|
+
params.party,
|
|
413
|
+
params.vaultAdminCap,
|
|
414
|
+
receivingCoins(tx, params.currencyType, params.coins),
|
|
415
|
+
],
|
|
416
|
+
}),
|
|
417
|
+
);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Redeem an exact Party accumulator amount and return its Balance. */
|
|
421
|
+
export function redeemPartyWalletBalance(
|
|
422
|
+
tx: Transaction,
|
|
423
|
+
params: PartyWalletFundsParams & { readonly value: U64Input },
|
|
424
|
+
): TransactionArgument {
|
|
425
|
+
return tx.add(
|
|
426
|
+
partyWallet.redeemBalance({
|
|
427
|
+
package: params.pluginPackageId,
|
|
428
|
+
typeArguments: [params.currencyType],
|
|
429
|
+
arguments: [
|
|
430
|
+
params.vault,
|
|
431
|
+
params.party,
|
|
432
|
+
params.vaultAdminCap,
|
|
433
|
+
asU64("value", params.value),
|
|
434
|
+
],
|
|
435
|
+
}),
|
|
436
|
+
);
|
|
437
|
+
}
|
|
438
|
+
|
|
439
|
+
/** Sweep the Party's currently settled accumulator funds and return its Balance. */
|
|
440
|
+
export function sweepPartyWalletBalance(
|
|
441
|
+
tx: Transaction,
|
|
442
|
+
params: PartyWalletFundsParams & {
|
|
443
|
+
readonly accumulatorRoot: TransactionObjectArgument;
|
|
444
|
+
},
|
|
445
|
+
): TransactionArgument {
|
|
446
|
+
return tx.add(
|
|
447
|
+
partyWallet.sweepBalance({
|
|
448
|
+
package: params.pluginPackageId,
|
|
449
|
+
typeArguments: [params.currencyType],
|
|
450
|
+
arguments: [
|
|
451
|
+
params.vault,
|
|
452
|
+
params.party,
|
|
453
|
+
params.accumulatorRoot,
|
|
454
|
+
params.vaultAdminCap,
|
|
455
|
+
],
|
|
456
|
+
}),
|
|
457
|
+
);
|
|
458
|
+
}
|
|
459
|
+
|
|
381
460
|
export function uninstallRecordingRoyaltyPoolPlugin(
|
|
382
461
|
tx: Transaction,
|
|
383
462
|
params: RecordingRoyaltyPoolPluginParams,
|
|
@@ -412,25 +491,27 @@ export interface RecordingRoyaltyPoolCrankParams {
|
|
|
412
491
|
readonly vault: TransactionObjectArgument;
|
|
413
492
|
readonly recording: TransactionObjectArgument;
|
|
414
493
|
readonly pool: TransactionObjectArgument;
|
|
494
|
+
readonly accumulatorRoot: TransactionObjectArgument;
|
|
415
495
|
readonly recordingShareType: string;
|
|
416
496
|
readonly compositionShareType: string;
|
|
417
497
|
readonly currencyType: string;
|
|
418
498
|
readonly pluginPackageId: string;
|
|
419
499
|
}
|
|
420
500
|
|
|
421
|
-
|
|
501
|
+
/** Permissionless crank: sweep settled address funds into the canonical pool. */
|
|
502
|
+
export function sweepRecordingRoyaltyPool(
|
|
422
503
|
tx: Transaction,
|
|
423
|
-
params: RecordingRoyaltyPoolCrankParams
|
|
504
|
+
params: RecordingRoyaltyPoolCrankParams,
|
|
424
505
|
): void {
|
|
425
506
|
tx.add(
|
|
426
|
-
recordingRoyaltyPool.
|
|
507
|
+
recordingRoyaltyPool.sweepAndDeposit({
|
|
427
508
|
package: params.pluginPackageId,
|
|
428
509
|
typeArguments: [
|
|
429
510
|
params.recordingShareType,
|
|
430
511
|
params.compositionShareType,
|
|
431
512
|
params.currencyType,
|
|
432
513
|
],
|
|
433
|
-
arguments: [params.vault, params.recording, params.pool,
|
|
514
|
+
arguments: [params.vault, params.recording, params.pool, params.accumulatorRoot],
|
|
434
515
|
}),
|
|
435
516
|
);
|
|
436
517
|
}
|