@ercworldio/blockchain-shared 1.0.5-dev.8-PLAT304.1 → 1.0.5-dev.8-PLAT304.3

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.
Files changed (26) hide show
  1. package/build/chains/networks_dev.json +2 -1
  2. package/build/contracts/contract-events/EscrowEvents.d.ts +16 -2
  3. package/build/contracts/contract-events/EscrowEvents.d.ts.map +1 -1
  4. package/build/contracts/contract-events/EscrowEvents.js +5 -0
  5. package/build/contracts/contract-events/types/events.d.ts +5 -1
  6. package/build/contracts/contract-events/types/events.d.ts.map +1 -1
  7. package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts +15 -1
  8. package/build/contracts/typechain-types/contracts/escrow/Escrow.d.ts.map +1 -1
  9. package/build/contracts/typechain-types/contracts/lib/Events.d.ts +15 -1
  10. package/build/contracts/typechain-types/contracts/lib/Events.d.ts.map +1 -1
  11. package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts +11 -1
  12. package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.d.ts.map +1 -1
  13. package/build/contracts/typechain-types/factories/contracts/escrow/Escrow__factory.js +14 -1
  14. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts +11 -1
  15. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.d.ts.map +1 -1
  16. package/build/contracts/typechain-types/factories/contracts/lib/Events__factory.js +14 -1
  17. package/build/services/AzureEventHubHandler.d.ts.map +1 -1
  18. package/build/services/AzureEventHubHandler.js +4 -1
  19. package/build/services/db/multisig/MultisigService.js +1 -1
  20. package/build/services/solana/escrow/idl/escrow.json +528 -17
  21. package/build/services/solana/escrow/types/escrow.d.ts +528 -17
  22. package/build/services/solana/escrow/types/escrow.d.ts.map +1 -1
  23. package/build/services/types/azure_event_hub_handler.d.ts +3 -1
  24. package/build/services/types/azure_event_hub_handler.d.ts.map +1 -1
  25. package/build/services/types/azure_event_hub_handler.js +3 -0
  26. package/package.json +1 -1
