Replies: 1 comment 1 reply
|
Dug into the published types for The two valid shapesMode A — explicit per-source allocations (what you landed on): await spend(context, {
from: { adapter, allocations: { amount: '50', chain: 'Ethereum' } }, // amount lives inside each allocation
to: { adapter: destAdapter, chain: 'Avalanche' },
token: 'USDC',
})Mode B — adapter-only, provider auto-allocates (top-level await spend(context, {
from: { adapter }, // no allocations
amountIn: '50', // required in this mode; provider resolves per-chain allocations
to: { adapter: destAdapter, chain: 'Avalanche' },
token: 'USDC',
})This is straight from the type docs:
So the failures line up:
On the discoverability ask (agree)Worth noting the v1.4.0 README does already show the Mode A shape ( One routing note: this kit is a standalone Circle stablecoin-kit (its source/README live outside |
Uh oh!
There was an error while loading. Please reload this page.
While integrating the standalone Unified Balance Kit package into ShieldFi, it took two failed attempts to find the correct parameter shape for spend():
Used amountIn → got "Invalid amount 'unknown': Amount must be a numeric string..."
Passed from as an array ([{ adapter }], no chain specified) → got "Failed to initialize wallet client for chain undefined: No chain definition found for blockchain: undefined"
Working shape: from: { adapter, allocations: { amount, chain } }, field name amount (not amountIn)
Finding the difference took a while since a clear usage example for the standalone package wasn't easy to locate.
Suggestion: A more discoverable, copy-pasteable example of the standalone Unified Balance Kit's spend() signature (especially the from/allocations shape) in the npm README or Arc Docs would improve the dev experience.
All reactions