Skip to content

Commit

Permalink
feat: new alex contracts (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel authored Jun 24, 2024
1 parent 3d70fac commit 9149f93
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sour-falcons-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stackspulse": minor
---

Track new alex contracts.
23 changes: 23 additions & 0 deletions chainhooks/alex/amm-pool-v2-01.swap-helper-a.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chain": "stacks",
"uuid": "1",
"name": "amm-pool-v2-01.swap-helper-a",
"version": 1,
"networks": {
"mainnet": {
"if_this": {
"scope": "contract_call",
"contract_identifier": "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-pool-v2-01",
"method": "swap-helper-a"
},
"then_that": {
"http_post": {
"url": "http://localhost:3000/api/chainhooks/swap",
"authorization_header": "Bearer dev-api-token"
}
},
"start_block": 152429,
"decode_clarity_values": false
}
}
}
23 changes: 23 additions & 0 deletions chainhooks/alex/amm-pool-v2-01.swap-helper-b.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chain": "stacks",
"uuid": "1",
"name": "amm-pool-v2-01.swap-helper-b",
"version": 1,
"networks": {
"mainnet": {
"if_this": {
"scope": "contract_call",
"contract_identifier": "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-pool-v2-01",
"method": "swap-helper-b"
},
"then_that": {
"http_post": {
"url": "http://localhost:3000/api/chainhooks/swap",
"authorization_header": "Bearer dev-api-token"
}
},
"start_block": 152429,
"decode_clarity_values": false
}
}
}
23 changes: 23 additions & 0 deletions chainhooks/alex/amm-pool-v2-01.swap-helper.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"chain": "stacks",
"uuid": "1",
"name": "amm-pool-v2-01.swap-helper",
"version": 1,
"networks": {
"mainnet": {
"if_this": {
"scope": "contract_call",
"contract_identifier": "SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-pool-v2-01",
"method": "swap-helper"
},
"then_that": {
"http_post": {
"url": "http://localhost:3000/api/chainhooks/swap",
"authorization_header": "Bearer dev-api-token"
}
},
"start_block": 152429,
"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 @@ -51,7 +51,9 @@ export async function POST(request: Request) {
transactionToProcess.metadata.kind.data.contract_identifier ===
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-v1-02" ||
transactionToProcess.metadata.kind.data.contract_identifier ===
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-v1-03"
"SP3K8BC0PPEVCV7NZ6QSRWPQ2JE9E5B6N3PA0KBR9.swap-helper-v1-03" ||
transactionToProcess.metadata.kind.data.contract_identifier ===
"SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.amm-pool-v2-01"
) {
protocol = "alex";
} else if (
Expand Down

0 comments on commit 9149f93

Please sign in to comment.