Skip to content

Commit 1f85414

Browse files
authored
Use Codama v1.0.0 (#14)
See codama-idl/codama#234
1 parent 96f53f6 commit 1f85414

File tree

81 files changed

+691
-629
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

81 files changed

+691
-629
lines changed

clients/js/src/generated/accounts/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
export * from './mint';

clients/js/src/generated/accounts/mint.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {

clients/js/src/generated/accounts/multisig.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {

clients/js/src/generated/accounts/token.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {

clients/js/src/generated/errors/associatedToken.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {

clients/js/src/generated/errors/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
export * from './associatedToken';

clients/js/src/generated/errors/token2022.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {

clients/js/src/generated/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
export * from './accounts';

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

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -93,14 +93,15 @@ export type AmountToUiAmountInput<TAccountMint extends string = string> = {
9393
amount: AmountToUiAmountInstructionDataArgs['amount'];
9494
};
9595

96-
export function getAmountToUiAmountInstruction<TAccountMint extends string>(
97-
input: AmountToUiAmountInput<TAccountMint>
98-
): AmountToUiAmountInstruction<
99-
typeof TOKEN_2022_PROGRAM_ADDRESS,
100-
TAccountMint
101-
> {
96+
export function getAmountToUiAmountInstruction<
97+
TAccountMint extends string,
98+
TProgramAddress extends Address = typeof TOKEN_2022_PROGRAM_ADDRESS,
99+
>(
100+
input: AmountToUiAmountInput<TAccountMint>,
101+
config?: { programAddress?: TProgramAddress }
102+
): AmountToUiAmountInstruction<TProgramAddress, TAccountMint> {
102103
// Program address.
103-
const programAddress = TOKEN_2022_PROGRAM_ADDRESS;
104+
const programAddress = config?.programAddress ?? TOKEN_2022_PROGRAM_ADDRESS;
104105

105106
// Original accounts.
106107
const originalAccounts = {
@@ -121,10 +122,7 @@ export function getAmountToUiAmountInstruction<TAccountMint extends string>(
121122
data: getAmountToUiAmountInstructionDataEncoder().encode(
122123
args as AmountToUiAmountInstructionDataArgs
123124
),
124-
} as AmountToUiAmountInstruction<
125-
typeof TOKEN_2022_PROGRAM_ADDRESS,
126-
TAccountMint
127-
>;
125+
} as AmountToUiAmountInstruction<TProgramAddress, TAccountMint>;
128126

129127
return instruction;
130128
}

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

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
/**
2-
* This code was AUTOGENERATED using the kinobi library.
2+
* This code was AUTOGENERATED using the codama library.
33
* Please DO NOT EDIT THIS FILE, instead use visitors
4-
* to add features, then rerun kinobi to update it.
4+
* to add features, then rerun codama to update it.
55
*
6-
* @see https://github.com/kinobi-so/kinobi
6+
* @see https://github.com/codama-idl/codama
77
*/
88

99
import {
@@ -154,18 +154,20 @@ export type ApplyConfidentialPendingBalanceInput<
154154
export function getApplyConfidentialPendingBalanceInstruction<
155155
TAccountToken extends string,
156156
TAccountAuthority extends string,
157+
TProgramAddress extends Address = typeof TOKEN_2022_PROGRAM_ADDRESS,
157158
>(
158-
input: ApplyConfidentialPendingBalanceInput<TAccountToken, TAccountAuthority>
159+
input: ApplyConfidentialPendingBalanceInput<TAccountToken, TAccountAuthority>,
160+
config?: { programAddress?: TProgramAddress }
159161
): ApplyConfidentialPendingBalanceInstruction<
160-
typeof TOKEN_2022_PROGRAM_ADDRESS,
162+
TProgramAddress,
161163
TAccountToken,
162164
(typeof input)['authority'] extends TransactionSigner<TAccountAuthority>
163165
? ReadonlySignerAccount<TAccountAuthority> &
164166
IAccountSignerMeta<TAccountAuthority>
165167
: TAccountAuthority
166168
> {
167169
// Program address.
168-
const programAddress = TOKEN_2022_PROGRAM_ADDRESS;
170+
const programAddress = config?.programAddress ?? TOKEN_2022_PROGRAM_ADDRESS;
169171

170172
// Original accounts.
171173
const originalAccounts = {
@@ -201,7 +203,7 @@ export function getApplyConfidentialPendingBalanceInstruction<
201203
args as ApplyConfidentialPendingBalanceInstructionDataArgs
202204
),
203205
} as ApplyConfidentialPendingBalanceInstruction<
204-
typeof TOKEN_2022_PROGRAM_ADDRESS,
206+
TProgramAddress,
205207
TAccountToken,
206208
(typeof input)['authority'] extends TransactionSigner<TAccountAuthority>
207209
? ReadonlySignerAccount<TAccountAuthority> &

0 commit comments

Comments
 (0)