@ercworldio/blockchain-shared 1.0.3-dev.6 → 1.0.5-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/chains/Provider.js +1 -1
- package/build/chains/networks_dev.json +17 -17
- package/build/chains/networks_prod-dz.json +0 -35
- package/build/chains/networks_prod-sh.json +40 -4
- package/build/chains/networks_prod-yb.json +40 -4
- package/build/contracts/Escrow.d.ts +16 -6
- package/build/contracts/Escrow.d.ts.map +1 -1
- package/build/contracts/Escrow.js +112 -4
- package/build/contracts/EscrowErrors.d.ts +110 -1
- package/build/contracts/EscrowErrors.d.ts.map +1 -1
- package/build/contracts/EscrowErrors.js +71 -14
- package/build/contracts/artifacts/Escrow.json +244 -14
- package/build/contracts/contract-events/AccessControlEvents.d.ts +12 -2
- package/build/contracts/contract-events/AccessControlEvents.d.ts.map +1 -1
- package/build/contracts/contract-events/AccessControlEvents.js +29 -5
- package/build/contracts/contract-events/EscrowEvents.d.ts +134 -2
- package/build/contracts/contract-events/EscrowEvents.d.ts.map +1 -1
- package/build/contracts/contract-events/EscrowEvents.js +67 -17
- package/build/contracts/contract-events/types/events.d.ts +35 -1
- package/build/contracts/contract-events/types/events.d.ts.map +1 -1
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts +76 -15
- package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts.map +1 -1
- package/build/contracts/typechain-types/contracts/lib/Events.d.ts +2 -8
- package/build/contracts/typechain-types/contracts/lib/Events.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.d.ts +69 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowAccessControl__factory.js +91 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.d.ts +69 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowErrors__factory.js +91 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowSignature__factory.d.ts +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/EscrowSignature__factory.js +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts +188 -13
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.js +245 -15
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts +1 -11
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.js +1 -13
- package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.d.ts +45 -1
- package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.d.ts.map +1 -1
- package/build/contracts/typechain-types/factories/contracts/lib/MultisigLib__factory.js +59 -1
- package/build/contracts/types/escrow.d.ts +16 -2
- package/build/contracts/types/escrow.d.ts.map +1 -1
- package/build/contracts/types/escrow.js +4 -0
- package/build/entities/AdminOperationThresholds.d.ts +0 -1
- package/build/entities/AdminOperationThresholds.d.ts.map +1 -1
- package/build/entities/AdminOperationThresholds.js +1 -5
- package/build/entities/ClaimJob.d.ts +1 -0
- package/build/entities/ClaimJob.d.ts.map +1 -1
- package/build/entities/ClaimJob.js +4 -0
- package/build/entities/EscrowRoles.js +1 -1
- package/build/entities/GlobalTimelock.d.ts +0 -1
- package/build/entities/GlobalTimelock.d.ts.map +1 -1
- package/build/entities/GlobalTimelock.js +1 -5
- package/build/entities/RoleHash.js +1 -1
- package/build/entities/TokenExecutionThresholds.d.ts +0 -1
- package/build/entities/TokenExecutionThresholds.d.ts.map +1 -1
- package/build/entities/TokenExecutionThresholds.js +1 -5
- package/build/errors/errors.d.ts +33 -0
- package/build/errors/errors.d.ts.map +1 -1
- package/build/errors/errors.js +70 -2
- package/build/index.d.ts +6 -9
- package/build/index.d.ts.map +1 -1
- package/build/index.js +22 -11
- package/build/interfaces.d.ts +2 -2
- package/build/interfaces.d.ts.map +1 -1
- package/build/services/AlchemyService.d.ts +2 -1
- package/build/services/AlchemyService.d.ts.map +1 -1
- package/build/services/AlchemyService.js +8 -2
- package/build/services/AlchemyWebhooks.d.ts.map +1 -1
- package/build/services/AlchemyWebhooks.js +34 -29
- package/build/services/AzureEventHubHandler.d.ts.map +1 -1
- package/build/services/AzureEventHubHandler.js +17 -5
- package/build/services/ClaimJobService.d.ts +6 -2
- package/build/services/ClaimJobService.d.ts.map +1 -1
- package/build/services/ClaimJobService.js +155 -24
- package/build/services/db/roles/ContractRoles.d.ts +2 -2
- package/build/services/db/roles/ContractRoles.d.ts.map +1 -1
- package/build/services/db/roles/ContractRoles.js +18 -12
- package/build/services/types/azure_event_hub_handler.d.ts +9 -1
- package/build/services/types/azure_event_hub_handler.d.ts.map +1 -1
- package/build/services/types/azure_event_hub_handler.js +8 -0
- package/build/services/types/claim.d.ts +17 -1
- package/build/services/types/claim.d.ts.map +1 -1
- package/build/services/types/claim_job_service.d.ts +9 -1
- package/build/services/types/claim_job_service.d.ts.map +1 -1
- package/build/services/types/index.d.ts +1 -0
- package/build/services/types/index.d.ts.map +1 -1
- package/build/services/types/index.js +1 -0
- package/build/services/utils/alchemy.d.ts.map +1 -1
- package/build/services/utils/alchemy.js +6 -1
- package/build/utils/AsyncTTLCache.d.ts +2 -0
- package/build/utils/AsyncTTLCache.d.ts.map +1 -1
- package/build/utils/AsyncTTLCache.js +10 -2
- package/build/utils/custodial.d.ts +9 -0
- package/build/utils/custodial.d.ts.map +1 -1
- package/build/utils/custodial.js +32 -4
- package/build/utils/solana.js +1 -1
- package/package.json +6 -3
package/build/chains/Provider.js
CHANGED
|
@@ -67,7 +67,7 @@ class Provider extends errors_1.default {
|
|
|
67
67
|
case RpcProviderType.ALCHEMY:
|
|
68
68
|
if (!this.config.config.alchemyApiKey)
|
|
69
69
|
throw new Error(this.RequireParameter("secret: alchemyApiKey"));
|
|
70
|
-
let alchemy_network_name = (0, alchemy_1.get_alchemy_chain_name)(chain_id).toLowerCase();
|
|
70
|
+
let alchemy_network_name = (0, alchemy_1.get_alchemy_chain_name)(chain_id, false).toLowerCase();
|
|
71
71
|
if (alchemy_network_name.includes("_")) {
|
|
72
72
|
alchemy_network_name = alchemy_network_name.replace("_", "-");
|
|
73
73
|
}
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"treasury_receiver": "TN4tXH5F36BxWEe8UQuUeMr1EuPwJjNUFJ",
|
|
47
47
|
"overflow_treasury_receiver": "TCdE3ZGvBjUcqVCreT25SWwF36gkiLYTGD",
|
|
48
48
|
"overflow_threshold_decimal": 100000,
|
|
49
|
-
"min_funding_wallet_balance_usd":
|
|
49
|
+
"min_funding_wallet_balance_usd": 1,
|
|
50
50
|
"allowed_receivers": [
|
|
51
51
|
"TCdE3ZGvBjUcqVCreT25SWwF36gkiLYTGD"
|
|
52
52
|
]
|
|
@@ -120,7 +120,7 @@
|
|
|
120
120
|
"treasury_receiver": "AAuFzrm6H4Vv7UyJi8R5Gsm4ixtR2yVmqzLmuyUTS5cu",
|
|
121
121
|
"overflow_treasury_receiver": "GLfRJqsRtTNDVvYVccXrz8RCKNnad2hqQfgFaApAKXCq",
|
|
122
122
|
"overflow_threshold_decimal": 100000,
|
|
123
|
-
"min_funding_wallet_balance_usd":
|
|
123
|
+
"min_funding_wallet_balance_usd": 1,
|
|
124
124
|
"allowed_receivers": [
|
|
125
125
|
"AAuFzrm6H4Vv7UyJi8R5Gsm4ixtR2yVmqzLmuyUTS5cu"
|
|
126
126
|
]
|
|
@@ -223,7 +223,7 @@
|
|
|
223
223
|
"treasury_receiver": "0xaD372aCDd0F14A9430Af29DaEc8229A9F109d7F5",
|
|
224
224
|
"overflow_treasury_receiver": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
225
225
|
"overflow_threshold_decimal": 100000,
|
|
226
|
-
"min_funding_wallet_balance_usd":
|
|
226
|
+
"min_funding_wallet_balance_usd": 1,
|
|
227
227
|
"allowed_receivers": [
|
|
228
228
|
"0xaD372aCDd0F14A9430Af29DaEc8229A9F109d7F5"
|
|
229
229
|
]
|
|
@@ -395,12 +395,12 @@
|
|
|
395
395
|
"targetConfirmations": 10,
|
|
396
396
|
"accounting": {
|
|
397
397
|
"funding_wallet": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
398
|
-
"treasury_receiver": "
|
|
398
|
+
"treasury_receiver": "0x81E612A63f7e1E8435fdbaE04a81ac84638D25f3",
|
|
399
399
|
"overflow_treasury_receiver": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
400
400
|
"overflow_threshold_decimal": 100000,
|
|
401
|
-
"min_funding_wallet_balance_usd":
|
|
401
|
+
"min_funding_wallet_balance_usd": 1,
|
|
402
402
|
"allowed_receivers": [
|
|
403
|
-
"
|
|
403
|
+
"0x81E612A63f7e1E8435fdbaE04a81ac84638D25f3"
|
|
404
404
|
]
|
|
405
405
|
},
|
|
406
406
|
"custodialAlchemyWebhooks": [
|
|
@@ -436,7 +436,7 @@
|
|
|
436
436
|
}
|
|
437
437
|
],
|
|
438
438
|
"addresses": [
|
|
439
|
-
"
|
|
439
|
+
"0x81E612A63f7e1E8435fdbaE04a81ac84638D25f3"
|
|
440
440
|
]
|
|
441
441
|
},
|
|
442
442
|
{
|
|
@@ -506,12 +506,12 @@
|
|
|
506
506
|
"targetConfirmations": 10,
|
|
507
507
|
"accounting": {
|
|
508
508
|
"funding_wallet": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
509
|
-
"treasury_receiver": "
|
|
509
|
+
"treasury_receiver": "0x296d7BfECCa7Fa59157b012e12Bab48859F11b32",
|
|
510
510
|
"overflow_treasury_receiver": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
511
511
|
"overflow_threshold_decimal": 100000,
|
|
512
|
-
"min_funding_wallet_balance_usd":
|
|
512
|
+
"min_funding_wallet_balance_usd": 1,
|
|
513
513
|
"allowed_receivers": [
|
|
514
|
-
"
|
|
514
|
+
"0x296d7BfECCa7Fa59157b012e12Bab48859F11b32"
|
|
515
515
|
]
|
|
516
516
|
},
|
|
517
517
|
"custodialAlchemyWebhooks": [
|
|
@@ -547,7 +547,7 @@
|
|
|
547
547
|
}
|
|
548
548
|
],
|
|
549
549
|
"addresses": [
|
|
550
|
-
"
|
|
550
|
+
"0x296d7BfECCa7Fa59157b012e12Bab48859F11b32"
|
|
551
551
|
]
|
|
552
552
|
},
|
|
553
553
|
{
|
|
@@ -603,12 +603,12 @@
|
|
|
603
603
|
"targetConfirmations": 10,
|
|
604
604
|
"accounting": {
|
|
605
605
|
"funding_wallet": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
606
|
-
"treasury_receiver": "
|
|
606
|
+
"treasury_receiver": "0x32fDf51e2EdbCD58f10A721Bd2A815e64135B815",
|
|
607
607
|
"overflow_treasury_receiver": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
608
608
|
"overflow_threshold_decimal": 100000,
|
|
609
609
|
"min_funding_wallet_balance_usd": 1,
|
|
610
610
|
"allowed_receivers": [
|
|
611
|
-
"
|
|
611
|
+
"0x32fDf51e2EdbCD58f10A721Bd2A815e64135B815"
|
|
612
612
|
]
|
|
613
613
|
},
|
|
614
614
|
"custodialAlchemyWebhooks": [
|
|
@@ -644,7 +644,7 @@
|
|
|
644
644
|
}
|
|
645
645
|
],
|
|
646
646
|
"addresses": [
|
|
647
|
-
"
|
|
647
|
+
"0x32fDf51e2EdbCD58f10A721Bd2A815e64135B815"
|
|
648
648
|
]
|
|
649
649
|
},
|
|
650
650
|
{
|
|
@@ -699,12 +699,12 @@
|
|
|
699
699
|
"targetConfirmations": 10,
|
|
700
700
|
"accounting": {
|
|
701
701
|
"funding_wallet": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
702
|
-
"treasury_receiver": "
|
|
702
|
+
"treasury_receiver": "0x5cAb2AE411442130eAD1d6d7C0219b19Bdd00C6b",
|
|
703
703
|
"overflow_treasury_receiver": "0xF84a78E56fBACAADd73E59eDAe02b3b80e4966C8",
|
|
704
704
|
"overflow_threshold_decimal": 100000,
|
|
705
705
|
"min_funding_wallet_balance_usd": 0.5,
|
|
706
706
|
"allowed_receivers": [
|
|
707
|
-
"
|
|
707
|
+
"0x5cAb2AE411442130eAD1d6d7C0219b19Bdd00C6b"
|
|
708
708
|
]
|
|
709
709
|
},
|
|
710
710
|
"custodialAlchemyWebhooks": [
|
|
@@ -747,7 +747,7 @@
|
|
|
747
747
|
}
|
|
748
748
|
],
|
|
749
749
|
"addresses": [
|
|
750
|
-
"
|
|
750
|
+
"0x5cAb2AE411442130eAD1d6d7C0219b19Bdd00C6b"
|
|
751
751
|
]
|
|
752
752
|
},
|
|
753
753
|
{
|
|
@@ -30,13 +30,6 @@
|
|
|
30
30
|
}
|
|
31
31
|
],
|
|
32
32
|
"quicknodeNotificationConfig": [
|
|
33
|
-
{
|
|
34
|
-
"name": "escrow-eth-prod-dz",
|
|
35
|
-
"network": "ethereum-mainnet",
|
|
36
|
-
"template": "evmWalletFilter",
|
|
37
|
-
"source": "contract",
|
|
38
|
-
"chain_id": 1
|
|
39
|
-
},
|
|
40
33
|
{
|
|
41
34
|
"name": "qn-custodial-webhook-eth-prod-dz",
|
|
42
35
|
"network": "ethereum-mainnet",
|
|
@@ -162,13 +155,6 @@
|
|
|
162
155
|
}
|
|
163
156
|
],
|
|
164
157
|
"quicknodeNotificationConfig": [
|
|
165
|
-
{
|
|
166
|
-
"name": "escrow-bnb-prod-dz",
|
|
167
|
-
"network": "bnbchain-mainnet",
|
|
168
|
-
"template": "evmWalletFilter",
|
|
169
|
-
"source": "contract",
|
|
170
|
-
"chain_id": 56
|
|
171
|
-
},
|
|
172
158
|
{
|
|
173
159
|
"name": "qn-custodial-webhook-bnb-prod-dz",
|
|
174
160
|
"network": "bnbchain-mainnet",
|
|
@@ -384,13 +370,6 @@
|
|
|
384
370
|
}
|
|
385
371
|
],
|
|
386
372
|
"quicknodeNotificationConfig": [
|
|
387
|
-
{
|
|
388
|
-
"name": "escrow-pol-prod-dz",
|
|
389
|
-
"network": "polygon-mainnet",
|
|
390
|
-
"template": "evmWalletFilter",
|
|
391
|
-
"source": "contract",
|
|
392
|
-
"chain_id": 137
|
|
393
|
-
},
|
|
394
373
|
{
|
|
395
374
|
"name": "qn-custodial-webhook-pol-prod-dz",
|
|
396
375
|
"network": "bnbchain-mainnet",
|
|
@@ -488,13 +467,6 @@
|
|
|
488
467
|
}
|
|
489
468
|
],
|
|
490
469
|
"quicknodeNotificationConfig": [
|
|
491
|
-
{
|
|
492
|
-
"name": "escrow-mon-prod-dz",
|
|
493
|
-
"network": "monad-mainnet",
|
|
494
|
-
"template": "evmWalletFilter",
|
|
495
|
-
"source": "contract",
|
|
496
|
-
"chain_id": 143
|
|
497
|
-
},
|
|
498
470
|
{
|
|
499
471
|
"name": "qn-custodial-webhook-mon-prod-dz",
|
|
500
472
|
"network": "monad-mainnet",
|
|
@@ -578,13 +550,6 @@
|
|
|
578
550
|
}
|
|
579
551
|
],
|
|
580
552
|
"quicknodeNotificationConfig": [
|
|
581
|
-
{
|
|
582
|
-
"name": "escrow-avax-prod-dz",
|
|
583
|
-
"network": "avalanche-mainnet",
|
|
584
|
-
"template": "evmWalletFilter",
|
|
585
|
-
"source": "contract",
|
|
586
|
-
"chain_id": 43114
|
|
587
|
-
},
|
|
588
553
|
{
|
|
589
554
|
"name": "qn-custodial-webhook-avax-prod-dz",
|
|
590
555
|
"network": "avalanche-mainnet",
|
|
@@ -48,7 +48,16 @@
|
|
|
48
48
|
"type": "Escrow",
|
|
49
49
|
"version": "1",
|
|
50
50
|
"startingBlock": 24496423,
|
|
51
|
-
"escrowAlchemyWebhooks": [
|
|
51
|
+
"escrowAlchemyWebhooks": [
|
|
52
|
+
{
|
|
53
|
+
"chainId": "1",
|
|
54
|
+
"network_symbol": "eth",
|
|
55
|
+
"network": "ETH_MAINNET",
|
|
56
|
+
"type": "GRAPHQL",
|
|
57
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
58
|
+
"source": "contract"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
52
61
|
"addresses": [
|
|
53
62
|
"0xB28BE79Ffe7CC1f352a8EFF3E3E8f4faFD05a881"
|
|
54
63
|
]
|
|
@@ -157,7 +166,16 @@
|
|
|
157
166
|
"type": "Escrow",
|
|
158
167
|
"version": "1",
|
|
159
168
|
"startingBlock": 82263026,
|
|
160
|
-
"escrowAlchemyWebhooks": [
|
|
169
|
+
"escrowAlchemyWebhooks": [
|
|
170
|
+
{
|
|
171
|
+
"chainId": "56",
|
|
172
|
+
"network_symbol": "bnb",
|
|
173
|
+
"network": "BNB_MAINNET",
|
|
174
|
+
"type": "GRAPHQL",
|
|
175
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
176
|
+
"source": "contract"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
161
179
|
"addresses": [
|
|
162
180
|
"0xa4f0f80b1f4b2dBDD7cE553342Ad5542ba7758Ec"
|
|
163
181
|
]
|
|
@@ -357,7 +375,16 @@
|
|
|
357
375
|
"type": "Escrow",
|
|
358
376
|
"version": "1",
|
|
359
377
|
"startingBlock": 82937871,
|
|
360
|
-
"escrowAlchemyWebhooks": [
|
|
378
|
+
"escrowAlchemyWebhooks": [
|
|
379
|
+
{
|
|
380
|
+
"chainId": "137",
|
|
381
|
+
"network_symbol": "pol",
|
|
382
|
+
"network": "MATIC_MAINNET",
|
|
383
|
+
"type": "GRAPHQL",
|
|
384
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
385
|
+
"source": "contract"
|
|
386
|
+
}
|
|
387
|
+
],
|
|
361
388
|
"addresses": [
|
|
362
389
|
"0x0074D8ed3168bEF415337064670e0bf90981A1F5"
|
|
363
390
|
]
|
|
@@ -452,7 +479,16 @@
|
|
|
452
479
|
"type": "Escrow",
|
|
453
480
|
"version": "1",
|
|
454
481
|
"startingBlock": 78523433,
|
|
455
|
-
"escrowAlchemyWebhooks": [
|
|
482
|
+
"escrowAlchemyWebhooks": [
|
|
483
|
+
{
|
|
484
|
+
"chainId": "43114",
|
|
485
|
+
"network_symbol": "avax",
|
|
486
|
+
"network": "AVAX_MAINNET",
|
|
487
|
+
"type": "GRAPHQL",
|
|
488
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
489
|
+
"source": "contract"
|
|
490
|
+
}
|
|
491
|
+
],
|
|
456
492
|
"addresses": [
|
|
457
493
|
"0x28DE9CeCd83D9b20Ee6A438d39114Add08ED5FF7"
|
|
458
494
|
]
|
|
@@ -48,7 +48,16 @@
|
|
|
48
48
|
"type": "Escrow",
|
|
49
49
|
"version": "1",
|
|
50
50
|
"startingBlock": 24754256,
|
|
51
|
-
"escrowAlchemyWebhooks": [
|
|
51
|
+
"escrowAlchemyWebhooks": [
|
|
52
|
+
{
|
|
53
|
+
"chainId": "1",
|
|
54
|
+
"network_symbol": "eth",
|
|
55
|
+
"network": "ETH_MAINNET",
|
|
56
|
+
"type": "GRAPHQL",
|
|
57
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
58
|
+
"source": "contract"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
52
61
|
"addresses": [
|
|
53
62
|
"0xBC88D756b866854C02410c8d3e62E5648279dc70"
|
|
54
63
|
]
|
|
@@ -157,7 +166,16 @@
|
|
|
157
166
|
"type": "Escrow",
|
|
158
167
|
"version": "1",
|
|
159
168
|
"startingBlock": 89178576,
|
|
160
|
-
"escrowAlchemyWebhooks": [
|
|
169
|
+
"escrowAlchemyWebhooks": [
|
|
170
|
+
{
|
|
171
|
+
"chainId": "56",
|
|
172
|
+
"network_symbol": "bnb",
|
|
173
|
+
"network": "BNB_MAINNET",
|
|
174
|
+
"type": "GRAPHQL",
|
|
175
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
176
|
+
"source": "contract"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
161
179
|
"addresses": [
|
|
162
180
|
"0x0074D8ed3168bEF415337064670e0bf90981A1F5"
|
|
163
181
|
]
|
|
@@ -357,7 +375,16 @@
|
|
|
357
375
|
"type": "Escrow",
|
|
358
376
|
"version": "1",
|
|
359
377
|
"startingBlock": 84779780,
|
|
360
|
-
"escrowAlchemyWebhooks": [
|
|
378
|
+
"escrowAlchemyWebhooks": [
|
|
379
|
+
{
|
|
380
|
+
"chainId": "137",
|
|
381
|
+
"network_symbol": "pol",
|
|
382
|
+
"network": "MATIC_MAINNET",
|
|
383
|
+
"type": "GRAPHQL",
|
|
384
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
385
|
+
"source": "contract"
|
|
386
|
+
}
|
|
387
|
+
],
|
|
361
388
|
"addresses": [
|
|
362
389
|
"0x251824258e218293d79036Be1423388bf3476Ef4"
|
|
363
390
|
]
|
|
@@ -452,7 +479,16 @@
|
|
|
452
479
|
"type": "Escrow",
|
|
453
480
|
"version": "1",
|
|
454
481
|
"startingBlock": 81474572,
|
|
455
|
-
"escrowAlchemyWebhooks": [
|
|
482
|
+
"escrowAlchemyWebhooks": [
|
|
483
|
+
{
|
|
484
|
+
"chainId": "43114",
|
|
485
|
+
"network_symbol": "avax",
|
|
486
|
+
"network": "AVAX_MAINNET",
|
|
487
|
+
"type": "GRAPHQL",
|
|
488
|
+
"endpoint": "webhook/alchemy/escrow-events",
|
|
489
|
+
"source": "contract"
|
|
490
|
+
}
|
|
491
|
+
],
|
|
456
492
|
"addresses": [
|
|
457
493
|
"0x6d47B7230F5D466677795E271db3aEE4C59c0B47"
|
|
458
494
|
]
|
|
@@ -2,7 +2,7 @@ import { escrow } from "./typechain-types/contracts";
|
|
|
2
2
|
import { Signer, Provider, ethers } from "ethers";
|
|
3
3
|
import { ErrorObject, EscrowErrorMessage } from "./EscrowErrors";
|
|
4
4
|
import Errors from "../errors/TransactionsErrors";
|
|
5
|
-
import { BatchSweepErc20Payload, BatchWithdrawPayload, FundWalletsPayload, OpType, TransactionStatus } from "./types/escrow";
|
|
5
|
+
import { BatchSweepErc20Payload, BatchWithdrawPayload, ExecuteWithdrawalPayload, FundWalletsPayload, OpType, TransactionStatus } from "./types/escrow";
|
|
6
6
|
/**
|
|
7
7
|
* Class to interact with the escrow contract
|
|
8
8
|
* @author @0xgio - Georgio Diab
|
|
@@ -44,7 +44,7 @@ declare class EscrowInteraction extends Errors {
|
|
|
44
44
|
transactionHash: null;
|
|
45
45
|
receipt: null;
|
|
46
46
|
error: {
|
|
47
|
-
name: "ContractBusy" | "ContractPaused" | "
|
|
47
|
+
name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "ExceedsLimit" | "ExceedsMax" | "UnknownError" | "InvalidNonce" | "TimelockConfigGroupNotSet" | "ConfigGroupNotSet" | "TimelockConfigNotSet" | "CommitmentNotFound" | "AlreadyCreatedTransaction" | "AccountAlreadyHasSignerRole" | "InvalidOperation" | "InvalidConfig" | "InvalidSignatures" | "AdminMultisigConfigNotSet" | "MultisigConfigNotSet" | "RequireTreasuryReceiverRole" | "InvalidMultiSig" | "RequireMultiSig" | "TimelockNotExpired" | "InsufficientExecutiveSigs" | "InsufficientManagerSigs" | "InvalidMultiSigForRequest" | "InsufficientManagerSigsForRequest" | "InsufficientExecutiveSigsForRequest";
|
|
48
48
|
message: string;
|
|
49
49
|
data?: any;
|
|
50
50
|
};
|
|
@@ -61,14 +61,14 @@ declare class EscrowInteraction extends Errors {
|
|
|
61
61
|
transactionHash: null;
|
|
62
62
|
receipt: null;
|
|
63
63
|
error: {
|
|
64
|
-
name: "ContractBusy" | "ContractPaused" | "
|
|
64
|
+
name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "ExceedsLimit" | "ExceedsMax" | "UnknownError" | "InvalidNonce" | "TimelockConfigGroupNotSet" | "ConfigGroupNotSet" | "TimelockConfigNotSet" | "CommitmentNotFound" | "AlreadyCreatedTransaction" | "AccountAlreadyHasSignerRole" | "InvalidOperation" | "InvalidConfig" | "InvalidSignatures" | "AdminMultisigConfigNotSet" | "MultisigConfigNotSet" | "RequireTreasuryReceiverRole" | "InvalidMultiSig" | "RequireMultiSig" | "TimelockNotExpired" | "InsufficientExecutiveSigs" | "InsufficientManagerSigs" | "InvalidMultiSigForRequest" | "InsufficientManagerSigsForRequest" | "InsufficientExecutiveSigsForRequest";
|
|
65
65
|
message: string;
|
|
66
66
|
data?: any;
|
|
67
67
|
};
|
|
68
68
|
fee?: undefined;
|
|
69
69
|
}>;
|
|
70
70
|
get_used_request_ids(ids: number[]): Promise<number[]>;
|
|
71
|
-
|
|
71
|
+
batch_withdraw(payloads: BatchWithdrawPayload[], token_price: number): Promise<{
|
|
72
72
|
status: TransactionStatus;
|
|
73
73
|
transactionHash: null;
|
|
74
74
|
receipt: null;
|
|
@@ -108,7 +108,7 @@ declare class EscrowInteraction extends Errors {
|
|
|
108
108
|
receipt: null;
|
|
109
109
|
executed_at: Date;
|
|
110
110
|
error: {
|
|
111
|
-
name: "ContractBusy" | "ContractPaused" | "
|
|
111
|
+
name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "ExceedsLimit" | "ExceedsMax" | "UnknownError" | "InvalidNonce" | "TimelockConfigGroupNotSet" | "ConfigGroupNotSet" | "TimelockConfigNotSet" | "CommitmentNotFound" | "AlreadyCreatedTransaction" | "AccountAlreadyHasSignerRole" | "InvalidOperation" | "InvalidConfig" | "InvalidSignatures" | "AdminMultisigConfigNotSet" | "MultisigConfigNotSet" | "RequireTreasuryReceiverRole" | "InvalidMultiSig" | "RequireMultiSig" | "TimelockNotExpired" | "InsufficientExecutiveSigs" | "InsufficientManagerSigs" | "InvalidMultiSigForRequest" | "InsufficientManagerSigsForRequest" | "InsufficientExecutiveSigsForRequest";
|
|
112
112
|
message: string;
|
|
113
113
|
data?: any;
|
|
114
114
|
};
|
|
@@ -124,6 +124,16 @@ declare class EscrowInteraction extends Errors {
|
|
|
124
124
|
feePerTxUsd?: undefined;
|
|
125
125
|
feePerTxUsdDecimals?: undefined;
|
|
126
126
|
}>;
|
|
127
|
+
execute_withdrawal(payload: ExecuteWithdrawalPayload): Promise<{
|
|
128
|
+
status: TransactionStatus;
|
|
129
|
+
transactionHash: string;
|
|
130
|
+
fee: bigint;
|
|
131
|
+
}>;
|
|
132
|
+
batch_execute_withdrawal(payload: ExecuteWithdrawalPayload[]): Promise<{
|
|
133
|
+
status: TransactionStatus;
|
|
134
|
+
transactionHash: string;
|
|
135
|
+
fee: bigint;
|
|
136
|
+
}>;
|
|
127
137
|
/**
|
|
128
138
|
* Entry point for withdraw, requires signer to be set
|
|
129
139
|
* @param amount Amount of tokens to withdraw in decimal format. e.g: 1.5 ETH
|
|
@@ -148,7 +158,7 @@ declare class EscrowInteraction extends Errors {
|
|
|
148
158
|
transactionHash: null;
|
|
149
159
|
receipt: null;
|
|
150
160
|
error: {
|
|
151
|
-
name: "ContractBusy" | "ContractPaused" | "
|
|
161
|
+
name: "ContractBusy" | "ContractPaused" | "InvalidSignature" | "SignatureAlreadyUsed" | "ZeroValue" | "ZeroAddress" | "RequestAlreadyFulfilled" | "EtherDirectTransferNotAllowed" | "DepositOnlyERC20" | "TokenNotAllowed" | "InsufficientBalance" | "InsufficientReserves" | "TransferError" | "NotAdmin" | "NotAuthorized" | "ExceedsLimit" | "ExceedsMax" | "UnknownError" | "InvalidNonce" | "TimelockConfigGroupNotSet" | "ConfigGroupNotSet" | "TimelockConfigNotSet" | "CommitmentNotFound" | "AlreadyCreatedTransaction" | "AccountAlreadyHasSignerRole" | "InvalidOperation" | "InvalidConfig" | "InvalidSignatures" | "AdminMultisigConfigNotSet" | "MultisigConfigNotSet" | "RequireTreasuryReceiverRole" | "InvalidMultiSig" | "RequireMultiSig" | "TimelockNotExpired" | "InsufficientExecutiveSigs" | "InsufficientManagerSigs" | "InvalidMultiSigForRequest" | "InsufficientManagerSigsForRequest" | "InsufficientExecutiveSigsForRequest";
|
|
152
162
|
message: string;
|
|
153
163
|
data?: any;
|
|
154
164
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Escrow.d.ts","sourceRoot":"","sources":["../../src/contracts/Escrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAqC,MAAM,EAA2B,MAAM,QAAQ,CAAC;AAG9G,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAqB,MAAM,gBAAgB,CAAC;AACpF,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAiB,kBAAkB,EAAiB,MAAM,EAAa,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Escrow.d.ts","sourceRoot":"","sources":["../../src/contracts/Escrow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAqC,MAAM,EAA2B,MAAM,QAAQ,CAAC;AAG9G,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAqB,MAAM,gBAAgB,CAAC;AACpF,OAAO,MAAM,MAAM,8BAA8B,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,oBAAoB,EAAiB,wBAAwB,EAAE,kBAAkB,EAAiB,MAAM,EAAa,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAGhM;;;GAGG;AACH,cAAM,iBAAkB,SAAQ,MAAM;IAClC,OAAO,CAAC,MAAM,CAAuB;IAC9B,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC;IACrC,OAAO,CAAC,QAAQ,CAAyB;IACzC,OAAO,CAAC,aAAa,CAAa;gBAEf,aAAa,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,EAAE,MAAM;IAU7E;;;OAGG;IACI,SAAS,CAAC,MAAM,EAAE,MAAM;IAK/B,uBAAuB;IAEvB;;;;OAIG;IACU,mBAAmB,CAAC,WAAW,EAAE,MAAM;IAYpD;;;;;OAKG;IACU,QAAQ,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAgBzD,uBAAuB;IAEV,WAAW,CAAC,OAAO,EAAE,kBAAkB;;;;;;;;;;;;;;;;;IAiCvC,eAAe,CAAC,OAAO,EAAE,sBAAsB,EAAE,EAAE,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;IA6BnE,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAatD,cAAc,CAAC,QAAQ,EAAE,oBAAoB,EAAE,EAAE,WAAW,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuEpE,kBAAkB,CAAC,OAAO,EAAE,wBAAwB;;;;;IAsBpD,wBAAwB,CAAC,OAAO,EAAE,wBAAwB,EAAE;;;;;IA2FzE;;;;;;;;OAQG;IACU,QAAQ,CACjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,eAAe,EAAE,MAAM,EACvB,SAAS,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE;;;;;;;;;;;;;;;;;YAyCpC,aAAa;YAiCb,aAAa;IA0C3B,iBAAiB,CAAC,KAAK,EAAE,WAAW;CAkBvC;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -97,7 +97,7 @@ class EscrowInteraction extends TransactionsErrors_1.default {
|
|
|
97
97
|
throw new Error("Signer not connected to contract.");
|
|
98
98
|
}
|
|
99
99
|
const tx = yield this.escrowContract.fundWallets(payload.wallets, payload.amount);
|
|
100
|
-
const receipt = yield tx.wait();
|
|
100
|
+
const receipt = yield tx.wait(this.CONFIRMATIONS);
|
|
101
101
|
if (!receipt)
|
|
102
102
|
throw new Error("Failed to send transaction");
|
|
103
103
|
return {
|
|
@@ -162,7 +162,8 @@ class EscrowInteraction extends TransactionsErrors_1.default {
|
|
|
162
162
|
}
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
|
-
|
|
165
|
+
/// Withdrawal requests with no timelock (no scheduling needed)
|
|
166
|
+
batch_withdraw(payloads, token_price) {
|
|
166
167
|
return __awaiter(this, void 0, void 0, function* () {
|
|
167
168
|
let success = [];
|
|
168
169
|
let failed = [];
|
|
@@ -184,7 +185,7 @@ class EscrowInteraction extends TransactionsErrors_1.default {
|
|
|
184
185
|
cancel
|
|
185
186
|
}
|
|
186
187
|
};
|
|
187
|
-
let tx = yield this.escrowContract.
|
|
188
|
+
let tx = yield this.escrowContract.batchWithdrawWithTimelock(payloads);
|
|
188
189
|
let receipt = yield tx.wait(this.CONFIRMATIONS);
|
|
189
190
|
if (!receipt)
|
|
190
191
|
throw new Error(this.UnexpectedError("Failed to retrieve transaction receipt"));
|
|
@@ -229,6 +230,113 @@ class EscrowInteraction extends TransactionsErrors_1.default {
|
|
|
229
230
|
}
|
|
230
231
|
});
|
|
231
232
|
}
|
|
233
|
+
// Execute a withdrawal that has a timelock (scheduling needed)
|
|
234
|
+
execute_withdrawal(payload) {
|
|
235
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
236
|
+
try {
|
|
237
|
+
if (!this.signer)
|
|
238
|
+
throw new Error("Signer not set");
|
|
239
|
+
const tx = yield this.escrowContract.executeWithdrawal(payload.committedAmount, payload.netAmount, payload.requestId, payload.tokenAddress, payload.receiverAddress, payload.executeAt);
|
|
240
|
+
const receipt = yield tx.wait(this.CONFIRMATIONS);
|
|
241
|
+
if (!receipt)
|
|
242
|
+
throw new Error(this.UnexpectedError("Failed to retrieve transaction receipt"));
|
|
243
|
+
return {
|
|
244
|
+
status: escrow_1.TransactionStatus.SUCCESS,
|
|
245
|
+
transactionHash: tx.hash,
|
|
246
|
+
fee: receipt.fee,
|
|
247
|
+
};
|
|
248
|
+
}
|
|
249
|
+
catch (e) {
|
|
250
|
+
const errorResult = this.decodeRevertError(e);
|
|
251
|
+
throw errorResult;
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
// Execute a withdrawal that has a timelock (scheduling needed)
|
|
256
|
+
batch_execute_withdrawal(payload) {
|
|
257
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
258
|
+
try {
|
|
259
|
+
if (!this.signer)
|
|
260
|
+
throw new Error("Signer not set");
|
|
261
|
+
const tx = yield this.escrowContract.batchExecuteWithdrawal(payload);
|
|
262
|
+
const receipt = yield tx.wait(this.CONFIRMATIONS);
|
|
263
|
+
if (!receipt)
|
|
264
|
+
throw new Error(this.UnexpectedError("Failed to retrieve transaction receipt"));
|
|
265
|
+
return {
|
|
266
|
+
status: escrow_1.TransactionStatus.SUCCESS,
|
|
267
|
+
transactionHash: tx.hash,
|
|
268
|
+
fee: receipt.fee,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
catch (e) {
|
|
272
|
+
const errorResult = this.decodeRevertError(e);
|
|
273
|
+
throw errorResult;
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
// public async admin_batch_withdraw(payloads: BatchWithdrawPayload[], token_price: number) {
|
|
278
|
+
// let success: number[] = [];
|
|
279
|
+
// let failed: number[] = [];
|
|
280
|
+
// let dropped: number[] = [];
|
|
281
|
+
// let cancel: number[] = [];
|
|
282
|
+
// const executed_at = new Date();
|
|
283
|
+
// try {
|
|
284
|
+
// if (!this.signer) throw new Error("Signer not set");
|
|
285
|
+
// if (!payloads.length) return {
|
|
286
|
+
// status: TransactionStatus.FAILED,
|
|
287
|
+
// transactionHash: null,
|
|
288
|
+
// receipt: null,
|
|
289
|
+
// data: {
|
|
290
|
+
// success,
|
|
291
|
+
// failed,
|
|
292
|
+
// dropped,
|
|
293
|
+
// cancel
|
|
294
|
+
// }
|
|
295
|
+
// }
|
|
296
|
+
// let tx = await this.escrowContract.batch_withdraw(payloads);
|
|
297
|
+
// let receipt = await tx.wait(this.CONFIRMATIONS);
|
|
298
|
+
// if (!receipt) throw new Error(this.UnexpectedError("Failed to retrieve transaction receipt"));
|
|
299
|
+
// success = payloads.map(p => p.requestId);
|
|
300
|
+
// const fee_per_transaction = receipt.fee / BigInt(payloads.length);
|
|
301
|
+
// const fee_per_tx_decimals = parseFloat(formatEther(fee_per_transaction));
|
|
302
|
+
// const fee_per_tx_usd_decimals = fee_per_tx_decimals * token_price;
|
|
303
|
+
// const fee_per_tx_usd = parseUnits(fee_per_tx_decimals.toFixed(5), 6);
|
|
304
|
+
// return {
|
|
305
|
+
// status: TransactionStatus.SUCCESS,
|
|
306
|
+
// transactionHash: tx.hash,
|
|
307
|
+
// fee: receipt.fee,
|
|
308
|
+
// feePerTx: fee_per_transaction,
|
|
309
|
+
// feePerTxDecimals: fee_per_tx_decimals,
|
|
310
|
+
// feePerTxUsd: fee_per_tx_usd,
|
|
311
|
+
// feePerTxUsdDecimals: fee_per_tx_usd_decimals,
|
|
312
|
+
// receipt,
|
|
313
|
+
// executed_at,
|
|
314
|
+
// data: {
|
|
315
|
+
// success,
|
|
316
|
+
// failed,
|
|
317
|
+
// dropped,
|
|
318
|
+
// cancel
|
|
319
|
+
// }
|
|
320
|
+
// }
|
|
321
|
+
// } catch (e) {
|
|
322
|
+
// const errorResult = this.decodeRevertError(e as ErrorObject);
|
|
323
|
+
// return {
|
|
324
|
+
// status: TransactionStatus.FAILED,
|
|
325
|
+
// transactionHash: null,
|
|
326
|
+
// receipt: null,
|
|
327
|
+
// executed_at,
|
|
328
|
+
// error: {
|
|
329
|
+
// ...errorResult
|
|
330
|
+
// },
|
|
331
|
+
// data: {
|
|
332
|
+
// success,
|
|
333
|
+
// failed,
|
|
334
|
+
// dropped,
|
|
335
|
+
// cancel
|
|
336
|
+
// }
|
|
337
|
+
// };
|
|
338
|
+
// }
|
|
339
|
+
// }
|
|
232
340
|
/**
|
|
233
341
|
* Entry point for withdraw, requires signer to be set
|
|
234
342
|
* @param amount Amount of tokens to withdraw in decimal format. e.g: 1.5 ETH
|
|
@@ -341,7 +449,7 @@ class EscrowInteraction extends TransactionsErrors_1.default {
|
|
|
341
449
|
}
|
|
342
450
|
decodeRevertError(error) {
|
|
343
451
|
// Decode error data
|
|
344
|
-
if (error.data) {
|
|
452
|
+
if (error.data && error.data !== "0x") {
|
|
345
453
|
const decodedError = this.escrowContract.interface.parseError(error.data);
|
|
346
454
|
if (decodedError) {
|
|
347
455
|
// Decoded error
|