Skip to content

Commit 6577f80

Browse files
committed
rename amount to lamports
1 parent aea6e05 commit 6577f80

7 files changed

Lines changed: 60 additions & 48 deletions

File tree

clients/js/src/generated/instructions/createAccountWithSeed.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,15 @@ export type CreateAccountWithSeedInstructionData = {
7676
discriminator: number;
7777
base: Address;
7878
seed: string;
79-
amount: bigint;
79+
lamports: bigint;
8080
space: bigint;
8181
programAddress: Address;
8282
};
8383

8484
export type CreateAccountWithSeedInstructionDataArgs = {
8585
base: Address;
8686
seed: string;
87-
amount: number | bigint;
87+
lamports: number | bigint;
8888
space: number | bigint;
8989
programAddress: Address;
9090
};
@@ -95,7 +95,7 @@ export function getCreateAccountWithSeedInstructionDataEncoder(): Encoder<Create
9595
['discriminator', getU32Encoder()],
9696
['base', getAddressEncoder()],
9797
['seed', addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
98-
['amount', getU64Encoder()],
98+
['lamports', getU64Encoder()],
9999
['space', getU64Encoder()],
100100
['programAddress', getAddressEncoder()],
101101
]),
@@ -108,7 +108,7 @@ export function getCreateAccountWithSeedInstructionDataDecoder(): Decoder<Create
108108
['discriminator', getU32Decoder()],
109109
['base', getAddressDecoder()],
110110
['seed', addDecoderSizePrefix(getUtf8Decoder(), getU64Decoder())],
111-
['amount', getU64Decoder()],
111+
['lamports', getU64Decoder()],
112112
['space', getU64Decoder()],
113113
['programAddress', getAddressDecoder()],
114114
]);
@@ -134,7 +134,7 @@ export type CreateAccountWithSeedInput<
134134
baseAccount?: TransactionSigner<TAccountBaseAccount>;
135135
base: CreateAccountWithSeedInstructionDataArgs['base'];
136136
seed: CreateAccountWithSeedInstructionDataArgs['seed'];
137-
amount: CreateAccountWithSeedInstructionDataArgs['amount'];
137+
lamports: CreateAccountWithSeedInstructionDataArgs['lamports'];
138138
space: CreateAccountWithSeedInstructionDataArgs['space'];
139139
programAddress: CreateAccountWithSeedInstructionDataArgs['programAddress'];
140140
};

clients/js/src/generated/instructions/transfer.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ export type TransferInstruction<
5757
]
5858
>;
5959

60-
export type TransferInstructionData = { discriminator: number; amount: bigint };
60+
export type TransferInstructionData = { discriminator: number; lamports: bigint };
6161

62-
export type TransferInstructionDataArgs = { amount: number | bigint };
62+
export type TransferInstructionDataArgs = { lamports: number | bigint };
6363

