@woof-software/contracts-tools-sdk-ethers 0.0.7 → 0.0.8
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.
|
@@ -26,7 +26,9 @@ export declare class MulticallUnit extends BaseContract {
|
|
|
26
26
|
isSuccess(tags: MulticallTags): boolean | undefined;
|
|
27
27
|
getRaw(tags: MulticallTags): string | null;
|
|
28
28
|
getSingle<T>(tags: MulticallTags): T | null;
|
|
29
|
+
getSingleOrThrow<T>(tags: MulticallTags): T;
|
|
29
30
|
getArray<T>(tags: MulticallTags, deep?: boolean): T | null;
|
|
31
|
+
getArrayOrThrow<T>(tags: MulticallTags, deep?: boolean): T;
|
|
30
32
|
run(options?: Partial<MulticallOptions>): Promise<boolean>;
|
|
31
33
|
private processStaticCalls;
|
|
32
34
|
private processMutableCalls;
|
|
@@ -85,6 +85,12 @@ export class MulticallUnit extends BaseContract {
|
|
|
85
85
|
const [value] = data.call.contractInterface.decodeFunctionResult(data.call.method, data.rawData);
|
|
86
86
|
return value;
|
|
87
87
|
}
|
|
88
|
+
getSingleOrThrow(tags) {
|
|
89
|
+
const value = this.get(tags);
|
|
90
|
+
if (value === null)
|
|
91
|
+
throw MULTICALL_ERRORS.RESULT_NOT_FOUND;
|
|
92
|
+
return value;
|
|
93
|
+
}
|
|
88
94
|
getArray(tags, deep = false) {
|
|
89
95
|
const data = this.getDecodableData(tags);
|
|
90
96
|
if (data === null)
|
|
@@ -93,6 +99,12 @@ export class MulticallUnit extends BaseContract {
|
|
|
93
99
|
.contractInterface.decodeFunctionResult(data.call.method, data.rawData)
|
|
94
100
|
.toArray(deep);
|
|
95
101
|
}
|
|
102
|
+
getArrayOrThrow(tags, deep = false) {
|
|
103
|
+
const value = this.getArray(tags, deep);
|
|
104
|
+
if (value === null)
|
|
105
|
+
throw MULTICALL_ERRORS.RESULT_NOT_FOUND;
|
|
106
|
+
return value;
|
|
107
|
+
}
|
|
96
108
|
async run(options = {}) {
|
|
97
109
|
const runOptions = {
|
|
98
110
|
...this._multicallOptions,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@woof-software/contracts-tools-sdk-ethers",
|
|
3
3
|
"description": "Module simplify smart contract interactions and multicall3 aggregation on the Ethereum blockchain and other EVM-compatible networks.",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/woof-compound/sandbox-sdks.git"
|