@ozdao/prometheus-framework 0.2.89 → 0.2.91
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/auth.server.js +1 -0
- package/dist/auth.server.mjs +1 -0
- package/dist/main-BQisDfLk.js +92 -0
- package/dist/main-BV1Yv9Hy.js +92 -0
- package/dist/main-DTlUA63C.mjs +13617 -0
- package/dist/main-DmNP-t33.mjs +13625 -0
- package/dist/main.css +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +748 -750
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.cjs +1 -1
- package/dist/node_modules/embla-carousel-autoplay/esm/embla-carousel-autoplay.esm.js +40 -39
- package/dist/node_modules/web3/lib/esm/index.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/index.js +42 -41
- package/dist/node_modules/web3/lib/esm/version.cjs +1 -1
- package/dist/node_modules/web3/lib/esm/version.js +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.cjs +1 -1
- package/dist/node_modules/web3-eth/lib/esm/schemas.js +113 -88
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.cjs +3 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/contract.js +242 -217
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.cjs +1 -1
- package/dist/node_modules/web3-eth-contract/lib/esm/encoding.js +43 -37
- package/dist/node_modules/web3-eth-ens/lib/esm/config.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/config.js +3 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/ens.js +34 -13
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.cjs +1 -1
- package/dist/node_modules/web3-eth-ens/lib/esm/resolver.js +48 -36
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/chunk_response_parser.js +2 -2
- package/dist/node_modules/web3-utils/lib/esm/converters.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/converters.js +52 -50
- package/dist/node_modules/web3-utils/lib/esm/uint8array.cjs +1 -1
- package/dist/node_modules/web3-utils/lib/esm/uint8array.js +13 -13
- package/dist/node_modules/web3-validator/lib/esm/utils.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/utils.js +76 -87
- package/dist/node_modules/web3-validator/lib/esm/validator.cjs +1 -1
- package/dist/node_modules/web3-validator/lib/esm/validator.js +49 -47
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.cjs +1 -1
- package/dist/prometheus-framework/node_modules/@capacitor/core/dist/index.js +168 -158
- package/dist/prometheus-framework/src/components/Button/Button.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue.js +94 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Button/Button.vue2.js +1 -102
- package/dist/prometheus-framework/src/components/Field/Field.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue.js +84 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Field/Field.vue2.js +1 -84
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldBig/FieldBig.vue.js +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/FieldPhone/FieldPhone.vue.js +17 -16
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue.js +73 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/components/Popup/Popup.vue2.js +1 -73
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/layouts/Auth.vue.js +9 -8
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterCode.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/EnterPassword.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/Invite.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/ResetPassword.vue.js +28 -29
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignIn.vue.js +65 -65
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/components/pages/SignUp.vue.js +38 -39
- package/dist/prometheus-framework/src/modules/auth/store/auth.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/auth.js +35 -37
- package/dist/prometheus-framework/src/modules/auth/store/twofa.cjs +1 -1
- package/dist/prometheus-framework/src/modules/auth/store/twofa.js +3 -3
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/backoffice/components/pages/Dashboard.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/Community.vue.js +11 -10
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/pages/CreateBlogPost.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/community/components/sections/HotPosts.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/constructor/components/elements/Embed.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonCheck.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/elements/ButtonJoin.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEvent.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/events/components/pages/EditEventTickets.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/BackofficeGallery.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/gallery/components/sections/GalleryWithCategories.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/BlockSearch.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/globals/components/blocks/CardHeader.vue.js +4 -3
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/legal/components/pages/Legal.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.cjs +1 -1
- package/dist/prometheus-framework/src/modules/middlewares/client/inputs.validation.js +10 -13
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue.js +13 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.cjs +1 -1
- package/dist/prometheus-framework/src/modules/mobile/components/Menu/Menu.vue2.js +1 -13
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/pages/OrderCreateBackoffice.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormAddCustomer.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormCustomerDetails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/orders/components/sections/FormDelivery.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/blocks/DepartmentMemberModify.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/elements/ButtonToggleMembership.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/DepartmentEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Members.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/Organization.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/pages/OrganizationEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Documents.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/MembersAdd.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/organizations/components/sections/Organizations.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/CardPosition.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ImagesThumbnails.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/LeftoverPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/blocks/ListPositions.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Categories.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/CategoryEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/EditLeftover.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/Product.vue.js +20 -25
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/pages/ProductEdit.vue.js +3 -3
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditModifications.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/EditProductInfo.vue.js +8 -7
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/products/components/sections/SectionProduct.vue.js +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/reports/components/sections/FormReport.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/Profile.vue.js +6 -5
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/users/components/pages/ProfileEdit.vue.js +2 -2
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.cjs +1 -1
- package/dist/prometheus-framework/src/modules/wallet/views/components/pages/Wallet.vue.js +5 -4
- package/dist/prometheus-framework.cjs.js +1 -1
- package/dist/prometheus-framework.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/web-Bk_OtXgv.js +1 -0
- package/dist/web-CXzcKdk4.mjs +54 -0
- package/dist/web-D9Cfcy5k.js +1 -0
- package/dist/web-VFuzUsNl.mjs +54 -0
- package/package.json +1 -1
- package/src/components/Button/Button.vue +5 -8
- package/src/components/FieldPhone/FieldPhone.vue +4 -0
- package/src/modules/auth/components/pages/ResetPassword.vue +1 -1
- package/src/modules/auth/components/pages/SignIn.vue +3 -3
- package/src/modules/auth/components/pages/SignUp.vue +1 -1
- package/src/modules/auth/controllers/auth.controller.js +1 -0
- package/src/modules/auth/store/auth.js +3 -5
- package/src/modules/auth/store/twofa.js +1 -1
- package/src/modules/middlewares/client/inputs.validation.js +0 -13
@@ -1,4 +1,4 @@
|
|
1
|
-
const
|
1
|
+
const s = {
|
2
2
|
type: "object",
|
3
3
|
properties: {
|
4
4
|
address: {
|
@@ -13,7 +13,7 @@ const r = {
|
|
13
13
|
}
|
14
14
|
}, t = {
|
15
15
|
type: "array",
|
16
|
-
items: Object.assign({},
|
16
|
+
items: Object.assign({}, s)
|
17
17
|
}, c = {
|
18
18
|
type: "object",
|
19
19
|
properties: {
|
@@ -44,7 +44,7 @@ const r = {
|
|
44
44
|
"spuriousDragon",
|
45
45
|
"tangerineWhistle"
|
46
46
|
]
|
47
|
-
},
|
47
|
+
}, o = {
|
48
48
|
type: "object",
|
49
49
|
properties: {
|
50
50
|
name: {
|
@@ -57,7 +57,7 @@ const r = {
|
|
57
57
|
format: "uint"
|
58
58
|
}
|
59
59
|
}
|
60
|
-
},
|
60
|
+
}, m = {
|
61
61
|
type: "object",
|
62
62
|
properties: {
|
63
63
|
from: {
|
@@ -108,7 +108,7 @@ const r = {
|
|
108
108
|
common: {
|
109
109
|
type: "object",
|
110
110
|
properties: {
|
111
|
-
customChain: Object.assign({},
|
111
|
+
customChain: Object.assign({}, o),
|
112
112
|
baseChain: Object.assign({}, a),
|
113
113
|
hardfork: Object.assign({}, e)
|
114
114
|
}
|
@@ -126,9 +126,9 @@ const r = {
|
|
126
126
|
format: "bytes32"
|
127
127
|
}
|
128
128
|
}
|
129
|
-
},
|
129
|
+
}, i = {
|
130
130
|
type: "object",
|
131
|
-
properties: Object.assign(Object.assign({},
|
131
|
+
properties: Object.assign(Object.assign({}, m.properties), { blockHash: {
|
132
132
|
format: "bytes32"
|
133
133
|
}, blockNumber: {
|
134
134
|
format: "uint"
|
@@ -169,46 +169,53 @@ const r = {
|
|
169
169
|
}, s: {
|
170
170
|
format: "bytes32"
|
171
171
|
} })
|
172
|
-
},
|
172
|
+
}, r = {
|
173
173
|
type: "object",
|
174
174
|
properties: {
|
175
|
-
|
176
|
-
format: "
|
177
|
-
},
|
178
|
-
sha3Uncles: {
|
179
|
-
format: "bytes32"
|
180
|
-
},
|
181
|
-
miner: {
|
182
|
-
format: "bytes"
|
175
|
+
index: {
|
176
|
+
format: "uint"
|
183
177
|
},
|
184
|
-
|
185
|
-
format: "
|
178
|
+
validatorIndex: {
|
179
|
+
format: "uint"
|
186
180
|
},
|
187
|
-
|
188
|
-
format: "
|
181
|
+
address: {
|
182
|
+
format: "address"
|
189
183
|
},
|
190
|
-
|
191
|
-
format: "
|
184
|
+
amount: {
|
185
|
+
format: "uint"
|
186
|
+
}
|
187
|
+
}
|
188
|
+
}, y = {
|
189
|
+
type: "object",
|
190
|
+
properties: {
|
191
|
+
baseFeePerGas: {
|
192
|
+
format: "uint"
|
192
193
|
},
|
193
|
-
|
194
|
-
format: "
|
194
|
+
blobGasUsed: {
|
195
|
+
format: "uint"
|
195
196
|
},
|
196
197
|
difficulty: {
|
197
198
|
format: "uint"
|
198
199
|
},
|
199
|
-
|
200
|
+
excessBlobGas: {
|
200
201
|
format: "uint"
|
201
202
|
},
|
203
|
+
extraData: {
|
204
|
+
format: "bytes"
|
205
|
+
},
|
202
206
|
gasLimit: {
|
203
207
|
format: "uint"
|
204
208
|
},
|
205
209
|
gasUsed: {
|
206
210
|
format: "uint"
|
207
211
|
},
|
208
|
-
|
209
|
-
format: "
|
212
|
+
hash: {
|
213
|
+
format: "bytes32"
|
210
214
|
},
|
211
|
-
|
215
|
+
logsBloom: {
|
216
|
+
format: "bytes256"
|
217
|
+
},
|
218
|
+
miner: {
|
212
219
|
format: "bytes"
|
213
220
|
},
|
214
221
|
mixHash: {
|
@@ -217,20 +224,38 @@ const r = {
|
|
217
224
|
nonce: {
|
218
225
|
format: "uint"
|
219
226
|
},
|
220
|
-
|
227
|
+
number: {
|
221
228
|
format: "uint"
|
222
229
|
},
|
223
|
-
|
224
|
-
format: "
|
230
|
+
parentBeaconBlockRoot: {
|
231
|
+
format: "bytes32"
|
232
|
+
},
|
233
|
+
parentHash: {
|
234
|
+
format: "bytes32"
|
235
|
+
},
|
236
|
+
receiptsRoot: {
|
237
|
+
format: "bytes32"
|
238
|
+
},
|
239
|
+
sha3Uncles: {
|
240
|
+
format: "bytes32"
|
225
241
|
},
|
226
242
|
size: {
|
227
243
|
format: "uint"
|
228
244
|
},
|
245
|
+
stateRoot: {
|
246
|
+
format: "bytes32"
|
247
|
+
},
|
248
|
+
timestamp: {
|
249
|
+
format: "uint"
|
250
|
+
},
|
251
|
+
totalDifficulty: {
|
252
|
+
format: "uint"
|
253
|
+
},
|
229
254
|
transactions: {
|
230
255
|
oneOf: [
|
231
256
|
{
|
232
257
|
type: "array",
|
233
|
-
items: Object.assign({},
|
258
|
+
items: Object.assign({}, i)
|
234
259
|
},
|
235
260
|
{
|
236
261
|
type: "array",
|
@@ -240,85 +265,79 @@ const r = {
|
|
240
265
|
}
|
241
266
|
]
|
242
267
|
},
|
268
|
+
transactionsRoot: {
|
269
|
+
format: "bytes32"
|
270
|
+
},
|
243
271
|
uncles: {
|
244
272
|
type: "array",
|
245
273
|
items: {
|
246
274
|
format: "bytes32"
|
247
275
|
}
|
248
276
|
},
|
249
|
-
|
277
|
+
withdrawals: {
|
278
|
+
type: "array",
|
279
|
+
items: Object.assign({}, r)
|
280
|
+
},
|
281
|
+
withdrawalsRoot: {
|
250
282
|
format: "bytes32"
|
251
283
|
}
|
252
284
|
}
|
253
|
-
},
|
285
|
+
}, b = {
|
254
286
|
type: "object",
|
255
287
|
properties: {
|
256
|
-
|
257
|
-
format: "
|
288
|
+
author: {
|
289
|
+
format: "bytes32"
|
258
290
|
},
|
259
|
-
|
291
|
+
excessDataGas: {
|
260
292
|
format: "uint"
|
261
293
|
},
|
262
|
-
|
263
|
-
format: "address"
|
264
|
-
},
|
265
|
-
amount: {
|
294
|
+
baseFeePerGas: {
|
266
295
|
format: "uint"
|
267
|
-
}
|
268
|
-
}
|
269
|
-
}, b = {
|
270
|
-
type: "object",
|
271
|
-
properties: {
|
272
|
-
author: {
|
273
|
-
format: "bytes32"
|
274
296
|
},
|
275
|
-
|
276
|
-
format: "
|
297
|
+
blobGasUsed: {
|
298
|
+
format: "uint"
|
277
299
|
},
|
278
|
-
|
279
|
-
format: "
|
300
|
+
difficulty: {
|
301
|
+
format: "uint"
|
280
302
|
},
|
281
|
-
|
282
|
-
format: "
|
303
|
+
excessBlobGas: {
|
304
|
+
format: "uint"
|
283
305
|
},
|
284
|
-
|
306
|
+
extraData: {
|
285
307
|
format: "bytes"
|
286
308
|
},
|
287
|
-
|
288
|
-
format: "
|
309
|
+
gasLimit: {
|
310
|
+
format: "uint"
|
289
311
|
},
|
290
|
-
|
291
|
-
format: "
|
312
|
+
gasUsed: {
|
313
|
+
format: "uint"
|
292
314
|
},
|
293
|
-
|
315
|
+
hash: {
|
294
316
|
format: "bytes32"
|
295
317
|
},
|
296
318
|
logsBloom: {
|
297
319
|
format: "bytes256"
|
298
320
|
},
|
299
|
-
|
300
|
-
format: "
|
301
|
-
},
|
302
|
-
totalDifficulty: {
|
303
|
-
format: "uint"
|
321
|
+
miner: {
|
322
|
+
format: "bytes"
|
304
323
|
},
|
305
|
-
|
306
|
-
format: "
|
324
|
+
mixHash: {
|
325
|
+
format: "bytes32"
|
307
326
|
},
|
308
|
-
|
327
|
+
nonce: {
|
309
328
|
format: "uint"
|
310
329
|
},
|
311
|
-
|
330
|
+
number: {
|
312
331
|
format: "uint"
|
313
332
|
},
|
314
|
-
|
315
|
-
format: "
|
333
|
+
parentBeaconBlockRoot: {
|
334
|
+
format: "bytes32"
|
316
335
|
},
|
317
|
-
|
318
|
-
format: "
|
336
|
+
parentHash: {
|
337
|
+
format: "bytes32"
|
319
338
|
},
|
320
|
-
|
321
|
-
format: "
|
339
|
+
receiptsRoot: {
|
340
|
+
format: "bytes32"
|
322
341
|
},
|
323
342
|
sha3Uncles: {
|
324
343
|
format: "bytes32"
|
@@ -326,14 +345,14 @@ const r = {
|
|
326
345
|
size: {
|
327
346
|
format: "uint"
|
328
347
|
},
|
329
|
-
|
330
|
-
format: "
|
348
|
+
stateRoot: {
|
349
|
+
format: "bytes32"
|
331
350
|
},
|
332
|
-
|
351
|
+
timestamp: {
|
333
352
|
format: "uint"
|
334
353
|
},
|
335
|
-
|
336
|
-
format: "
|
354
|
+
totalDifficulty: {
|
355
|
+
format: "uint"
|
337
356
|
},
|
338
357
|
transactions: {
|
339
358
|
type: "array",
|
@@ -341,6 +360,9 @@ const r = {
|
|
341
360
|
format: "bytes32"
|
342
361
|
}
|
343
362
|
},
|
363
|
+
transactionsRoot: {
|
364
|
+
format: "bytes32"
|
365
|
+
},
|
344
366
|
uncles: {
|
345
367
|
type: "array",
|
346
368
|
items: {
|
@@ -349,7 +371,10 @@ const r = {
|
|
349
371
|
},
|
350
372
|
withdrawals: {
|
351
373
|
type: "array",
|
352
|
-
items: Object.assign({},
|
374
|
+
items: Object.assign({}, r)
|
375
|
+
},
|
376
|
+
withdrawalsRoot: {
|
377
|
+
format: "bytes32"
|
353
378
|
}
|
354
379
|
}
|
355
380
|
}, n = {
|
@@ -477,7 +502,7 @@ const r = {
|
|
477
502
|
format: "bytes"
|
478
503
|
}
|
479
504
|
}
|
480
|
-
},
|
505
|
+
}, l = {
|
481
506
|
type: "object",
|
482
507
|
properties: {
|
483
508
|
oldestBlock: {
|
@@ -550,21 +575,21 @@ const r = {
|
|
550
575
|
};
|
551
576
|
export {
|
552
577
|
d as SignatureObjectSchema,
|
553
|
-
|
578
|
+
s as accessListItemSchema,
|
554
579
|
c as accessListResultSchema,
|
555
580
|
t as accessListSchema,
|
556
581
|
h as accountSchema,
|
557
582
|
b as blockHeaderSchema,
|
558
583
|
y as blockSchema,
|
559
584
|
a as chainSchema,
|
560
|
-
|
561
|
-
|
585
|
+
o as customChainSchema,
|
586
|
+
l as feeHistorySchema,
|
562
587
|
e as hardforkSchema,
|
563
588
|
n as logSchema,
|
564
589
|
f as storageProofSchema,
|
565
590
|
u as syncSchema,
|
566
|
-
|
591
|
+
i as transactionInfoSchema,
|
567
592
|
p as transactionReceiptSchema,
|
568
|
-
|
569
|
-
|
593
|
+
m as transactionSchema,
|
594
|
+
r as withdrawalsSchema
|
570
595
|
};
|
@@ -1 +1,3 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const R=require("../../../web3-core/lib/esm/web3_config.cjs");require("../../../web3-core/lib/esm/web3_request_manager.cjs");require("../../../web3-core/lib/esm/web3_subscription_manager.cjs");require("../../../web3-core/lib/esm/web3_subscriptions.cjs");const D=require("../../../web3-core/lib/esm/web3_context.cjs");require("../../../web3-core/lib/esm/web3_batch_request.cjs");const v=require("../../../web3-types/lib/esm/data_format_types.cjs"),G=require("../../../web3-types/lib/esm/eth_types.cjs");require("../../../web3-types/lib/esm/web3_base_provider.cjs");const A=require("../../../web3-errors/lib/esm/errors/contract_errors.cjs"),N=require("../../../web3-errors/lib/esm/errors/provider_errors.cjs");require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");require("../../../web3-eth-iban/lib/esm/iban.cjs");const V=require("../../../web3-validator/lib/esm/errors.cjs");require("../../../web3-validator/lib/esm/formats.cjs");const H=require("../../../web3-validator/lib/esm/utils.cjs"),U=require("../../../web3-validator/lib/esm/default_validator.cjs"),I=require("../../../web3-validator/lib/esm/validation/object.cjs");require("../../../web3-core/lib/esm/web3_promi_event.cjs");require("../../../setimmediate/setImmediate.cjs");require("../../../web3-eth/lib/esm/web3_eth.cjs");const $=require("../../../web3-eth/lib/esm/utils/decoding.cjs");require("../../../web3-eth/lib/esm/schemas.cjs");const w=require("../../../web3-eth/lib/esm/constants.cjs"),T=require("../../../web3-eth/lib/esm/rpc_method_wrappers.cjs");require("../../../web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs");const P=require("../../../web3-eth/lib/esm/web3_subscriptions.cjs");require("../../../web3-eth/lib/esm/utils/transaction_builder.cjs");const j=require("../../../web3-eth-abi/lib/esm/utils.cjs"),k=require("../../../web3-eth-abi/lib/esm/api/events_api.cjs"),J=require("../../../web3-eth-abi/lib/esm/api/functions_api.cjs");require("../../../web3-eth-abi/lib/esm/coders/base/number.cjs");const L=require("../../../web3-eth-abi/lib/esm/decode_contract_error_data.cjs"),F=require("./encoding.cjs"),x=require("./log_subscription.cjs"),m=require("./utils.cjs"),b=require("../../../web3-utils/lib/esm/formatter.cjs"),W=require("../../../web3-utils/lib/esm/validation.cjs"),O=require("../../../web3-utils/lib/esm/hash.cjs"),K=require("../../../web3-utils/lib/esm/converters.cjs");var E=function(B,t,n,s){function c(o){return o instanceof n?o:new n(function(i){i(o)})}return new(n||(n=Promise))(function(o,i){function r(d){try{e(s.next(d))}catch(h){i(h)}}function a(d){try{e(s.throw(d))}catch(h){i(h)}}function e(d){d.done?o(d.value):c(d.value).then(r,a)}e((s=s.apply(B,t||[])).next())})};const z={logs:x.LogsSubscription,newHeads:P.NewHeadsSubscription,newBlockHeaders:P.NewHeadsSubscription};class M extends D.Web3Context{constructor(t,n,s,c,o){var i,r,a;const e=W.isContractInitOptions(n)?n:W.isContractInitOptions(s)?s:void 0;let d;m.isWeb3ContractContext(n)?d=n:m.isWeb3ContractContext(s)?d=s:d=c;let h;if(typeof n=="object"&&"provider"in n?h=n.provider:typeof s=="object"&&"provider"in s?h=s.provider:typeof c=="object"&&"provider"in c?h=c.provider:h=M.givenProvider,super(Object.assign(Object.assign({},d),{provider:h,registeredSubscriptions:z})),this.syncWithContext=!1,this._functions={},d!=null&&d.wallet&&(this._wallet=d.wallet),d!=null&&d.accountProvider&&(this._accountProvider=d.accountProvider),!I.isNullish(e)&&!I.isNullish(e.data)&&!I.isNullish(e.input)&&this.config.contractDataInputFill!=="both")throw new A.ContractTransactionDataAndInputError({data:e.data,input:e.input});this._overloadedMethodAbis=new Map;const u=b.isDataFormat(c)?c:b.isDataFormat(s)?s:o??v.DEFAULT_RETURN_FORMAT,l=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(i=e==null?void 0:e.dataInputFill)!==null&&i!==void 0?i:this.config.contractDataInputFill,this._parseAndSetJsonInterface(t,u),I.isNullish(l)||this._parseAndSetAddress(l,u),this.options={address:l,jsonInterface:this._jsonInterface,gas:(r=e==null?void 0:e.gas)!==null&&r!==void 0?r:e==null?void 0:e.gasLimit,gasPrice:e==null?void 0:e.gasPrice,from:e==null?void 0:e.from,input:e==null?void 0:e.input,data:e==null?void 0:e.data},this.syncWithContext=(a=e==null?void 0:e.syncWithContext)!==null&&a!==void 0?a:!1,d instanceof D.Web3Context&&this.subscribeToContextEvents(d),Object.defineProperty(this.options,"address",{set:f=>this._parseAndSetAddress(f,u),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:f=>this._parseAndSetJsonInterface(f,u),get:()=>this._jsonInterface}),d instanceof D.Web3Context&&d.on(R.Web3ConfigEvent.CONFIG_CHANGE,f=>{this.setConfig({[f.name]:f.newValue})})}get events(){return this._events}get methods(){return this._methods}clone(){let t;return this.options.address?t=new M([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):t=new M([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&t.subscribeToContextEvents(this.context),t}deploy(t){var n,s,c;let o=this._jsonInterface.find(h=>h.type==="constructor");o||(o={type:"constructor",stateMutability:""});const i=b.format({format:"bytes"},(n=t==null?void 0:t.input)!==null&&n!==void 0?n:this.options.input,v.DEFAULT_RETURN_FORMAT),r=b.format({format:"bytes"},(s=t==null?void 0:t.data)!==null&&s!==void 0?s:this.options.data,v.DEFAULT_RETURN_FORMAT);if((!i||i.trim()==="0x")&&(!r||r.trim()==="0x"))throw new A.Web3ContractError("contract creation without any data provided.");const a=(c=t==null?void 0:t.arguments)!==null&&c!==void 0?c:[],e=Object.assign(Object.assign({},this.options),{input:i,data:r}),d=i??r;return{arguments:a,send:h=>{const u=Object.assign({},h);return this._contractMethodDeploySend(o,a,u,e)},estimateGas:(h,u=v.DEFAULT_RETURN_FORMAT)=>E(this,void 0,void 0,function*(){const l=Object.assign({},h);return this._contractMethodEstimateGas({abi:o,params:a,returnFormat:u,options:l,contractOptions:e})}),encodeABI:()=>F.encodeMethodABI(o,a,b.format({format:"bytes"},d,v.DEFAULT_RETURN_FORMAT))}}getPastEvents(t,n,s){var c;return E(this,void 0,void 0,function*(){const o=typeof t=="string"?t:w.ALL_EVENTS,i=typeof t!="string"&&!b.isDataFormat(t)?t:b.isDataFormat(n)?{}:n,r=b.isDataFormat(t)?t:b.isDataFormat(n)?n:s??v.DEFAULT_RETURN_FORMAT,a=o==="allEvents"||o===w.ALL_EVENTS?w.ALL_EVENTS_ABI:this._jsonInterface.find(g=>"name"in g&&g.name===o);if(!a)throw new A.Web3ContractError(`Event ${o} not found.`);const{fromBlock:e,toBlock:d,topics:h,address:u}=F.encodeEventABI(this.options,a,i??{}),l=yield T.getLogs(this,{fromBlock:e,toBlock:d,topics:h,address:u},r),f=l?l.map(g=>typeof g=="string"?g:$.decodeEventABI(a,g,this._jsonInterface,r)):[],_=(c=i==null?void 0:i.filter)!==null&&c!==void 0?c:{},C=Object.keys(_);return C.length>0?f.filter(g=>typeof g=="string"?!0:C.every(p=>{var q;if(Array.isArray(_[p]))return _[p].some(y=>String(g.returnValues[p]).toUpperCase()===String(y).toUpperCase());const S=(q=a.inputs)===null||q===void 0?void 0:q.filter(y=>y.name===p)[0];return S!=null&&S.indexed&&S.type==="string"&&O.keccak256Wrapper(_[p])===String(g.returnValues[p])?!0:String(g.returnValues[p]).toUpperCase()===String(_[p]).toUpperCase()})):f})}_parseAndSetAddress(t,n=v.DEFAULT_RETURN_FORMAT){this._address=t&&K.toChecksumAddress(b.format({format:"address"},t,n))}_parseAndSetJsonInterface(t,n=v.DEFAULT_RETURN_FORMAT){var s,c,o,i,r;this._functions={},this._methods={},this._events={};let a=[];const e=t.filter(h=>h.type!=="error"),d=t.filter(h=>j.isAbiErrorFragment(h));for(const h of e){const u=Object.assign(Object.assign({},h),{signature:""});if(j.isAbiFunctionFragment(u)){const l=j.jsonInterfaceMethodToString(u),f=J.encodeFunctionSignature(l);u.signature=f,u.constant=(c=(s=u.stateMutability==="view")!==null&&s!==void 0?s:u.stateMutability==="pure")!==null&&c!==void 0?c:u.constant,u.payable=(o=u.stateMutability==="payable")!==null&&o!==void 0?o:u.payable,this._overloadedMethodAbis.set(u.name,[...(i=this._overloadedMethodAbis.get(u.name))!==null&&i!==void 0?i:[],u]);const _=(r=this._overloadedMethodAbis.get(u.name))!==null&&r!==void 0?r:[],C=this._createContractMethod(_,d);this._functions[l]={signature:f,method:C},this._methods[u.name]=this._functions[l].method,this._methods[l]=this._functions[l].method,this._methods[f]=this._functions[l].method}else if(j.isAbiEventFragment(u)){const l=j.jsonInterfaceMethodToString(u),f=k.encodeEventSignature(l),_=this._createContractEvent(u,n);u.signature=f,(!(l in this._events)||u.name==="bound")&&(this._events[l]=_),this._events[u.name]=_,this._events[f]=_}a=[...a,u]}this._events.allEvents=this._createContractEvent(w.ALL_EVENTS_ABI,n),this._jsonInterface=[...a],this._errorsInterface=d}_getAbiParams(t,n){var s;try{return H.transformJsonDataToAbiFormat((s=t.inputs)!==null&&s!==void 0?s:[],n)}catch(c){throw new A.Web3ContractError(`Invalid parameters for method ${t.name}: ${c.message}`)}}_createContractMethod(t,n){const s=t[t.length-1];return(...c)=>{var o,i;let r;const a=(o=this._overloadedMethodAbis.get(s.name))!==null&&o!==void 0?o:[];let e=a[0];const d=n,h=a.filter(l=>{var f;return((f=l.inputs)!==null&&f!==void 0?f:[]).length===c.length});if(a.length===1||h.length===0)r=this._getAbiParams(e,c),U.validator.validate((i=s.inputs)!==null&&i!==void 0?i:[],r);else{const l=[];for(const f of h)try{r=this._getAbiParams(f,c),U.validator.validate(f.inputs,r),e=f;break}catch(_){l.push(_)}if(l.length===h.length)throw new V.Web3ValidatorError(l)}const u={arguments:r,call:(l,f)=>E(this,void 0,void 0,function*(){return this._contractMethodCall(e,r,d,l,f)}),send:l=>this._contractMethodSend(e,r,d,l),estimateGas:(l,f=v.DEFAULT_RETURN_FORMAT)=>E(this,void 0,void 0,function*(){return this._contractMethodEstimateGas({abi:e,params:r,returnFormat:f,options:l})}),encodeABI:()=>F.encodeMethodABI(e,r),createAccessList:(l,f)=>E(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(e,r,d,l,f)})};return e.stateMutability==="payable",u}}_contractMethodCall(t,n,s,c,o){var i;return E(this,void 0,void 0,function*(){const r=m.getEthTxCallParams({abi:t,params:n,options:Object.assign(Object.assign({},c),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(i=this.options.from)!==null&&i!==void 0?i:this.config.defaultAccount})});try{const a=yield T.call(this,r,o,v.DEFAULT_RETURN_FORMAT);return F.decodeMethodReturn(t,a)}catch(a){throw a instanceof A.ContractExecutionError&&L.decodeContractErrorData(s,a.cause),a}})}_contractMethodCreateAccessList(t,n,s,c,o){var i;return E(this,void 0,void 0,function*(){const r=m.getCreateAccessListParams({abi:t,params:n,options:Object.assign(Object.assign({},c),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(i=this.options.from)!==null&&i!==void 0?i:this.config.defaultAccount})});try{return T.createAccessList(this,r,o,v.DEFAULT_RETURN_FORMAT)}catch(a){throw a instanceof A.ContractExecutionError&&L.decodeContractErrorData(s,a.cause),a}})}_contractMethodSend(t,n,s,c,o){var i,r;let a=o??this.options;a=Object.assign(Object.assign({},a),{input:void 0,from:(r=(i=a.from)!==null&&i!==void 0?i:this.defaultAccount)!==null&&r!==void 0?r:void 0});const e=m.getSendTxParams({abi:t,params:n,options:Object.assign(Object.assign({},c),{dataInputFill:this.config.contractDataInputFill}),contractOptions:a}),d=T.sendTransaction(this,e,v.DEFAULT_RETURN_FORMAT,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface});return d.on("error",h=>{h instanceof A.ContractExecutionError&&L.decodeContractErrorData(s,h.cause)}),d}_contractMethodDeploySend(t,n,s,c){var o,i;let r=c??this.options;r=Object.assign(Object.assign({},r),{from:(i=(o=r.from)!==null&&o!==void 0?o:this.defaultAccount)!==null&&i!==void 0?i:void 0});const a=m.getSendTxParams({abi:t,params:n,options:Object.assign(Object.assign({},s),{dataInputFill:this.config.contractDataInputFill}),contractOptions:r});return T.sendTransaction(this,a,v.DEFAULT_RETURN_FORMAT,{transactionResolver:e=>{if(e.status===BigInt(0))throw new A.Web3ContractError("code couldn't be stored",e);const d=this.clone();return d.options.address=e.contractAddress,d},contractAbi:this._jsonInterface,checkRevertBeforeSending:!1})}_contractMethodEstimateGas({abi:t,params:n,returnFormat:s,options:c,contractOptions:o}){return E(this,void 0,void 0,function*(){const i=m.getEstimateGasParams({abi:t,params:n,options:Object.assign(Object.assign({},c),{dataInputFill:this.config.contractDataInputFill}),contractOptions:o??this.options});return T.estimateGas(this,i,G.BlockTags.LATEST,s)})}_createContractEvent(t,n=v.DEFAULT_RETURN_FORMAT){return(...s)=>{var c;const{topics:o,fromBlock:i}=F.encodeEventABI(this.options,t,s[0]),r=new x.LogsSubscription({address:this.options.address,topics:o,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return I.isNullish(i)||this.getPastEvents(t.name,{fromBlock:i,topics:o},n).then(a=>{a&&a.forEach(e=>r.emit("data",e))}).catch(a=>{r.emit("error",new N.SubscriptionError("Failed to get past events.",a))}),(c=this.subscriptionManager)===null||c===void 0||c.addSubscription(r).catch(a=>{r.emit("error",new N.SubscriptionError("Failed to subscribe.",a))}),r}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(R.Web3ConfigEvent.CONFIG_CHANGE,s=>{n.setConfig({[s.name]:s.newValue})})}}exports.Contract=M;
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("../../../web3-core/lib/esm/web3_config.cjs");require("../../../web3-core/lib/esm/web3_request_manager.cjs");require("../../../web3-core/lib/esm/web3_subscription_manager.cjs");require("../../../web3-core/lib/esm/web3_subscriptions.cjs");const q=require("../../../web3-core/lib/esm/web3_context.cjs");require("../../../web3-core/lib/esm/web3_batch_request.cjs");const p=require("../../../web3-types/lib/esm/data_format_types.cjs"),G=require("../../../web3-types/lib/esm/eth_types.cjs");require("../../../web3-types/lib/esm/web3_base_provider.cjs");const A=require("../../../web3-errors/lib/esm/errors/contract_errors.cjs"),R=require("../../../web3-errors/lib/esm/errors/provider_errors.cjs");require("../../../web3-errors/lib/esm/errors/rpc_errors.cjs");require("../../../web3-eth-iban/lib/esm/iban.cjs");const V=require("../../../web3-validator/lib/esm/errors.cjs");require("../../../web3-validator/lib/esm/formats.cjs");const O=require("../../../web3-validator/lib/esm/utils.cjs"),U=require("../../../web3-validator/lib/esm/default_validator.cjs"),F=require("../../../web3-validator/lib/esm/validation/object.cjs");require("../../../web3-core/lib/esm/web3_promi_event.cjs");require("../../../setimmediate/setImmediate.cjs");require("../../../web3-eth/lib/esm/web3_eth.cjs");const H=require("../../../web3-eth/lib/esm/utils/decoding.cjs");require("../../../web3-eth/lib/esm/schemas.cjs");const y=require("../../../web3-eth/lib/esm/constants.cjs"),j=require("../../../web3-eth/lib/esm/rpc_method_wrappers.cjs");require("../../../web3-eth/lib/esm/utils/prepare_transaction_for_signing.cjs");const P=require("../../../web3-eth/lib/esm/web3_subscriptions.cjs");require("../../../web3-eth/lib/esm/utils/transaction_builder.cjs");const I=require("../../../web3-eth-abi/lib/esm/utils.cjs"),J=require("../../../web3-eth-abi/lib/esm/api/events_api.cjs"),W=require("../../../web3-eth-abi/lib/esm/api/functions_api.cjs");require("../../../web3-eth-abi/lib/esm/coders/base/number.cjs");const N=require("../../../web3-eth-abi/lib/esm/decode_contract_error_data.cjs"),E=require("./encoding.cjs"),B=require("./log_subscription.cjs"),M=require("./utils.cjs"),m=require("../../../web3-utils/lib/esm/formatter.cjs"),x=require("../../../web3-utils/lib/esm/validation.cjs"),k=require("../../../web3-utils/lib/esm/hash.cjs"),K=require("../../../web3-utils/lib/esm/converters.cjs");var T=function($,t,n,o){function r(i){return i instanceof n?i:new n(function(s){s(i)})}return new(n||(n=Promise))(function(i,s){function d(c){try{e(o.next(c))}catch(u){s(u)}}function a(c){try{e(o.throw(c))}catch(u){s(u)}}function e(c){c.done?i(c.value):r(c.value).then(d,a)}e((o=o.apply($,t||[])).next())})};const z={logs:B.LogsSubscription,newHeads:P.NewHeadsSubscription,newBlockHeaders:P.NewHeadsSubscription};class S extends q.Web3Context{constructor(t,n,o,r,i){var s,d,a;const e=x.isContractInitOptions(n)?n:x.isContractInitOptions(o)?o:void 0;let c;M.isWeb3ContractContext(n)?c=n:M.isWeb3ContractContext(o)?c=o:c=r;let u;if(typeof n=="object"&&"provider"in n?u=n.provider:typeof o=="object"&&"provider"in o?u=o.provider:typeof r=="object"&&"provider"in r?u=r.provider:u=S.givenProvider,super(Object.assign(Object.assign({},c),{provider:u,registeredSubscriptions:z})),this.syncWithContext=!1,this._functions={},c!=null&&c.wallet&&(this._wallet=c.wallet),c!=null&&c.accountProvider&&(this._accountProvider=c.accountProvider),!F.isNullish(e)&&!F.isNullish(e.data)&&!F.isNullish(e.input)&&this.config.contractDataInputFill!=="both")throw new A.ContractTransactionDataAndInputError({data:e.data,input:e.input});this._overloadedMethodAbis=new Map;const l=m.isDataFormat(r)?r:m.isDataFormat(o)?o:i??p.DEFAULT_RETURN_FORMAT,_=typeof n=="string"?n:void 0;this.config.contractDataInputFill=(s=e==null?void 0:e.dataInputFill)!==null&&s!==void 0?s:this.config.contractDataInputFill,this._parseAndSetJsonInterface(t,l),F.isNullish(_)||this._parseAndSetAddress(_,l),this.options={address:_,jsonInterface:this._jsonInterface,gas:(d=e==null?void 0:e.gas)!==null&&d!==void 0?d:e==null?void 0:e.gasLimit,gasPrice:e==null?void 0:e.gasPrice,from:e==null?void 0:e.from,input:e==null?void 0:e.input,data:e==null?void 0:e.data},this.syncWithContext=(a=e==null?void 0:e.syncWithContext)!==null&&a!==void 0?a:!1,c instanceof q.Web3Context&&this.subscribeToContextEvents(c),Object.defineProperty(this.options,"address",{set:g=>this._parseAndSetAddress(g,l),get:()=>this._address}),Object.defineProperty(this.options,"jsonInterface",{set:g=>this._parseAndSetJsonInterface(g,l),get:()=>this._jsonInterface}),c instanceof q.Web3Context&&c.on(L.Web3ConfigEvent.CONFIG_CHANGE,g=>{this.setConfig({[g.name]:g.newValue})})}get events(){return this._events}get methods(){return this._methods}clone(){let t;return this.options.address?t=new S([...this._jsonInterface,...this._errorsInterface],this.options.address,{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()):t=new S([...this._jsonInterface,...this._errorsInterface],{gas:this.options.gas,gasPrice:this.options.gasPrice,from:this.options.from,input:this.options.input,data:this.options.data,provider:this.currentProvider,syncWithContext:this.syncWithContext,dataInputFill:this.config.contractDataInputFill},this.getContextObject()),this.context&&t.subscribeToContextEvents(this.context),t}deploy(t){var n,o,r;let i=this._jsonInterface.find(u=>u.type==="constructor");i||(i={type:"constructor",stateMutability:""});const s=m.format({format:"bytes"},(n=t==null?void 0:t.input)!==null&&n!==void 0?n:this.options.input,p.DEFAULT_RETURN_FORMAT),d=m.format({format:"bytes"},(o=t==null?void 0:t.data)!==null&&o!==void 0?o:this.options.data,p.DEFAULT_RETURN_FORMAT);if((!s||s.trim()==="0x")&&(!d||d.trim()==="0x"))throw new A.Web3ContractError("contract creation without any data provided.");const a=(r=t==null?void 0:t.arguments)!==null&&r!==void 0?r:[],e=Object.assign(Object.assign({},this.options),{input:s,data:d}),c=s??d;return{arguments:a,send:u=>{const l=Object.assign({},u);return this._contractMethodDeploySend(i,a,l,e)},estimateGas:(u,l=p.DEFAULT_RETURN_FORMAT)=>T(this,void 0,void 0,function*(){const _=Object.assign({},u);return this._contractMethodEstimateGas({abi:i,params:a,returnFormat:l,options:_,contractOptions:e})}),encodeABI:()=>E.encodeMethodABI(i,a,m.format({format:"bytes"},c,p.DEFAULT_RETURN_FORMAT)),decodeData:u=>Object.assign(Object.assign({},E.decodeMethodParams(i,u.replace(c,""),!1)),{__method__:i.type})}}getPastEvents(t,n,o){var r;return T(this,void 0,void 0,function*(){const i=typeof t=="string"?t:y.ALL_EVENTS,s=typeof t!="string"&&!m.isDataFormat(t)?t:m.isDataFormat(n)?{}:n,d=m.isDataFormat(t)?t:m.isDataFormat(n)?n:o??p.DEFAULT_RETURN_FORMAT,a=i==="allEvents"||i===y.ALL_EVENTS?y.ALL_EVENTS_ABI:this._jsonInterface.find(v=>"name"in v&&v.name===i);if(!a)throw new A.Web3ContractError(`Event ${i} not found.`);const{fromBlock:e,toBlock:c,topics:u,address:l}=E.encodeEventABI(this.options,a,s??{}),_=yield j.getLogs(this,{fromBlock:e,toBlock:c,topics:u,address:l},d),g=_?_.map(v=>typeof v=="string"?v:H.decodeEventABI(a,v,this._jsonInterface,d)):[],h=(r=s==null?void 0:s.filter)!==null&&r!==void 0?r:{},f=Object.keys(h);return f.length>0?g.filter(v=>typeof v=="string"?!0:f.every(b=>{var D;if(Array.isArray(h[b]))return h[b].some(C=>String(v.returnValues[b]).toUpperCase()===String(C).toUpperCase());const w=(D=a.inputs)===null||D===void 0?void 0:D.filter(C=>C.name===b)[0];return w!=null&&w.indexed&&w.type==="string"&&k.keccak256Wrapper(h[b])===String(v.returnValues[b])?!0:String(v.returnValues[b]).toUpperCase()===String(h[b]).toUpperCase()})):g})}_parseAndSetAddress(t,n=p.DEFAULT_RETURN_FORMAT){this._address=t&&K.toChecksumAddress(m.format({format:"address"},t,n))}decodeMethodData(t){const n=t.slice(0,10),r=this._jsonInterface.filter(i=>i.type!=="error").find(i=>n===W.encodeFunctionSignature(I.jsonInterfaceMethodToString(i)));if(!r)throw new A.Web3ContractError(`The ABI for the provided method signature ${n} was not found.`);return Object.assign(Object.assign({},E.decodeMethodParams(r,t)),{__method__:I.jsonInterfaceMethodToString(r)})}_parseAndSetJsonInterface(t,n=p.DEFAULT_RETURN_FORMAT){var o,r,i,s,d;this._functions={},this._methods={},this._events={};let a=[];const e=t.filter(u=>u.type!=="error"),c=t.filter(u=>I.isAbiErrorFragment(u));for(const u of e){const l=Object.assign(Object.assign({},u),{signature:""});if(I.isAbiFunctionFragment(l)){const _=I.jsonInterfaceMethodToString(l),g=W.encodeFunctionSignature(_);l.methodNameWithInputs=_,l.signature=g,l.constant=(r=(o=l.stateMutability==="view")!==null&&o!==void 0?o:l.stateMutability==="pure")!==null&&r!==void 0?r:l.constant,l.payable=(i=l.stateMutability==="payable")!==null&&i!==void 0?i:l.payable,this._overloadedMethodAbis.set(l.name,[...(s=this._overloadedMethodAbis.get(l.name))!==null&&s!==void 0?s:[],l]);const h=(d=this._overloadedMethodAbis.get(l.name))!==null&&d!==void 0?d:[],f=this._createContractMethod(h,c),v=this._createContractMethod(h,c,!0);this._functions[_]={signature:g,method:v},this._methods[l.name]=f,this._methods[_]=v,this._methods[g]=v}else if(I.isAbiEventFragment(l)){const _=I.jsonInterfaceMethodToString(l),g=J.encodeEventSignature(_),h=this._createContractEvent(l,n);l.signature=g,(!(_ in this._events)||l.name==="bound")&&(this._events[_]=h),this._events[l.name]=h,this._events[g]=h}a=[...a,l]}this._events.allEvents=this._createContractEvent(y.ALL_EVENTS_ABI,n),this._jsonInterface=[...a],this._errorsInterface=c}_getAbiParams(t,n){var o;try{return O.transformJsonDataToAbiFormat((o=t.inputs)!==null&&o!==void 0?o:[],n)}catch(r){throw new A.Web3ContractError(`Invalid parameters for method ${t.name}: ${r.message}`)}}_createContractMethod(t,n,o=!1){const r=t[t.length-1];return(...i)=>{var s,d,a;let e;const c=(d=o?(s=this._overloadedMethodAbis.get(r.name))===null||s===void 0?void 0:s.filter(h=>h.signature===r.signature):this._overloadedMethodAbis.get(r.name))!==null&&d!==void 0?d:[];let u=c[0];const l=n,_=c.filter(h=>{var f;return((f=h.inputs)!==null&&f!==void 0?f:[]).length===i.length});if(c.length===1||_.length===0)e=this._getAbiParams(u,i),U.validator.validate((a=r.inputs)!==null&&a!==void 0?a:[],e);else{const h=[],f=[];for(const v of _)try{e=this._getAbiParams(v,i),U.validator.validate(v.inputs,e),f.push(v)}catch(b){h.push(b)}if(f.length===1?[u]=f:f.length>1&&([u]=f,console.warn(`Multiple methods found that is compatible with the given inputs.
|
2
|
+
Found ${f.length} compatible methods: ${JSON.stringify(f.map(v=>`${v.methodNameWithInputs} (signature: ${v.signature})`))}
|
3
|
+
The first one will be used: ${u.methodNameWithInputs}`)),h.length===_.length)throw new V.Web3ValidatorError(h)}const g={arguments:e,call:(h,f)=>T(this,void 0,void 0,function*(){return this._contractMethodCall(u,e,l,h,f)}),send:h=>this._contractMethodSend(u,e,l,h),estimateGas:(h,f=p.DEFAULT_RETURN_FORMAT)=>T(this,void 0,void 0,function*(){return this._contractMethodEstimateGas({abi:u,params:e,returnFormat:f,options:h})}),encodeABI:()=>E.encodeMethodABI(u,e),decodeData:h=>E.decodeMethodParams(u,h),createAccessList:(h,f)=>T(this,void 0,void 0,function*(){return this._contractMethodCreateAccessList(u,e,l,h,f)})};return u.stateMutability==="payable",g}}_contractMethodCall(t,n,o,r,i){var s;return T(this,void 0,void 0,function*(){const d=M.getEthTxCallParams({abi:t,params:n,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(s=this.options.from)!==null&&s!==void 0?s:this.config.defaultAccount})});try{const a=yield j.call(this,d,i,p.DEFAULT_RETURN_FORMAT);return E.decodeMethodReturn(t,a)}catch(a){throw a instanceof A.ContractExecutionError&&N.decodeContractErrorData(o,a.cause),a}})}_contractMethodCreateAccessList(t,n,o,r,i){var s;return T(this,void 0,void 0,function*(){const d=M.getCreateAccessListParams({abi:t,params:n,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:Object.assign(Object.assign({},this.options),{from:(s=this.options.from)!==null&&s!==void 0?s:this.config.defaultAccount})});try{return j.createAccessList(this,d,i,p.DEFAULT_RETURN_FORMAT)}catch(a){throw a instanceof A.ContractExecutionError&&N.decodeContractErrorData(o,a.cause),a}})}_contractMethodSend(t,n,o,r,i){var s,d;let a=i??this.options;a=Object.assign(Object.assign({},a),{input:void 0,from:(d=(s=a.from)!==null&&s!==void 0?s:this.defaultAccount)!==null&&d!==void 0?d:void 0});const e=M.getSendTxParams({abi:t,params:n,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:a}),c=j.sendTransaction(this,e,p.DEFAULT_RETURN_FORMAT,{checkRevertBeforeSending:!1,contractAbi:this._jsonInterface});return c.on("error",u=>{u instanceof A.ContractExecutionError&&N.decodeContractErrorData(o,u.cause)}),c}_contractMethodDeploySend(t,n,o,r){var i,s;let d=r??this.options;d=Object.assign(Object.assign({},d),{from:(s=(i=d.from)!==null&&i!==void 0?i:this.defaultAccount)!==null&&s!==void 0?s:void 0});const a=M.getSendTxParams({abi:t,params:n,options:Object.assign(Object.assign({},o),{dataInputFill:this.config.contractDataInputFill}),contractOptions:d});return j.sendTransaction(this,a,p.DEFAULT_RETURN_FORMAT,{transactionResolver:e=>{if(e.status===BigInt(0))throw new A.Web3ContractError("code couldn't be stored",e);const c=this.clone();return c.options.address=e.contractAddress,c},contractAbi:this._jsonInterface,checkRevertBeforeSending:!1})}_contractMethodEstimateGas({abi:t,params:n,returnFormat:o,options:r,contractOptions:i}){return T(this,void 0,void 0,function*(){const s=M.getEstimateGasParams({abi:t,params:n,options:Object.assign(Object.assign({},r),{dataInputFill:this.config.contractDataInputFill}),contractOptions:i??this.options});return j.estimateGas(this,s,G.BlockTags.LATEST,o)})}_createContractEvent(t,n=p.DEFAULT_RETURN_FORMAT){return(...o)=>{var r;const{topics:i,fromBlock:s}=E.encodeEventABI(this.options,t,o[0]),d=new B.LogsSubscription({address:this.options.address,topics:i,abi:t,jsonInterface:this._jsonInterface},{subscriptionManager:this.subscriptionManager,returnFormat:n});return F.isNullish(s)||this.getPastEvents(t.name,{fromBlock:s,topics:i},n).then(a=>{a&&a.forEach(e=>d.emit("data",e))}).catch(a=>{d.emit("error",new R.SubscriptionError("Failed to get past events.",a))}),(r=this.subscriptionManager)===null||r===void 0||r.addSubscription(d).catch(a=>{d.emit("error",new R.SubscriptionError("Failed to subscribe.",a))}),d}}subscribeToContextEvents(t){const n=this;this.context=t,n.syncWithContext&&t.on(L.Web3ConfigEvent.CONFIG_CHANGE,o=>{n.setConfig({[o.name]:o.newValue})})}}exports.Contract=S;
|