Skip to content

Commit 78ae27b

Browse files
fix(sdk-coin-sol): use null check for decimalPlaces in token transfer builders
decimalPlaces of 0 (e.g. NFTs) is falsy in JS, causing buildImplementation to skip the sendParams branch and throw "Could not determine token information" during PA approval. TICKET: CECHO-606 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 73b0cb6 commit 78ae27b

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

modules/sdk-coin-sol/src/lib/tokenTransferBuilder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export class TokenTransferBuilder extends TransactionBuilder {
124124
let tokenName: string;
125125
let programId: string | undefined;
126126
let decimals: number | undefined;
127-
if (sendParams.tokenAddress && sendParams.programId && sendParams.decimalPlaces) {
127+
if (sendParams.tokenAddress && sendParams.programId && sendParams.decimalPlaces != null) {
128128
tokenAddress = sendParams.tokenAddress;
129129
tokenName = sendParams.tokenName;
130130
programId = sendParams.programId;

modules/sdk-coin-sol/src/lib/transferBuilderV2.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class TransferBuilderV2 extends TransactionBuilder {
138138
let tokenName: string;
139139
let programId: string | undefined;
140140
let decimals: number | undefined;
141-
if (sendParams.tokenAddress && sendParams.programId && sendParams.decimalPlaces) {
141+
if (sendParams.tokenAddress && sendParams.programId && sendParams.decimalPlaces != null) {
142142
tokenName = sendParams.tokenName;
143143
tokenAddress = sendParams.tokenAddress;
144144
decimals = sendParams.decimalPlaces;

0 commit comments

Comments
 (0)