[Blockchain Watcher] (SNAXCHAIN) Support snaxchain source and redeem events (#1625)

* Support snaxchain source and redeem events

* Change chainId for 43

---------

Co-authored-by: julian merlo <julianmerlo@julians-MacBook-Air.local>
This commit is contained in:
Julian 2024-08-22 10:39:52 -03:00 committed by GitHub
parent d541de73df
commit b9f883d8e4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 201 additions and 1 deletions

View File

@ -207,6 +207,13 @@
"__format": "json"
}
},
"snaxchain": {
"network": "SNAXCHAIN_NETWORK",
"rpcs": {
"__name": "SNAXCHAIN_RPCS",
"__format": "json"
}
},
"polygon-sepolia": {
"network": "POLYGON_SEPOLIA_NETWORK",
"rpcs": {

View File

@ -227,6 +227,13 @@
"rpcs": ["https://xlayertestrpc.okx.com", "https://testrpc.xlayer.tech"],
"timeout": 10000
},
"snaxchain": {
"name": "snaxchain",
"network": "testnet",
"chainId": 43,
"rpcs": ["https://testnet.snaxchain.io/"],
"timeout": 10000
},
"evmos": {
"name": "evmos",
"network": "testnet",

View File

@ -190,6 +190,11 @@
"chainId": 37,
"rpcs": ["https://xlayerrpc.okx.com", "https://rpc.xlayer.tech"]
},
"snaxchain": {
"network": "mainnet",
"chainId": 43,
"rpcs": ["https://mainnet.snaxchain.io/"]
},
"wormchain": {
"network": "mainnet",
"chainId": 3104,

View File

@ -1752,6 +1752,36 @@
}
]
},
{
"chain": "snaxchain",
"protocols": [
{
"addresses": [
"0xa10f2eF61dE1f19f586ab8B6F2EbA89bACE63F7a",
"0x8B94bfE456B48a6025b92E11Be393BAa86e68410"
],
"type": "Token Bridge",
"methods": [
{
"methodId": "0xc6878519",
"method": "MethodCompleteTransfer"
},
{
"methodId": "0xff200cde",
"method": "MethodCompleteAndUnwrapETH"
},
{
"methodId": "0xe8059810",
"method": "MethodCreateWrapped"
},
{
"methodId": "0xf768441f",
"method": "MethodUpdateWrapped"
}
]
}
]
},
{
"chain": "karura",
"protocols": [

View File

@ -79,6 +79,7 @@ const EVM_CHAINS = new Map([
["blast", "evmRepo"],
["mantle", "evmRepo"],
["xlayer", "evmRepo"],
["snaxchain", "evmRepo"],
]);
const POOL_STRATEGY = "healthy";

View File

@ -207,6 +207,13 @@ export const configMock = (): Config => {
rpcs: ["http://localhost"],
timeout: 10000,
},
snaxchain: {
name: "snaxchain",
network: "testnet",
chainId: 43,
rpcs: ["http://localhost"],
timeout: 10000,
},
"ethereum-sepolia": {
name: "ethereum-sepolia",
network: "sepolia",

View File

@ -62,3 +62,4 @@ SEI_RPCS=
TERRA_RPCS=
TERRA2_RPCS=
OASIS_RPCS=
SNAXCHAIN_RPCS=

View File

@ -57,4 +57,5 @@ INJECTIVE_RPCS=
SEI_RPCS=
TERRA_RPCS=
TERRA2_RPCS=
OASIS_RPCS=
OASIS_RPCS=
SNAXCHAIN_RPCS=

View File

@ -58,3 +58,4 @@ SEI_RPCS=
TERRA_RPCS=
TERRA2_RPCS=
OASIS_RPCS=
SNAXCHAIN_RPCS=

View File

@ -58,3 +58,4 @@ SEI_RPCS=
TERRA_RPCS=
TERRA2_RPCS=
OASIS_RPCS=
SNAXCHAIN_RPCS=

View File

@ -141,6 +141,38 @@ data:
}
}
]
},
{
"id": "poll-log-message-published-snaxchain",
"chain": "snaxchain",
"source": {
"action": "PollEvm",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 15000,
"filters": [
{
"addresses": ["0xBB73cB66C26740F31d1FabDC6b7A46a038A300dd"],
"type": "Portal Token Bridge",
"topics": ["0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2"]
}
],
"chain": "snaxchain",
"chainId": 43
}
},
"handlers": [
{
"action": "HandleEvmLogs",
"target": "sns",
"mapper": "evmLogMessagePublishedMapper",
"config": {
"abi": "event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)",
"metricName": "process_source_event"
}
}
]
}
]
mainnet-jobs.json: |-
@ -372,6 +404,38 @@ data:
}
}
]
},
{
"id": "poll-log-message-published-snaxchain",
"chain": "snaxchain",
"source": {
"action": "PollEvm",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 5000,
"filters": [
{
"addresses": ["0xc1BA3CC4bFE724A08FbbFbF64F8db196738665f4"],
"type": "Portal Token Bridge",
"topics": ["0x6eb224fb001ed210e379b335e35efe88672a8ce935d981a6896b27ffdf52a3b2"]
}
],
"chain": "snaxchain",
"chainId": 43
}
},
"handlers": [
{
"action": "HandleEvmLogs",
"target": "sns",
"mapper": "evmLogMessagePublishedMapper",
"config": {
"abi": "event LogMessagePublished(address indexed sender, uint64 sequence, uint32 nonce, bytes payload, uint8 consistencyLevel)",
"metricName": "process_source_event"
}
}
]
}
]
---
@ -424,6 +488,10 @@ spec:
- name: ALGORAND_RPCS
value: '{{ .ALGORAND_RPCS }}'
{{ end }}
{{ if .SNAXCHAIN_RPCS }}
- name: SNAXCHAIN_RPCS
value: '{{ .SNAXCHAIN_RPCS }}'
{{ end }}
image: {{ .IMAGE_NAME }}
resources:
limits:

