Skip to content
Draft
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
9 changes: 9 additions & 0 deletions functions/api/example/basic-gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,15 @@ router.add({
},
})

router.add({
type: 'function addr(bytes32 node, uint256 coinType) external view returns (bytes)',
handle: ([_node, _coinType]) => {
// Always return the same address (offchain.integration-tests.eth)
// https://github.com/ensdomains/resolution-tests
return ['0xeE9eeaAB0Bb7D9B969D701f6f8212609EDeA252E' as const]
},
})

export async function onRequestPost({ request }: { request: Request }) {
const body = await request.json()
const { body: ccipReadRes } = await router.call(body)
Expand Down