@@ -204,7 +204,7 @@ class MultisigService {
204
204
  */
205
205
  static fn_create_admin_withdrawal_request(pool, blockchain, chainId, escrow_address, amount, amount_decimals, token_address, receiver_address, admin_user_id) {
206
206
  return __awaiter(this, void 0, void 0, function* () {
207
- const result = yield pool.query(`SELECT multisig.fn_create_admin_withdrawal_request($1::varchar,$2::varchar,$3::varchar,$4::numeric,$5::numeric,$6::varchar,$7::varchar,$8::bigint)`, [blockchain, chainId, escrow_address, amount, amount_decimals, token_address, receiver_address, admin_user_id]);
207
+ const result = yield pool.query(`SELECT multisig.fn_create_admin_withdrawal_request($1::varchar,$2::varchar,$3::varchar,$4::numeric,$5::numeric,$6::varchar,$7::varchar,$8::varchar)`, [blockchain, chainId, escrow_address, amount, amount_decimals, token_address, receiver_address, admin_user_id.toString()]);
208
208
  if (!result)
209
209
  throw new Error(`DB FN error: multisig.fn_create_admin_withdrawal_request()`);
210
210
  return result.rows[0].fn_create_admin_withdrawal_request;
@@ -62,6 +62,188 @@
62
62
  }
63
63
  ]
64
64
  },
65
+ {
66
+ "name": "add_admin_treasury_executive",
67
+ "discriminator": [
68
+ 19,
69
+ 201,
70
+ 206,
71
+ 150,
72
+ 205,
73
+ 172,
74
+ 131,
75
+ 126
76
+ ],
77
+ "accounts": [
78
+ {
79
+ "name": "escrow_config",
80
+ "pda": {
81
+ "seeds": [
82
+ {
83
+ "kind": "const",
84
+ "value": [
85
+ 101,
86
+ 115,
87
+ 99,
88
+ 114,
89
+ 111,
90
+ 119,
91
+ 45,
92
+ 99,
93
+ 111,
94
+ 110,
95
+ 102,
96
+ 105,
97
+ 103,
98
+ 45,
99
+ 118,
100
+ 50
101
+ ]
102
+ }
103
+ ]
104
+ }
105
+ },
106
+ {
107
+ "name": "admin_treasury_roles",
108
+ "writable": true,
109
+ "pda": {
110
+ "seeds": [
111
+ {
112
+ "kind": "const",
113
+ "value": [
114
+ 97,
115
+ 100,
116
+ 109,
117
+ 105,
118
+ 110,
119
+ 45,
120
+ 116,
121
+ 114,
122
+ 101,
123
+ 97,
124
+ 115,
125
+ 117,
126
+ 114,
127
+ 121,
128
+ 45,
129
+ 114,
130
+ 111,
131
+ 108,
132
+ 101,
133
+ 115
134
+ ]
135
+ }
136
+ ]
137
+ }
138
+ },
139
+ {
140
+ "name": "admin",
141
+ "writable": true,
142
+ "signer": true
143
+ },
144
+ {
145
+ "name": "system_program",
146
+ "address": "11111111111111111111111111111111"
147
+ }
148
+ ],
149
+ "args": [
150
+ {
151
+ "name": "pubkey",
152
+ "type": "pubkey"
153
+ }
154
+ ]
155
+ },
156
+ {
157
+ "name": "add_admin_treasury_manager",
158
+ "discriminator": [
159
+ 68,
160
+ 147,
161
+ 56,
162
+ 98,
163
+ 60,
164
+ 102,
165
+ 81,
166
+ 38
167
+ ],
168
+ "accounts": [
169
+ {
170
+ "name": "escrow_config",
171
+ "pda": {
172
+ "seeds": [
173
+ {
174
+ "kind": "const",
175
+ "value": [
176
+ 101,
177
+ 115,
178
+ 99,
179
+ 114,
180
+ 111,
181
+ 119,
182
+ 45,
183
+ 99,
184
+ 111,
185
+ 110,
186
+ 102,
187
+ 105,
188
+ 103,
189
+ 45,
190
+ 118,
191
+ 50
192
+ ]
193
+ }
194
+ ]
195
+ }
196
+ },
197
+ {
198
+ "name": "admin_treasury_roles",
199
+ "writable": true,
200
+ "pda": {
201
+ "seeds": [
202
+ {
203
+ "kind": "const",
204
+ "value": [
205
+ 97,
206
+ 100,
207
+ 109,
208
+ 105,
209
+ 110,
210
+ 45,
211
+ 116,
212
+ 114,
213
+ 101,
214
+ 97,
215
+ 115,
216
+ 117,
217
+ 114,
218
+ 121,
219
+ 45,
220
+ 114,
221
+ 111,
222
+ 108,
223
+ 101,
224
+ 115
225
+ ]
226
+ }
227
+ ]
228
+ }
229
+ },
230
+ {
231
+ "name": "admin",
232
+ "writable": true,
233
+ "signer": true
234
+ },
235
+ {
236
+ "name": "system_program",
237
+ "address": "11111111111111111111111111111111"
238
+ }
239
+ ],
240
+ "args": [
241
+ {
242
+ "name": "pubkey",
243
+ "type": "pubkey"
244
+ }
245
+ ]
246
+ },
65
247
  {
66
248
  "name": "add_config_executive",
67
249
  "discriminator": [
@@ -1218,12 +1400,18 @@
1218
1400
  }
1219
1401
  },
1220
1402
  {
1221
- "name": "treasury_config",
1403
+ "name": "admin_treasury_roles",
1222
1404
  "pda": {
1223
1405
  "seeds": [
1224
1406
  {
1225
1407
  "kind": "const",
1226
1408
  "value": [
1409
+ 97,
1410
+ 100,
1411
+ 109,
1412
+ 105,
1413
+ 110,
1414
+ 45,
1227
1415
  116,
1228
1416
  114,
1229
1417
  101,
@@ -1233,12 +1421,11 @@
1233
1421
  114,
1234
1422
  121,
1235
1423
  45,
1236
- 99,
1424
+ 114,
1237
1425
  111,
1238
- 110,
1239
- 102,
1240
- 105,
1241
- 103
1426
+ 108,
1427
+ 101,
1428
+ 115
1242
1429
  ]
1243
1430
  }
1244
1431
  ]
@@ -1454,12 +1641,18 @@
1454
1641
  "name": "mint"
1455
1642
  },
1456
1643
  {
1457
- "name": "treasury_config",
1644
+ "name": "admin_treasury_roles",
1458
1645
  "pda": {
1459
1646
  "seeds": [
1460
1647
  {
1461
1648
  "kind": "const",
1462
1649
  "value": [
1650
+ 97,
1651
+ 100,
1652
+ 109,
1653
+ 105,
1654
+ 110,
1655
+ 45,
1463
1656
  116,
1464
1657
  114,
1465
1658
  101,
@@ -1469,12 +1662,11 @@
1469
1662
  114,
1470
1663
  121,
1471
1664
  45,
1472
- 99,
1665
+ 114,
1473
1666
  111,
1474
- 110,
1475
- 102,
1476
- 105,
1477
- 103
1667
+ 108,
1668
+ 101,
1669
+ 115
1478
1670
  ]
1479
1671
  }
1480
1672
  ]
@@ -3697,6 +3889,92 @@
3697
3889
  "args": [],
3698
3890
  "returns": "u64"
3699
3891
  },
3892
+ {
3893
+ "name": "initialize_admin_treasury_roles",
3894
+ "discriminator": [
3895
+ 145,
3896
+ 145,
3897
+ 154,
3898
+ 38,
3899
+ 140,
3900
+ 204,
3901
+ 170,
3902
+ 127
3903
+ ],
3904
+ "accounts": [
3905
+ {
3906
+ "name": "escrow_config",
3907
+ "pda": {
3908
+ "seeds": [
3909
+ {
3910
+ "kind": "const",
3911
+ "value": [
3912
+ 101,
3913
+ 115,
3914
+ 99,
3915
+ 114,
3916
+ 111,
3917
+ 119,
3918
+ 45,
3919
+ 99,
3920
+ 111,
3921
+ 110,
3922
+ 102,
3923
+ 105,
3924
+ 103,
3925
+ 45,
3926
+ 118,
3927
+ 50
3928
+ ]
3929
+ }
3930
+ ]
3931
+ }
3932
+ },
3933
+ {
3934
+ "name": "admin_treasury_roles",
3935
+ "writable": true,
3936
+ "pda": {
3937
+ "seeds": [
3938
+ {
3939
+ "kind": "const",
3940
+ "value": [
3941
+ 97,
3942
+ 100,
3943
+ 109,
3944
+ 105,
3945
+ 110,
3946
+ 45,
3947
+ 116,
3948
+ 114,
3949
+ 101,
3950
+ 97,
3951
+ 115,
3952
+ 117,
3953
+ 114,
3954
+ 121,
3955
+ 45,
3956
+ 114,
3957
+ 111,
3958
+ 108,
3959
+ 101,
3960
+ 115
3961
+ ]
3962
+ }
3963
+ ]
3964
+ }
3965
+ },
3966
+ {
3967
+ "name": "admin",
3968
+ "writable": true,
3969
+ "signer": true
3970
+ },
3971
+ {
3972
+ "name": "system_program",
3973
+ "address": "11111111111111111111111111111111"
3974
+ }
3975
+ ],
3976
+ "args": []
3977
+ },
3700
3978
  {
3701
3979
  "name": "initialize_escrow_config",
3702
3980
  "discriminator": [
@@ -4370,6 +4648,180 @@
4370
4648
  }
4371
4649
  ]
4372
4650
  },
4651
+ {
4652
+ "name": "remove_admin_treasury_executive",
4653
+ "discriminator": [
4654
+ 245,
4655
+ 211,
4656
+ 237,
4657
+ 57,
4658
+ 23,
4659
+ 70,
4660
+ 97,
4661
+ 168
4662
+ ],
4663
+ "accounts": [
4664
+ {
4665
+ "name": "escrow_config",
4666
+ "pda": {
4667
+ "seeds": [
4668
+ {
4669
+ "kind": "const",
4670
+ "value": [
4671
+ 101,
4672
+ 115,
4673
+ 99,
4674
+ 114,
4675
+ 111,
4676
+ 119,
4677
+ 45,
4678
+ 99,
4679
+ 111,
4680
+ 110,
4681
+ 102,
4682
+ 105,
4683
+ 103,
4684
+ 45,
4685
+ 118,
4686
+ 50
4687
+ ]
4688
+ }
4689
+ ]
4690
+ }
4691
+ },
4692
+ {
4693
+ "name": "admin_treasury_roles",
4694
+ "writable": true,
4695
+ "pda": {
4696
+ "seeds": [
4697
+ {
4698
+ "kind": "const",
4699
+ "value": [
4700
+ 97,
4701
+ 100,
4702
+ 109,
4703
+ 105,
4704
+ 110,
4705
+ 45,
4706
+ 116,
4707
+ 114,
4708
+ 101,
4709
+ 97,
4710
+ 115,
4711
+ 117,
4712
+ 114,
4713
+ 121,
4714
+ 45,
4715
+ 114,
4716
+ 111,
4717
+ 108,
4718
+ 101,
4719
+ 115
4720
+ ]
4721
+ }
4722
+ ]
4723
+ }
4724
+ },
4725
+ {
4726
+ "name": "admin",
4727
+ "writable": true,
4728
+ "signer": true
4729
+ }
4730
+ ],
4731
+ "args": [
4732
+ {
4733
+ "name": "pubkey",
4734
+ "type": "pubkey"
4735
+ }
4736
+ ]
4737
+ },
4738
+ {
4739
+ "name": "remove_admin_treasury_manager",
4740
+ "discriminator": [
4741
+ 255,
4742
+ 44,
4743
+ 160,
4744
+ 215,
4745
+ 194,
4746
+ 194,
4747
+ 237,
4748
+ 228
4749
+ ],
4750
+ "accounts": [
4751
+ {
4752
+ "name": "escrow_config",
4753
+ "pda": {
4754
+ "seeds": [
4755
+ {
4756
+ "kind": "const",
4757
+ "value": [
4758
+ 101,
4759
+ 115,
4760
+ 99,
4761
+ 114,
4762
+ 111,
4763
+ 119,
4764
+ 45,
4765
+ 99,
4766
+ 111,
4767
+ 110,
4768
+ 102,
4769
+ 105,
4770
+ 103,
4771
+ 45,
4772
+ 118,
4773
+ 50
4774
+ ]
4775
+ }
4776
+ ]
4777
+ }
4778
+ },
4779
+ {
4780
+ "name": "admin_treasury_roles",
4781
+ "writable": true,
4782
+ "pda": {
4783
+ "seeds": [
4784
+ {
4785
+ "kind": "const",
4786
+ "value": [
4787
+ 97,
4788
+ 100,
4789
+ 109,
4790
+ 105,
4791
+ 110,
4792
+ 45,
4793
+ 116,
4794
+ 114,
4795
+ 101,
4796
+ 97,
4797
+ 115,
4798
+ 117,
4799
+ 114,
4800
+ 121,
4801
+ 45,
4802
+ 114,
4803
+ 111,
4804
+ 108,
4805
+ 101,
4806
+ 115
4807
+ ]
4808
+ }
4809
+ ]
4810
+ }
4811
+ },
4812
+ {
4813
+ "name": "admin",
4814
+ "writable": true,
4815
+ "signer": true
4816
+ }
4817
+ ],
4818
+ "args": [
4819
+ {
4820
+ "name": "pubkey",
4821
+ "type": "pubkey"
4822
+ }
4823
+ ]
4824
+ },
4373
4825
  {
4374
4826
  "name": "remove_config_executive",
4375
4827
  "discriminator": [
@@ -7156,6 +7608,19 @@
7156
7608
  }
7157
7609
  ],
7158
7610
  "accounts": [
7611
+ {
7612
+ "name": "AdminTreasuryRoles",
7613
+ "discriminator": [
7614
+ 133,
7615
+ 108,
7616
+ 246,
7617
+ 222,
7618
+ 12,
7619
+ 121,
7620
+ 141,
7621
+ 177
7622
+ ]
7623
+ },
7159
7624
  {
7160
7625
  "name": "AdminWithdrawConfig",
7161
7626
  "discriminator": [
@@ -7794,6 +8259,11 @@
7794
8259
  "code": 6035,
7795
8260
  "name": "ReceiverNotWhitelisted",
7796
8261
  "msg": "Receiver is not whitelisted for admin withdrawals"
8262
+ },
8263
+ {
8264
+ "code": 6036,
8265
+ "name": "AdminTreasuryRolesNotInitialized",
8266
+ "msg": "Admin treasury roles not initialized"
7797
8267
  }
7798
8268
  ],
7799
8269
  "types": [
@@ -7879,6 +8349,41 @@
7879
8349
  ]
7880
8350
  }
7881
8351
  },
8352
+ {
8353
+ "name": "AdminTreasuryRoles",
8354
+ "docs": [
8355
+ "Signer rosters for **admin withdrawal** approvals — mirrors EVM's distinct",
8356
+ "`ADMIN_TREASURY_MANAGER_ROLE` / `ADMIN_TREASURY_EXECUTIVE_ROLE` signer groups, kept separate from",
8357
+ "the `TreasuryConfig` roster that approves *user* withdrawals (they are different people/quorums).",
8358
+ "",
8359
+ "The required counts live in `AdminWithdrawConfig` (single fixed level, no amount bands). The",
8360
+ "admin's wallet composes `[Ed25519 sig ixs] + [admin_withdraw_*_v2 ix]` and the instruction verifies",
8361
+ "the collected signatures against these rosters. Unbounded: adding a member grows the account.",
8362
+ "",
8363
+ "PDA seeds: [b\"admin-treasury-roles\"]."
8364
+ ],
8365
+ "type": {
8366
+ "kind": "struct",
8367
+ "fields": [
8368
+ {
8369
+ "name": "admin_treasury_managers",
8370
+ "type": {
8371
+ "vec": "pubkey"
8372
+ }
8373
+ },
8374
+ {
8375
+ "name": "admin_treasury_executives",
8376
+ "type": {
8377
+ "vec": "pubkey"
8378
+ }
8379
+ },
8380
+ {
8381
+ "name": "is_initialized",
8382
+ "type": "bool"
8383
+ }
8384
+ ]
8385
+ }
8386
+ },
7882
8387
  {
7883
8388
  "name": "AdminWithdraw",
7884
8389
  "type": {
@@ -7914,11 +8419,11 @@
7914
8419
  {
7915
8420
  "name": "AdminWithdrawConfig",
7916
8421
  "docs": [
7917
- "Single, global (not per-token) execution threshold for the interim pull-based admin withdrawal",
7918
- "(mirrors EVM's `adminTokenThresholdSettings` — one fixed level, no amount bands). Signatures are",
7919
- "verified against the existing `TreasuryConfig` roster (the same managers/executives who approve",
7920
- "regular withdrawals) rather than a separate admin-only rostersee the plan doc for why this is",
7921
- "a deliberate scope simplification vs EVM's distinct ADMIN_TREASURY_MANAGER/EXECUTIVE roles.",
8422
+ "Single, global (not per-token) execution threshold for the pull-based admin withdrawal (mirrors",
8423
+ "EVM's `adminTokenThresholdSettings` — one fixed level, no amount bands). Signatures are verified",
8424
+ "against the dedicated `AdminTreasuryRoles` roster (`ADMIN_TREASURY_MANAGER` / `_EXECUTIVE`),",
8425
+ "mirroring EVM's distinct admin-treasury signer groups kept separate from the `TreasuryConfig`",
8426
+ "roster that approves regular user withdrawals.",
7922
8427
  "",
7923
8428
  "PDA seeds: `[b\"admin-withdraw-config\"]`."
7924
8429
  ],
@@ -8403,6 +8908,12 @@
8403
8908
  },
8404
8909
  {
8405
8910
  "name": "TreasuryReceiver"
8911
+ },
8912
+ {
8913
+ "name": "AdminTreasuryManager"
8914
+ },
8915
+ {
8916
+ "name": "AdminTreasuryExecutive"
8406
8917
  }
8407
8918
  ]
8408
8919
  }