@@ -11,6 +11,8 @@ import {
1111 combineCodec ,
1212 getAddressDecoder ,
1313 getAddressEncoder ,
14+ getLamportsDecoder ,
15+ getLamportsEncoder ,
1416 getStructDecoder ,
1517 getStructEncoder ,
1618 getU32Decoder ,
@@ -27,6 +29,7 @@ import {
2729 type IInstruction ,
2830 type IInstructionWithAccounts ,
2931 type IInstructionWithData ,
32+ type LamportsUnsafeBeyond2Pow53Minus1 ,
3033 type TransactionSigner ,
3134 type WritableSignerAccount ,
3235} from '@solana/web3.js' ;
@@ -60,13 +63,13 @@ export type CreateAccountInstruction<
6063
6164export type CreateAccountInstructionData = {
6265 discriminator : number ;
63- lamports : bigint ;
66+ lamports : LamportsUnsafeBeyond2Pow53Minus1 ;
6467 space : bigint ;
6568 programAddress : Address ;
6669} ;
6770
6871export type CreateAccountInstructionDataArgs = {
69- lamports : number | bigint ;
72+ lamports : LamportsUnsafeBeyond2Pow53Minus1 ;
7073 space : number | bigint ;
7174 programAddress : Address ;
7275} ;
@@ -75,7 +78,7 @@ export function getCreateAccountInstructionDataEncoder(): Encoder<CreateAccountI
7578 return transformEncoder (
7679 getStructEncoder ( [
7780 [ 'discriminator' , getU32Encoder ( ) ] ,
78- [ 'lamports' , getU64Encoder ( ) ] ,
81+ [ 'lamports' , getLamportsEncoder ( getU64Encoder ( ) ) ] ,
7982 [ 'space' , getU64Encoder ( ) ] ,
8083 [ 'programAddress' , getAddressEncoder ( ) ] ,
8184 ] ) ,
@@ -86,7 +89,7 @@ export function getCreateAccountInstructionDataEncoder(): Encoder<CreateAccountI
8689export function getCreateAccountInstructionDataDecoder ( ) : Decoder < CreateAccountInstructionData > {
8790 return getStructDecoder ( [
8891 [ 'discriminator' , getU32Decoder ( ) ] ,
89- [ 'lamports' , getU64Decoder ( ) ] ,
92+ [ 'lamports' , getLamportsDecoder ( getU64Decoder ( ) ) ] ,
9093 [ 'space' , getU64Decoder ( ) ] ,
9194 [ 'programAddress' , getAddressDecoder ( ) ] ,
9295 ] ) ;
0 commit comments