Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Canton SDK: a send no longer picks locked holdings, or holdings owned by another party, as token or fee inputs when it selects them itself. The active party can see holdings it does not own (for example as the instrument admin), and a locked or foreign holding was counted as spendable, so a transfer could include it and the EDS pool-send call failed with a 500. Pass `tokenTransferHoldingCids` / `feeTokenHoldingCids` to choose holdings explicitly.
- SDK, CLI: support Aptos CCIP 2.0 lanes, next to 1.6
- SDK (EVM): `getLogs` treats `maximum [from, to] blocks distance: N` (mova, JSON-RPC `-32000`) as a block-range error and pages with at most N blocks. Before, it failed every call with its default 10000-block page. A depth limit, such as `fromBlock is too far from the latest block`, is still not a range error, because a smaller page does not fix it
- SDK (EVM, Solana, TON): a failed `getBlockInfo` for a tag (`latest`, `finalized`) or a depth is no longer also an unhandled promise rejection. micro-memoize's `forceUpdate` cached a wrapper of each forced call that nothing read, and that wrapper rethrew the failure; after one successful call for a tag, every failed one leaked. `getBlockInfo` now caches only positive block numbers and calls the RPC for tags and depths, as before
Expand Down
8 changes: 8 additions & 0 deletions ccip-sdk/src/canton/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,10 @@ export class CantonChain extends Chain<typeof ChainFamily.Canton> {
}

// Token pool disclosures
this.logger.debug(
`CantonChain.generateUnsignedSendMessage: token pool send request for ${tokenPoolAddress.toInstanceAddress().toString()}`,
oapiMessage,
)
const tokenPoolSendDisclosuresResponse = await this.edsClientProvider
.tokenPoolClientFor(tokenPoolAddress.owner)
.POST('/ccip/v1/external/tokenPool/{address}/send', {
Expand Down Expand Up @@ -2423,7 +2427,10 @@ export class CantonChain extends Chain<typeof ChainFamily.Canton> {
tokenTransferHoldingCids.push(...explicitTokenTransferHoldingCids)
} else {
// Select holdings from lowest-to-highest amount in order to minimize dust
// Only our own unlocked holdings can be spent as transfer inputs (the active party can
// also see holdings it doesn't own, e.g. as the instrument admin)
const holdings = (await this.listTokenHoldings(tokenTransfer.instrumentId))
.filter((holding) => !holding.view.lock && holding.view.owner === this.activeParty)
.map((holding) => ({
contractId: holding.contractId,
units: parseCantonDecimalAmountUnits(holding.view.amount),
Expand Down Expand Up @@ -2472,6 +2479,7 @@ export class CantonChain extends Chain<typeof ChainFamily.Canton> {
// Pass all holdings, sorted from lowest-to-highest amount in order to minimize dust
const transferCids = new Set(tokenTransferHoldingCids)
feeTokenHoldingCids = (await this.listTokenHoldings(feeTokenInstrumentId))
.filter((holding) => !holding.view.lock && holding.view.owner === this.activeParty)
.map((holding) => ({
contractId: holding.contractId,
units: parseCantonDecimalAmountUnits(holding.view.amount),
Expand Down
Loading