|
15242 | 15242 | ] |
15243 | 15243 | ] |
15244 | 15244 | }, |
| 15245 | + "Respond to Webhook2": { |
| 15246 | + "main": [ |
| 15247 | + [ |
| 15248 | + { |
| 15249 | + "index": 0, |
| 15250 | + "node": "Postgres11", |
| 15251 | + "type": "main" |
| 15252 | + } |
| 15253 | + ] |
| 15254 | + ] |
| 15255 | + }, |
15245 | 15256 | "Save Account ID and Private Key": { |
15246 | 15257 | "main": [ |
15247 | 15258 | [ |
|
15510 | 15521 | "node": "Postgres28", |
15511 | 15522 | "type": "main" |
15512 | 15523 | } |
15513 | | - ], |
15514 | | - [ |
15515 | | - { |
15516 | | - "index": 0, |
15517 | | - "node": "Postgres11", |
15518 | | - "type": "main" |
15519 | | - } |
15520 | 15524 | ] |
15521 | 15525 | ] |
15522 | 15526 | }, |
|
16299 | 16303 | }, |
16300 | 16304 | "outputKey": "getRewardAmount", |
16301 | 16305 | "renameOutput": true |
16302 | | - }, |
16303 | | - { |
16304 | | - "conditions": { |
16305 | | - "combinator": "and", |
16306 | | - "conditions": [ |
16307 | | - { |
16308 | | - "id": "05512e6a-84db-432b-a3d9-1fef6bbf6c04", |
16309 | | - "leftValue": "={{ $('Webhook').item.json.body.method }}", |
16310 | | - "operator": { |
16311 | | - "name": "filter.operator.equals", |
16312 | | - "operation": "equals", |
16313 | | - "type": "string" |
16314 | | - }, |
16315 | | - "rightValue": "claimRewards" |
16316 | | - } |
16317 | | - ], |
16318 | | - "options": { |
16319 | | - "caseSensitive": true, |
16320 | | - "leftValue": "", |
16321 | | - "typeValidation": "strict", |
16322 | | - "version": 2 |
16323 | | - } |
16324 | | - }, |
16325 | | - "outputKey": "claimRewards", |
16326 | | - "renameOutput": true |
16327 | 16306 | } |
16328 | 16307 | ] |
16329 | 16308 | } |
@@ -19404,14 +19383,14 @@ |
19404 | 19383 | "values": [ |
19405 | 19384 | { |
19406 | 19385 | "column": "id", |
19407 | | - "value": "={{ $json.authToken.user.id }}" |
| 19386 | + "value": "={{ $('Parse Auth Token').item.json.authToken.user.id }}" |
19408 | 19387 | } |
19409 | 19388 | ] |
19410 | 19389 | } |
19411 | 19390 | }, |
19412 | 19391 | "position": [ |
19413 | | - 2520, |
19414 | | - 5600 |
| 19392 | + 3960, |
| 19393 | + -540 |
19415 | 19394 | ], |
19416 | 19395 | "type": "n8n-nodes-base.postgres", |
19417 | 19396 | "typeVersion": 2.6 |
|
19445 | 19424 | } |
19446 | 19425 | }, |
19447 | 19426 | "position": [ |
19448 | | - 2720, |
19449 | | - 5600 |
| 19427 | + 4160, |
| 19428 | + -540 |
19450 | 19429 | ], |
19451 | 19430 | "type": "n8n-nodes-base.if", |
19452 | 19431 | "typeVersion": 2.2 |
|
19469 | 19448 | } |
19470 | 19449 | }, |
19471 | 19450 | "position": [ |
19472 | | - 2940, |
19473 | | - 5680 |
| 19451 | + 4380, |
| 19452 | + -460 |
19474 | 19453 | ], |
19475 | 19454 | "type": "n8n-nodes-base.set", |
19476 | 19455 | "typeVersion": 3.4 |
|
19493 | 19472 | "query": "select \n\tstring_agg(amount, ',') as amounts\nfrom (\n\tselect rh.id, rh.amount\n\tfrom \"default\".reward_history rh \n\tjoin \"default\".usage_history uh on uh.id = rh.related_item_id and rh.related_item_type = 'usage-caller'\n\twhere uh.caller_username = $1\n\t\tand rh.tx_hash is null\n\t\tand rh.amount != '0'\n\t\t\n\tunion all\n\t\n\tselect rh.id, rh.amount\n\tfrom \"default\".reward_history rh \n\tjoin \"default\".warning w on w.id = rh.related_item_id and rh.related_item_type = 'bug'\n\twhere w.username = $1\n\t\tand rh.tx_hash is null\n\t\tand rh.amount != '0'\n)" |
19494 | 19473 | }, |
19495 | 19474 | "position": [ |
19496 | | - 3140, |
19497 | | - 5520 |
| 19475 | + 4580, |
| 19476 | + -620 |
19498 | 19477 | ], |
19499 | 19478 | "type": "n8n-nodes-base.postgres", |
19500 | 19479 | "typeVersion": 2.6 |
|
19515 | 19494 | "query": "select \n\t(select value from environment.variables where type = 'BUG_REWARD_AMOUNT') as bug_reward_amount,\n\t(select value from environment.variables where type = 'USAGE_REWARD_AMOUNT') as usage_reward_amount,\n\t(select value from environment.variables where type = 'REWARD_ACCOUNT_ID') as reward_account_id,\n\t(select value from environment.variables where type = 'REWARD_ACCOUNT_PRIVATE_KEY') as reward_account_private_key,\n\t(select value from environment.variables where type = 'MAX_USAGE_REWARD_AMOUNT') as max_usage_reward_amount,\n (select value from environment.variables where type = 'TELEGRAM_MONITORING_CHAT_ID') as telegram_monitoring_chat_id,\n\t(select value from environment.variables where type = 'TELEGRAM_MONITORING_TOPIC_ID') as telegram_monitoring_topic_id" |
19516 | 19495 | }, |
19517 | 19496 | "position": [ |
19518 | | - 2940, |
19519 | | - 5520 |
| 19497 | + 4380, |
| 19498 | + -620 |
19520 | 19499 | ], |
19521 | 19500 | "type": "n8n-nodes-base.postgres", |
19522 | 19501 | "typeVersion": 2.6 |
|
19532 | 19511 | "senderId": "={{ $('GetVariables').item.json.reward_account_id }}" |
19533 | 19512 | }, |
19534 | 19513 | "position": [ |
19535 | | - 3800, |
19536 | | - 5520 |
| 19514 | + 5240, |
| 19515 | + -620 |
19537 | 19516 | ], |
19538 | 19517 | "type": "@dapplets/n8n-nodes-near-protocol.transfer", |
19539 | 19518 | "typeVersion": 1 |
|
19546 | 19525 | "mode": "runOnceForEachItem" |
19547 | 19526 | }, |
19548 | 19527 | "position": [ |
19549 | | - 3360, |
19550 | | - 5520 |
| 19528 | + 4800, |
| 19529 | + -620 |
19551 | 19530 | ], |
19552 | 19531 | "type": "n8n-nodes-base.code", |
19553 | 19532 | "typeVersion": 2 |
|
19570 | 19549 | } |
19571 | 19550 | }, |
19572 | 19551 | "position": [ |
19573 | | - 4040, |
19574 | | - 5680 |
| 19552 | + 5480, |
| 19553 | + -460 |
19575 | 19554 | ], |
19576 | 19555 | "type": "n8n-nodes-base.set", |
19577 | 19556 | "typeVersion": 3.4 |
|
19593 | 19572 | "query": "update \"default\".reward_history\nset tx_hash = $2, recipient_account_id = $3\nwhere id in (\n\tselect rh.id\n\tfrom \"default\".reward_history rh \n\tjoin \"default\".usage_history uh on uh.id = rh.related_item_id and rh.related_item_type = 'usage-caller'\n\twhere uh.caller_username = $1\n\t\tand rh.tx_hash is null\n\t\tand rh.amount != '0'\n\t\t\n\tunion all\n\t\n\tselect rh.id\n\tfrom \"default\".reward_history rh \n\tjoin \"default\".warning w on w.id = rh.related_item_id and rh.related_item_type = 'bug'\n\twhere w.username = $1\n\t\tand rh.tx_hash is null\n\t\tand rh.amount != '0'\n)" |
19594 | 19573 | }, |
19595 | 19574 | "position": [ |
19596 | | - 4040, |
19597 | | - 5520 |
| 19575 | + 5480, |
| 19576 | + -620 |
19598 | 19577 | ], |
19599 | 19578 | "type": "n8n-nodes-base.postgres", |
19600 | 19579 | "typeVersion": 2.6 |
|
19627 | 19606 | } |
19628 | 19607 | }, |
19629 | 19608 | "position": [ |
19630 | | - 3580, |
19631 | | - 5520 |
| 19609 | + 5020, |
| 19610 | + -620 |
19632 | 19611 | ], |
19633 | 19612 | "type": "n8n-nodes-base.if", |
19634 | 19613 | "typeVersion": 2.2 |
|
19651 | 19630 | } |
19652 | 19631 | }, |
19653 | 19632 | "position": [ |
19654 | | - 3800, |
19655 | | - 5720 |
| 19633 | + 5240, |
| 19634 | + -420 |
19656 | 19635 | ], |
19657 | 19636 | "type": "n8n-nodes-base.set", |
19658 | 19637 | "typeVersion": 3.4 |
|
19709 | 19688 | ], |
19710 | 19689 | "type": "n8n-nodes-base.merge", |
19711 | 19690 | "typeVersion": 3.1 |
| 19691 | + }, |
| 19692 | + { |
| 19693 | + "id": "b9bbf6fd-e5bb-4d1c-b44b-564d2522814b", |
| 19694 | + "name": "Sticky Note", |
| 19695 | + "parameters": { |
| 19696 | + "content": "Claim Rewards", |
| 19697 | + "height": 480, |
| 19698 | + "width": 1730 |
| 19699 | + }, |
| 19700 | + "position": [ |
| 19701 | + 3940, |
| 19702 | + -660 |
| 19703 | + ], |
| 19704 | + "type": "n8n-nodes-base.stickyNote", |
| 19705 | + "typeVersion": 1 |
19712 | 19706 | } |
19713 | 19707 | ], |
19714 | 19708 | "pinData": { |
|
19720 | 19714 | "tags": [ |
19721 | 19715 | ], |
19722 | 19716 | "triggerCount": 1, |
19723 | | - "updatedAt": "2025-05-15T16:19:08.000Z", |
19724 | | - "versionId": "8382ffdc-a1b5-46d9-a642-ea8e0246be06" |
| 19717 | + "updatedAt": "2025-05-16T11:40:04.000Z", |
| 19718 | + "versionId": "d83b53bb-6b8d-4a7e-ab9a-cc2c880a9555" |
19725 | 19719 | }, |
19726 | 19720 | { |
19727 | 19721 | "active": true, |
|
0 commit comments