@@ -40,13 +40,13 @@ import {
4040import { getAccountMetaFactory , type ResolvedInstructionAccount } from '@solana/kit/program-client-core' ;
4141import { SYSTEM_PROGRAM_ADDRESS } from '../programs' ;
4242
43- export const TRANSFER_SOL_WITH_SEED_DISCRIMINATOR = 11 ;
43+ export const TRANSFER_WITH_SEED_DISCRIMINATOR = 11 ;
4444
45- export function getTransferSolWithSeedDiscriminatorBytes ( ) : ReadonlyUint8Array {
46- return getU32Encoder ( ) . encode ( TRANSFER_SOL_WITH_SEED_DISCRIMINATOR ) ;
45+ export function getTransferWithSeedDiscriminatorBytes ( ) : ReadonlyUint8Array {
46+ return getU32Encoder ( ) . encode ( TRANSFER_WITH_SEED_DISCRIMINATOR ) ;
4747}
4848
49- export type TransferSolWithSeedInstruction <
49+ export type TransferWithSeedInstruction <
5050 TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS ,
5151 TAccountSource extends string | AccountMeta < string > = string ,
5252 TAccountBaseAccount extends string | AccountMeta < string > = string ,
@@ -65,28 +65,28 @@ export type TransferSolWithSeedInstruction<
6565 ]
6666 > ;
6767
68- export type TransferSolWithSeedInstructionData = {
68+ export type TransferWithSeedInstructionData = {
6969 discriminator : number ;
7070 amount : bigint ;
7171 fromSeed : string ;
7272 fromOwner : Address ;
7373} ;
7474
75- export type TransferSolWithSeedInstructionDataArgs = { amount : number | bigint ; fromSeed : string ; fromOwner : Address } ;
75+ export type TransferWithSeedInstructionDataArgs = { amount : number | bigint ; fromSeed : string ; fromOwner : Address } ;
7676
77- export function getTransferSolWithSeedInstructionDataEncoder ( ) : Encoder < TransferSolWithSeedInstructionDataArgs > {
77+ export function getTransferWithSeedInstructionDataEncoder ( ) : Encoder < TransferWithSeedInstructionDataArgs > {
7878 return transformEncoder (
7979 getStructEncoder ( [
8080 [ 'discriminator' , getU32Encoder ( ) ] ,
8181 [ 'amount' , getU64Encoder ( ) ] ,
8282 [ 'fromSeed' , addEncoderSizePrefix ( getUtf8Encoder ( ) , getU64Encoder ( ) ) ] ,
8383 [ 'fromOwner' , getAddressEncoder ( ) ] ,
8484 ] ) ,
85- value => ( { ...value , discriminator : TRANSFER_SOL_WITH_SEED_DISCRIMINATOR } ) ,
85+ value => ( { ...value , discriminator : TRANSFER_WITH_SEED_DISCRIMINATOR } ) ,
8686 ) ;
8787}
8888
89- export function getTransferSolWithSeedInstructionDataDecoder ( ) : Decoder < TransferSolWithSeedInstructionData > {
89+ export function getTransferWithSeedInstructionDataDecoder ( ) : Decoder < TransferWithSeedInstructionData > {
9090 return getStructDecoder ( [
9191 [ 'discriminator' , getU32Decoder ( ) ] ,
9292 [ 'amount' , getU64Decoder ( ) ] ,
@@ -95,35 +95,35 @@ export function getTransferSolWithSeedInstructionDataDecoder(): Decoder<Transfer
9595 ] ) ;
9696}
9797
98- export function getTransferSolWithSeedInstructionDataCodec ( ) : Codec <
99- TransferSolWithSeedInstructionDataArgs ,
100- TransferSolWithSeedInstructionData
98+ export function getTransferWithSeedInstructionDataCodec ( ) : Codec <
99+ TransferWithSeedInstructionDataArgs ,
100+ TransferWithSeedInstructionData
101101> {
102- return combineCodec ( getTransferSolWithSeedInstructionDataEncoder ( ) , getTransferSolWithSeedInstructionDataDecoder ( ) ) ;
102+ return combineCodec ( getTransferWithSeedInstructionDataEncoder ( ) , getTransferWithSeedInstructionDataDecoder ( ) ) ;
103103}
104104
105- export type TransferSolWithSeedInput <
105+ export type TransferWithSeedInput <
106106 TAccountSource extends string = string ,
107107 TAccountBaseAccount extends string = string ,
108108 TAccountDestination extends string = string ,
109109> = {
110110 source : Address < TAccountSource > ;
111111 baseAccount : TransactionSigner < TAccountBaseAccount > ;
112112 destination : Address < TAccountDestination > ;
113- amount : TransferSolWithSeedInstructionDataArgs [ 'amount' ] ;
114- fromSeed : TransferSolWithSeedInstructionDataArgs [ 'fromSeed' ] ;
115- fromOwner : TransferSolWithSeedInstructionDataArgs [ 'fromOwner' ] ;
113+ amount : TransferWithSeedInstructionDataArgs [ 'amount' ] ;
114+ fromSeed : TransferWithSeedInstructionDataArgs [ 'fromSeed' ] ;
115+ fromOwner : TransferWithSeedInstructionDataArgs [ 'fromOwner' ] ;
116116} ;
117117
118- export function getTransferSolWithSeedInstruction <
118+ export function getTransferWithSeedInstruction <
119119 TAccountSource extends string ,
120120 TAccountBaseAccount extends string ,
121121 TAccountDestination extends string ,
122122 TProgramAddress extends Address = typeof SYSTEM_PROGRAM_ADDRESS ,
123123> (
124- input : TransferSolWithSeedInput < TAccountSource , TAccountBaseAccount , TAccountDestination > ,
124+ input : TransferWithSeedInput < TAccountSource , TAccountBaseAccount , TAccountDestination > ,
125125 config ?: { programAddress ?: TProgramAddress } ,
126- ) : TransferSolWithSeedInstruction < TProgramAddress , TAccountSource , TAccountBaseAccount , TAccountDestination > {
126+ ) : TransferWithSeedInstruction < TProgramAddress , TAccountSource , TAccountBaseAccount , TAccountDestination > {
127127 // Program address.
128128 const programAddress = config ?. programAddress ?? SYSTEM_PROGRAM_ADDRESS ;
129129
@@ -145,12 +145,12 @@ export function getTransferSolWithSeedInstruction<
145145 getAccountMeta ( 'baseAccount' , accounts . baseAccount ) ,
146146 getAccountMeta ( 'destination' , accounts . destination ) ,
147147 ] ,
148- data : getTransferSolWithSeedInstructionDataEncoder ( ) . encode ( args as TransferSolWithSeedInstructionDataArgs ) ,
148+ data : getTransferWithSeedInstructionDataEncoder ( ) . encode ( args as TransferWithSeedInstructionDataArgs ) ,
149149 programAddress,
150- } as TransferSolWithSeedInstruction < TProgramAddress , TAccountSource , TAccountBaseAccount , TAccountDestination > ) ;
150+ } as TransferWithSeedInstruction < TProgramAddress , TAccountSource , TAccountBaseAccount , TAccountDestination > ) ;
151151}
152152
153- export type ParsedTransferSolWithSeedInstruction <
153+ export type ParsedTransferWithSeedInstruction <
154154 TProgram extends string = typeof SYSTEM_PROGRAM_ADDRESS ,
155155 TAccountMetas extends readonly AccountMeta [ ] = readonly AccountMeta [ ] ,
156156> = {
@@ -160,17 +160,14 @@ export type ParsedTransferSolWithSeedInstruction<
160160 baseAccount : TAccountMetas [ 1 ] ;
161161 destination : TAccountMetas [ 2 ] ;
162162 } ;
163- data : TransferSolWithSeedInstructionData ;
163+ data : TransferWithSeedInstructionData ;
164164} ;
165165
166- export function parseTransferSolWithSeedInstruction <
167- TProgram extends string ,
168- TAccountMetas extends readonly AccountMeta [ ] ,
169- > (
166+ export function parseTransferWithSeedInstruction < TProgram extends string , TAccountMetas extends readonly AccountMeta [ ] > (
170167 instruction : Instruction < TProgram > &
171168 InstructionWithAccounts < TAccountMetas > &
172169 InstructionWithData < ReadonlyUint8Array > ,
173- ) : ParsedTransferSolWithSeedInstruction < TProgram , TAccountMetas > {
170+ ) : ParsedTransferWithSeedInstruction < TProgram , TAccountMetas > {
174171 if ( instruction . accounts . length < 3 ) {
175172 throw new SolanaError ( SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS , {
176173 actualAccountMetas : instruction . accounts . length ,
@@ -186,6 +183,6 @@ export function parseTransferSolWithSeedInstruction<
186183 return {
187184 programAddress : instruction . programAddress ,
188185 accounts : { source : getNextAccount ( ) , baseAccount : getNextAccount ( ) , destination : getNextAccount ( ) } ,
189- data : getTransferSolWithSeedInstructionDataDecoder ( ) . decode ( instruction . data ) ,
186+ data : getTransferWithSeedInstructionDataDecoder ( ) . decode ( instruction . data ) ,
190187 } ;
191188}
0 commit comments