Skip to content

Commit

Permalink
feat: memo 28 char max
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonKozAllB authored and faramozzayw committed Dec 1, 2023
1 parent 0690dbc commit 772ae8a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Utils {
/**
* Add memo to solana's transaction
* @param transaction transaction to add memo
* @param memo memo to add (32 char max)
* @param memo memo to add (28 char max)
*/
addMemoToTx(transaction: VersionedTransaction, memo: string): Promise<void>;
}
Expand All @@ -18,8 +18,8 @@ export class DefaultUtils implements Utils {
constructor(readonly solanaRpcUrl: string) {}

async addMemoToTx(transaction: VersionedTransaction, memo: string): Promise<void> {
if (memo.length > 32) {
throw new SdkError("InvalidArgumentException memo cannot be more than 32 characters");
if (memo.length > 28) {
throw new SdkError("InvalidArgumentException memo cannot be more than 28 characters");
}
const connection = new Connection(this.solanaRpcUrl, "confirmed");
const addressLookupTableAccounts = await fetchAddressLookupTableAccountsFromTx(transaction, connection);
Expand Down

0 comments on commit 772ae8a

Please sign in to comment.