Skip to content
Merged
Show file tree
Hide file tree
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
62 changes: 62 additions & 0 deletions src/config/data/ccip/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
Environment,
Version,
CCIPSendErrorEntry,
CCIPEventEntry,
SupportedTokenConfig,
TokenMechanism,
NetworkFees,
Expand Down Expand Up @@ -54,6 +55,18 @@ import * as errors_v1_6_1 from "./errors/v1_6_1/index.ts"
import * as errors_v1_6_2 from "./errors/v1_6_2/index.ts"
// eslint-disable-next-line camelcase
import * as errors_v1_6_3 from "./errors/v1_6_3/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_5_0 from "./events/v1_5_0/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_5_1 from "./events/v1_5_1/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_6_0 from "./events/v1_6_0/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_6_1 from "./events/v1_6_1/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_6_2 from "./events/v1_6_2/index.ts"
// eslint-disable-next-line camelcase
import * as events_v1_6_3 from "./events/v1_6_3/index.ts"

export const getAllEnvironments = () => [Environment.Mainnet, Environment.Testnet]
export const getAllVersions = () => [Version.V1_2_0]
Expand Down Expand Up @@ -106,6 +119,55 @@ export const errors: VersionedErrors = {
v1_6_3: errors_v1_6_3 as ErrorTypesV163,
}

// Type for v1.5.0 events
type EventTypesV150 = {
onrampCCIPSendEvents: CCIPEventEntry[]
offrampCCIPReceiveEvents: CCIPEventEntry[]
routerCCIPReceiveEvents: CCIPEventEntry[]
poolCCIPSendEvents: CCIPEventEntry[]
poolCCIPReceiveEvents: CCIPEventEntry[]
}

// Type for v1.5.1 events
type EventTypesV151 = EventTypesV150

// Type for v1.6.0 events
type EventTypesV160 = EventTypesV151

// Type for v1.6.1 events
type EventTypesV161 = EventTypesV160

// Type for v1.6.2 events
type EventTypesV162 = EventTypesV161

// Type for v1.6.3 events
type EventTypesV163 = EventTypesV162

type VersionedEvents = {
v1_5_0: EventTypesV150
v1_5_1: EventTypesV151
v1_6_0: EventTypesV160
v1_6_1: EventTypesV161
v1_6_2: EventTypesV162
v1_6_3: EventTypesV163
}

// Export events by version with type safety
export const events: VersionedEvents = {
// eslint-disable-next-line camelcase
v1_5_0: events_v1_5_0 as EventTypesV150,
// eslint-disable-next-line camelcase
v1_5_1: events_v1_5_1 as EventTypesV151,
// eslint-disable-next-line camelcase
v1_6_0: events_v1_6_0 as EventTypesV160,
// eslint-disable-next-line camelcase
v1_6_1: events_v1_6_1 as EventTypesV161,
// eslint-disable-next-line camelcase
v1_6_2: events_v1_6_2 as EventTypesV162,
// eslint-disable-next-line camelcase
v1_6_3: events_v1_6_3 as EventTypesV163,
}

