diff --git a/contracts/wrappers/ccip/OnRamp.ts b/contracts/wrappers/ccip/OnRamp.ts index 6489e4877..7fcad45d4 100644 --- a/contracts/wrappers/ccip/OnRamp.ts +++ b/contracts/wrappers/ccip/OnRamp.ts @@ -742,6 +742,31 @@ export class OnRamp implements Contract, withdrawable.Interface, ownable2step.Co return typeAndVersion.getCodeHash(provider) } + async getDestChainConfig( + provider: ContractProvider, + destChainSelector: bigint, + ): Promise { + 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 }