@vetro-protocol/gateway 1.0.0-beta

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.
Files changed (113) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -0
  3. package/_esm/abi/gatewayAbi.js +185 -0
  4. package/_esm/abi/gatewayAbi.js.map +1 -0
  5. package/_esm/actions/index.js +18 -0
  6. package/_esm/actions/index.js.map +1 -0
  7. package/_esm/actions/public/getMaxWithdraw.js +28 -0
  8. package/_esm/actions/public/getMaxWithdraw.js.map +1 -0
  9. package/_esm/actions/public/getMintFee.js +28 -0
  10. package/_esm/actions/public/getMintFee.js.map +1 -0
  11. package/_esm/actions/public/getPeggedToken.js +23 -0
  12. package/_esm/actions/public/getPeggedToken.js.map +1 -0
  13. package/_esm/actions/public/getRedeemFee.js +28 -0
  14. package/_esm/actions/public/getRedeemFee.js.map +1 -0
  15. package/_esm/actions/public/getRedeemRequest.js +28 -0
  16. package/_esm/actions/public/getRedeemRequest.js.map +1 -0
  17. package/_esm/actions/public/getTreasury.js +23 -0
  18. package/_esm/actions/public/getTreasury.js.map +1 -0
  19. package/_esm/actions/public/getWithdrawalDelay.js +23 -0
  20. package/_esm/actions/public/getWithdrawalDelay.js.map +1 -0
  21. package/_esm/actions/public/getWithdrawalDelayEnabled.js +23 -0
  22. package/_esm/actions/public/getWithdrawalDelayEnabled.js.map +1 -0
  23. package/_esm/actions/public/index.js +12 -0
  24. package/_esm/actions/public/index.js.map +1 -0
  25. package/_esm/actions/public/isInstantRedeemWhitelisted.js +28 -0
  26. package/_esm/actions/public/isInstantRedeemWhitelisted.js.map +1 -0
  27. package/_esm/actions/public/previewDeposit.js +35 -0
  28. package/_esm/actions/public/previewDeposit.js.map +1 -0
  29. package/_esm/actions/public/previewRedeem.js +35 -0
  30. package/_esm/actions/public/previewRedeem.js.map +1 -0
  31. package/_esm/actions/wallet/cancelRedeemRequest.js +89 -0
  32. package/_esm/actions/wallet/cancelRedeemRequest.js.map +1 -0
  33. package/_esm/actions/wallet/deposit.js +193 -0
  34. package/_esm/actions/wallet/deposit.js.map +1 -0
  35. package/_esm/actions/wallet/redeem.js +226 -0
  36. package/_esm/actions/wallet/redeem.js.map +1 -0
  37. package/_esm/actions/wallet/requestRedeem.js +153 -0
  38. package/_esm/actions/wallet/requestRedeem.js.map +1 -0
  39. package/_esm/gatewayAddresses.js +18 -0
  40. package/_esm/gatewayAddresses.js.map +1 -0
  41. package/_esm/index.js +30 -0
  42. package/_esm/index.js.map +1 -0
  43. package/_esm/types.js +2 -0
  44. package/_esm/types.js.map +1 -0
  45. package/_esm/utils/isAddressValid.js +3 -0
  46. package/_esm/utils/isAddressValid.js.map +1 -0
  47. package/_types/abi/gatewayAbi.d.ts +252 -0
  48. package/_types/abi/gatewayAbi.d.ts.map +1 -0
  49. package/_types/actions/index.d.ts +16 -0
  50. package/_types/actions/index.d.ts.map +1 -0
  51. package/_types/actions/public/getMaxWithdraw.d.ts +6 -0
  52. package/_types/actions/public/getMaxWithdraw.d.ts.map +1 -0
  53. package/_types/actions/public/getMintFee.d.ts +6 -0
  54. package/_types/actions/public/getMintFee.d.ts.map +1 -0
  55. package/_types/actions/public/getPeggedToken.d.ts +5 -0
  56. package/_types/actions/public/getPeggedToken.d.ts.map +1 -0
  57. package/_types/actions/public/getRedeemFee.d.ts +6 -0
  58. package/_types/actions/public/getRedeemFee.d.ts.map +1 -0
  59. package/_types/actions/public/getRedeemRequest.d.ts +6 -0
  60. package/_types/actions/public/getRedeemRequest.d.ts.map +1 -0
  61. package/_types/actions/public/getTreasury.d.ts +5 -0
  62. package/_types/actions/public/getTreasury.d.ts.map +1 -0
  63. package/_types/actions/public/getWithdrawalDelay.d.ts +5 -0
  64. package/_types/actions/public/getWithdrawalDelay.d.ts.map +1 -0
  65. package/_types/actions/public/getWithdrawalDelayEnabled.d.ts +5 -0
  66. package/_types/actions/public/getWithdrawalDelayEnabled.d.ts.map +1 -0
  67. package/_types/actions/public/index.d.ts +12 -0
  68. package/_types/actions/public/index.d.ts.map +1 -0
  69. package/_types/actions/public/isInstantRedeemWhitelisted.d.ts +6 -0
  70. package/_types/actions/public/isInstantRedeemWhitelisted.d.ts.map +1 -0
  71. package/_types/actions/public/previewDeposit.d.ts +7 -0
  72. package/_types/actions/public/previewDeposit.d.ts.map +1 -0
  73. package/_types/actions/public/previewRedeem.d.ts +7 -0
  74. package/_types/actions/public/previewRedeem.d.ts.map +1 -0
  75. package/_types/actions/wallet/cancelRedeemRequest.d.ts +14 -0
  76. package/_types/actions/wallet/cancelRedeemRequest.d.ts.map +1 -0
  77. package/_types/actions/wallet/deposit.d.ts +19 -0
  78. package/_types/actions/wallet/deposit.d.ts.map +1 -0
  79. package/_types/actions/wallet/redeem.d.ts +24 -0
  80. package/_types/actions/wallet/redeem.d.ts.map +1 -0
  81. package/_types/actions/wallet/requestRedeem.d.ts +18 -0
  82. package/_types/actions/wallet/requestRedeem.d.ts.map +1 -0
  83. package/_types/gatewayAddresses.d.ts +8 -0
  84. package/_types/gatewayAddresses.d.ts.map +1 -0
  85. package/_types/index.d.ts +42 -0
  86. package/_types/index.d.ts.map +1 -0
  87. package/_types/types.d.ts +53 -0
  88. package/_types/types.d.ts.map +1 -0
  89. package/_types/utils/isAddressValid.d.ts +3 -0
  90. package/_types/utils/isAddressValid.d.ts.map +1 -0
  91. package/package.json +59 -0
  92. package/src/abi/gatewayAbi.ts +184 -0
  93. package/src/actions/index.ts +18 -0
  94. package/src/actions/public/getMaxWithdraw.ts +40 -0
  95. package/src/actions/public/getMintFee.ts +40 -0
  96. package/src/actions/public/getPeggedToken.ts +33 -0
  97. package/src/actions/public/getRedeemFee.ts +40 -0
  98. package/src/actions/public/getRedeemRequest.ts +40 -0
  99. package/src/actions/public/getTreasury.ts +33 -0
  100. package/src/actions/public/getWithdrawalDelay.ts +33 -0
  101. package/src/actions/public/getWithdrawalDelayEnabled.ts +33 -0
  102. package/src/actions/public/index.ts +11 -0
  103. package/src/actions/public/isInstantRedeemWhitelisted.ts +40 -0
  104. package/src/actions/public/previewDeposit.ts +49 -0
  105. package/src/actions/public/previewRedeem.ts +49 -0
  106. package/src/actions/wallet/cancelRedeemRequest.ts +135 -0
  107. package/src/actions/wallet/deposit.ts +277 -0
  108. package/src/actions/wallet/redeem.ts +321 -0
  109. package/src/actions/wallet/requestRedeem.ts +226 -0
  110. package/src/gatewayAddresses.ts +27 -0
  111. package/src/index.ts +79 -0
  112. package/src/types.ts +60 -0
  113. package/src/utils/isAddressValid.ts +4 -0
