diff --git a/js/compressed-token/src/idl/light_compressed_token.ts b/js/compressed-token/src/idl/light_compressed_token.ts index f1737b33b9..83f3fb9097 100644 --- a/js/compressed-token/src/idl/light_compressed_token.ts +++ b/js/compressed-token/src/idl/light_compressed_token.ts @@ -885,6 +885,12 @@ export type LightCompressedToken = { name: 'rootIndex'; type: 'u16'; }, + { + name: 'lamports'; + type: { + option: 'u64'; + }; + }, ]; }; }, @@ -2249,6 +2255,12 @@ export const IDL: LightCompressedToken = { name: 'rootIndex', type: 'u16', }, + { + name: 'lamports', + type: { + option: 'u64', + }, + }, ], }, }, diff --git a/js/compressed-token/src/instructions/pack-compressed-token-accounts.ts b/js/compressed-token/src/instructions/pack-compressed-token-accounts.ts index 42df4dc3a1..64ab948193 100644 --- a/js/compressed-token/src/instructions/pack-compressed-token-accounts.ts +++ b/js/compressed-token/src/instructions/pack-compressed-token-accounts.ts @@ -84,6 +84,7 @@ export function packCompressedTokenAccounts( leafIndex: account.compressedAccount.leafIndex, }, rootIndex: rootIndices[index], + lamports: account.compressedAccount.lamports.eq(bn(0)) ? null : account.compressedAccount.lamports, }); }, ); diff --git a/js/compressed-token/src/types.ts b/js/compressed-token/src/types.ts index df32357bda..0586ece438 100644 --- a/js/compressed-token/src/types.ts +++ b/js/compressed-token/src/types.ts @@ -59,6 +59,10 @@ export type InputTokenDataWithContext = { * The index of the leaf in the merkle tree */ leafIndex: number; + /** + * Lamports in the input token account. + */ + lamports: BN | null; }; export type CompressedTokenInstructionDataInvoke = { diff --git a/js/stateless.js/src/idls/light_compressed_token.ts b/js/stateless.js/src/idls/light_compressed_token.ts index f1737b33b9..83f3fb9097 100644 --- a/js/stateless.js/src/idls/light_compressed_token.ts +++ b/js/stateless.js/src/idls/light_compressed_token.ts @@ -885,6 +885,12 @@ export type LightCompressedToken = { name: 'rootIndex'; type: 'u16'; }, + { + name: 'lamports'; + type: { + option: 'u64'; + }; + }, ]; }; }, @@ -2249,6 +2255,12 @@ export const IDL: LightCompressedToken = { name: 'rootIndex', type: 'u16', }, + { + name: 'lamports', + type: { + option: 'u64', + }, + }, ], }, }, diff --git a/js/stateless.js/src/state/types.ts b/js/stateless.js/src/state/types.ts index 8265bc59a5..bff9d3194d 100644 --- a/js/stateless.js/src/state/types.ts +++ b/js/stateless.js/src/state/types.ts @@ -105,6 +105,7 @@ export interface InputTokenDataWithContext { delegateIndex: number | null; // Option merkleContext: PackedMerkleContext; rootIndex: number; // u16 + lamports: BN | null; } export type TokenData = { /// The mint associated with this account