@vetro-protocol/gateway 1.2.0 → 1.3.1
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/_esm/actions/index.js +49 -20
- package/_esm/actions/index.js.map +7 -1
- package/_esm/chunk-ZE4YZMXK.js +1326 -0
- package/_esm/chunk-ZE4YZMXK.js.map +7 -0
- package/_esm/index.js +57 -30
- package/_esm/index.js.map +7 -1
- package/_types/abi/gatewayAbi.d.ts +34 -0
- package/_types/abi/gatewayAbi.d.ts.map +1 -1
- package/_types/actions/index.d.ts +18 -17
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/getGateway.d.ts.map +1 -1
- package/_types/actions/public/getMaxMint.d.ts +5 -0
- package/_types/actions/public/getMaxMint.d.ts.map +1 -0
- package/_types/actions/public/getMaxWithdraw.d.ts.map +1 -1
- package/_types/actions/public/getMintFee.d.ts.map +1 -1
- package/_types/actions/public/getPeggedToken.d.ts.map +1 -1
- package/_types/actions/public/getRedeemFee.d.ts.map +1 -1
- package/_types/actions/public/getRedeemRequest.d.ts.map +1 -1
- package/_types/actions/public/getTreasury.d.ts.map +1 -1
- package/_types/actions/public/getWithdrawalDelay.d.ts.map +1 -1
- package/_types/actions/public/getWithdrawalDelayEnabled.d.ts.map +1 -1
- package/_types/actions/public/index.d.ts +14 -13
- package/_types/actions/public/index.d.ts.map +1 -1
- package/_types/actions/public/isInstantRedeemWhitelisted.d.ts.map +1 -1
- package/_types/actions/public/previewDeposit.d.ts.map +1 -1
- package/_types/actions/public/previewRedeem.d.ts.map +1 -1
- package/_types/actions/public/previewWithdraw.d.ts.map +1 -1
- package/_types/actions/wallet/cancelRedeemRequest.d.ts +1 -1
- package/_types/actions/wallet/deposit.d.ts +1 -1
- package/_types/actions/wallet/redeem.d.ts +1 -1
- package/_types/actions/wallet/requestRedeem.d.ts +1 -1
- package/_types/gatewayAddresses.d.ts.map +1 -1
- package/_types/index.d.ts +13 -12
- package/_types/index.d.ts.map +1 -1
- package/package.json +7 -5
- package/src/abi/gatewayAbi.ts +28 -0
- package/src/actions/index.ts +18 -17
- package/src/actions/public/getGateway.ts +2 -2
- package/src/actions/public/getMaxMint.ts +33 -0
- package/src/actions/public/getMaxWithdraw.ts +2 -2
- package/src/actions/public/getMintFee.ts +2 -2
- package/src/actions/public/getPeggedToken.ts +2 -2
- package/src/actions/public/getRedeemFee.ts +2 -2
- package/src/actions/public/getRedeemRequest.ts +2 -2
- package/src/actions/public/getTreasury.ts +2 -2
- package/src/actions/public/getWithdrawalDelay.ts +2 -2
- package/src/actions/public/getWithdrawalDelayEnabled.ts +2 -2
- package/src/actions/public/index.ts +14 -13
- package/src/actions/public/isInstantRedeemWhitelisted.ts +2 -2
- package/src/actions/public/previewDeposit.ts +2 -2
- package/src/actions/public/previewRedeem.ts +2 -2
- package/src/actions/public/previewWithdraw.ts +2 -2
- package/src/actions/wallet/cancelRedeemRequest.ts +2 -2
- package/src/actions/wallet/deposit.ts +2 -2
- package/src/actions/wallet/redeem.ts +6 -6
- package/src/actions/wallet/requestRedeem.ts +3 -3
- package/src/gatewayAddresses.ts +6 -17
- package/src/index.ts +11 -8
- package/_esm/abi/gatewayAbi.js +0 -195
- package/_esm/abi/gatewayAbi.js.map +0 -1
- package/_esm/abi/peggedTokenAbi.js +0 -10
- package/_esm/abi/peggedTokenAbi.js.map +0 -1
- package/_esm/actions/public/getGateway.js +0 -30
- package/_esm/actions/public/getGateway.js.map +0 -1
- package/_esm/actions/public/getMaxWithdraw.js +0 -28
- package/_esm/actions/public/getMaxWithdraw.js.map +0 -1
- package/_esm/actions/public/getMintFee.js +0 -28
- package/_esm/actions/public/getMintFee.js.map +0 -1
- package/_esm/actions/public/getPeggedToken.js +0 -23
- package/_esm/actions/public/getPeggedToken.js.map +0 -1
- package/_esm/actions/public/getRedeemFee.js +0 -28
- package/_esm/actions/public/getRedeemFee.js.map +0 -1
- package/_esm/actions/public/getRedeemRequest.js +0 -28
- package/_esm/actions/public/getRedeemRequest.js.map +0 -1
- package/_esm/actions/public/getTreasury.js +0 -23
- package/_esm/actions/public/getTreasury.js.map +0 -1
- package/_esm/actions/public/getWithdrawalDelay.js +0 -23
- package/_esm/actions/public/getWithdrawalDelay.js.map +0 -1
- package/_esm/actions/public/getWithdrawalDelayEnabled.js +0 -23
- package/_esm/actions/public/getWithdrawalDelayEnabled.js.map +0 -1
- package/_esm/actions/public/index.js +0 -14
- package/_esm/actions/public/index.js.map +0 -1
- package/_esm/actions/public/isInstantRedeemWhitelisted.js +0 -28
- package/_esm/actions/public/isInstantRedeemWhitelisted.js.map +0 -1
- package/_esm/actions/public/previewDeposit.js +0 -35
- package/_esm/actions/public/previewDeposit.js.map +0 -1
- package/_esm/actions/public/previewRedeem.js +0 -35
- package/_esm/actions/public/previewRedeem.js.map +0 -1
- package/_esm/actions/public/previewWithdraw.js +0 -35
- package/_esm/actions/public/previewWithdraw.js.map +0 -1
- package/_esm/actions/wallet/cancelRedeemRequest.js +0 -89
- package/_esm/actions/wallet/cancelRedeemRequest.js.map +0 -1
- package/_esm/actions/wallet/deposit.js +0 -193
- package/_esm/actions/wallet/deposit.js.map +0 -1
- package/_esm/actions/wallet/redeem.js +0 -226
- package/_esm/actions/wallet/redeem.js.map +0 -1
- package/_esm/actions/wallet/requestRedeem.js +0 -153
- package/_esm/actions/wallet/requestRedeem.js.map +0 -1
- package/_esm/gatewayAddresses.js +0 -18
- package/_esm/gatewayAddresses.js.map +0 -1
- package/_esm/types.js +0 -2
- package/_esm/types.js.map +0 -1
- package/_esm/utils/isAddressValid.js +0 -3
- package/_esm/utils/isAddressValid.js.map +0 -1
- package/_types/utils/isAddressValid.d.ts +0 -3
- package/_types/utils/isAddressValid.d.ts.map +0 -1
- package/src/utils/isAddressValid.ts +0 -4
package/_esm/abi/gatewayAbi.js
DELETED
|
@@ -1,195 +0,0 @@
|
|
|
1
|
-
export const gatewayAbi = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [],
|
|
4
|
-
name: "PEGGED_TOKEN",
|
|
5
|
-
outputs: [{ type: "address" }],
|
|
6
|
-
stateMutability: "view",
|
|
7
|
-
type: "function",
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
inputs: [{ name: "token_", type: "address" }],
|
|
11
|
-
name: "mintFee",
|
|
12
|
-
outputs: [{ type: "uint256" }],
|
|
13
|
-
stateMutability: "view",
|
|
14
|
-
type: "function",
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
inputs: [],
|
|
18
|
-
name: "owner",
|
|
19
|
-
outputs: [{ type: "address" }],
|
|
20
|
-
stateMutability: "view",
|
|
21
|
-
type: "function",
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
inputs: [{ name: "token_", type: "address" }],
|
|
25
|
-
name: "redeemFee",
|
|
26
|
-
outputs: [{ type: "uint256" }],
|
|
27
|
-
stateMutability: "view",
|
|
28
|
-
type: "function",
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
inputs: [],
|
|
32
|
-
name: "treasury",
|
|
33
|
-
outputs: [{ type: "address" }],
|
|
34
|
-
stateMutability: "view",
|
|
35
|
-
type: "function",
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
inputs: [],
|
|
39
|
-
name: "withdrawalDelayEnabled",
|
|
40
|
-
outputs: [{ type: "bool" }],
|
|
41
|
-
stateMutability: "view",
|
|
42
|
-
type: "function",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
inputs: [],
|
|
46
|
-
name: "withdrawalDelay",
|
|
47
|
-
outputs: [{ type: "uint256" }],
|
|
48
|
-
stateMutability: "view",
|
|
49
|
-
type: "function",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
inputs: [{ name: "user_", type: "address" }],
|
|
53
|
-
name: "getRedeemRequest",
|
|
54
|
-
outputs: [
|
|
55
|
-
{ name: "amountLocked", type: "uint256" },
|
|
56
|
-
{ name: "claimableAt", type: "uint256" },
|
|
57
|
-
],
|
|
58
|
-
stateMutability: "view",
|
|
59
|
-
type: "function",
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
inputs: [{ name: "account_", type: "address" }],
|
|
63
|
-
name: "isInstantRedeemWhitelisted",
|
|
64
|
-
outputs: [{ type: "bool" }],
|
|
65
|
-
stateMutability: "view",
|
|
66
|
-
type: "function",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
inputs: [{ name: "tokenOut_", type: "address" }],
|
|
70
|
-
name: "maxWithdraw",
|
|
71
|
-
outputs: [{ type: "uint256" }],
|
|
72
|
-
stateMutability: "view",
|
|
73
|
-
type: "function",
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
inputs: [{ name: "account_", type: "address" }],
|
|
77
|
-
name: "removeFromInstantRedeemWhitelist",
|
|
78
|
-
outputs: [],
|
|
79
|
-
stateMutability: "nonpayable",
|
|
80
|
-
type: "function",
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
inputs: [
|
|
84
|
-
{ name: "tokenIn_", type: "address" },
|
|
85
|
-
{ name: "amountIn_", type: "uint256" },
|
|
86
|
-
],
|
|
87
|
-
name: "previewDeposit",
|
|
88
|
-
outputs: [{ type: "uint256" }],
|
|
89
|
-
stateMutability: "view",
|
|
90
|
-
type: "function",
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
inputs: [
|
|
94
|
-
{ name: "tokenOut_", type: "address" },
|
|
95
|
-
{ name: "peggedTokenIn_", type: "uint256" },
|
|
96
|
-
],
|
|
97
|
-
name: "previewRedeem",
|
|
98
|
-
outputs: [{ type: "uint256" }],
|
|
99
|
-
stateMutability: "view",
|
|
100
|
-
type: "function",
|
|
101
|
-
},
|
|
102
|
-
{
|
|
103
|
-
inputs: [
|
|
104
|
-
{ name: "tokenOut_", type: "address" },
|
|
105
|
-
{ name: "amountOut_", type: "uint256" },
|
|
106
|
-
],
|
|
107
|
-
name: "previewWithdraw",
|
|
108
|
-
outputs: [{ type: "uint256" }],
|
|
109
|
-
stateMutability: "view",
|
|
110
|
-
type: "function",
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
inputs: [],
|
|
114
|
-
name: "cancelRedeemRequest",
|
|
115
|
-
outputs: [],
|
|
116
|
-
stateMutability: "nonpayable",
|
|
117
|
-
type: "function",
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
inputs: [
|
|
121
|
-
{ name: "tokenIn_", type: "address" },
|
|
122
|
-
{ name: "amountIn_", type: "uint256" },
|
|
123
|
-
{ name: "minPeggedTokenOut_", type: "uint256" },
|
|
124
|
-
{ name: "receiver_", type: "address" },
|
|
125
|
-
],
|
|
126
|
-
name: "deposit",
|
|
127
|
-
outputs: [{ type: "uint256" }],
|
|
128
|
-
stateMutability: "nonpayable",
|
|
129
|
-
type: "function",
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
inputs: [
|
|
133
|
-
{ name: "tokenOut_", type: "address" },
|
|
134
|
-
{ name: "peggedTokenIn_", type: "uint256" },
|
|
135
|
-
{ name: "minAmountOut_", type: "uint256" },
|
|
136
|
-
{ name: "receiver_", type: "address" },
|
|
137
|
-
],
|
|
138
|
-
name: "redeem",
|
|
139
|
-
outputs: [{ type: "uint256" }],
|
|
140
|
-
stateMutability: "nonpayable",
|
|
141
|
-
type: "function",
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
inputs: [{ name: "peggedTokenAmount_", type: "uint256" }],
|
|
145
|
-
name: "requestRedeem",
|
|
146
|
-
outputs: [],
|
|
147
|
-
stateMutability: "nonpayable",
|
|
148
|
-
type: "function",
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
inputs: [{ name: "enabled_", type: "bool" }],
|
|
152
|
-
name: "setWithdrawalDelayEnabled",
|
|
153
|
-
outputs: [],
|
|
154
|
-
stateMutability: "nonpayable",
|
|
155
|
-
type: "function",
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
inputs: [
|
|
159
|
-
{ name: "token_", type: "address" },
|
|
160
|
-
{ name: "newMintFee_", type: "uint256" },
|
|
161
|
-
],
|
|
162
|
-
name: "updateMintFee",
|
|
163
|
-
outputs: [],
|
|
164
|
-
stateMutability: "nonpayable",
|
|
165
|
-
type: "function",
|
|
166
|
-
},
|
|
167
|
-
{
|
|
168
|
-
inputs: [
|
|
169
|
-
{ name: "token_", type: "address" },
|
|
170
|
-
{ name: "newRedeemFee_", type: "uint256" },
|
|
171
|
-
],
|
|
172
|
-
name: "updateRedeemFee",
|
|
173
|
-
outputs: [],
|
|
174
|
-
stateMutability: "nonpayable",
|
|
175
|
-
type: "function",
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
inputs: [{ name: "newDelay_", type: "uint256" }],
|
|
179
|
-
name: "updateWithdrawalDelay",
|
|
180
|
-
outputs: [],
|
|
181
|
-
stateMutability: "nonpayable",
|
|
182
|
-
type: "function",
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
anonymous: false,
|
|
186
|
-
inputs: [
|
|
187
|
-
{ indexed: true, name: "user", type: "address" },
|
|
188
|
-
{ indexed: false, name: "amount", type: "uint256" },
|
|
189
|
-
{ indexed: false, name: "claimableAt", type: "uint256" },
|
|
190
|
-
],
|
|
191
|
-
name: "RedeemRequested",
|
|
192
|
-
type: "event",
|
|
193
|
-
},
|
|
194
|
-
];
|
|
195
|
-
//# sourceMappingURL=gatewayAbi.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gatewayAbi.js","sourceRoot":"","sources":["../../src/abi/gatewayAbi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,cAAc;QACpB,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9B,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;IACD;QACE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,E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QACE,SAAS,EAAE,KAAK;QAChB,MAAM,EAAE;YACN,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE;YAChD,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YACnD,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE;SACzD;QACD,IAAI,EAAE,iBAAiB;QACvB,IAAI,EAAE,OAAO;KACd;CACO,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"peggedTokenAbi.js","sourceRoot":"","sources":["../../src/abi/peggedTokenAbi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B;QACE,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC;QAC9B,eAAe,EAAE,MAAM;QACvB,IAAI,EAAE,UAAU;KACjB;CACO,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { peggedTokenAbi } from "../../abi/peggedTokenAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
/**
|
|
5
|
-
* Reads the gateway address for a given pegged token.
|
|
6
|
-
* @param client - The viem client used to read the contract.
|
|
7
|
-
* @param parameters - The parameters object.
|
|
8
|
-
* @param parameters.address - The pegged token address to read the gateway from.
|
|
9
|
-
* @returns The gateway address configured on the pegged token.
|
|
10
|
-
*/
|
|
11
|
-
export async function getGateway(client, parameters) {
|
|
12
|
-
// Validate client
|
|
13
|
-
if (!client) {
|
|
14
|
-
throw new Error("Client is not defined");
|
|
15
|
-
}
|
|
16
|
-
// Validate parameters exist
|
|
17
|
-
if (!parameters) {
|
|
18
|
-
throw new Error("Parameters are required");
|
|
19
|
-
}
|
|
20
|
-
// Validate pegged token address
|
|
21
|
-
if (!isAddressValid(parameters.address)) {
|
|
22
|
-
throw new Error("Pegged token is invalid");
|
|
23
|
-
}
|
|
24
|
-
return readContract(client, {
|
|
25
|
-
abi: peggedTokenAbi,
|
|
26
|
-
address: parameters.address,
|
|
27
|
-
functionName: "gateway",
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=getGateway.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getGateway.js","sourceRoot":"","sources":["../../../src/actions/public/getGateway.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAc,EACd,UAEC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,gCAAgC;IAChC,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,cAAc;QACnB,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,YAAY,EAAE,SAAS;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getMaxWithdraw(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate tokenOut address
|
|
18
|
-
if (!isAddressValid(parameters.tokenOut)) {
|
|
19
|
-
throw new Error("Token is invalid");
|
|
20
|
-
}
|
|
21
|
-
return readContract(client, {
|
|
22
|
-
abi: gatewayAbi,
|
|
23
|
-
address: parameters.address,
|
|
24
|
-
args: [parameters.tokenOut],
|
|
25
|
-
functionName: "maxWithdraw",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=getMaxWithdraw.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMaxWithdraw.js","sourceRoot":"","sources":["../../../src/actions/public/getMaxWithdraw.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,UAGC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,QAAQ,CAAC;QAC3B,YAAY,EAAE,aAAa;KAC5B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getMintFee(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate token address
|
|
18
|
-
if (!isAddressValid(parameters.token)) {
|
|
19
|
-
throw new Error("Token is invalid");
|
|
20
|
-
}
|
|
21
|
-
return readContract(client, {
|
|
22
|
-
abi: gatewayAbi,
|
|
23
|
-
address: parameters.address,
|
|
24
|
-
args: [parameters.token],
|
|
25
|
-
functionName: "mintFee",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=getMintFee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMintFee.js","sourceRoot":"","sources":["../../../src/actions/public/getMintFee.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAc,EACd,UAGC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,yBAAyB;IACzB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QACxB,YAAY,EAAE,SAAS;KACxB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getPeggedToken(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
return readContract(client, {
|
|
18
|
-
abi: gatewayAbi,
|
|
19
|
-
address: parameters.address,
|
|
20
|
-
functionName: "PEGGED_TOKEN",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=getPeggedToken.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getPeggedToken.js","sourceRoot":"","sources":["../../../src/actions/public/getPeggedToken.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,UAEC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,YAAY,EAAE,cAAc;KAC7B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getRedeemFee(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate token address
|
|
18
|
-
if (!isAddressValid(parameters.token)) {
|
|
19
|
-
throw new Error("Token is invalid");
|
|
20
|
-
}
|
|
21
|
-
return readContract(client, {
|
|
22
|
-
abi: gatewayAbi,
|
|
23
|
-
address: parameters.address,
|
|
24
|
-
args: [parameters.token],
|
|
25
|
-
functionName: "redeemFee",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=getRedeemFee.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRedeemFee.js","sourceRoot":"","sources":["../../../src/actions/public/getRedeemFee.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,MAAc,EACd,UAGC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,yBAAyB;IACzB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC;QACxB,YAAY,EAAE,WAAW;KAC1B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getRedeemRequest(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate user address
|
|
18
|
-
if (!isAddressValid(parameters.user)) {
|
|
19
|
-
throw new Error("User is invalid");
|
|
20
|
-
}
|
|
21
|
-
return readContract(client, {
|
|
22
|
-
abi: gatewayAbi,
|
|
23
|
-
address: parameters.address,
|
|
24
|
-
args: [parameters.user],
|
|
25
|
-
functionName: "getRedeemRequest",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=getRedeemRequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getRedeemRequest.js","sourceRoot":"","sources":["../../../src/actions/public/getRedeemRequest.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,MAAc,EACd,UAGC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,wBAAwB;IACxB,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC;QACvB,YAAY,EAAE,kBAAkB;KACjC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getTreasury(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
return readContract(client, {
|
|
18
|
-
abi: gatewayAbi,
|
|
19
|
-
address: parameters.address,
|
|
20
|
-
functionName: "treasury",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=getTreasury.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getTreasury.js","sourceRoot":"","sources":["../../../src/actions/public/getTreasury.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,UAEC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,YAAY,EAAE,UAAU;KACzB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getWithdrawalDelay(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
return readContract(client, {
|
|
18
|
-
abi: gatewayAbi,
|
|
19
|
-
address: parameters.address,
|
|
20
|
-
functionName: "withdrawalDelay",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=getWithdrawalDelay.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getWithdrawalDelay.js","sourceRoot":"","sources":["../../../src/actions/public/getWithdrawalDelay.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,MAAc,EACd,UAEC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,YAAY,EAAE,iBAAiB;KAChC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function getWithdrawalDelayEnabled(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
return readContract(client, {
|
|
18
|
-
abi: gatewayAbi,
|
|
19
|
-
address: parameters.address,
|
|
20
|
-
functionName: "withdrawalDelayEnabled",
|
|
21
|
-
});
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=getWithdrawalDelayEnabled.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getWithdrawalDelayEnabled.js","sourceRoot":"","sources":["../../../src/actions/public/getWithdrawalDelayEnabled.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC7C,MAAc,EACd,UAEC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,YAAY,EAAE,wBAAwB;KACvC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
export * from "./getGateway.js";
|
|
2
|
-
export * from "./getMaxWithdraw.js";
|
|
3
|
-
export * from "./getMintFee.js";
|
|
4
|
-
export * from "./getPeggedToken.js";
|
|
5
|
-
export * from "./getRedeemFee.js";
|
|
6
|
-
export * from "./getRedeemRequest.js";
|
|
7
|
-
export * from "./getTreasury.js";
|
|
8
|
-
export * from "./getWithdrawalDelay.js";
|
|
9
|
-
export * from "./getWithdrawalDelayEnabled.js";
|
|
10
|
-
export * from "./isInstantRedeemWhitelisted.js";
|
|
11
|
-
export * from "./previewDeposit.js";
|
|
12
|
-
export * from "./previewRedeem.js";
|
|
13
|
-
export * from "./previewWithdraw.js";
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/actions/public/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,yBAAyB,CAAC;AACxC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function isInstantRedeemWhitelisted(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate account address
|
|
18
|
-
if (!isAddressValid(parameters.account)) {
|
|
19
|
-
throw new Error("Account is invalid");
|
|
20
|
-
}
|
|
21
|
-
return readContract(client, {
|
|
22
|
-
abi: gatewayAbi,
|
|
23
|
-
address: parameters.address,
|
|
24
|
-
args: [parameters.account],
|
|
25
|
-
functionName: "isInstantRedeemWhitelisted",
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
//# sourceMappingURL=isInstantRedeemWhitelisted.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isInstantRedeemWhitelisted.js","sourceRoot":"","sources":["../../../src/actions/public/isInstantRedeemWhitelisted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,0BAA0B,CAC9C,MAAc,EACd,UAGC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC;QAC1B,YAAY,EAAE,4BAA4B;KAC3C,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function previewDeposit(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate tokenIn address
|
|
18
|
-
if (!isAddressValid(parameters.tokenIn)) {
|
|
19
|
-
throw new Error("Token is invalid");
|
|
20
|
-
}
|
|
21
|
-
// Validate amountIn
|
|
22
|
-
if (typeof parameters.amountIn !== "bigint") {
|
|
23
|
-
throw new Error("Amount must be a bigint");
|
|
24
|
-
}
|
|
25
|
-
if (parameters.amountIn <= 0n) {
|
|
26
|
-
throw new Error("Amount must be greater than 0");
|
|
27
|
-
}
|
|
28
|
-
return readContract(client, {
|
|
29
|
-
abi: gatewayAbi,
|
|
30
|
-
address: parameters.address,
|
|
31
|
-
args: [parameters.tokenIn, parameters.amountIn],
|
|
32
|
-
functionName: "previewDeposit",
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=previewDeposit.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"previewDeposit.js","sourceRoot":"","sources":["../../../src/actions/public/previewDeposit.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,MAAc,EACd,UAIC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC,CAAC;IACxC,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QACxC,MAAM,IAAI,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACtC,CAAC;IAED,oBAAoB;IACpB,IAAI,OAAO,UAAU,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,UAAU,CAAC,QAAQ,IAAI,EAAE,EAAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,YAAY,CAAC,MAAM,EAAE;QAC1B,GAAG,EAAE,UAAU;QACf,OAAO,EAAE,UAAU,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,QAAQ,CAAC;QAC/C,YAAY,EAAE,gBAAgB;KAC/B,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { readContract } from "viem/actions";
|
|
2
|
-
import { gatewayAbi } from "../../abi/gatewayAbi.js";
|
|
3
|
-
import { isAddressValid } from "../../utils/isAddressValid.js";
|
|
4
|
-
export async function previewRedeem(client, parameters) {
|
|
5
|
-
// Validate client
|
|
6
|
-
if (!client) {
|
|
7
|
-
throw new Error("Client is not defined");
|
|
8
|
-
}
|
|
9
|
-
// Validate parameters exist
|
|
10
|
-
if (!parameters) {
|
|
11
|
-
throw new Error("Parameters are required");
|
|
12
|
-
}
|
|
13
|
-
// Validate gateway address
|
|
14
|
-
if (!isAddressValid(parameters.address)) {
|
|
15
|
-
throw new Error("Gateway is invalid");
|
|
16
|
-
}
|
|
17
|
-
// Validate tokenOut address
|
|
18
|
-
if (!isAddressValid(parameters.tokenOut)) {
|
|
19
|
-
throw new Error("Token is invalid");
|
|
20
|
-
}
|
|
21
|
-
// Validate peggedTokenIn
|
|
22
|
-
if (typeof parameters.peggedTokenIn !== "bigint") {
|
|
23
|
-
throw new Error("Amount must be a bigint");
|
|
24
|
-
}
|
|
25
|
-
if (parameters.peggedTokenIn <= 0n) {
|
|
26
|
-
throw new Error("Amount must be greater than 0");
|
|
27
|
-
}
|
|
28
|
-
return readContract(client, {
|
|
29
|
-
abi: gatewayAbi,
|
|
30
|
-
address: parameters.address,
|
|
31
|
-
args: [parameters.tokenOut, parameters.peggedTokenIn],
|
|
32
|
-
functionName: "previewRedeem",
|
|
33
|
-
});
|
|
34
|
-
}
|
|
35
|
-
//# sourceMappingURL=previewRedeem.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"previewRedeem.js","sourceRoot":"","sources":["../../../src/actions/public/previewRedeem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAE/D,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,MAAc,EACd,UAIC;IAED,kBAAkB;IAClB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;IAC3C,CAAC;IAED,4BAA4B;IAC5B,IAAI,CAAC,UAAU,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAC7C,CAAC;IAED,2BAA2B;IAC3B,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC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