feat(sdk): add getTokenDecimals SDK method - #444
Open
GBOYEE wants to merge 2 commits into
Open
Conversation
added 2 commits
July 20, 2026 02:41
- Add cli/src/commands/dispute.ts: opens a dispute against an invoice - Flags: --invoice-id (required), --reason-hash (required, 64-char SHA-256), --payer (optional, defaults to configured wallet), --yes to skip confirm - Validates invoice state is Pending or Funded before calling dispute_invoice - Register as `iln dispute` in cli/src/index.ts - Add cli/tests/e2e/dispute.test.ts (8 tests, all passing)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #411
Adds a
getTokenDecimalsSDK method that wraps the on-chainget_token_decimals(env, token) -> Option<u32>contract method.sdk/src/methods/getTokenDecimals.tsexportinggetTokenDecimals(server, contractId, token, networkPassphrase?).AddressScVal for the contract call.Promise<number | null>—nullwhen the token is not registered (Nonefrom the contract) or the simulation has no return value.validateContractId/validateGAddresshelpers.sdk/src/methods/getTokenDecimals.test.tsusing a mockSorobanRpc.Server(mirrors the existinginsurance.test.tspattern).sdk/src/index.ts.Test result
pnpm run testinsdk/— the newgetTokenDecimals.test.tssuite passes 6/6.Note: two unrelated suites fail on untouched
mainas well (pre-existing, not caused by this change):src/utils/xdrDecoder.test.ts— missingfast-checkdevDependency.tests/integration/invoiceLifecycle.integration.test.ts— requires testnet secrets (TEST_SUBMITTER_SECRET/TEST_LP_SECRET).All 283 unit tests pass, including the new suite.