Skip to content

Commit

Permalink
expose canUpdate and canPause in createUnchecked
Browse files Browse the repository at this point in the history
  • Loading branch information
Yolley committed Aug 2, 2024
1 parent a72066d commit 56622b9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions packages/stream/solana/StreamClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,8 @@ export default class SolanaStreamClient extends BaseStreamClient {
amountPerPeriod,
name,
canTopup,
canUpdateRate,
canPause,
cancelableBySender,
cancelableByRecipient,
transferableBySender,
Expand Down Expand Up @@ -393,6 +395,8 @@ export default class SolanaStreamClient extends BaseStreamClient {
transferableBySender,
transferableByRecipient,
canTopup,
canUpdateRate: !!canUpdateRate,
canPause: !!canPause,
name,
withdrawFrequency: new BN(automaticWithdrawal ? withdrawalFrequency : period),
recipient: recipientPublicKey,
Expand Down
6 changes: 4 additions & 2 deletions packages/stream/solana/instructions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ interface CreateUncheckedStreamData {
transferableBySender: boolean;
transferableByRecipient: boolean;
canTopup: boolean;
canUpdateRate: boolean;
canPause: boolean;
name: string;
withdrawFrequency: BN;
recipient: PublicKey;
Expand Down Expand Up @@ -203,8 +205,8 @@ export const createUncheckedStreamInstruction = (
withdraw_frequency: data.withdrawFrequency.toArrayLike(Buffer, "le", 8),
recipient: data.recipient.toBuffer(),
partner: data.partner.toBuffer(),
pausable: 1,
can_update_rate: 1,
pausable: Number(data.canPause),
can_update_rate: Number(data.canUpdateRate),
};
const encodeLength = Layout.createUncheckedStreamLayout.encode(decodedData, bufferData);
bufferData = bufferData.slice(0, encodeLength);
Expand Down

0 comments on commit 56622b9

Please sign in to comment.