Skip to content

Commit 61cbefe

Browse files
aledefrawzrdx
andauthored
feat: implement escrow delegate management with permissions (#36)
* feat: implement escrow delegate management with permissions * fix: delegates UI changes * feat: enhance escrow management with access fetching and state management * feat: limit actions based on permissions * fix: update getDelegatedAddresses * style: Improve EscrowDelegates design * fix: Small bugs and UX changes * style: Implement widthClasses in EscrowDelegates --------- Co-authored-by: wzrdx <128477299+wzrdx@users.noreply.github.com>
1 parent 2c03d1b commit 61cbefe

File tree

12 files changed

+1125
-27
lines changed

12 files changed

+1125
-27
lines changed

src/blockchain/CspEscrow.ts

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,69 @@ export const CspEscrowAbi = [
99
name: 'NotInitializing',
1010
type: 'error',
1111
},
12+
{
13+
anonymous: false,
14+
inputs: [
15+
{
16+
indexed: true,
17+
internalType: 'address',
18+
name: 'delegate',
19+
type: 'address',
20+
},
21+
{
22+
indexed: false,
23+
internalType: 'uint256',
24+
name: 'permissions',
25+
type: 'uint256',
26+
},
27+
],
28+
name: 'DelegatePermissionsUpdated',
29+
type: 'event',
30+
},
31+
{
32+
anonymous: false,
33+
inputs: [
34+
{
35+
indexed: true,
36+
internalType: 'address',
37+
name: 'delegate',
38+
type: 'address',
39+
},
40+
],
41+
name: 'DelegateRemoved',
42+
type: 'event',
43+
},
44+
{
45+
anonymous: false,
46+
inputs: [
47+
{
48+
indexed: true,
49+
internalType: 'uint256',
50+
name: 'jobId',
51+
type: 'uint256',
52+
},
53+
{
54+
indexed: false,
55+
internalType: 'uint256',
56+
name: 'oldJobType',
57+
type: 'uint256',
58+
},
59+
{
60+
indexed: false,
61+
internalType: 'uint256',
62+
name: 'newJobType',
63+
type: 'uint256',
64+
},
65+
{
66+
indexed: false,
67+
internalType: 'uint256',
68+
name: 'newPricePerEpoch',
69+
type: 'uint256',
70+
},
71+
],
72+
name: 'DeprecatedJobMigrated',
73+
type: 'event',
74+
},
1275
{
1376
anonymous: false,
1477
inputs: [
@@ -116,6 +179,31 @@ export const CspEscrowAbi = [
116179
name: 'JobDurationExtended',
117180
type: 'event',
118181
},
182+
{
183+
anonymous: false,
184+
inputs: [
185+
{
186+
indexed: true,
187+
internalType: 'uint256',
188+
name: 'jobId',
189+
type: 'uint256',
190+
},
191+
{
192+
indexed: false,
193+
internalType: 'uint256',
194+
name: 'oldLastExecutionEpoch',
195+
type: 'uint256',
196+
},
197+
{
198+
indexed: false,
199+
internalType: 'uint256',
200+
name: 'newLastExecutionEpoch',
201+
type: 'uint256',
202+
},
203+
],
204+
name: 'JobLastExecutionEpochReconciled',
205+
type: 'event',
206+
},
119207
{
120208
anonymous: false,
121209
inputs: [
@@ -627,6 +715,43 @@ export const CspEscrowAbi = [
627715
stateMutability: 'view',
628716
type: 'function',
629717
},
718+
{
719+
inputs: [
720+
{
721+
internalType: 'address',
722+
name: 'delegate',
723+
type: 'address',
724+
},
725+
],
726+
name: 'getDelegatePermissions',
727+
outputs: [
728+
{
729+
internalType: 'uint256',
730+
name: '',
731+
type: 'uint256',
732+
},
733+
],
734+
stateMutability: 'view',
735+
type: 'function',
736+
},
737+
{
738+
inputs: [],
739+
name: 'getDelegatedAddresses',
740+
outputs: [
741+
{
742+
internalType: 'address[]',
743+
name: '',
744+
type: 'address[]',
745+
},
746+
{
747+
internalType: 'uint256[]',
748+
name: '',
749+
type: 'uint256[]',
750+
},
751+
],
752+
stateMutability: 'view',
753+
type: 'function',
754+
},
630755
{
631756
inputs: [],
632757
name: 'getFirstClosableJobId',
@@ -910,6 +1035,13 @@ export const CspEscrowAbi = [
9101035
stateMutability: 'view',
9111036
type: 'function',
9121037
},
1038+
{
1039+
inputs: [],
1040+
name: 'reconcileAllJobs',
1041+
outputs: [],
1042+
stateMutability: 'nonpayable',
1043+
type: 'function',
1044+
},
9131045
{
9141046
inputs: [],
9151047
name: 'reconcileJobsBalance',
@@ -930,6 +1062,37 @@ export const CspEscrowAbi = [
9301062
stateMutability: 'nonpayable',
9311063
type: 'function',
9321064
},
1065+
{
1066+
inputs: [
1067+
{
1068+
internalType: 'address',
1069+
name: 'delegate',
1070+
type: 'address',
1071+
},
1072+
],
1073+
name: 'removeDelegate',
1074+
outputs: [],
1075+
stateMutability: 'nonpayable',
1076+
type: 'function',
1077+
},
1078+
{
1079+
inputs: [
1080+
{
1081+
internalType: 'address',
1082+
name: 'delegate',
1083+
type: 'address',
1084+
},
1085+
{
1086+
internalType: 'uint256',
1087+
name: 'permissions',
1088+
type: 'uint256',
1089+
},
1090+
],
1091+
name: 'setDelegatePermissions',
1092+
outputs: [],
1093+
stateMutability: 'nonpayable',
1094+
type: 'function',
1095+
},
9331096
{
9341097
inputs: [],
9351098
name: 'uniswapV2Pair',

0 commit comments

Comments
 (0)