Skip to content

Commit

Permalink
feat: alex swap-helper-v1-03
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel committed Mar 19, 2024
1 parent 8d41aec commit 2c6d300
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
23 changes: 23 additions & 0 deletions chainhooks/alex/swap-helper-v1-03.swap-helper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chain": "stacks",
"uuid": "1",
"name": "swap-helper-v1-03.swap-helper",
"version": 1,
"networks": {
"mainnet": {
"if_this": {
"scope": "contract_call",
"contract_identifier": "SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-v1-03",
"method": "swap-helper"
},
"then_that": {
"http_post": {
"url": "http://localhost:3000/api/chainhooks/swap",
"authorization_header": "Bearer dev-api-token"
}
},
"start_block": 104237,
"decode_clarity_values": false
}
}
}
4 changes: 3 additions & 1 deletion src/app/api/chainhooks/swap/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ export async function POST(request: Request) {
let protocol: Protocol;
if (
transactionToProcess.metadata.kind.data.contract_identifier ===
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1"
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.amm-swap-pool-v1-1" ||
transactionToProcess.metadata.kind.data.contract_identifier ===
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-v1-03"
) {
protocol = "alex";
} else if (
Expand Down

0 comments on commit 2c6d300

Please sign in to comment.