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
25 changes: 25 additions & 0 deletions contracts/wrappers/ccip/OnRamp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,31 @@ export class OnRamp implements Contract, withdrawable.Interface, ownable2step.Co
return typeAndVersion.getCodeHash(provider)
}

async getDestChainConfig(
provider: ContractProvider,
destChainSelector: bigint,
): Promise<DestChainConfig> {
const { stack } = await provider.get('destChainConfig', [
{ type: 'int', value: destChainSelector },
])
const router = stack.readAddress()
const sequenceNumber = stack.readBigNumber()
const allowlistEnabled = stack.readBoolean()
const allowedSendersCell = stack.readCellOpt()
return {
router,
sequenceNumber,
allowlistEnabled,
allowedSenders: allowedSendersCell
? Dictionary.loadDirect(
Dictionary.Keys.Address(),
Dictionary.Values.Bool(),
allowedSendersCell,
)
: Dictionary.empty(),
}
}

static version() {
return ONRAMP_CONTRACT_VERSION
}
Expand Down
Loading