Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clients/js/src/generated/errors/tokenWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type TokenWrapError =
| typeof TOKEN_WRAP_ERROR__ZERO_WRAP_AMOUNT;

let tokenWrapErrorMessages: Record<TokenWrapError, string> | undefined;
if (process.env.NODE_ENV !== 'production') {
if (process.env['NODE_ENV'] !== 'production') {
tokenWrapErrorMessages = {
[TOKEN_WRAP_ERROR__BACKPOINTER_MISMATCH]: `Wrapped backpointer account address does not match expected PDA`,
[TOKEN_WRAP_ERROR__ESCROW_IN_GOOD_STATE]: `The escrow account is in a good state and cannot be recreated`,
Expand All @@ -72,7 +72,7 @@ if (process.env.NODE_ENV !== 'production') {
}

export function getTokenWrapErrorMessage(code: TokenWrapError): string {
if (process.env.NODE_ENV !== 'production') {
if (process.env['NODE_ENV'] !== 'production') {
return (tokenWrapErrorMessages as Record<TokenWrapError, string>)[code];
}

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/closeStuckEscrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const CLOSE_STUCK_ESCROW_DISCRIMINATOR = 3;

export function getCloseStuckEscrowDiscriminatorBytes() {
export function getCloseStuckEscrowDiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(CLOSE_STUCK_ESCROW_DISCRIMINATOR);
}

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/createMint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const CREATE_MINT_DISCRIMINATOR = 0;

export function getCreateMintDiscriminatorBytes() {
export function getCreateMintDiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(CREATE_MINT_DISCRIMINATOR);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const SYNC_METADATA_TO_SPL_TOKEN_DISCRIMINATOR = 5;

export function getSyncMetadataToSplTokenDiscriminatorBytes() {
export function getSyncMetadataToSplTokenDiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(SYNC_METADATA_TO_SPL_TOKEN_DISCRIMINATOR);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const SYNC_METADATA_TO_TOKEN2022_DISCRIMINATOR = 4;

export function getSyncMetadataToToken2022DiscriminatorBytes() {
export function getSyncMetadataToToken2022DiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(SYNC_METADATA_TO_TOKEN2022_DISCRIMINATOR);
}

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/unwrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const UNWRAP_DISCRIMINATOR = 2;

export function getUnwrapDiscriminatorBytes() {
export function getUnwrapDiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(UNWRAP_DISCRIMINATOR);
}

Expand Down
2 changes: 1 addition & 1 deletion clients/js/src/generated/instructions/wrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import { TOKEN_WRAP_PROGRAM_ADDRESS } from '../programs';

export const WRAP_DISCRIMINATOR = 1;

export function getWrapDiscriminatorBytes() {
export function getWrapDiscriminatorBytes(): ReadonlyUint8Array {
return getU8Encoder().encode(WRAP_DISCRIMINATOR);
}

Expand Down
10 changes: 6 additions & 4 deletions clients/js/src/generated/programs/tokenWrap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import {
assertIsInstructionWithAccounts,
containsBytes,
extendClient,
getU8Encoder,
SOLANA_ERROR__PROGRAM_CLIENTS__FAILED_TO_IDENTIFY_INSTRUCTION,
SOLANA_ERROR__PROGRAM_CLIENTS__UNRECOGNIZED_INSTRUCTION_TYPE,
Expand Down Expand Up @@ -196,9 +197,10 @@ export type TokenWrapPluginRequirements = ClientWithRpc<GetAccountInfoApi & GetM
ClientWithTransactionSending;

export function tokenWrapProgram() {
return <T extends TokenWrapPluginRequirements>(client: T) => {
return {
...client,
return <T extends TokenWrapPluginRequirements>(
client: T,
): Omit<T, 'tokenWrap'> & { tokenWrap: TokenWrapPlugin } => {
return extendClient(client, {
tokenWrap: <TokenWrapPlugin>{
accounts: { backpointer: addSelfFetchFunctions(client, getBackpointerCodec()) },
instructions: {
Expand All @@ -218,6 +220,6 @@ export function tokenWrapProgram() {
wrappedMintAuthority: findWrappedMintAuthorityPda,
},
},
};
});
};
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"devDependencies": {
"@changesets/cli": "^2.31.0",
"@codama/renderers-js": "^2.1.0",
"@codama/renderers-js": "^2.2.0",
"@solana-program/system": "^0.12.0",
"@solana/sysvars": "^6.8.0",
"@solana/prettier-config-solana": "0.0.6",
Expand Down
Loading
Loading