6464
export function getTransferInstructionDataEncoder(): FixedSizeEncoder<TransferInstructionDataArgs> {
6565
return transformEncoder(
6666
getStructEncoder([
6767
['discriminator', getU32Encoder()],
68-
['amount', getU64Encoder()],
68+
['lamports', getU64Encoder()],
6969
]),
7070
value => ({ ...value, discriminator: TRANSFER_DISCRIMINATOR }),
7171
);
@@ -74,7 +74,7 @@ export function getTransferInstructionDataEncoder(): FixedSizeEncoder<TransferIn
7474
export function getTransferInstructionDataDecoder(): FixedSizeDecoder<TransferInstructionData> {
7575
return getStructDecoder([
7676
['discriminator', getU32Decoder()],
77-
['amount', getU64Decoder()],
77+
['lamports', getU64Decoder()],
7878
]);
7979
}
8080

@@ -88,7 +88,7 @@ export function getTransferInstructionDataCodec(): FixedSizeCodec<
8888
export type TransferInput<TAccountSource extends string = string, TAccountDestination extends string = string> = {
8989
source: TransactionSigner<TAccountSource>;
9090
destination: Address<TAccountDestination>;
91-
amount: TransferInstructionDataArgs['amount'];
91+
lamports: TransferInstructionDataArgs['lamports'];
9292
};
9393

9494
export function getTransferInstruction<

clients/js/src/generated/instructions/transferWithSeed.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,18 +67,18 @@ export type TransferWithSeedInstruction<
6767

6868
export type TransferWithSeedInstructionData = {
6969
discriminator: number;
70-
amount: bigint;
70+
lamports: bigint;
7171
fromSeed: string;
7272
fromOwner: Address;
7373
};
7474

75-
export type TransferWithSeedInstructionDataArgs = { amount: number | bigint; fromSeed: string; fromOwner: Address };
75+
export type TransferWithSeedInstructionDataArgs = { lamports: number | bigint; fromSeed: string; fromOwner: Address };
7676

7777
export function getTransferWithSeedInstructionDataEncoder(): Encoder<TransferWithSeedInstructionDataArgs> {
7878
return transformEncoder(
7979
getStructEncoder([
8080
['discriminator', getU32Encoder()],
81-
['amount', getU64Encoder()],
81+
['lamports', getU64Encoder()],
8282
['fromSeed', addEncoderSizePrefix(getUtf8Encoder(), getU64Encoder())],
8383
['fromOwner', getAddressEncoder()],
8484
]),
@@ -89,7 +89,7 @@ export function getTransferWithSeedInstructionDataEncoder(): Encoder<TransferWit
8989
export function getTransferWithSeedInstructionDataDecoder(): Decoder<TransferWithSeedInstructionData> {
9090
return getStructDecoder([
9191
['discriminator', getU32Decoder()],
92-
['amount', getU64Decoder()],
92+
['lamports', getU64Decoder()],
9393
['fromSeed', addDecoderSizePrefix(getUtf8Decoder(), getU64Decoder())],
9494
['fromOwner', getAddressDecoder()],
9595
]);
@@ -110,7 +110,7 @@ export type TransferWithSeedInput<
110110
source: Address<TAccountSource>;
111111
baseAccount: TransactionSigner<TAccountBaseAccount>;
112112
destination: Address<TAccountDestination>;
113-
amount: TransferWithSeedInstructionDataArgs['amount'];
113+
lamports: TransferWithSeedInstructionDataArgs['lamports'];
114114
fromSeed: TransferWithSeedInstructionDataArgs['fromSeed'];
115115
fromOwner: TransferWithSeedInstructionDataArgs['fromOwner'];
116116
};

clients/rust/src/generated/instructions/create_account_with_seed.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ impl Default for CreateAccountWithSeedInstructionData {
8888
pub struct CreateAccountWithSeedInstructionArgs {
8989
pub base: Address,
9090
pub seed: U64PrefixedStr,
91-
pub amount: u64,
91+
pub lamports: u64,
9292
pub space: u64,
9393
pub program_address: Address,
9494
}
@@ -113,7 +113,7 @@ pub struct CreateAccountWithSeedBuilder {
113113
base_account: Option<solana_address::Address>,
114114
base: Option<Address>,
115115
seed: Option<U64PrefixedStr>,
116-
amount: Option<u64>,
116+
lamports: Option<u64>,
117117
space: Option<u64>,
118118
program_address: Option<Address>,
119119
__remaining_accounts: Vec<solana_instruction::AccountMeta>,
@@ -150,8 +150,8 @@ impl CreateAccountWithSeedBuilder {
150150
self
151151
}
152152
#[inline(always)]
153-
pub fn amount(&mut self, amount: u64) -> &mut Self {
154-
self.amount = Some(amount);
153+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
154+
self.lamports = Some(lamports);
155155
self
156156
}
157157
#[inline(always)]
@@ -189,7 +189,7 @@ impl CreateAccountWithSeedBuilder {
189189
let args = CreateAccountWithSeedInstructionArgs {
190190
base: self.base.clone().expect("base is not set"),
191191
seed: self.seed.clone().expect("seed is not set"),
192-
amount: self.amount.clone().expect("amount is not set"),
192+
lamports: self.lamports.clone().expect("lamports is not set"),
193193
space: self.space.clone().expect("space is not set"),
194194
program_address: self
195195
.program_address
@@ -331,7 +331,7 @@ impl<'a, 'b> CreateAccountWithSeedCpiBuilder<'a, 'b> {
331331
base_account: None,
332332
base: None,
333333
seed: None,
334-
amount: None,
334+
lamports: None,
335335
space: None,
336336
program_address: None,
337337
__remaining_accounts: Vec::new(),
@@ -371,8 +371,8 @@ impl<'a, 'b> CreateAccountWithSeedCpiBuilder<'a, 'b> {
371371
self
372372
}
373373
#[inline(always)]
374-
pub fn amount(&mut self, amount: u64) -> &mut Self {
375-
self.instruction.amount = Some(amount);
374+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
375+
self.instruction.lamports = Some(lamports);
376376
self
377377
}
378378
#[inline(always)]
@@ -422,7 +422,11 @@ impl<'a, 'b> CreateAccountWithSeedCpiBuilder<'a, 'b> {
422422
let args = CreateAccountWithSeedInstructionArgs {
423423
base: self.instruction.base.clone().expect("base is not set"),
424424
seed: self.instruction.seed.clone().expect("seed is not set"),
425-
amount: self.instruction.amount.clone().expect("amount is not set"),
425+
lamports: self
426+
.instruction
427+
.lamports
428+
.clone()
429+
.expect("lamports is not set"),
426430
space: self.instruction.space.clone().expect("space is not set"),
427431
program_address: self
428432
.instruction
@@ -458,7 +462,7 @@ struct CreateAccountWithSeedCpiBuilderInstruction<'a, 'b> {
458462
base_account: Option<&'b solana_account_info::AccountInfo<'a>>,
459463
base: Option<Address>,
460464
seed: Option<U64PrefixedStr>,
461-
amount: Option<u64>,
465+
lamports: Option<u64>,
462466
space: Option<u64>,
463467
program_address: Option<Address>,
464468
/// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.

clients/rust/src/generated/instructions/transfer.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ impl Default for TransferInstructionData {
7171

7272
#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
7373
pub struct TransferInstructionArgs {
74-
pub amount: u64,
74+
pub lamports: u64,
7575
}
7676

7777
impl TransferInstructionArgs {
@@ -90,7 +90,7 @@ impl TransferInstructionArgs {
9090
pub struct TransferBuilder {
9191
source: Option<solana_address::Address>,
9292
destination: Option<solana_address::Address>,
93-
amount: Option<u64>,
93+
lamports: Option<u64>,
9494
__remaining_accounts: Vec<solana_instruction::AccountMeta>,
9595
}
9696

@@ -109,8 +109,8 @@ impl TransferBuilder {
109109
self
110110
}
111111
#[inline(always)]
112-
pub fn amount(&mut self, amount: u64) -> &mut Self {
113-
self.amount = Some(amount);
112+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
113+
self.lamports = Some(lamports);
114114
self
115115
}
116116
/// Add an additional account to the instruction.
@@ -135,7 +135,7 @@ impl TransferBuilder {
135135
destination: self.destination.expect("destination is not set"),
136136
};
137137
let args = TransferInstructionArgs {
138-
amount: self.amount.clone().expect("amount is not set"),
138+
lamports: self.lamports.clone().expect("lamports is not set"),
139139
};
140140

141141
accounts.instruction_with_remaining_accounts(args, &self.__remaining_accounts)
@@ -252,7 +252,7 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> {
252252
__program: program,
253253
source: None,
254254
destination: None,
255-
amount: None,
255+
lamports: None,
256256
__remaining_accounts: Vec::new(),
257257
});
258258
Self { instruction }
@@ -271,8 +271,8 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> {
271271
self
272272
}
273273
#[inline(always)]
274-
pub fn amount(&mut self, amount: u64) -> &mut Self {
275-
self.instruction.amount = Some(amount);
274+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
275+
self.instruction.lamports = Some(lamports);
276276
self
277277
}
278278
/// Add an additional account to the instruction.
@@ -310,7 +310,11 @@ impl<'a, 'b> TransferCpiBuilder<'a, 'b> {
310310
#[allow(clippy::vec_init_then_push)]
311311
pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
312312
let args = TransferInstructionArgs {
313-
amount: self.instruction.amount.clone().expect("amount is not set"),
313+
lamports: self
314+
.instruction
315+
.lamports
316+
.clone()
317+
.expect("lamports is not set"),
314318
};
315319
let instruction = TransferCpi {
316320
__program: self.instruction.__program,
@@ -335,7 +339,7 @@ struct TransferCpiBuilderInstruction<'a, 'b> {
335339
__program: &'b solana_account_info::AccountInfo<'a>,
336340
source: Option<&'b solana_account_info::AccountInfo<'a>>,
337341
destination: Option<&'b solana_account_info::AccountInfo<'a>>,
338-
amount: Option<u64>,
342+
lamports: Option<u64>,
339343
/// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.
340344
__remaining_accounts: Vec<(&'b solana_account_info::AccountInfo<'a>, bool, bool)>,
341345
}

clients/rust/src/generated/instructions/transfer_with_seed.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ impl Default for TransferWithSeedInstructionData {
8282

8383
#[derive(BorshSerialize, BorshDeserialize, Clone, Debug, Eq, PartialEq)]
8484
pub struct TransferWithSeedInstructionArgs {
85-
pub amount: u64,
85+
pub lamports: u64,
8686
pub from_seed: U64PrefixedStr,
8787
pub from_owner: Address,
8888
}
@@ -105,7 +105,7 @@ pub struct TransferWithSeedBuilder {
105105
source: Option<solana_address::Address>,
106106
base_account: Option<solana_address::Address>,
107107
destination: Option<solana_address::Address>,
108-
amount: Option<u64>,
108+
lamports: Option<u64>,
109109
from_seed: Option<U64PrefixedStr>,
110110
from_owner: Option<Address>,
111111
__remaining_accounts: Vec<solana_instruction::AccountMeta>,
@@ -131,8 +131,8 @@ impl TransferWithSeedBuilder {
131131
self
132132
}
133133
#[inline(always)]
134-
pub fn amount(&mut self, amount: u64) -> &mut Self {
135-
self.amount = Some(amount);
134+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
135+
self.lamports = Some(lamports);
136136
self
137137
}
138138
#[inline(always)]
@@ -168,7 +168,7 @@ impl TransferWithSeedBuilder {
168168
destination: self.destination.expect("destination is not set"),
169169
};
170170
let args = TransferWithSeedInstructionArgs {
171-
amount: self.amount.clone().expect("amount is not set"),
171+
lamports: self.lamports.clone().expect("lamports is not set"),
172172
from_seed: self.from_seed.clone().expect("from_seed is not set"),
173173
from_owner: self.from_owner.clone().expect("from_owner is not set"),
174174
};
@@ -302,7 +302,7 @@ impl<'a, 'b> TransferWithSeedCpiBuilder<'a, 'b> {
302302
source: None,
303303
base_account: None,
304304
destination: None,
305-
amount: None,
305+
lamports: None,
306306
from_seed: None,
307307
from_owner: None,
308308
__remaining_accounts: Vec::new(),
@@ -331,8 +331,8 @@ impl<'a, 'b> TransferWithSeedCpiBuilder<'a, 'b> {
331331
self
332332
}
333333
#[inline(always)]
334-
pub fn amount(&mut self, amount: u64) -> &mut Self {
335-
self.instruction.amount = Some(amount);
334+
pub fn lamports(&mut self, lamports: u64) -> &mut Self {
335+
self.instruction.lamports = Some(lamports);
336336
self
337337
}
338338
#[inline(always)]
@@ -380,7 +380,11 @@ impl<'a, 'b> TransferWithSeedCpiBuilder<'a, 'b> {
380380
#[allow(clippy::vec_init_then_push)]
381381
pub fn invoke_signed(&self, signers_seeds: &[&[&[u8]]]) -> solana_program_error::ProgramResult {
382382
let args = TransferWithSeedInstructionArgs {
383-
amount: self.instruction.amount.clone().expect("amount is not set"),
383+
lamports: self
384+
.instruction
385+
.lamports
386+
.clone()
387+
.expect("lamports is not set"),
384388
from_seed: self
385389
.instruction
386390
.from_seed
@@ -421,7 +425,7 @@ struct TransferWithSeedCpiBuilderInstruction<'a, 'b> {
421425
source: Option<&'b solana_account_info::AccountInfo<'a>>,
422426
base_account: Option<&'b solana_account_info::AccountInfo<'a>>,
423427
destination: Option<&'b solana_account_info::AccountInfo<'a>>,
424-
amount: Option<u64>,
428+
lamports: Option<u64>,
425429
from_seed: Option<U64PrefixedStr>,
426430
from_owner: Option<Address>,
427431
/// Additional instruction accounts `(AccountInfo, is_writable, is_signer)`.

program/idl.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@
211211
},
212212
{
213213
"kind": "instructionArgumentNode",
214-
"name": "amount",
214+
"name": "lamports",
215215
"type": {
216216
"kind": "numberTypeNode",
217217
"format": "u64",
@@ -296,7 +296,7 @@
296296
},
297297
{
298298
"kind": "instructionArgumentNode",
299-
"name": "amount",
299+
"name": "lamports",
300300
"type": {
301301
"kind": "numberTypeNode",
302302
"format": "u64",
@@ -844,7 +844,7 @@
844844
},
845845
{
846846
"kind": "instructionArgumentNode",
847-
"name": "amount",
847+
"name": "lamports",
848848
"type": {
849849
"kind": "numberTypeNode",
850850
"format": "u64",

0 commit comments

Comments
 (0)