@sentio/sdk 2.18.0 → 2.18.1-rc.10
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/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +49 -23
- package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc1155-processor.js +19 -8
- package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20-processor.js +39 -18
- package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc20bytes-processor.js +21 -9
- package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
- package/lib/eth/builtin/internal/erc721-processor.js +31 -14
- package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
- package/lib/eth/builtin/internal/weth9-processor.js +25 -11
- package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
- package/lib/eth/codegen/file.js +4 -1
- package/lib/eth/codegen/file.js.map +1 -1
- package/lib/eth/codegen/function-calls.js +2 -1
- package/lib/eth/codegen/function-calls.js.map +1 -1
- package/lib/eth/eth.d.ts +2 -2
- package/lib/eth/eth.js +12 -13
- package/lib/eth/eth.js.map +1 -1
- package/lib/eth/provider.js +1 -1
- package/lib/eth/provider.js.map +1 -1
- package/lib/utils/call.d.ts +6 -0
- package/lib/utils/call.js +21 -0
- package/lib/utils/call.js.map +1 -0
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +1 -0
- package/lib/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +50 -24
- package/src/eth/builtin/internal/erc1155-processor.ts +20 -9
- package/src/eth/builtin/internal/erc20-processor.ts +40 -19
- package/src/eth/builtin/internal/erc20bytes-processor.ts +22 -10
- package/src/eth/builtin/internal/erc721-processor.ts +32 -15
- package/src/eth/builtin/internal/weth9-processor.ts +26 -12
- package/src/eth/codegen/file.ts +4 -1
- package/src/eth/codegen/function-calls.ts +2 -1
- package/src/eth/eth.ts +11 -13
- package/src/eth/provider.ts +1 -1
- package/src/utils/call.ts +20 -0
- package/src/utils/index.ts +1 -0
@@ -175,6 +175,7 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
175
175
|
spender: string,
|
176
176
|
overrides?: Overrides
|
177
177
|
): Promise<bigint> {
|
178
|
+
const stack = new Error().stack;
|
178
179
|
try {
|
179
180
|
return await this.contract.getFunction("allowance(address,address)")(
|
180
181
|
owner,
|
@@ -182,66 +183,73 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
182
183
|
overrides || {}
|
183
184
|
);
|
184
185
|
} catch (e) {
|
185
|
-
throw transformEtherError(e, undefined);
|
186
|
+
throw transformEtherError(e, undefined, stack);
|
186
187
|
}
|
187
188
|
}
|
188
189
|
|
189
190
|
async balanceOf(account: string, overrides?: Overrides): Promise<bigint> {
|
191
|
+
const stack = new Error().stack;
|
190
192
|
try {
|
191
193
|
return await this.contract.getFunction("balanceOf(address)")(
|
192
194
|
account,
|
193
195
|
overrides || {}
|
194
196
|
);
|
195
197
|
} catch (e) {
|
196
|
-
throw transformEtherError(e, undefined);
|
198
|
+
throw transformEtherError(e, undefined, stack);
|
197
199
|
}
|
198
200
|
}
|
199
201
|
|
200
202
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
203
|
+
const stack = new Error().stack;
|
201
204
|
try {
|
202
205
|
return await this.contract.getFunction("decimals()")(overrides || {});
|
203
206
|
} catch (e) {
|
204
|
-
throw transformEtherError(e, undefined);
|
207
|
+
throw transformEtherError(e, undefined, stack);
|
205
208
|
}
|
206
209
|
}
|
207
210
|
|
208
211
|
async locker(overrides?: Overrides): Promise<string> {
|
212
|
+
const stack = new Error().stack;
|
209
213
|
try {
|
210
214
|
return await this.contract.getFunction("locker()")(overrides || {});
|
211
215
|
} catch (e) {
|
212
|
-
throw transformEtherError(e, undefined);
|
216
|
+
throw transformEtherError(e, undefined, stack);
|
213
217
|
}
|
214
218
|
}
|
215
219
|
|
216
220
|
async name(overrides?: Overrides): Promise<string> {
|
221
|
+
const stack = new Error().stack;
|
217
222
|
try {
|
218
223
|
return await this.contract.getFunction("name()")(overrides || {});
|
219
224
|
} catch (e) {
|
220
|
-
throw transformEtherError(e, undefined);
|
225
|
+
throw transformEtherError(e, undefined, stack);
|
221
226
|
}
|
222
227
|
}
|
223
228
|
|
224
229
|
async owner(overrides?: Overrides): Promise<string> {
|
230
|
+
const stack = new Error().stack;
|
225
231
|
try {
|
226
232
|
return await this.contract.getFunction("owner()")(overrides || {});
|
227
233
|
} catch (e) {
|
228
|
-
throw transformEtherError(e, undefined);
|
234
|
+
throw transformEtherError(e, undefined, stack);
|
229
235
|
}
|
230
236
|
}
|
231
237
|
|
232
238
|
async symbol(overrides?: Overrides): Promise<string> {
|
239
|
+
const stack = new Error().stack;
|
233
240
|
try {
|
234
241
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
235
242
|
} catch (e) {
|
236
|
-
throw transformEtherError(e, undefined);
|
243
|
+
throw transformEtherError(e, undefined, stack);
|
237
244
|
}
|
238
245
|
}
|
239
246
|
|
240
247
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
248
|
+
const stack = new Error().stack;
|
241
249
|
try {
|
242
250
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
243
251
|
} catch (e) {
|
244
|
-
throw transformEtherError(e, undefined);
|
252
|
+
throw transformEtherError(e, undefined, stack);
|
245
253
|
}
|
246
254
|
}
|
247
255
|
|
@@ -253,21 +261,23 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
253
261
|
amount: BigNumberish,
|
254
262
|
overrides?: Overrides
|
255
263
|
): Promise<boolean> {
|
264
|
+
const stack = new Error().stack;
|
256
265
|
try {
|
257
266
|
return await this.contract
|
258
267
|
.getFunction("approve(address,uint256)")
|
259
268
|
.staticCall(spender, amount, overrides || {});
|
260
269
|
} catch (e) {
|
261
|
-
throw transformEtherError(e, undefined);
|
270
|
+
throw transformEtherError(e, undefined, stack);
|
262
271
|
}
|
263
272
|
},
|
264
273
|
async burn(amount: BigNumberish, overrides?: Overrides): Promise<void> {
|
274
|
+
const stack = new Error().stack;
|
265
275
|
try {
|
266
276
|
return await this.contract
|
267
277
|
.getFunction("burn(uint256)")
|
268
278
|
.staticCall(amount, overrides || {});
|
269
279
|
} catch (e) {
|
270
|
-
throw transformEtherError(e, undefined);
|
280
|
+
throw transformEtherError(e, undefined, stack);
|
271
281
|
}
|
272
282
|
},
|
273
283
|
async burnFrom(
|
@@ -275,12 +285,13 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
275
285
|
amount: BigNumberish,
|
276
286
|
overrides?: Overrides
|
277
287
|
): Promise<void> {
|
288
|
+
const stack = new Error().stack;
|
278
289
|
try {
|
279
290
|
return await this.contract
|
280
291
|
.getFunction("burnFrom(address,uint256)")
|
281
292
|
.staticCall(account, amount, overrides || {});
|
282
293
|
} catch (e) {
|
283
|
-
throw transformEtherError(e, undefined);
|
294
|
+
throw transformEtherError(e, undefined, stack);
|
284
295
|
}
|
285
296
|
},
|
286
297
|
async decreaseAllowance(
|
@@ -288,12 +299,13 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
288
299
|
subtractedValue: BigNumberish,
|
289
300
|
overrides?: Overrides
|
290
301
|
): Promise<boolean> {
|
302
|
+
const stack = new Error().stack;
|
291
303
|
try {
|
292
304
|
return await this.contract
|
293
305
|
.getFunction("decreaseAllowance(address,uint256)")
|
294
306
|
.staticCall(spender, subtractedValue, overrides || {});
|
295
307
|
} catch (e) {
|
296
|
-
throw transformEtherError(e, undefined);
|
308
|
+
throw transformEtherError(e, undefined, stack);
|
297
309
|
}
|
298
310
|
},
|
299
311
|
async increaseAllowance(
|
@@ -301,30 +313,33 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
301
313
|
addedValue: BigNumberish,
|
302
314
|
overrides?: Overrides
|
303
315
|
): Promise<boolean> {
|
316
|
+
const stack = new Error().stack;
|
304
317
|
try {
|
305
318
|
return await this.contract
|
306
319
|
.getFunction("increaseAllowance(address,uint256)")
|
307
320
|
.staticCall(spender, addedValue, overrides || {});
|
308
321
|
} catch (e) {
|
309
|
-
throw transformEtherError(e, undefined);
|
322
|
+
throw transformEtherError(e, undefined, stack);
|
310
323
|
}
|
311
324
|
},
|
312
325
|
async renounceOwnership(overrides?: Overrides): Promise<void> {
|
326
|
+
const stack = new Error().stack;
|
313
327
|
try {
|
314
328
|
return await this.contract
|
315
329
|
.getFunction("renounceOwnership()")
|
316
330
|
.staticCall(overrides || {});
|
317
331
|
} catch (e) {
|
318
|
-
throw transformEtherError(e, undefined);
|
332
|
+
throw transformEtherError(e, undefined, stack);
|
319
333
|
}
|
320
334
|
},
|
321
335
|
async setLocker(_locker: string, overrides?: Overrides): Promise<void> {
|
336
|
+
const stack = new Error().stack;
|
322
337
|
try {
|
323
338
|
return await this.contract
|
324
339
|
.getFunction("setLocker(address)")
|
325
340
|
.staticCall(_locker, overrides || {});
|
326
341
|
} catch (e) {
|
327
|
-
throw transformEtherError(e, undefined);
|
342
|
+
throw transformEtherError(e, undefined, stack);
|
328
343
|
}
|
329
344
|
},
|
330
345
|
async transfer(
|
@@ -332,12 +347,13 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
332
347
|
amount: BigNumberish,
|
333
348
|
overrides?: Overrides
|
334
349
|
): Promise<boolean> {
|
350
|
+
const stack = new Error().stack;
|
335
351
|
try {
|
336
352
|
return await this.contract
|
337
353
|
.getFunction("transfer(address,uint256)")
|
338
354
|
.staticCall(recipient, amount, overrides || {});
|
339
355
|
} catch (e) {
|
340
|
-
throw transformEtherError(e, undefined);
|
356
|
+
throw transformEtherError(e, undefined, stack);
|
341
357
|
}
|
342
358
|
},
|
343
359
|
async transferFrom(
|
@@ -346,24 +362,26 @@ export class ERC20ContractView extends ContractView<ERC20> {
|
|
346
362
|
amount: BigNumberish,
|
347
363
|
overrides?: Overrides
|
348
364
|
): Promise<boolean> {
|
365
|
+
const stack = new Error().stack;
|
349
366
|
try {
|
350
367
|
return await this.contract
|
351
368
|
.getFunction("transferFrom(address,address,uint256)")
|
352
369
|
.staticCall(sender, recipient, amount, overrides || {});
|
353
370
|
} catch (e) {
|
354
|
-
throw transformEtherError(e, undefined);
|
371
|
+
throw transformEtherError(e, undefined, stack);
|
355
372
|
}
|
356
373
|
},
|
357
374
|
async transferOwnership(
|
358
375
|
newOwner: string,
|
359
376
|
overrides?: Overrides
|
360
377
|
): Promise<void> {
|
378
|
+
const stack = new Error().stack;
|
361
379
|
try {
|
362
380
|
return await this.contract
|
363
381
|
.getFunction("transferOwnership(address)")
|
364
382
|
.staticCall(newOwner, overrides || {});
|
365
383
|
} catch (e) {
|
366
|
-
throw transformEtherError(e, undefined);
|
384
|
+
throw transformEtherError(e, undefined, stack);
|
367
385
|
}
|
368
386
|
},
|
369
387
|
};
|
@@ -843,6 +861,9 @@ export function getERC20ContractOnContext(
|
|
843
861
|
): ERC20BoundContractView {
|
844
862
|
const view = getERC20Contract(context.getChainId(), address);
|
845
863
|
const boundView = new ERC20BoundContractView(address, view);
|
846
|
-
boundView.context = context
|
864
|
+
boundView.context = context;
|
865
|
+
if (boundView.callStatic) {
|
866
|
+
boundView.callStatic.context = context;
|
867
|
+
}
|
847
868
|
return boundView;
|
848
869
|
}
|
@@ -103,45 +103,50 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
103
103
|
}
|
104
104
|
|
105
105
|
async name(overrides?: Overrides): Promise<string> {
|
106
|
+
const stack = new Error().stack;
|
106
107
|
try {
|
107
108
|
return await this.contract.getFunction("name()")(overrides || {});
|
108
109
|
} catch (e) {
|
109
|
-
throw transformEtherError(e, undefined);
|
110
|
+
throw transformEtherError(e, undefined, stack);
|
110
111
|
}
|
111
112
|
}
|
112
113
|
|
113
114
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
115
|
+
const stack = new Error().stack;
|
114
116
|
try {
|
115
117
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
116
118
|
} catch (e) {
|
117
|
-
throw transformEtherError(e, undefined);
|
119
|
+
throw transformEtherError(e, undefined, stack);
|
118
120
|
}
|
119
121
|
}
|
120
122
|
|
121
123
|
async decimals(overrides?: Overrides): Promise<bigint> {
|
124
|
+
const stack = new Error().stack;
|
122
125
|
try {
|
123
126
|
return await this.contract.getFunction("decimals()")(overrides || {});
|
124
127
|
} catch (e) {
|
125
|
-
throw transformEtherError(e, undefined);
|
128
|
+
throw transformEtherError(e, undefined, stack);
|
126
129
|
}
|
127
130
|
}
|
128
131
|
|
129
132
|
async balanceOf(who: string, overrides?: Overrides): Promise<bigint> {
|
133
|
+
const stack = new Error().stack;
|
130
134
|
try {
|
131
135
|
return await this.contract.getFunction("balanceOf(address)")(
|
132
136
|
who,
|
133
137
|
overrides || {}
|
134
138
|
);
|
135
139
|
} catch (e) {
|
136
|
-
throw transformEtherError(e, undefined);
|
140
|
+
throw transformEtherError(e, undefined, stack);
|
137
141
|
}
|
138
142
|
}
|
139
143
|
|
140
144
|
async symbol(overrides?: Overrides): Promise<string> {
|
145
|
+
const stack = new Error().stack;
|
141
146
|
try {
|
142
147
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
143
148
|
} catch (e) {
|
144
|
-
throw transformEtherError(e, undefined);
|
149
|
+
throw transformEtherError(e, undefined, stack);
|
145
150
|
}
|
146
151
|
}
|
147
152
|
|
@@ -150,6 +155,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
150
155
|
spender: string,
|
151
156
|
overrides?: Overrides
|
152
157
|
): Promise<bigint> {
|
158
|
+
const stack = new Error().stack;
|
153
159
|
try {
|
154
160
|
return await this.contract.getFunction("allowance(address,address)")(
|
155
161
|
owner,
|
@@ -157,7 +163,7 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
157
163
|
overrides || {}
|
158
164
|
);
|
159
165
|
} catch (e) {
|
160
|
-
throw transformEtherError(e, undefined);
|
166
|
+
throw transformEtherError(e, undefined, stack);
|
161
167
|
}
|
162
168
|
}
|
163
169
|
|
@@ -169,12 +175,13 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
169
175
|
value: BigNumberish,
|
170
176
|
overrides?: Overrides
|
171
177
|
): Promise<boolean> {
|
178
|
+
const stack = new Error().stack;
|
172
179
|
try {
|
173
180
|
return await this.contract
|
174
181
|
.getFunction("approve(address,uint256)")
|
175
182
|
.staticCall(spender, value, overrides || {});
|
176
183
|
} catch (e) {
|
177
|
-
throw transformEtherError(e, undefined);
|
184
|
+
throw transformEtherError(e, undefined, stack);
|
178
185
|
}
|
179
186
|
},
|
180
187
|
async transferFrom(
|
@@ -183,12 +190,13 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
183
190
|
value: BigNumberish,
|
184
191
|
overrides?: Overrides
|
185
192
|
): Promise<boolean> {
|
193
|
+
const stack = new Error().stack;
|
186
194
|
try {
|
187
195
|
return await this.contract
|
188
196
|
.getFunction("transferFrom(address,address,uint256)")
|
189
197
|
.staticCall(from, to, value, overrides || {});
|
190
198
|
} catch (e) {
|
191
|
-
throw transformEtherError(e, undefined);
|
199
|
+
throw transformEtherError(e, undefined, stack);
|
192
200
|
}
|
193
201
|
},
|
194
202
|
async transfer(
|
@@ -196,12 +204,13 @@ export class ERC20BytesContractView extends ContractView<ERC20Bytes> {
|
|
196
204
|
value: BigNumberish,
|
197
205
|
overrides?: Overrides
|
198
206
|
): Promise<boolean> {
|
207
|
+
const stack = new Error().stack;
|
199
208
|
try {
|
200
209
|
return await this.contract
|
201
210
|
.getFunction("transfer(address,uint256)")
|
202
211
|
.staticCall(to, value, overrides || {});
|
203
212
|
} catch (e) {
|
204
|
-
throw transformEtherError(e, undefined);
|
213
|
+
throw transformEtherError(e, undefined, stack);
|
205
214
|
}
|
206
215
|
},
|
207
216
|
};
|
@@ -508,6 +517,9 @@ export function getERC20BytesContractOnContext(
|
|
508
517
|
): ERC20BytesBoundContractView {
|
509
518
|
const view = getERC20BytesContract(context.getChainId(), address);
|
510
519
|
const boundView = new ERC20BytesBoundContractView(address, view);
|
511
|
-
boundView.context = context
|
520
|
+
boundView.context = context;
|
521
|
+
if (boundView.callStatic) {
|
522
|
+
boundView.callStatic.context = context;
|
523
|
+
}
|
512
524
|
return boundView;
|
513
525
|
}
|
@@ -155,21 +155,23 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
155
155
|
}
|
156
156
|
|
157
157
|
async totalSupply(overrides?: Overrides): Promise<bigint> {
|
158
|
+
const stack = new Error().stack;
|
158
159
|
try {
|
159
160
|
return await this.contract.getFunction("totalSupply()")(overrides || {});
|
160
161
|
} catch (e) {
|
161
|
-
throw transformEtherError(e, undefined);
|
162
|
+
throw transformEtherError(e, undefined, stack);
|
162
163
|
}
|
163
164
|
}
|
164
165
|
|
165
166
|
async balanceOf(owner: string, overrides?: Overrides): Promise<bigint> {
|
167
|
+
const stack = new Error().stack;
|
166
168
|
try {
|
167
169
|
return await this.contract.getFunction("balanceOf(address)")(
|
168
170
|
owner,
|
169
171
|
overrides || {}
|
170
172
|
);
|
171
173
|
} catch (e) {
|
172
|
-
throw transformEtherError(e, undefined);
|
174
|
+
throw transformEtherError(e, undefined, stack);
|
173
175
|
}
|
174
176
|
}
|
175
177
|
|
@@ -177,13 +179,14 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
177
179
|
tokenId: BigNumberish,
|
178
180
|
overrides?: Overrides
|
179
181
|
): Promise<string> {
|
182
|
+
const stack = new Error().stack;
|
180
183
|
try {
|
181
184
|
return await this.contract.getFunction("getApproved(uint256)")(
|
182
185
|
tokenId,
|
183
186
|
overrides || {}
|
184
187
|
);
|
185
188
|
} catch (e) {
|
186
|
-
throw transformEtherError(e, undefined);
|
189
|
+
throw transformEtherError(e, undefined, stack);
|
187
190
|
}
|
188
191
|
}
|
189
192
|
|
@@ -192,31 +195,34 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
192
195
|
operator: string,
|
193
196
|
overrides?: Overrides
|
194
197
|
): Promise<boolean> {
|
198
|
+
const stack = new Error().stack;
|
195
199
|
try {
|
196
200
|
return await this.contract.getFunction(
|
197
201
|
"isApprovedForAll(address,address)"
|
198
202
|
)(owner, operator, overrides || {});
|
199
203
|
} catch (e) {
|
200
|
-
throw transformEtherError(e, undefined);
|
204
|
+
throw transformEtherError(e, undefined, stack);
|
201
205
|
}
|
202
206
|
}
|
203
207
|
|
204
208
|
async name(overrides?: Overrides): Promise<string> {
|
209
|
+
const stack = new Error().stack;
|
205
210
|
try {
|
206
211
|
return await this.contract.getFunction("name()")(overrides || {});
|
207
212
|
} catch (e) {
|
208
|
-
throw transformEtherError(e, undefined);
|
213
|
+
throw transformEtherError(e, undefined, stack);
|
209
214
|
}
|
210
215
|
}
|
211
216
|
|
212
217
|
async ownerOf(tokenId: BigNumberish, overrides?: Overrides): Promise<string> {
|
218
|
+
const stack = new Error().stack;
|
213
219
|
try {
|
214
220
|
return await this.contract.getFunction("ownerOf(uint256)")(
|
215
221
|
tokenId,
|
216
222
|
overrides || {}
|
217
223
|
);
|
218
224
|
} catch (e) {
|
219
|
-
throw transformEtherError(e, undefined);
|
225
|
+
throw transformEtherError(e, undefined, stack);
|
220
226
|
}
|
221
227
|
}
|
222
228
|
|
@@ -224,21 +230,23 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
224
230
|
interfaceId: BytesLike,
|
225
231
|
overrides?: Overrides
|
226
232
|
): Promise<boolean> {
|
233
|
+
const stack = new Error().stack;
|
227
234
|
try {
|
228
235
|
return await this.contract.getFunction("supportsInterface(bytes4)")(
|
229
236
|
interfaceId,
|
230
237
|
overrides || {}
|
231
238
|
);
|
232
239
|
} catch (e) {
|
233
|
-
throw transformEtherError(e, undefined);
|
240
|
+
throw transformEtherError(e, undefined, stack);
|
234
241
|
}
|
235
242
|
}
|
236
243
|
|
237
244
|
async symbol(overrides?: Overrides): Promise<string> {
|
245
|
+
const stack = new Error().stack;
|
238
246
|
try {
|
239
247
|
return await this.contract.getFunction("symbol()")(overrides || {});
|
240
248
|
} catch (e) {
|
241
|
-
throw transformEtherError(e, undefined);
|
249
|
+
throw transformEtherError(e, undefined, stack);
|
242
250
|
}
|
243
251
|
}
|
244
252
|
|
@@ -246,13 +254,14 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
246
254
|
tokenId: BigNumberish,
|
247
255
|
overrides?: Overrides
|
248
256
|
): Promise<string> {
|
257
|
+
const stack = new Error().stack;
|
249
258
|
try {
|
250
259
|
return await this.contract.getFunction("tokenURI(uint256)")(
|
251
260
|
tokenId,
|
252
261
|
overrides || {}
|
253
262
|
);
|
254
263
|
} catch (e) {
|
255
|
-
throw transformEtherError(e, undefined);
|
264
|
+
throw transformEtherError(e, undefined, stack);
|
256
265
|
}
|
257
266
|
}
|
258
267
|
|
@@ -264,12 +273,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
264
273
|
tokenId: BigNumberish,
|
265
274
|
overrides?: Overrides
|
266
275
|
): Promise<void> {
|
276
|
+
const stack = new Error().stack;
|
267
277
|
try {
|
268
278
|
return await this.contract
|
269
279
|
.getFunction("approve(address,uint256)")
|
270
280
|
.staticCall(to, tokenId, overrides || {});
|
271
281
|
} catch (e) {
|
272
|
-
throw transformEtherError(e, undefined);
|
282
|
+
throw transformEtherError(e, undefined, stack);
|
273
283
|
}
|
274
284
|
},
|
275
285
|
async safeTransferFrom_address_address_uint256(
|
@@ -278,12 +288,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
278
288
|
tokenId: BigNumberish,
|
279
289
|
overrides?: Overrides
|
280
290
|
): Promise<void> {
|
291
|
+
const stack = new Error().stack;
|
281
292
|
try {
|
282
293
|
return await this.contract
|
283
294
|
.getFunction("safeTransferFrom(address,address,uint256)")
|
284
295
|
.staticCall(from, to, tokenId, overrides || {});
|
285
296
|
} catch (e) {
|
286
|
-
throw transformEtherError(e, undefined);
|
297
|
+
throw transformEtherError(e, undefined, stack);
|
287
298
|
}
|
288
299
|
},
|
289
300
|
async safeTransferFrom_address_address_uint256_bytes(
|
@@ -293,12 +304,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
293
304
|
data: BytesLike,
|
294
305
|
overrides?: Overrides
|
295
306
|
): Promise<void> {
|
307
|
+
const stack = new Error().stack;
|
296
308
|
try {
|
297
309
|
return await this.contract
|
298
310
|
.getFunction("safeTransferFrom(address,address,uint256,bytes)")
|
299
311
|
.staticCall(from, to, tokenId, data, overrides || {});
|
300
312
|
} catch (e) {
|
301
|
-
throw transformEtherError(e, undefined);
|
313
|
+
throw transformEtherError(e, undefined, stack);
|
302
314
|
}
|
303
315
|
},
|
304
316
|
async setApprovalForAll(
|
@@ -306,12 +318,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
306
318
|
_approved: boolean,
|
307
319
|
overrides?: Overrides
|
308
320
|
): Promise<void> {
|
321
|
+
const stack = new Error().stack;
|
309
322
|
try {
|
310
323
|
return await this.contract
|
311
324
|
.getFunction("setApprovalForAll(address,bool)")
|
312
325
|
.staticCall(operator, _approved, overrides || {});
|
313
326
|
} catch (e) {
|
314
|
-
throw transformEtherError(e, undefined);
|
327
|
+
throw transformEtherError(e, undefined, stack);
|
315
328
|
}
|
316
329
|
},
|
317
330
|
async transferFrom(
|
@@ -320,12 +333,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
|
|
320
333
|
tokenId: BigNumberish,
|
321
334
|
overrides?: Overrides
|
322
335
|
): Promise<void> {
|
336
|
+
const stack = new Error().stack;
|
323
337
|
try {
|
324
338
|
return await this.contract
|
325
339
|
.getFunction("transferFrom(address,address,uint256)")
|
326
340
|
.staticCall(from, to, tokenId, overrides || {});
|
327
341
|
} catch (e) {
|
328
|
-
throw transformEtherError(e, undefined);
|
342
|
+
throw transformEtherError(e, undefined, stack);
|
329
343
|
}
|
330
344
|
},
|
331
345
|
};
|
@@ -777,6 +791,9 @@ export function getERC721ContractOnContext(
|
|
777
791
|
): ERC721BoundContractView {
|
778
792
|
const view = getERC721Contract(context.getChainId(), address);
|
779
793
|
const boundView = new ERC721BoundContractView(address, view);
|
780
|
-
boundView.context = context
|
794
|
+
boundView.context = context;
|
795
|
+
if (boundView.callStatic) {
|
796
|
+
boundView.callStatic.context = context;
|
797
|
+
}
|
781
798
|
return boundView;
|
782
799
|
}
|