View File

@ -314,6 +314,39 @@ data:
}
}
]
},
{
"id": "poll-redeemed-transactions-snaxchain",
"chain": "snaxchain",
"source": {
"action": "PollEvm",
"records": "GetEvmTransactions",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 35000,
"filters": [
{
"addresses": [],
"type": "Portal Token Bridge (Connect, Portico, Omniswap, tBTC, etc)",
"topics": ["0xcaf280c8cfeba144da67230d9b009c8f868a75bac9a528fa0474be1ba317c169"],
"strategy": "GetTransactionsByLogFiltersStrategy"
}
],
"chain": "snaxchain",
"chainId": 43
}
},
"handlers": [
{
"action": "HandleEvmTransactions",
"target": "sns",
"mapper": "evmRedeemedTransactionFoundMapper",
"config": {
"metricName": "process_vaa_event"
}
}
]
}
]
mainnet-jobs.json: |-
@ -632,6 +665,40 @@ data:
}
}
]
},
{
"id": "poll-redeemed-transactions-snaxchain",
"chain": "snaxchain",
"source": {
"action": "PollEvm",
"records": "GetEvmTransactions",
"config": {
"blockBatchSize": 100,
"commitment": "latest",
"interval": 15000,
"filters": [
{
"addresses": [],
"type": "Portal Token Bridge (Connect, Portico, Omniswap, tBTC, etc)",
"topics": ["0xcaf280c8cfeba144da67230d9b009c8f868a75bac9a528fa0474be1ba317c169"],
"strategy": "GetTransactionsByLogFiltersStrategy"
}
],
"chain": "snaxchain",
"chainId": 43
}
},
"handlers": [
{
"action": "HandleEvmTransactions",
"target": "sns",
"mapper": "evmRedeemedTransactionFoundMapper",
"config": {
"abi": "",
"metricName": "process_vaa_event"
}
}
]
}
]
---
@ -724,6 +791,10 @@ spec:
- name: NEAR_RPCS
value: '{{ .NEAR_RPCS }}'
{{ end }}
{{ if .SNAXCHAIN_RPCS }}
- name: SNAXCHAIN_RPCS
value: '{{ .SNAXCHAIN_RPCS }}'
{{ end }}
image: {{ .IMAGE_NAME }}
resources:
limits: