@gearbox-protocol/sdk 14.11.1 → 14.11.2
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/dist/cjs/dev/abi.js +51 -0
- package/dist/cjs/dev/claimFromFaucet.js +4 -10
- package/dist/cjs/dev/index.js +2 -0
- package/dist/esm/dev/abi.js +49 -0
- package/dist/esm/dev/claimFromFaucet.js +1 -9
- package/dist/esm/dev/index.js +1 -0
- package/dist/types/dev/abi.d.ts +97 -0
- package/dist/types/dev/claimFromFaucet.d.ts +1 -1
- package/dist/types/dev/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/cjs/dev/abi.js
CHANGED
|
@@ -18,7 +18,9 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var abi_exports = {};
|
|
20
20
|
__export(abi_exports, {
|
|
21
|
+
faucetAbi: () => faucetAbi,
|
|
21
22
|
iDegenNftv2Abi: () => iDegenNftv2Abi,
|
|
23
|
+
iOnchainExecutionIdAbi: () => iOnchainExecutionIdAbi,
|
|
22
24
|
iOwnableAbi: () => iOwnableAbi,
|
|
23
25
|
iaclTraitAbi: () => iaclTraitAbi
|
|
24
26
|
});
|
|
@@ -34,9 +36,58 @@ const iDegenNftv2Abi = (0, import_viem.parseAbi)([
|
|
|
34
36
|
"function minter() external view returns (address)",
|
|
35
37
|
"function mint(address to, uint256 amount) external"
|
|
36
38
|
]);
|
|
39
|
+
const faucetAbi = (0, import_viem.parseAbi)([
|
|
40
|
+
"function minAmountUSD() external view returns (uint256)",
|
|
41
|
+
"function claim() external",
|
|
42
|
+
"function claim(uint256 amountUSD) external",
|
|
43
|
+
"function claim((address token, uint256 amount)[] claims) external"
|
|
44
|
+
]);
|
|
45
|
+
const iOnchainExecutionIdAbi = [
|
|
46
|
+
{
|
|
47
|
+
type: "function",
|
|
48
|
+
name: "deployer",
|
|
49
|
+
inputs: [],
|
|
50
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
51
|
+
stateMutability: "view"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "function",
|
|
55
|
+
name: "executionId",
|
|
56
|
+
inputs: [],
|
|
57
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
58
|
+
stateMutability: "view"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "function",
|
|
62
|
+
name: "forkAlias",
|
|
63
|
+
inputs: [],
|
|
64
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
65
|
+
stateMutability: "view"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "function",
|
|
69
|
+
name: "info",
|
|
70
|
+
inputs: [],
|
|
71
|
+
outputs: [
|
|
72
|
+
{
|
|
73
|
+
name: "",
|
|
74
|
+
type: "tuple",
|
|
75
|
+
internalType: "struct ExecutionId.Info",
|
|
76
|
+
components: [
|
|
77
|
+
{ name: "deployer", type: "string", internalType: "string" },
|
|
78
|
+
{ name: "executionId", type: "string", internalType: "string" },
|
|
79
|
+
{ name: "forkAlias", type: "string", internalType: "string" }
|
|
80
|
+
]
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
stateMutability: "view"
|
|
84
|
+
}
|
|
85
|
+
];
|
|
37
86
|
// Annotate the CommonJS export names for ESM import in node:
|
|
38
87
|
0 && (module.exports = {
|
|
88
|
+
faucetAbi,
|
|
39
89
|
iDegenNftv2Abi,
|
|
90
|
+
iOnchainExecutionIdAbi,
|
|
40
91
|
iOwnableAbi,
|
|
41
92
|
iaclTraitAbi
|
|
42
93
|
});
|
|
@@ -21,15 +21,9 @@ __export(claimFromFaucet_exports, {
|
|
|
21
21
|
claimFromFaucet: () => claimFromFaucet
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(claimFromFaucet_exports);
|
|
24
|
-
var import_viem = require("viem");
|
|
25
24
|
var import_actions = require("viem/actions");
|
|
26
25
|
var import_sdk = require("../sdk/index.js");
|
|
27
|
-
|
|
28
|
-
"function minAmountUSD() external view returns (uint256)",
|
|
29
|
-
"function claim() external",
|
|
30
|
-
"function claim(uint256 amountUSD) external",
|
|
31
|
-
"function claim((address token, uint256 amount)[] claims) external"
|
|
32
|
-
]);
|
|
26
|
+
var import_abi = require("./abi.js");
|
|
33
27
|
async function claimFromFaucet(opts) {
|
|
34
28
|
const {
|
|
35
29
|
sdk,
|
|
@@ -60,7 +54,7 @@ async function claimFromFaucet(opts) {
|
|
|
60
54
|
} else if (typeof amount === "function") {
|
|
61
55
|
const minAmountUSD = await (0, import_actions.readContract)(publicClient, {
|
|
62
56
|
address: faucet,
|
|
63
|
-
abi: faucetAbi,
|
|
57
|
+
abi: import_abi.faucetAbi,
|
|
64
58
|
functionName: "minAmountUSD"
|
|
65
59
|
});
|
|
66
60
|
logger?.debug(`faucet min amount USD: ${minAmountUSD}`);
|
|
@@ -78,7 +72,7 @@ async function claimFromFaucet(opts) {
|
|
|
78
72
|
const gas = await publicClient.estimateContractGas({
|
|
79
73
|
account: claimer,
|
|
80
74
|
address: faucet,
|
|
81
|
-
abi: faucetAbi,
|
|
75
|
+
abi: import_abi.faucetAbi,
|
|
82
76
|
functionName: "claim",
|
|
83
77
|
args
|
|
84
78
|
});
|
|
@@ -86,7 +80,7 @@ async function claimFromFaucet(opts) {
|
|
|
86
80
|
const { request } = await publicClient.simulateContract({
|
|
87
81
|
account: claimer,
|
|
88
82
|
address: faucet,
|
|
89
|
-
abi: faucetAbi,
|
|
83
|
+
abi: import_abi.faucetAbi,
|
|
90
84
|
functionName: "claim",
|
|
91
85
|
args,
|
|
92
86
|
chain: wallet.chain,
|
package/dist/cjs/dev/index.js
CHANGED
|
@@ -24,6 +24,7 @@ __export(dev_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(dev_exports);
|
|
26
26
|
__reExport(dev_exports, require("./AccountOpener.js"), module.exports);
|
|
27
|
+
__reExport(dev_exports, require("./abi.js"), module.exports);
|
|
27
28
|
__reExport(dev_exports, require("./calcLiquidatableLTs.js"), module.exports);
|
|
28
29
|
__reExport(dev_exports, require("./claimDSToken.js"), module.exports);
|
|
29
30
|
__reExport(dev_exports, require("./claimFromFaucet.js"), module.exports);
|
|
@@ -49,6 +50,7 @@ __reExport(dev_exports, require("./types.js"), module.exports);
|
|
|
49
50
|
isRangeError,
|
|
50
51
|
logSplitterTransport,
|
|
51
52
|
...require("./AccountOpener.js"),
|
|
53
|
+
...require("./abi.js"),
|
|
52
54
|
...require("./calcLiquidatableLTs.js"),
|
|
53
55
|
...require("./claimDSToken.js"),
|
|
54
56
|
...require("./claimFromFaucet.js"),
|
package/dist/esm/dev/abi.js
CHANGED
|
@@ -9,8 +9,57 @@ const iDegenNftv2Abi = parseAbi([
|
|
|
9
9
|
"function minter() external view returns (address)",
|
|
10
10
|
"function mint(address to, uint256 amount) external"
|
|
11
11
|
]);
|
|
12
|
+
const faucetAbi = parseAbi([
|
|
13
|
+
"function minAmountUSD() external view returns (uint256)",
|
|
14
|
+
"function claim() external",
|
|
15
|
+
"function claim(uint256 amountUSD) external",
|
|
16
|
+
"function claim((address token, uint256 amount)[] claims) external"
|
|
17
|
+
]);
|
|
18
|
+
const iOnchainExecutionIdAbi = [
|
|
19
|
+
{
|
|
20
|
+
type: "function",
|
|
21
|
+
name: "deployer",
|
|
22
|
+
inputs: [],
|
|
23
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
24
|
+
stateMutability: "view"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
type: "function",
|
|
28
|
+
name: "executionId",
|
|
29
|
+
inputs: [],
|
|
30
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
31
|
+
stateMutability: "view"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
type: "function",
|
|
35
|
+
name: "forkAlias",
|
|
36
|
+
inputs: [],
|
|
37
|
+
outputs: [{ name: "", type: "string", internalType: "string" }],
|
|
38
|
+
stateMutability: "view"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
type: "function",
|
|
42
|
+
name: "info",
|
|
43
|
+
inputs: [],
|
|
44
|
+
outputs: [
|
|
45
|
+
{
|
|
46
|
+
name: "",
|
|
47
|
+
type: "tuple",
|
|
48
|
+
internalType: "struct ExecutionId.Info",
|
|
49
|
+
components: [
|
|
50
|
+
{ name: "deployer", type: "string", internalType: "string" },
|
|
51
|
+
{ name: "executionId", type: "string", internalType: "string" },
|
|
52
|
+
{ name: "forkAlias", type: "string", internalType: "string" }
|
|
53
|
+
]
|
|
54
|
+
}
|
|
55
|
+
],
|
|
56
|
+
stateMutability: "view"
|
|
57
|
+
}
|
|
58
|
+
];
|
|
12
59
|
export {
|
|
60
|
+
faucetAbi,
|
|
13
61
|
iDegenNftv2Abi,
|
|
62
|
+
iOnchainExecutionIdAbi,
|
|
14
63
|
iOwnableAbi,
|
|
15
64
|
iaclTraitAbi
|
|
16
65
|
};
|
|
@@ -1,14 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
parseAbi
|
|
3
|
-
} from "viem";
|
|
4
1
|
import { readContract } from "viem/actions";
|
|
5
2
|
import { formatBN } from "../sdk/index.js";
|
|
6
|
-
|
|
7
|
-
"function minAmountUSD() external view returns (uint256)",
|
|
8
|
-
"function claim() external",
|
|
9
|
-
"function claim(uint256 amountUSD) external",
|
|
10
|
-
"function claim((address token, uint256 amount)[] claims) external"
|
|
11
|
-
]);
|
|
3
|
+
import { faucetAbi } from "./abi.js";
|
|
12
4
|
async function claimFromFaucet(opts) {
|
|
13
5
|
const {
|
|
14
6
|
sdk,
|
package/dist/esm/dev/index.js
CHANGED
package/dist/types/dev/abi.d.ts
CHANGED
|
@@ -37,3 +37,100 @@ export declare const iDegenNftv2Abi: readonly [{
|
|
|
37
37
|
}];
|
|
38
38
|
readonly outputs: readonly [];
|
|
39
39
|
}];
|
|
40
|
+
export declare const faucetAbi: readonly [{
|
|
41
|
+
readonly name: "minAmountUSD";
|
|
42
|
+
readonly type: "function";
|
|
43
|
+
readonly stateMutability: "view";
|
|
44
|
+
readonly inputs: readonly [];
|
|
45
|
+
readonly outputs: readonly [{
|
|
46
|
+
readonly type: "uint256";
|
|
47
|
+
}];
|
|
48
|
+
}, {
|
|
49
|
+
readonly name: "claim";
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly stateMutability: "nonpayable";
|
|
52
|
+
readonly inputs: readonly [];
|
|
53
|
+
readonly outputs: readonly [];
|
|
54
|
+
}, {
|
|
55
|
+
readonly name: "claim";
|
|
56
|
+
readonly type: "function";
|
|
57
|
+
readonly stateMutability: "nonpayable";
|
|
58
|
+
readonly inputs: readonly [{
|
|
59
|
+
readonly type: "uint256";
|
|
60
|
+
readonly name: "amountUSD";
|
|
61
|
+
}];
|
|
62
|
+
readonly outputs: readonly [];
|
|
63
|
+
}, {
|
|
64
|
+
readonly name: "claim";
|
|
65
|
+
readonly type: "function";
|
|
66
|
+
readonly stateMutability: "nonpayable";
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly type: "tuple[]";
|
|
69
|
+
readonly components: readonly [{
|
|
70
|
+
readonly type: "address";
|
|
71
|
+
readonly name: "token";
|
|
72
|
+
}, {
|
|
73
|
+
readonly type: "uint256";
|
|
74
|
+
readonly name: "amount";
|
|
75
|
+
}];
|
|
76
|
+
readonly name: "claims";
|
|
77
|
+
}];
|
|
78
|
+
readonly outputs: readonly [];
|
|
79
|
+
}];
|
|
80
|
+
/**
|
|
81
|
+
* This contract is deployed on testnets and contains testnet executionId and forkAlias
|
|
82
|
+
*/
|
|
83
|
+
export declare const iOnchainExecutionIdAbi: readonly [{
|
|
84
|
+
readonly type: "function";
|
|
85
|
+
readonly name: "deployer";
|
|
86
|
+
readonly inputs: readonly [];
|
|
87
|
+
readonly outputs: readonly [{
|
|
88
|
+
readonly name: "";
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly internalType: "string";
|
|
91
|
+
}];
|
|
92
|
+
readonly stateMutability: "view";
|
|
93
|
+
}, {
|
|
94
|
+
readonly type: "function";
|
|
95
|
+
readonly name: "executionId";
|
|
96
|
+
readonly inputs: readonly [];
|
|
97
|
+
readonly outputs: readonly [{
|
|
98
|
+
readonly name: "";
|
|
99
|
+
readonly type: "string";
|
|
100
|
+
readonly internalType: "string";
|
|
101
|
+
}];
|
|
102
|
+
readonly stateMutability: "view";
|
|
103
|
+
}, {
|
|
104
|
+
readonly type: "function";
|
|
105
|
+
readonly name: "forkAlias";
|
|
106
|
+
readonly inputs: readonly [];
|
|
107
|
+
readonly outputs: readonly [{
|
|
108
|
+
readonly name: "";
|
|
109
|
+
readonly type: "string";
|
|
110
|
+
readonly internalType: "string";
|
|
111
|
+
}];
|
|
112
|
+
readonly stateMutability: "view";
|
|
113
|
+
}, {
|
|
114
|
+
readonly type: "function";
|
|
115
|
+
readonly name: "info";
|
|
116
|
+
readonly inputs: readonly [];
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly name: "";
|
|
119
|
+
readonly type: "tuple";
|
|
120
|
+
readonly internalType: "struct ExecutionId.Info";
|
|
121
|
+
readonly components: readonly [{
|
|
122
|
+
readonly name: "deployer";
|
|
123
|
+
readonly type: "string";
|
|
124
|
+
readonly internalType: "string";
|
|
125
|
+
}, {
|
|
126
|
+
readonly name: "executionId";
|
|
127
|
+
readonly type: "string";
|
|
128
|
+
readonly internalType: "string";
|
|
129
|
+
}, {
|
|
130
|
+
readonly name: "forkAlias";
|
|
131
|
+
readonly type: "string";
|
|
132
|
+
readonly internalType: "string";
|
|
133
|
+
}];
|
|
134
|
+
}];
|
|
135
|
+
readonly stateMutability: "view";
|
|
136
|
+
}];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Account, Address, PublicClient, WalletClient } from "viem";
|
|
2
2
|
import { type ILogger, type OnchainSDK } from "../sdk/index.js";
|
|
3
3
|
interface TokenClaim {
|
|
4
4
|
token: Address;
|