The code snippets in the README are generated from examples/src by scripts/updateExamples.ts (run in prepublishOnly), but the "Token Transfer" snippet on main has drifted from its source.
It still calls wh.tokenTransfer with the old automatic boolean argument and a trailing nativeGas argument:
const xfer = await wh.tokenTransfer(
route.token,
route.amount,
route.source.address,
route.destination.address,
route.delivery?.automatic ?? false,
route.payload,
route.delivery?.nativeGas,
);
Since #1020 removed the AutomaticTokenBridge route, the fifth argument is the protocol name ("TokenBridge" | "ExecutorTokenBridge") and there is no trailing nativeGas argument (see the tokenTransfer overloads in connect/src/wormhole.ts). examples/src/tokenBridge.ts was updated in #1020 but the README wasn't regenerated, so the snippet no longer matches the source it is generated from.
Running scripts/updateExamples.ts locally regenerates the README — mainly the Token Transfer example, plus the CCTP example's CircleTransfer.track loop and a few See example line links. Happy to open a PR with the regenerated README if that's the preferred fix.
Related: #982 — the example still passes xfer.transfer to TokenTransfer.quoteTransfer, so regenerating the README syncs the docs but doesn't touch that type-narrowing question.
The code snippets in the README are generated from
examples/srcbyscripts/updateExamples.ts(run inprepublishOnly), but the "Token Transfer" snippet onmainhas drifted from its source.It still calls
wh.tokenTransferwith the oldautomaticboolean argument and a trailingnativeGasargument:Since #1020 removed the
AutomaticTokenBridgeroute, the fifth argument is the protocol name ("TokenBridge"|"ExecutorTokenBridge") and there is no trailingnativeGasargument (see thetokenTransferoverloads inconnect/src/wormhole.ts).examples/src/tokenBridge.tswas updated in #1020 but the README wasn't regenerated, so the snippet no longer matches the source it is generated from.Running
scripts/updateExamples.tslocally regenerates the README — mainly the Token Transfer example, plus the CCTP example'sCircleTransfer.trackloop and a fewSee exampleline links. Happy to open a PR with the regenerated README if that's the preferred fix.Related: #982 — the example still passes
xfer.transfertoTokenTransfer.quoteTransfer, so regenerating the README syncs the docs but doesn't touch that type-narrowing question.