@streamflow/stream 10.0.0-alpha.p313.4470e29 → 10.0.0-alpha.p313.85091cd
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/dist/cjs/index.cjs +148 -36
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/cjs/solana/descriptor/streamflow_aligned_unlocks.d.cts +101 -1
- package/dist/cjs/solana/index.cjs +148 -36
- package/dist/cjs/solana/index.cjs.map +1 -1
- package/dist/cjs/solana/index.d.cts +12 -11
- package/dist/esm/index.js +148 -36
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/solana/descriptor/idl/streamflow_aligned_unlocks.json +101 -1
- package/dist/esm/solana/descriptor/streamflow_aligned_unlocks.d.ts +101 -1
- package/dist/esm/solana/index.d.ts +12 -11
- package/dist/esm/solana/index.js +148 -36
- package/dist/esm/solana/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -553,7 +553,7 @@ declare class SolanaStreamClient {
|
|
|
553
553
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
554
554
|
* @returns Create stream instructions
|
|
555
555
|
*/
|
|
556
|
-
|
|
556
|
+
prepareCreateLinearStreamInstructions({ recipient, tokenId: mint, start, amount: depositedAmount, period, cliff, cliffAmount, amountPerPeriod, name, canPause, canUpdateRate, canTopup, cancelableBySender, cancelableByRecipient, transferableBySender, transferableByRecipient, automaticWithdrawal, withdrawalFrequency, partner, tokenProgramId: streamTokenProgramId, }: ICreateStreamData, { sender, metadataPubKeys, isNative, computePrice, computeLimit }: IPrepareCreateStreamExt): Promise<ICreateStreamInstructions>;
|
|
557
557
|
/**
|
|
558
558
|
* Creates a new stream/vesting contract using unchecked instruction.
|
|
559
559
|
*
|
|
@@ -637,7 +637,7 @@ declare class SolanaStreamClient {
|
|
|
637
637
|
* @param {ICreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
638
638
|
* @returns Multiple transaction information
|
|
639
639
|
*/
|
|
640
|
-
createMultiple(data: ICreateMultipleStreamData, extParams: ICreateStreamExt): Promise<IMultiTransactionResult>;
|
|
640
|
+
createMultiple(data: ICreateMultipleStreamData[] | ICreateMultipleStreamData, extParams: ICreateStreamExt): Promise<IMultiTransactionResult>;
|
|
641
641
|
/**
|
|
642
642
|
* Creates multiple stream/vesting contracts, and send all transactions sequentially.
|
|
643
643
|
* All fees are paid by sender (escrow metadata account rent, escrow token account rent, recipient's associated token account rent, Streamflow's service fee).
|
|
@@ -646,7 +646,7 @@ declare class SolanaStreamClient {
|
|
|
646
646
|
* @param {ICreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
647
647
|
* @returns Multiple transaction information
|
|
648
648
|
*/
|
|
649
|
-
createMultipleSequential(data: ICreateMultipleStreamData, extParams: ICreateStreamExt): Promise<IMultiTransactionResult>;
|
|
649
|
+
createMultipleSequential(data: ICreateMultipleStreamData[] | ICreateMultipleStreamData, extParams: ICreateStreamExt): Promise<IMultiTransactionResult>;
|
|
650
650
|
/**
|
|
651
651
|
* Attempts withdrawing from the specified stream.
|
|
652
652
|
* @param {IWithdrawData} withdrawData - Withdrawal parameters including stream ID and amount to withdraw
|
|
@@ -688,7 +688,7 @@ declare class SolanaStreamClient {
|
|
|
688
688
|
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet, token account validation, and compute settings
|
|
689
689
|
* @returns Transaction instructions
|
|
690
690
|
*/
|
|
691
|
-
|
|
691
|
+
prepareCancelLinearStream({ id }: ICancelData, { invoker, checkTokenAccounts, computePrice, computeLimit }: IPrepareStreamExt): Promise<TransactionInstruction[]>;
|
|
692
692
|
/**
|
|
693
693
|
* Attempts changing the stream/vesting contract's recipient (effectively transferring the stream/vesting contract).
|
|
694
694
|
* Potential associated token account rent fee (to make it rent-exempt) is paid by the transaction initiator.
|
|
@@ -771,11 +771,11 @@ declare class SolanaStreamClient {
|
|
|
771
771
|
*/
|
|
772
772
|
getDefaultStreamflowFee(): Promise<number>;
|
|
773
773
|
/**
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
774
|
+
* Returns total fee percent, streamflow fees + partner fees
|
|
775
|
+
* @param getFeesData structure with address for which we need to derive fee, either sender or partner usually
|
|
776
|
+
* @param chainSpecificParams additional parameters required by chain client
|
|
777
|
+
* @returns fee as floating number, so if fee is 0.99%, it will return 0.99
|
|
778
|
+
*/
|
|
779
779
|
getTotalFee(getFeesData: IGetFeesData): Promise<number>;
|
|
780
780
|
/**
|
|
781
781
|
* Extracts error code from an error
|
|
@@ -784,9 +784,10 @@ declare class SolanaStreamClient {
|
|
|
784
784
|
*/
|
|
785
785
|
extractErrorCode(err: Error): string | null;
|
|
786
786
|
/**
|
|
787
|
-
|
|
788
|
-
|
|
787
|
+
* Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
|
|
788
|
+
*/
|
|
789
789
|
isAlignedUnlock(streamPublicKey: PublicKey, senderPublicKey: PublicKey): boolean;
|
|
790
|
+
private flatBuildCreateMultipleTransactionInstructions;
|
|
790
791
|
/**
|
|
791
792
|
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
792
793
|
*/
|
package/dist/esm/index.js
CHANGED
|
@@ -879,7 +879,7 @@ var streamflow_aligned_unlocks_default = {
|
|
|
879
879
|
address: "aSTRM2NKoKxNnkmLWk9sz3k74gKBk9t7bpPrTGxMszH",
|
|
880
880
|
metadata: {
|
|
881
881
|
name: "streamflow_aligned_unlocks",
|
|
882
|
-
version: "1.
|
|
882
|
+
version: "1.4.0",
|
|
883
883
|
spec: "0.1.0",
|
|
884
884
|
description: "Proxy to update unlock amount within Streamflow vesting protocol according to Token performance and other metrics"
|
|
885
885
|
},
|
|
@@ -1753,6 +1753,80 @@ var streamflow_aligned_unlocks_default = {
|
|
|
1753
1753
|
],
|
|
1754
1754
|
args: []
|
|
1755
1755
|
},
|
|
1756
|
+
{
|
|
1757
|
+
name: "update_contract",
|
|
1758
|
+
discriminator: [
|
|
1759
|
+
78,
|
|
1760
|
+
184,
|
|
1761
|
+
162,
|
|
1762
|
+
174,
|
|
1763
|
+
233,
|
|
1764
|
+
5,
|
|
1765
|
+
40,
|
|
1766
|
+
82
|
|
1767
|
+
],
|
|
1768
|
+
accounts: [
|
|
1769
|
+
{
|
|
1770
|
+
name: "sender",
|
|
1771
|
+
writable: true,
|
|
1772
|
+
signer: true
|
|
1773
|
+
},
|
|
1774
|
+
{
|
|
1775
|
+
name: "proxy_metadata",
|
|
1776
|
+
docs: [
|
|
1777
|
+
"Proxy Contract"
|
|
1778
|
+
],
|
|
1779
|
+
writable: true,
|
|
1780
|
+
pda: {
|
|
1781
|
+
seeds: [
|
|
1782
|
+
{
|
|
1783
|
+
kind: "const",
|
|
1784
|
+
value: [
|
|
1785
|
+
99,
|
|
1786
|
+
111,
|
|
1787
|
+
110,
|
|
1788
|
+
116,
|
|
1789
|
+
114,
|
|
1790
|
+
97,
|
|
1791
|
+
99,
|
|
1792
|
+
116
|
|
1793
|
+
]
|
|
1794
|
+
},
|
|
1795
|
+
{
|
|
1796
|
+
kind: "account",
|
|
1797
|
+
path: "stream_metadata"
|
|
1798
|
+
}
|
|
1799
|
+
]
|
|
1800
|
+
}
|
|
1801
|
+
},
|
|
1802
|
+
{
|
|
1803
|
+
name: "stream_metadata",
|
|
1804
|
+
writable: true
|
|
1805
|
+
},
|
|
1806
|
+
{
|
|
1807
|
+
name: "withdrawor",
|
|
1808
|
+
writable: true
|
|
1809
|
+
},
|
|
1810
|
+
{
|
|
1811
|
+
name: "streamflow_program",
|
|
1812
|
+
address: "strmRqUCoQUgGUan5YhzUZa6KqdzwX5L6FpUxfmKg5m"
|
|
1813
|
+
},
|
|
1814
|
+
{
|
|
1815
|
+
name: "system_program",
|
|
1816
|
+
address: "11111111111111111111111111111111"
|
|
1817
|
+
}
|
|
1818
|
+
],
|
|
1819
|
+
args: [
|
|
1820
|
+
{
|
|
1821
|
+
name: "params",
|
|
1822
|
+
type: {
|
|
1823
|
+
defined: {
|
|
1824
|
+
name: "UpdateContractParams"
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
}
|
|
1828
|
+
]
|
|
1829
|
+
},
|
|
1756
1830
|
{
|
|
1757
1831
|
name: "update_test_oracle",
|
|
1758
1832
|
discriminator: [
|
|
@@ -2348,6 +2422,32 @@ var streamflow_aligned_unlocks_default = {
|
|
|
2348
2422
|
]
|
|
2349
2423
|
}
|
|
2350
2424
|
},
|
|
2425
|
+
{
|
|
2426
|
+
name: "UpdateContractParams",
|
|
2427
|
+
type: {
|
|
2428
|
+
kind: "struct",
|
|
2429
|
+
fields: [
|
|
2430
|
+
{
|
|
2431
|
+
name: "transferable_by_sender",
|
|
2432
|
+
type: {
|
|
2433
|
+
option: "bool"
|
|
2434
|
+
}
|
|
2435
|
+
},
|
|
2436
|
+
{
|
|
2437
|
+
name: "transferable_by_recipient",
|
|
2438
|
+
type: {
|
|
2439
|
+
option: "bool"
|
|
2440
|
+
}
|
|
2441
|
+
},
|
|
2442
|
+
{
|
|
2443
|
+
name: "cancelable_by_sender",
|
|
2444
|
+
type: {
|
|
2445
|
+
option: "bool"
|
|
2446
|
+
}
|
|
2447
|
+
}
|
|
2448
|
+
]
|
|
2449
|
+
}
|
|
2450
|
+
},
|
|
2351
2451
|
{
|
|
2352
2452
|
name: "UpdateTestOracleParams",
|
|
2353
2453
|
type: {
|
|
@@ -2538,7 +2638,7 @@ var SolanaStreamClient = class {
|
|
|
2538
2638
|
return { ixs, txId: signature, metadataId };
|
|
2539
2639
|
}
|
|
2540
2640
|
async prepareCreateInstructions(streamParams, extParams) {
|
|
2541
|
-
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.
|
|
2641
|
+
const { ixs, metadata, metadataPubKey } = isCreateAlignedStreamData(streamParams) ? await this.prepareCreateAlignedUnlockInstructions(streamParams, extParams) : await this.prepareCreateLinearStreamInstructions(streamParams, extParams);
|
|
2542
2642
|
return { ixs, metadata, metadataPubKey };
|
|
2543
2643
|
}
|
|
2544
2644
|
async prepareCreateAlignedUnlockInstructions(streamParams, extParams) {
|
|
@@ -2572,7 +2672,10 @@ var SolanaStreamClient = class {
|
|
|
2572
2672
|
floorPrice
|
|
2573
2673
|
} = streamParams;
|
|
2574
2674
|
const { isNative, sender, computeLimit, computePrice, metadataPubKeys } = extParams;
|
|
2575
|
-
invariant(
|
|
2675
|
+
invariant(
|
|
2676
|
+
priceOracle || !oracleType || oracleType === "none",
|
|
2677
|
+
"Price oracle is required for the specified oracle type"
|
|
2678
|
+
);
|
|
2576
2679
|
assertHasPublicKey(sender, "Sender's PublicKey is not available, check passed wallet adapter!");
|
|
2577
2680
|
const recipientPublicKey = new PublicKey(recipient);
|
|
2578
2681
|
const mintPublicKey = isNative ? NATIVE_MINT : new PublicKey(mint);
|
|
@@ -2645,7 +2748,7 @@ var SolanaStreamClient = class {
|
|
|
2645
2748
|
* @param {IPrepareCreateStreamExt} extParams - Transaction configuration including sender wallet, metadata keys, and compute settings
|
|
2646
2749
|
* @returns Create stream instructions
|
|
2647
2750
|
*/
|
|
2648
|
-
async
|
|
2751
|
+
async prepareCreateLinearStreamInstructions({
|
|
2649
2752
|
recipient,
|
|
2650
2753
|
tokenId: mint,
|
|
2651
2754
|
start,
|
|
@@ -2747,10 +2850,7 @@ var SolanaStreamClient = class {
|
|
|
2747
2850
|
* @returns Create result
|
|
2748
2851
|
*/
|
|
2749
2852
|
async createUnchecked(data, extParams) {
|
|
2750
|
-
const { ixs, metadata, metadataPubKey } = await this.prepareCreateUncheckedInstructions(
|
|
2751
|
-
data,
|
|
2752
|
-
extParams
|
|
2753
|
-
);
|
|
2853
|
+
const { ixs, metadata, metadataPubKey } = await this.prepareCreateUncheckedInstructions(data, extParams);
|
|
2754
2854
|
const { tx, hash, context } = await prepareTransaction(
|
|
2755
2855
|
this.connection,
|
|
2756
2856
|
ixs,
|
|
@@ -2902,19 +3002,10 @@ var SolanaStreamClient = class {
|
|
|
2902
3002
|
recipient: recipientData.recipient
|
|
2903
3003
|
});
|
|
2904
3004
|
}
|
|
2905
|
-
const prepareInstructions = await this.getCreateATAInstructions(
|
|
2906
|
-
[partnerPublicKey],
|
|
2907
|
-
mintPublicKey,
|
|
2908
|
-
sender,
|
|
2909
|
-
true
|
|
2910
|
-
);
|
|
3005
|
+
const prepareInstructions = await this.getCreateATAInstructions([partnerPublicKey], mintPublicKey, sender, true);
|
|
2911
3006
|
if (isNative) {
|
|
2912
3007
|
const totalDepositedAmount = recipients.reduce((acc, recipient) => recipient.amount.add(acc), new BN3(0));
|
|
2913
|
-
const nativeInstructions = await prepareWrappedAccount(
|
|
2914
|
-
this.connection,
|
|
2915
|
-
sender.publicKey,
|
|
2916
|
-
totalDepositedAmount
|
|
2917
|
-
);
|
|
3008
|
+
const nativeInstructions = await prepareWrappedAccount(this.connection, sender.publicKey, totalDepositedAmount);
|
|
2918
3009
|
prepareInstructions.push(...nativeInstructions);
|
|
2919
3010
|
}
|
|
2920
3011
|
return {
|
|
@@ -2983,7 +3074,7 @@ var SolanaStreamClient = class {
|
|
|
2983
3074
|
if (!sender.publicKey) {
|
|
2984
3075
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
2985
3076
|
}
|
|
2986
|
-
const { instructionsBatch, metadatas,
|
|
3077
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
2987
3078
|
const errors = [];
|
|
2988
3079
|
const signatures = [];
|
|
2989
3080
|
const metadataPubKeys = metadataPubKeysExt || [];
|
|
@@ -3048,7 +3139,7 @@ var SolanaStreamClient = class {
|
|
|
3048
3139
|
if (!sender.publicKey) {
|
|
3049
3140
|
throw new Error("Sender's PublicKey is not available, check passed wallet adapter!");
|
|
3050
3141
|
}
|
|
3051
|
-
const { instructionsBatch, metadatas,
|
|
3142
|
+
const { instructionsBatch, metadatas, prepareInstructions, metadataToRecipient } = await this.flatBuildCreateMultipleTransactionInstructions(data, extParams);
|
|
3052
3143
|
const errors = [];
|
|
3053
3144
|
const signatures = [];
|
|
3054
3145
|
const batch = [];
|
|
@@ -3112,10 +3203,7 @@ var SolanaStreamClient = class {
|
|
|
3112
3203
|
async withdraw({ id, amount = WITHDRAW_AVAILABLE_AMOUNT }, extParams) {
|
|
3113
3204
|
const { invoker, customInstructions } = extParams;
|
|
3114
3205
|
assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3115
|
-
const ixs = await this.prepareWithdrawInstructions(
|
|
3116
|
-
{ id, amount },
|
|
3117
|
-
extParams
|
|
3118
|
-
);
|
|
3206
|
+
const ixs = await this.prepareWithdrawInstructions({ id, amount }, extParams);
|
|
3119
3207
|
const metadata = new PublicKey(id);
|
|
3120
3208
|
await this.applyCustomAfterInstructions(ixs, customInstructions, metadata);
|
|
3121
3209
|
const { tx, hash, context } = await prepareTransaction(this.connection, ixs, invoker.publicKey);
|
|
@@ -3213,7 +3301,7 @@ var SolanaStreamClient = class {
|
|
|
3213
3301
|
}
|
|
3214
3302
|
const { sender: senderPublicKey } = decodeStream(account.data);
|
|
3215
3303
|
const isAlignedUnlock = this.isAlignedUnlock(streamPublicKey, senderPublicKey);
|
|
3216
|
-
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.
|
|
3304
|
+
const ixs = isAlignedUnlock ? await this.prepareCancelAlignedUnlockInstructions(cancelData, extParams) : await this.prepareCancelLinearStream(cancelData, extParams);
|
|
3217
3305
|
return ixs;
|
|
3218
3306
|
}
|
|
3219
3307
|
/**
|
|
@@ -3261,7 +3349,7 @@ var SolanaStreamClient = class {
|
|
|
3261
3349
|
* @param {IPrepareStreamExt} extParams - Transaction configuration including invoker wallet, token account validation, and compute settings
|
|
3262
3350
|
* @returns Transaction instructions
|
|
3263
3351
|
*/
|
|
3264
|
-
async
|
|
3352
|
+
async prepareCancelLinearStream({ id }, { invoker, checkTokenAccounts, computePrice, computeLimit }) {
|
|
3265
3353
|
assertHasPublicKey(invoker, "Invoker's PublicKey is not available, check passed wallet adapter!");
|
|
3266
3354
|
const streamPublicKey = new PublicKey(id);
|
|
3267
3355
|
const escrowAcc = await this.connection.getAccountInfo(streamPublicKey);
|
|
@@ -3619,17 +3707,26 @@ var SolanaStreamClient = class {
|
|
|
3619
3707
|
const streamPublicKey = new PublicKey(data.id);
|
|
3620
3708
|
const escrow = await this.connection.getAccountInfo(streamPublicKey);
|
|
3621
3709
|
invariant(escrow, "Couldn't get account info");
|
|
3710
|
+
const { sender: senderPublicKey } = decodeStream(escrow.data);
|
|
3711
|
+
const isAlignedUnlock = this.isAlignedUnlock(streamPublicKey, senderPublicKey);
|
|
3712
|
+
if (isAlignedUnlock && (data.enableAutomaticWithdrawal !== void 0 || data.amountPerPeriod !== void 0)) {
|
|
3713
|
+
throw new Error("Automatic withdrawal and rate update are not possible in price-based vesting!");
|
|
3714
|
+
}
|
|
3622
3715
|
const ixs = prepareBaseInstructions(this.connection, {
|
|
3623
3716
|
computePrice,
|
|
3624
3717
|
computeLimit
|
|
3625
3718
|
});
|
|
3626
3719
|
ixs.push(
|
|
3627
|
-
await
|
|
3720
|
+
await (isAlignedUnlock ? this.alignedProxyProgram.methods.updateContract({
|
|
3721
|
+
transferableBySender: data.transferableBySender ?? null,
|
|
3722
|
+
transferableByRecipient: data.transferableByRecipient ?? null,
|
|
3723
|
+
cancelableBySender: data.cancelableBySender ?? null
|
|
3724
|
+
}).accounts({ sender: invoker.publicKey, streamMetadata: streamPublicKey, withdrawor: WITHDRAWOR_PUBLIC_KEY }).accountsPartial({ streamflowProgram: this.programId }).instruction() : updateStreamInstruction(data, this.programId, {
|
|
3628
3725
|
authority: invoker.publicKey,
|
|
3629
3726
|
metadata: streamPublicKey,
|
|
3630
3727
|
withdrawor: WITHDRAWOR_PUBLIC_KEY,
|
|
3631
3728
|
systemProgram: SystemProgram.programId
|
|
3632
|
-
})
|
|
3729
|
+
}))
|
|
3633
3730
|
);
|
|
3634
3731
|
return ixs;
|
|
3635
3732
|
}
|
|
@@ -3665,11 +3762,11 @@ var SolanaStreamClient = class {
|
|
|
3665
3762
|
return DEFAULT_STREAMFLOW_FEE;
|
|
3666
3763
|
}
|
|
3667
3764
|
/**
|
|
3668
|
-
|
|
3669
|
-
|
|
3670
|
-
|
|
3671
|
-
|
|
3672
|
-
|
|
3765
|
+
* Returns total fee percent, streamflow fees + partner fees
|
|
3766
|
+
* @param getFeesData structure with address for which we need to derive fee, either sender or partner usually
|
|
3767
|
+
* @param chainSpecificParams additional parameters required by chain client
|
|
3768
|
+
* @returns fee as floating number, so if fee is 0.99%, it will return 0.99
|
|
3769
|
+
*/
|
|
3673
3770
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3674
3771
|
async getTotalFee(getFeesData) {
|
|
3675
3772
|
const fees = await this.getFees(getFeesData);
|
|
@@ -3688,12 +3785,27 @@ var SolanaStreamClient = class {
|
|
|
3688
3785
|
return extractSolanaErrorCode(err.toString() ?? "Unknown error!", logs);
|
|
3689
3786
|
}
|
|
3690
3787
|
/**
|
|
3691
|
-
|
|
3692
|
-
|
|
3788
|
+
* Utility function that checks whether the associated stream address is an aligned unlock contract, indicated by whether the sender/creator is a PDA
|
|
3789
|
+
*/
|
|
3693
3790
|
isAlignedUnlock(streamPublicKey, senderPublicKey) {
|
|
3694
3791
|
const pda = deriveContractPDA(this.alignedProxyProgram.programId, streamPublicKey);
|
|
3695
3792
|
return senderPublicKey.equals(pda);
|
|
3696
3793
|
}
|
|
3794
|
+
async flatBuildCreateMultipleTransactionInstructions(data, extParams) {
|
|
3795
|
+
const dataArray = Array.isArray(data) ? data : [data];
|
|
3796
|
+
const results = await Promise.all(
|
|
3797
|
+
dataArray.map((item) => this.buildCreateMultipleTransactionInstructions(item, extParams))
|
|
3798
|
+
);
|
|
3799
|
+
return {
|
|
3800
|
+
instructionsBatch: results.flatMap((r) => r.instructionsBatch),
|
|
3801
|
+
metadatas: results.flatMap((r) => r.metadatas),
|
|
3802
|
+
prepareInstructions: results.flatMap((r) => r.prepareInstructions),
|
|
3803
|
+
metadataToRecipient: results.reduce(
|
|
3804
|
+
(acc, r) => Object.assign(acc, r.metadataToRecipient),
|
|
3805
|
+
{}
|
|
3806
|
+
)
|
|
3807
|
+
};
|
|
3808
|
+
}
|
|
3697
3809
|
/**
|
|
3698
3810
|
* Utility function to generate metadata for a Contract or return existing Pubkey
|
|
3699
3811
|
*/
|