export const networkFees: NetworkFees = {
tokenTransfers: {
[TokenMechanism.LockAndUnlock]: {
Expand Down
5 changes: 5 additions & 0 deletions src/config/data/ccip/events/v1_5_0/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { default as onrampCCIPSendEvents } from "./onramp-send.json"
export { default as poolCCIPSendEvents } from "./pool-send.json"
export { default as offrampCCIPReceiveEvents } from "./offramp-receive.json"
export { default as routerCCIPReceiveEvents } from "./router-receive.json"
export { default as poolCCIPReceiveEvents } from "./pool-receive.json"
29 changes: 29 additions & 0 deletions src/config/data/ccip/events/v1_5_0/offramp-receive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"event": "ExecutionStateChanged",
"parameters": [
{
"type": "uint64",
"name": "sequenceNumber",
"indexed": true
},
{
"type": "bytes32",
"name": "messageId",
"indexed": true
},
{
"type": "Internal.MessageExecutionState",
"name": "state",
"indexed": false,
"typeLink": "/ccip/api-reference/evm/v1.5.0/internal#messageexecutionstate"
},
{
"type": "bytes",
"name": "returnData",
"indexed": false
}
],
"description": "Emitted when a message execution state changes to SUCCESS or FAILURE."
}
]
14 changes: 14 additions & 0 deletions src/config/data/ccip/events/v1_5_0/onramp-send.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"event": "CCIPSendRequested",
"parameters": [
{
"type": "Internal.EVM2EVMMessage",
"name": "message",
"indexed": false,
"typeLink": "/ccip/api-reference/evm/v1.5.0/internal#evm2evmmessage"
}
],
"description": "Emitted when a CCIP message is successfully sent."
}
]
44 changes: 44 additions & 0 deletions src/config/data/ccip/events/v1_5_0/pool-receive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"event": "Released",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "address",
"name": "recipient",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are released to the receiver on the destination chain."
},
{
"event": "Minted",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "address",
"name": "recipient",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are minted to the receiver on the destination chain."
}
]
34 changes: 34 additions & 0 deletions src/config/data/ccip/events/v1_5_0/pool-send.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"event": "Locked",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are locked during a cross-chain transfer."
},
{
"event": "Burned",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are burned during a cross-chain transfer."
}
]
28 changes: 28 additions & 0 deletions src/config/data/ccip/events/v1_5_0/router-receive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[
{
"event": "MessageExecuted",
"parameters": [
{
"type": "bytes32",
"name": "messageId",
"indexed": false
},
{
"type": "uint64",
"name": "sourceChainSelector",
"indexed": false
},
{
"type": "address",
"name": "offRamp",
"indexed": false
},
{
"type": "bytes32",
"name": "calldataHash",
"indexed": false
}
],
"description": "Emitted when the Router successfully routes a message to the receiver."
}
]
5 changes: 5 additions & 0 deletions src/config/data/ccip/events/v1_5_1/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export { default as onrampCCIPSendEvents } from "./onramp-send.json"
export { default as poolCCIPSendEvents } from "./pool-send.json"
export { default as offrampCCIPReceiveEvents } from "./offramp-receive.json"
export { default as routerCCIPReceiveEvents } from "./router-receive.json"
export { default as poolCCIPReceiveEvents } from "./pool-receive.json"
29 changes: 29 additions & 0 deletions src/config/data/ccip/events/v1_5_1/offramp-receive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"event": "ExecutionStateChanged",
"parameters": [
{
"type": "uint64",
"name": "sequenceNumber",
"indexed": true
},
{
"type": "bytes32",
"name": "messageId",
"indexed": true
},
{
"type": "Internal.MessageExecutionState",
"name": "state",
"indexed": false,
"typeLink": "/ccip/api-reference/evm/v1.5.1/internal#messageexecutionstate"
},
{
"type": "bytes",
"name": "returnData",
"indexed": false
}
],
"description": "Emitted when a message execution state changes to SUCCESS or FAILURE."
}
]
14 changes: 14 additions & 0 deletions src/config/data/ccip/events/v1_5_1/onramp-send.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
[
{
"event": "CCIPSendRequested",
"parameters": [
{
"type": "Internal.EVM2EVMMessage",
"name": "message",
"indexed": false,
"typeLink": "/ccip/api-reference/evm/v1.5.1/internal#evm2evmmessage"
}
],
"description": "Emitted when a CCIP message is successfully sent."
}
]
44 changes: 44 additions & 0 deletions src/config/data/ccip/events/v1_5_1/pool-receive.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
[
{
"event": "Released",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "address",
"name": "recipient",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are released to the receiver on the destination chain."
},
{
"event": "Minted",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "address",
"name": "recipient",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are minted to the receiver on the destination chain."
}
]
34 changes: 34 additions & 0 deletions src/config/data/ccip/events/v1_5_1/pool-send.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[
{
"event": "Locked",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are locked during a cross-chain transfer."
},
{
"event": "Burned",
"parameters": [
{
"type": "address",
"name": "sender",
"indexed": true
},
{
"type": "uint256",
"name": "amount",
"indexed": false
}
],
"description": "Emitted when tokens are burned during a cross-chain transfer."
}
]
Loading
Loading