@@ -0,0 +1,153 @@
1
+ import { toPromiseEvent } from "to-promise-event";
2
+ import { encodeFunctionData, isAddress, isAddressEqual, zeroAddress, } from "viem";
3
+ import { waitForTransactionReceipt, writeContract } from "viem/actions";
4
+ import { allowance, approve } from "viem-erc20/actions";
5
+ import { gatewayAbi } from "../../abi/gatewayAbi.js";
6
+ import { getPeggedToken } from "../public/getPeggedToken.js";
7
+ const canRequestRedeem = function ({ approveAmount, client, gatewayAddress, peggedTokenAmount, }) {
8
+ if (!client) {
9
+ return {
10
+ canRequestRedeem: false,
11
+ reason: "Client is not defined",
12
+ };
13
+ }
14
+ if (!client.chain) {
15
+ return {
16
+ canRequestRedeem: false,
17
+ reason: "Chain is not defined on wallet client",
18
+ };
19
+ }
20
+ if (!client.account) {
21
+ return {
22
+ canRequestRedeem: false,
23
+ reason: "Client must have an account",
24
+ };
25
+ }
26
+ // Validate gateway address
27
+ if (!gatewayAddress || !isAddress(gatewayAddress)) {
28
+ return {
29
+ canRequestRedeem: false,
30
+ reason: "Invalid gateway address",
31
+ };
32
+ }
33
+ if (isAddressEqual(gatewayAddress, zeroAddress)) {
34
+ return {
35
+ canRequestRedeem: false,
36
+ reason: "Gateway address cannot be zero address",
37
+ };
38
+ }
39
+ if (typeof peggedTokenAmount !== "bigint") {
40
+ return {
41
+ canRequestRedeem: false,
42
+ reason: "Amount must be a bigint",
43
+ };
44
+ }
45
+ if (peggedTokenAmount <= 0n) {
46
+ return {
47
+ canRequestRedeem: false,
48
+ reason: "Amount must be greater than 0",
49
+ };
50
+ }
51
+ // Validate approveAmount
52
+ if (approveAmount < peggedTokenAmount) {
53
+ return {
54
+ canRequestRedeem: false,
55
+ reason: "Approve amount must be greater than or equal to amount",
56
+ };
57
+ }
58
+ return { canRequestRedeem: true };
59
+ };
60
+ const runRequestRedeem = (walletClient, { approveAmount, gatewayAddress, peggedTokenAmount }) => async function (emitter) {
61
+ const resolvedApproveAmount = approveAmount ?? peggedTokenAmount;
62
+ try {
63
+ const { canRequestRedeem: canRequestRedeemFlag, reason } = canRequestRedeem({
64
+ approveAmount: resolvedApproveAmount,
65
+ client: walletClient,
66
+ gatewayAddress,
67
+ peggedTokenAmount,
68
+ });
69
+ if (!canRequestRedeemFlag) {
70
+ emitter.emit("request-redeem-failed-validation", reason);
71
+ return;
72
+ }
73
+ // Get the pegged token address
74
+ const peggedTokenAddress = await getPeggedToken(walletClient, {
75
+ address: gatewayAddress,
76
+ });
77
+ // Check current allowance for pegged token
78
+ const currentAllowance = await allowance(walletClient, {
79
+ address: peggedTokenAddress,
80
+ owner: walletClient.account.address,
81
+ spender: gatewayAddress,
82
+ });
83
+ // If allowance is insufficient, approve first
84
+ if (currentAllowance < peggedTokenAmount) {
85
+ emitter.emit("pre-approve");
86
+ const approvalHash = await approve(walletClient, {
87
+ address: peggedTokenAddress,
88
+ amount: resolvedApproveAmount,
89
+ spender: gatewayAddress,
90
+ }).catch(function (error) {
91
+ emitter.emit("user-signing-approval-error", error);
92
+ });
93
+ if (!approvalHash) {
94
+ return;
95
+ }
96
+ emitter.emit("user-signed-approval", approvalHash);
97
+ const approvalReceipt = await waitForTransactionReceipt(walletClient, {
98
+ hash: approvalHash,
99
+ }).catch(function (error) {
100
+ emitter.emit("request-redeem-failed", error);
101
+ });
102
+ if (!approvalReceipt) {
103
+ return;
104
+ }
105
+ if (approvalReceipt.status === "reverted") {
106
+ emitter.emit("approve-transaction-reverted", approvalReceipt);
107
+ return;
108
+ }
109
+ emitter.emit("approve-transaction-succeeded", approvalReceipt);
110
+ }
111
+ emitter.emit("pre-request-redeem");
112
+ const requestRedeemHash = await writeContract(walletClient, {
113
+ abi: gatewayAbi,
114
+ account: walletClient.account,
115
+ address: gatewayAddress,
116
+ args: [peggedTokenAmount],
117
+ chain: walletClient.chain,
118
+ functionName: "requestRedeem",
119
+ }).catch(function (error) {
120
+ emitter.emit("user-signing-request-redeem-error", error);
121
+ });
122
+ if (!requestRedeemHash) {
123
+ return;
124
+ }
125
+ emitter.emit("user-signed-request-redeem", requestRedeemHash);
126
+ const requestRedeemReceipt = await waitForTransactionReceipt(walletClient, {
127
+ hash: requestRedeemHash,
128
+ }).catch(function (error) {
129
+ emitter.emit("request-redeem-failed", error);
130
+ });
131
+ if (!requestRedeemReceipt) {
132
+ return;
133
+ }
134
+ const requestRedeemEventMap = {
135
+ reverted: "request-redeem-transaction-reverted",
136
+ success: "request-redeem-transaction-succeeded",
137
+ };
138
+ emitter.emit(requestRedeemEventMap[requestRedeemReceipt.status], requestRedeemReceipt);
139
+ }
140
+ catch (error) {
141
+ emitter.emit("unexpected-error", error);
142
+ }
143
+ finally {
144
+ emitter.emit("request-redeem-settled");
145
+ }
146
+ };
147
+ export const requestRedeem = (...args) => toPromiseEvent(runRequestRedeem(...args));
148
+ export const encodeRequestRedeem = ({ peggedTokenAmount, }) => encodeFunctionData({
149
+ abi: gatewayAbi,
150
+ args: [peggedTokenAmount],
151
+ functionName: "requestRedeem",
152
+ });
153
+ //# sourceMappingURL=requestRedeem.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"requestRedeem.js","sourceRoot":"","sources":["../../../src/actions/wallet/requestRedeem.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAIL,kBAAkB,EAClB,SAAS,EACT,cAAc,EACd,WAAW,GACZ,MAAM,MAAM,CAAC;AACd,OAAO,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,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D for the VUSD gateway),
3
+ // so the USD price for any whitelisted token is `oracle × portal[pegBaseSymbol]`.
4
+ // See `web/src/fetchers/fetchPrices.ts` for the merge.
5
+ export const gateways = [
6
+ // VUSD
7
+ {
8
+ address: "0xDaD503f8B9d42bb7af3AfC588358D30163e4416F",
9
+ pegBaseSymbol: "USD",
10
+ },
11
+ // vetBTC
12
+ {
13
+ address: "0xCBA2Ffa0AC52d7871a4221a871793Eb788013faB",
14
+ pegBaseSymbol: "BTC",
15
+ },
16
+ ];
17
+ export const gatewayAddresses = gateways.map((g) => g.address);
18
+ //# sourceMappingURL=gatewayAddresses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gatewayAddresses.js","sourceRoot":"","sources":["../src/gatewayAddresses.ts"],"names":[],"mappings":"AASA,8EAA8E;AAC9E,kFAAkF;AAClF,kFAAkF;AAClF,uDAAuD;AACvD,MAAM,CAAC,MAAM,QAAQ,GAAc;IACjC,OAAO;IACP;QACE,OAAO,EAAE,4CAA4C;QACrD,aAAa,EAAE,KAAK;KACrB;IACD,SAAS;IACT;QACE,OAAO,EAAE,4CAA4C;QACrD,aAAa,EAAE,KAAK;KACrB;CACF,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAc,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC"}
package/_esm/index.js ADDED
@@ -0,0 +1,30 @@
1
+ import { getMaxWithdraw, getMintFee, getPeggedToken, getRedeemFee, getRedeemRequest, getTreasury, getWithdrawalDelay, getWithdrawalDelayEnabled, isInstantRedeemWhitelisted, previewDeposit, previewRedeem, } from "./actions/public/index.js";
2
+ import { cancelRedeemRequest, } from "./actions/wallet/cancelRedeemRequest.js";
3
+ import { deposit } from "./actions/wallet/deposit.js";
4
+ import { redeem } from "./actions/wallet/redeem.js";
5
+ import { requestRedeem, } from "./actions/wallet/requestRedeem.js";
6
+ // Export ABI
7
+ export { gatewayAbi } from "./abi/gatewayAbi.js";
8
+ // Export gateway addresses and per-gateway peg-base metadata
9
+ export { gatewayAddresses, gateways, } from "./gatewayAddresses.js";
10
+ // Export factory functions for .extend() pattern
11
+ export const gatewayPublicActions = () => (client) => ({
12
+ getMaxWithdraw: (params) => getMaxWithdraw(client, params),
13
+ getMintFee: (params) => getMintFee(client, params),
14
+ getPeggedToken: (params) => getPeggedToken(client, params),
15
+ getRedeemFee: (params) => getRedeemFee(client, params),
16
+ getRedeemRequest: (params) => getRedeemRequest(client, params),
17
+ getTreasury: (params) => getTreasury(client, params),
18
+ getWithdrawalDelay: (params) => getWithdrawalDelay(client, params),
19
+ getWithdrawalDelayEnabled: (params) => getWithdrawalDelayEnabled(client, params),
20
+ isInstantRedeemWhitelisted: (params) => isInstantRedeemWhitelisted(client, params),
21
+ previewDeposit: (params) => previewDeposit(client, params),
22
+ previewRedeem: (params) => previewRedeem(client, params),
23
+ });
24
+ export const gatewayWalletActions = () => (client) => ({
25
+ cancelRedeemRequest: (params) => cancelRedeemRequest(client, params),
26
+ deposit: (params) => deposit(client, params),
27
+ redeem: (params) => redeem(client, params),
28
+ requestRedeem: (params) => requestRedeem(client, params),
29
+ });
30
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,cAAc,EACd,UAAU,EACV,cAAc,EACd,YAAY,EACZ,gBAAgB,EAChB,WAAW,EACX,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,cAAc,EACd,aAAa,GACd,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAEL,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAsB,OAAO,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAqB,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAEL,aAAa,GACd,MAAM,mCAAmC,CAAC;AAE3C,aAAa;AACb,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AAM,CAAC,MAAM,oBAAoB,GAAG,GAAG,EAAE,CAAC,CAAC,MAAoB,EAAE,EAAE,CAAC,CAAC;IACnE,mBAAmB,EAAE,CAAC,MAAiC,EAAE,EAAE,CACzD,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC;IACrC,OAAO,EAAE,CAAC,MAAqB,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC;IAC3D,MAAM,EAAE,CAAC,MAAoB,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IACxD,aAAa,EAAE,CAAC,MAA2B,EAAE,EAAE,CAAC,aAAa,CAAC,MAAM,EAAE,MAAM,CAAC;CAC9E,CAAC,CAAC"}
package/_esm/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ import { isAddress, isAddressEqual, zeroAddress } from "viem";
2
+ export const isAddressValid = (address) => !!address && isAddress(address) && !isAddressEqual(address, zeroAddress);
3
+ //# sourceMappingURL=isAddressValid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isAddressValid.js","sourceRoot":"","sources":["../../src/utils/isAddressValid.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAE5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,OAA4B,EAAE,EAAE,CAC7D,CAAC,CAAC,OAAO,IAAI,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC"}
@@ -0,0 +1,252 @@
1
+ export declare const gatewayAbi: readonly [{
2
+ readonly inputs: readonly [];
3
+ readonly name: "PEGGED_TOKEN";
4
+ readonly outputs: readonly [{
5
+ readonly type: "address";
6
+ }];
7
+ readonly stateMutability: "view";
8
+ readonly type: "function";
9
+ }, {
10
+ readonly inputs: readonly [{
11
+ readonly name: "token_";
12
+ readonly type: "address";
13
+ }];
14
+ readonly name: "mintFee";
15
+ readonly outputs: readonly [{
16
+ readonly type: "uint256";
17
+ }];
18
+ readonly stateMutability: "view";
19
+ readonly type: "function";
20
+ }, {
21
+ readonly inputs: readonly [];
22
+ readonly name: "owner";
23
+ readonly outputs: readonly [{
24
+ readonly type: "address";
25
+ }];
26
+ readonly stateMutability: "view";
27
+ readonly type: "function";
28
+ }, {
29
+ readonly inputs: readonly [{
30
+ readonly name: "token_";
31
+ readonly type: "address";
32
+ }];
33
+ readonly name: "redeemFee";
34
+ readonly outputs: readonly [{
35
+ readonly type: "uint256";
36
+ }];
37
+ readonly stateMutability: "view";
38
+ readonly type: "function";
39
+ }, {
40
+ readonly inputs: readonly [];
41
+ readonly name: "treasury";
42
+ readonly outputs: readonly [{
43
+ readonly type: "address";
44
+ }];
45
+ readonly stateMutability: "view";
46
+ readonly type: "function";
47
+ }, {
48
+ readonly inputs: readonly [];
49
+ readonly name: "withdrawalDelayEnabled";
50
+ readonly outputs: readonly [{
51
+ readonly type: "bool";
52
+ }];
53
+ readonly stateMutability: "view";
54
+ readonly type: "function";
55
+ }, {
56
+ readonly inputs: readonly [];
57
+ readonly name: "withdrawalDelay";
58
+ readonly outputs: readonly [{
59
+ readonly type: "uint256";
60
+ }];
61
+ readonly stateMutability: "view";
62
+ readonly type: "function";
63
+ }, {
64
+ readonly inputs: readonly [{
65
+ readonly name: "user_";
66
+ readonly type: "address";
67
+ }];
68
+ readonly name: "getRedeemRequest";
69
+ readonly outputs: readonly [{
70
+ readonly name: "amountLocked";
71
+ readonly type: "uint256";
72
+ }, {
73
+ readonly name: "claimableAt";
74
+ readonly type: "uint256";
75
+ }];
76
+ readonly stateMutability: "view";
77
+ readonly type: "function";
78
+ }, {
79
+ readonly inputs: readonly [{
80
+ readonly name: "account_";
81
+ readonly type: "address";
82
+ }];
83
+ readonly name: "isInstantRedeemWhitelisted";
84
+ readonly outputs: readonly [{
85
+ readonly type: "bool";
86
+ }];
87
+ readonly stateMutability: "view";
88
+ readonly type: "function";
89
+ }, {
90
+ readonly inputs: readonly [{
91
+ readonly name: "tokenOut_";
92
+ readonly type: "address";
93
+ }];
94
+ readonly name: "maxWithdraw";
95
+ readonly outputs: readonly [{
96
+ readonly type: "uint256";
97
+ }];
98
+ readonly stateMutability: "view";
99
+ readonly type: "function";
100
+ }, {
101
+ readonly inputs: readonly [{
102
+ readonly name: "account_";
103
+ readonly type: "address";
104
+ }];
105
+ readonly name: "removeFromInstantRedeemWhitelist";
106
+ readonly outputs: readonly [];
107
+ readonly stateMutability: "nonpayable";
108
+ readonly type: "function";
109
+ }, {
110
+ readonly inputs: readonly [{
111
+ readonly name: "tokenIn_";
112
+ readonly type: "address";
113
+ }, {
114
+ readonly name: "amountIn_";
115
+ readonly type: "uint256";
116
+ }];
117
+ readonly name: "previewDeposit";
118
+ readonly outputs: readonly [{
119
+ readonly type: "uint256";
120
+ }];
121
+ readonly stateMutability: "view";
122
+ readonly type: "function";
123
+ }, {
124
+ readonly inputs: readonly [{
125
+ readonly name: "tokenOut_";
126
+ readonly type: "address";
127
+ }, {
128
+ readonly name: "peggedTokenIn_";
129
+ readonly type: "uint256";
130
+ }];
131
+ readonly name: "previewRedeem";
132
+ readonly outputs: readonly [{
133
+ readonly type: "uint256";
134
+ }];
135
+ readonly stateMutability: "view";
136
+ readonly type: "function";
137
+ }, {
138
+ readonly inputs: readonly [];
139
+ readonly name: "cancelRedeemRequest";
140
+ readonly outputs: readonly [];
141
+ readonly stateMutability: "nonpayable";
142
+ readonly type: "function";
143
+ }, {
144
+ readonly inputs: readonly [{
145
+ readonly name: "tokenIn_";
146
+ readonly type: "address";
147
+ }, {
148
+ readonly name: "amountIn_";
149
+ readonly type: "uint256";
150
+ }, {
151
+ readonly name: "minPeggedTokenOut_";
152
+ readonly type: "uint256";
153
+ }, {
154
+ readonly name: "receiver_";
155
+ readonly type: "address";
156
+ }];
157
+ readonly name: "deposit";
158
+ readonly outputs: readonly [{
159
+ readonly type: "uint256";
160
+ }];
161
+ readonly stateMutability: "nonpayable";
162
+ readonly type: "function";
163
+ }, {
164
+ readonly inputs: readonly [{
165
+ readonly name: "tokenOut_";
166
+ readonly type: "address";
167
+ }, {
168
+ readonly name: "peggedTokenIn_";
169
+ readonly type: "uint256";
170
+ }, {
171
+ readonly name: "minAmountOut_";
172
+ readonly type: "uint256";
173
+ }, {
174
+ readonly name: "receiver_";
175
+ readonly type: "address";
176
+ }];
177
+ readonly name: "redeem";
178
+ readonly outputs: readonly [{
179
+ readonly type: "uint256";
180
+ }];
181
+ readonly stateMutability: "nonpayable";
182
+ readonly type: "function";
183
+ }, {
184
+ readonly inputs: readonly [{
185
+ readonly name: "peggedTokenAmount_";
186
+ readonly type: "uint256";
187
+ }];
188
+ readonly name: "requestRedeem";
189
+ readonly outputs: readonly [];
190
+ readonly stateMutability: "nonpayable";
191
+ readonly type: "function";
192
+ }, {
193
+ readonly inputs: readonly [{
194
+ readonly name: "enabled_";
195
+ readonly type: "bool";
196
+ }];
197
+ readonly name: "setWithdrawalDelayEnabled";
198
+ readonly outputs: readonly [];
199
+ readonly stateMutability: "nonpayable";
200
+ readonly type: "function";
201
+ }, {
202
+ readonly inputs: readonly [{
203
+ readonly name: "token_";
204
+ readonly type: "address";
205
+ }, {
206
+ readonly name: "newMintFee_";
207
+ readonly type: "uint256";
208
+ }];
209
+ readonly name: "updateMintFee";
210
+ readonly outputs: readonly [];
211
+ readonly stateMutability: "nonpayable";
212
+ readonly type: "function";
213
+ }, {
214
+ readonly inputs: readonly [{
215
+ readonly name: "token_";
216
+ readonly type: "address";
217
+ }, {
218
+ readonly name: "newRedeemFee_";
219
+ readonly type: "uint256";
220
+ }];
221
+ readonly name: "updateRedeemFee";
222
+ readonly outputs: readonly [];
223
+ readonly stateMutability: "nonpayable";
224
+ readonly type: "function";
225
+ }, {
226
+ readonly inputs: readonly [{
227
+ readonly name: "newDelay_";
228
+ readonly type: "uint256";
229
+ }];
230
+ readonly name: "updateWithdrawalDelay";
231
+ readonly outputs: readonly [];
232
+ readonly stateMutability: "nonpayable";
233
+ readonly type: "function";
234
+ }, {
235
+ readonly anonymous: false;
236
+ readonly inputs: readonly [{
237
+ readonly indexed: true;
238
+ readonly name: "user";
239
+ readonly type: "address";
240
+ }, {
241
+ readonly indexed: false;
242
+ readonly name: "amount";
243
+ readonly type: "uint256";
244
+ }, {
245
+ readonly indexed: false;
246
+ readonly name: "claimableAt";
247
+ readonly type: "uint256";
248
+ }];
249
+ readonly name: "RedeemRequested";
250
+ readonly type: "event";
251
+ }];
252
+ //# sourceMappingURL=gatewayAbi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gatewayAbi.d.ts","sourceRoot":"","sources":["../../src/abi/gatewayAbi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuLb,CAAC"}
@@ -0,0 +1,16 @@
1
+ export * from "./public/getMaxWithdraw.js";
2
+ export * from "./public/getPeggedToken.js";
3
+ export * from "./public/getMintFee.js";
4
+ export * from "./public/getRedeemFee.js";
5
+ export * from "./public/getRedeemRequest.js";
6
+ export * from "./public/getTreasury.js";
7
+ export * from "./public/getWithdrawalDelayEnabled.js";
8
+ export * from "./public/getWithdrawalDelay.js";
9
+ export * from "./public/isInstantRedeemWhitelisted.js";
10
+ export * from "./public/previewDeposit.js";
11
+ export * from "./public/previewRedeem.js";
12
+ export * from "./wallet/cancelRedeemRequest.js";
13
+ export * from "./wallet/deposit.js";
14
+ export * from "./wallet/redeem.js";
15
+ export * from "./wallet/requestRedeem.js";
16
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/actions/index.ts"],"names":[],"mappings":"AACA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,0BAA0B,CAAC;AACzC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC;AACxC,cAAc,uCAAuC,CAAC;AACtD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAG1C,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC"}
@@ -0,0 +1,6 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getMaxWithdraw(client: Client, parameters: {
3
+ address: Address;
4
+ tokenOut: Address;
5
+ }): Promise<bigint>;
6
+ //# sourceMappingURL=getMaxWithdraw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMaxWithdraw.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getMaxWithdraw.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;CACnB,mBA4BF"}
@@ -0,0 +1,6 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getMintFee(client: Client, parameters: {
3
+ address: Address;
4
+ token: Address;
5
+ }): Promise<bigint>;
6
+ //# sourceMappingURL=getMintFee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getMintFee.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getMintFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,mBA4BF"}
@@ -0,0 +1,5 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getPeggedToken(client: Client, parameters: {
3
+ address: Address;
4
+ }): Promise<`0x${string}`>;
5
+ //# sourceMappingURL=getPeggedToken.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPeggedToken.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getPeggedToken.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,0BAsBF"}
@@ -0,0 +1,6 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getRedeemFee(client: Client, parameters: {
3
+ address: Address;
4
+ token: Address;
5
+ }): Promise<bigint>;
6
+ //# sourceMappingURL=getRedeemFee.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRedeemFee.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getRedeemFee.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;CAChB,mBA4BF"}
@@ -0,0 +1,6 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getRedeemRequest(client: Client, parameters: {
3
+ address: Address;
4
+ user: Address;
5
+ }): Promise<readonly [bigint, bigint]>;
6
+ //# sourceMappingURL=getRedeemRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getRedeemRequest.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getRedeemRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,OAAO,CAAC;CACf,sCA4BF"}
@@ -0,0 +1,5 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getTreasury(client: Client, parameters: {
3
+ address: Address;
4
+ }): Promise<`0x${string}`>;
5
+ //# sourceMappingURL=getTreasury.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getTreasury.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getTreasury.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,0BAsBF"}
@@ -0,0 +1,5 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getWithdrawalDelay(client: Client, parameters: {
3
+ address: Address;
4
+ }): Promise<bigint>;
5
+ //# sourceMappingURL=getWithdrawalDelay.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWithdrawalDelay.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getWithdrawalDelay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,mBAsBF"}
@@ -0,0 +1,5 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function getWithdrawalDelayEnabled(client: Client, parameters: {
3
+ address: Address;
4
+ }): Promise<boolean>;
5
+ //# sourceMappingURL=getWithdrawalDelayEnabled.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getWithdrawalDelayEnabled.d.ts","sourceRoot":"","sources":["../../../src/actions/public/getWithdrawalDelayEnabled.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,yBAAyB,CAC7C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;CAClB,oBAsBF"}
@@ -0,0 +1,12 @@
1
+ export * from "./getMaxWithdraw.js";
2
+ export * from "./getMintFee.js";
3
+ export * from "./getPeggedToken.js";
4
+ export * from "./getRedeemFee.js";
5
+ export * from "./getRedeemRequest.js";
6
+ export * from "./getTreasury.js";
7
+ export * from "./getWithdrawalDelay.js";
8
+ export * from "./getWithdrawalDelayEnabled.js";
9
+ export * from "./isInstantRedeemWhitelisted.js";
10
+ export * from "./previewDeposit.js";
11
+ export * from "./previewRedeem.js";
12
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/actions/public/index.ts"],"names":[],"mappings":"AAAA,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"}
@@ -0,0 +1,6 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function isInstantRedeemWhitelisted(client: Client, parameters: {
3
+ address: Address;
4
+ account: Address;
5
+ }): Promise<boolean>;
6
+ //# sourceMappingURL=isInstantRedeemWhitelisted.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isInstantRedeemWhitelisted.d.ts","sourceRoot":"","sources":["../../../src/actions/public/isInstantRedeemWhitelisted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,0BAA0B,CAC9C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;CAClB,oBA4BF"}
@@ -0,0 +1,7 @@
1
+ import { type Address, type Client } from "viem";
2
+ export declare function previewDeposit(client: Client, parameters: {
3
+ address: Address;
4
+ tokenIn: Address;
5
+ amountIn: bigint;
6
+ }): Promise<bigint>;
7
+ //# sourceMappingURL=previewDeposit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"previewDeposit.d.ts","sourceRoot":"","sources":["../../../src/actions/public/previewDeposit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAMjD,wBAAsB,cAAc,CAClC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;CAClB,mBAoCF"}