@gearbox-protocol/sdk 14.5.6 → 14.5.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.
- package/dist/cjs/history/assembleOperations.js +18 -4
- package/dist/cjs/history/classifyMulticallOperations.js +20 -4
- package/dist/cjs/history/errors.js +12 -2
- package/dist/cjs/history/extractTransfers.js +12 -1
- package/dist/cjs/history/parseCreditAccountTransaction.js +3 -1
- package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeOnRamp.js +73 -0
- package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeOnRampAdapter.js +98 -0
- package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeRedemptionGateway.js +149 -0
- package/dist/cjs/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayAdapter.js +144 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +4 -2
- package/dist/cjs/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +4 -2
- package/dist/esm/history/assembleOperations.js +18 -4
- package/dist/esm/history/classifyMulticallOperations.js +25 -5
- package/dist/esm/history/errors.js +10 -1
- package/dist/esm/history/extractTransfers.js +12 -1
- package/dist/esm/history/parseCreditAccountTransaction.js +3 -1
- package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeOnRamp.js +49 -0
- package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeOnRampAdapter.js +74 -0
- package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeRedemptionGateway.js +125 -0
- package/dist/esm/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayAdapter.js +120 -0
- package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +4 -2
- package/dist/esm/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +4 -2
- package/dist/types/history/assembleOperations.d.ts +2 -0
- package/dist/types/history/classifyMulticallOperations.d.ts +2 -0
- package/dist/types/history/errors.d.ts +3 -0
- package/dist/types/history/extractTransfers.d.ts +19 -0
- package/dist/types/plugins/adapters/abi/securitize/iSecuritizeOnRamp.d.ts +67 -0
- package/dist/types/plugins/adapters/abi/securitize/iSecuritizeOnRampAdapter.d.ts +107 -0
- package/dist/types/plugins/adapters/abi/securitize/iSecuritizeRedemptionGateway.d.ts +183 -0
- package/dist/types/plugins/adapters/abi/securitize/iSecuritizeRedemptionGatewayAdapter.d.ts +185 -0
- package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +174 -2
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +368 -2
- package/package.json +1 -1
|
@@ -32,16 +32,24 @@ function assembleOperations(input) {
|
|
|
32
32
|
underlying,
|
|
33
33
|
liquidationRemainingFunds,
|
|
34
34
|
phantomTokens,
|
|
35
|
+
withdrawCollateralEvents = [],
|
|
35
36
|
strict
|
|
36
37
|
} = input;
|
|
37
|
-
let
|
|
38
|
+
let executeOffset = 0;
|
|
39
|
+
let withdrawOffset = 0;
|
|
38
40
|
return facadeCalls.map((fc) => {
|
|
39
41
|
if (fc.operation === "PartiallyLiquidateCreditAccount") {
|
|
40
42
|
return assemblePartialLiquidation(fc);
|
|
41
43
|
}
|
|
42
44
|
const count = countAdapterCalls(fc.innerCalls, register);
|
|
43
|
-
const sliced = executeResults.slice(
|
|
44
|
-
|
|
45
|
+
const sliced = executeResults.slice(executeOffset, executeOffset + count);
|
|
46
|
+
executeOffset += count;
|
|
47
|
+
const withdrawCount = countWithdrawCollateralCalls(fc.innerCalls);
|
|
48
|
+
const slicedWithdrawEvents = withdrawCollateralEvents.slice(
|
|
49
|
+
withdrawOffset,
|
|
50
|
+
withdrawOffset + withdrawCount
|
|
51
|
+
);
|
|
52
|
+
withdrawOffset += withdrawCount;
|
|
45
53
|
const protocolCalldatas = (0, import_extractProtocolCalls.extractProtocolCalls)(fc.trace, sliced);
|
|
46
54
|
const multicall = (0, import_classifyMulticallOperations.classifyMulticallOperations)({
|
|
47
55
|
innerCalls: fc.innerCalls,
|
|
@@ -51,7 +59,8 @@ function assembleOperations(input) {
|
|
|
51
59
|
creditAccount: fc.creditAccount,
|
|
52
60
|
underlying,
|
|
53
61
|
strict,
|
|
54
|
-
phantomTokens
|
|
62
|
+
phantomTokens,
|
|
63
|
+
withdrawCollateralEvents: slicedWithdrawEvents
|
|
55
64
|
});
|
|
56
65
|
switch (fc.operation) {
|
|
57
66
|
case "OpenCreditAccount":
|
|
@@ -86,6 +95,11 @@ function countAdapterCalls(innerCalls, register) {
|
|
|
86
95
|
return !contract || contract instanceof import_adapters.AbstractAdapterContract;
|
|
87
96
|
}).length;
|
|
88
97
|
}
|
|
98
|
+
function countWithdrawCollateralCalls(innerCalls) {
|
|
99
|
+
return innerCalls.filter(
|
|
100
|
+
(call) => call.functionName.startsWith("withdrawCollateral")
|
|
101
|
+
).length;
|
|
102
|
+
}
|
|
89
103
|
function assemblePartialLiquidation(fc) {
|
|
90
104
|
const { rawArgs } = fc.parsed;
|
|
91
105
|
return {
|
|
@@ -33,9 +33,11 @@ function classifyMulticallOperations(input) {
|
|
|
33
33
|
creditAccount,
|
|
34
34
|
underlying,
|
|
35
35
|
strict,
|
|
36
|
-
phantomTokens
|
|
36
|
+
phantomTokens,
|
|
37
|
+
withdrawCollateralEvents
|
|
37
38
|
} = input;
|
|
38
39
|
let transferIdx = 0;
|
|
40
|
+
let withdrawIdx = 0;
|
|
39
41
|
const result = [];
|
|
40
42
|
for (const call of innerCalls) {
|
|
41
43
|
const contract = register.getContract(call.target);
|
|
@@ -58,7 +60,14 @@ function classifyMulticallOperations(input) {
|
|
|
58
60
|
continue;
|
|
59
61
|
}
|
|
60
62
|
if (contract !== void 0) {
|
|
61
|
-
const
|
|
63
|
+
const isWithdraw = call.functionName.startsWith("withdrawCollateral");
|
|
64
|
+
const withdrawEvent = isWithdraw ? withdrawCollateralEvents?.[withdrawIdx++] : void 0;
|
|
65
|
+
const op = classifyFacadeInnerCall(
|
|
66
|
+
call,
|
|
67
|
+
underlying,
|
|
68
|
+
phantomTokens,
|
|
69
|
+
withdrawEvent
|
|
70
|
+
);
|
|
62
71
|
if (op) result.push(op);
|
|
63
72
|
continue;
|
|
64
73
|
}
|
|
@@ -93,9 +102,15 @@ function classifyMulticallOperations(input) {
|
|
|
93
102
|
if (transferIdx !== executeResults.length) {
|
|
94
103
|
throw new import_errors.TransferAlignmentError(executeResults.length, transferIdx);
|
|
95
104
|
}
|
|
105
|
+
if (withdrawCollateralEvents && withdrawCollateralEvents.length > 0 && withdrawIdx !== withdrawCollateralEvents.length) {
|
|
106
|
+
throw new import_errors.WithdrawCollateralAlignmentError(
|
|
107
|
+
withdrawCollateralEvents.length,
|
|
108
|
+
withdrawIdx
|
|
109
|
+
);
|
|
110
|
+
}
|
|
96
111
|
return result;
|
|
97
112
|
}
|
|
98
|
-
function classifyFacadeInnerCall(call, underlying, phantomTokens) {
|
|
113
|
+
function classifyFacadeInnerCall(call, underlying, phantomTokens, withdrawEvent) {
|
|
99
114
|
const { functionName: sig, rawArgs } = call;
|
|
100
115
|
const functionName = sig.split("(")[0];
|
|
101
116
|
switch (functionName) {
|
|
@@ -124,10 +139,11 @@ function classifyFacadeInnerCall(call, underlying, phantomTokens) {
|
|
|
124
139
|
calldataToken,
|
|
125
140
|
phantomTokens
|
|
126
141
|
);
|
|
142
|
+
const amount = withdrawEvent ? withdrawEvent.amount : rawArgs.amount;
|
|
127
143
|
return {
|
|
128
144
|
operation: "WithdrawCollateral",
|
|
129
145
|
token: depositedToken ?? calldataToken,
|
|
130
|
-
amount
|
|
146
|
+
amount,
|
|
131
147
|
to: rawArgs.to,
|
|
132
148
|
...depositedToken ? { phantomToken: calldataToken } : {}
|
|
133
149
|
};
|
|
@@ -23,7 +23,8 @@ __export(errors_exports, {
|
|
|
23
23
|
TransferAlignmentError: () => TransferAlignmentError,
|
|
24
24
|
UnexpectedFacadeEventOrderError: () => UnexpectedFacadeEventOrderError,
|
|
25
25
|
UnknownAdapterError: () => UnknownAdapterError,
|
|
26
|
-
UnknownFacadeCallError: () => UnknownFacadeCallError
|
|
26
|
+
UnknownFacadeCallError: () => UnknownFacadeCallError,
|
|
27
|
+
WithdrawCollateralAlignmentError: () => WithdrawCollateralAlignmentError
|
|
27
28
|
});
|
|
28
29
|
module.exports = __toCommonJS(errors_exports);
|
|
29
30
|
class UnknownAdapterError extends Error {
|
|
@@ -42,6 +43,14 @@ class TransferAlignmentError extends Error {
|
|
|
42
43
|
this.name = "TransferAlignmentError";
|
|
43
44
|
}
|
|
44
45
|
}
|
|
46
|
+
class WithdrawCollateralAlignmentError extends Error {
|
|
47
|
+
constructor(expected, actual) {
|
|
48
|
+
super(
|
|
49
|
+
`withdrawCollateral event alignment mismatch: expected ${expected} events, consumed ${actual}`
|
|
50
|
+
);
|
|
51
|
+
this.name = "WithdrawCollateralAlignmentError";
|
|
52
|
+
}
|
|
53
|
+
}
|
|
45
54
|
class ProtocolCallNotFoundError extends Error {
|
|
46
55
|
targetContract;
|
|
47
56
|
executeIndex;
|
|
@@ -89,5 +98,6 @@ class UnknownFacadeCallError extends Error {
|
|
|
89
98
|
TransferAlignmentError,
|
|
90
99
|
UnexpectedFacadeEventOrderError,
|
|
91
100
|
UnknownAdapterError,
|
|
92
|
-
UnknownFacadeCallError
|
|
101
|
+
UnknownFacadeCallError,
|
|
102
|
+
WithdrawCollateralAlignmentError
|
|
93
103
|
});
|
|
@@ -32,6 +32,7 @@ function extractTransfers(logs, creditAccount, pool, creditFacade) {
|
|
|
32
32
|
const executeResults = [];
|
|
33
33
|
const directTransfers = [];
|
|
34
34
|
const phantomTokens = new import_sdk.AddressMap();
|
|
35
|
+
const withdrawCollateralEvents = [];
|
|
35
36
|
let liquidationRemainingFunds;
|
|
36
37
|
for (const log of logs) {
|
|
37
38
|
const facadeEvent = tryDecodeFacadeEvent(log, creditFacade);
|
|
@@ -62,6 +63,12 @@ function extractTransfers(logs, creditAccount, pool, creditFacade) {
|
|
|
62
63
|
facadeEvent.args.token,
|
|
63
64
|
(0, import_viem.getAddress)(rawDeposit.token)
|
|
64
65
|
);
|
|
66
|
+
} else if (isWithdrawCollateral(facadeEvent, creditAccount)) {
|
|
67
|
+
withdrawCollateralEvents.push({
|
|
68
|
+
token: (0, import_viem.getAddress)(facadeEvent.args.token),
|
|
69
|
+
amount: facadeEvent.args.amount,
|
|
70
|
+
to: (0, import_viem.getAddress)(facadeEvent.args.to)
|
|
71
|
+
});
|
|
65
72
|
}
|
|
66
73
|
currentEntries = [];
|
|
67
74
|
continue;
|
|
@@ -86,7 +93,8 @@ function extractTransfers(logs, creditAccount, pool, creditFacade) {
|
|
|
86
93
|
executeResults,
|
|
87
94
|
directTransfers,
|
|
88
95
|
liquidationRemainingFunds,
|
|
89
|
-
phantomTokens
|
|
96
|
+
phantomTokens,
|
|
97
|
+
withdrawCollateralEvents
|
|
90
98
|
};
|
|
91
99
|
}
|
|
92
100
|
function buildOperationRanges(logs, facadeAddress, creditAccount) {
|
|
@@ -162,6 +170,9 @@ function isLiquidation(e, creditAccount) {
|
|
|
162
170
|
function isWithdrawPhantomToken(e, creditAccount) {
|
|
163
171
|
return e.eventName === "WithdrawPhantomToken" && (0, import_viem.isAddressEqual)(e.args.creditAccount, creditAccount);
|
|
164
172
|
}
|
|
173
|
+
function isWithdrawCollateral(e, creditAccount) {
|
|
174
|
+
return e.eventName === "WithdrawCollateral" && (0, import_viem.isAddressEqual)(e.args.creditAccount, creditAccount);
|
|
175
|
+
}
|
|
165
176
|
// Annotate the CommonJS export names for ESM import in node:
|
|
166
177
|
0 && (module.exports = {
|
|
167
178
|
extractTransfers
|
|
@@ -51,7 +51,8 @@ function parseCreditAccountTransaction(input) {
|
|
|
51
51
|
executeResults,
|
|
52
52
|
directTransfers,
|
|
53
53
|
liquidationRemainingFunds,
|
|
54
|
-
phantomTokens
|
|
54
|
+
phantomTokens,
|
|
55
|
+
withdrawCollateralEvents
|
|
55
56
|
} = (0, import_extractTransfers.extractTransfers)(logs, creditAccount, pool, creditFacade);
|
|
56
57
|
const meta = {
|
|
57
58
|
creditManager,
|
|
@@ -67,6 +68,7 @@ function parseCreditAccountTransaction(input) {
|
|
|
67
68
|
underlying,
|
|
68
69
|
liquidationRemainingFunds,
|
|
69
70
|
phantomTokens,
|
|
71
|
+
withdrawCollateralEvents,
|
|
70
72
|
strict
|
|
71
73
|
}).map((o) => ({ ...o, ...meta }));
|
|
72
74
|
const directOps = directTransfers.map((dt) => ({
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var iSecuritizeOnRamp_exports = {};
|
|
20
|
+
__export(iSecuritizeOnRamp_exports, {
|
|
21
|
+
iSecuritizeOnRampAbi: () => iSecuritizeOnRampAbi
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(iSecuritizeOnRamp_exports);
|
|
24
|
+
const iSecuritizeOnRampAbi = [
|
|
25
|
+
{
|
|
26
|
+
type: "function",
|
|
27
|
+
name: "calculateDsTokenAmount",
|
|
28
|
+
inputs: [
|
|
29
|
+
{ name: "_liquidityAmount", type: "uint256", internalType: "uint256" }
|
|
30
|
+
],
|
|
31
|
+
outputs: [
|
|
32
|
+
{ name: "dsTokenAmount", type: "uint256", internalType: "uint256" },
|
|
33
|
+
{ name: "rate", type: "uint256", internalType: "uint256" },
|
|
34
|
+
{ name: "fee", type: "uint256", internalType: "uint256" }
|
|
35
|
+
],
|
|
36
|
+
stateMutability: "view"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
type: "function",
|
|
40
|
+
name: "dsToken",
|
|
41
|
+
inputs: [],
|
|
42
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
43
|
+
stateMutability: "view"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
type: "function",
|
|
47
|
+
name: "liquidityToken",
|
|
48
|
+
inputs: [],
|
|
49
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
50
|
+
stateMutability: "view"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "function",
|
|
54
|
+
name: "navProvider",
|
|
55
|
+
inputs: [],
|
|
56
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
57
|
+
stateMutability: "view"
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: "function",
|
|
61
|
+
name: "swap",
|
|
62
|
+
inputs: [
|
|
63
|
+
{ name: "_liquidityAmount", type: "uint256", internalType: "uint256" },
|
|
64
|
+
{ name: "_minOutAmount", type: "uint256", internalType: "uint256" }
|
|
65
|
+
],
|
|
66
|
+
outputs: [],
|
|
67
|
+
stateMutability: "nonpayable"
|
|
68
|
+
}
|
|
69
|
+
];
|
|
70
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
71
|
+
0 && (module.exports = {
|
|
72
|
+
iSecuritizeOnRampAbi
|
|
73
|
+
});
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var iSecuritizeOnRampAdapter_exports = {};
|
|
20
|
+
__export(iSecuritizeOnRampAdapter_exports, {
|
|
21
|
+
iSecuritizeOnRampAdapterAbi: () => iSecuritizeOnRampAdapterAbi
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(iSecuritizeOnRampAdapter_exports);
|
|
24
|
+
const iSecuritizeOnRampAdapterAbi = [
|
|
25
|
+
{
|
|
26
|
+
type: "function",
|
|
27
|
+
name: "contractType",
|
|
28
|
+
inputs: [],
|
|
29
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
30
|
+
stateMutability: "view"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
type: "function",
|
|
34
|
+
name: "creditManager",
|
|
35
|
+
inputs: [],
|
|
36
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
37
|
+
stateMutability: "view"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
type: "function",
|
|
41
|
+
name: "dsToken",
|
|
42
|
+
inputs: [],
|
|
43
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
44
|
+
stateMutability: "view"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
type: "function",
|
|
48
|
+
name: "liquidityToken",
|
|
49
|
+
inputs: [],
|
|
50
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
51
|
+
stateMutability: "view"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
type: "function",
|
|
55
|
+
name: "serialize",
|
|
56
|
+
inputs: [],
|
|
57
|
+
outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
|
|
58
|
+
stateMutability: "view"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "function",
|
|
62
|
+
name: "swap",
|
|
63
|
+
inputs: [
|
|
64
|
+
{ name: "liquidityAmount", type: "uint256", internalType: "uint256" },
|
|
65
|
+
{ name: "minOutAmount", type: "uint256", internalType: "uint256" }
|
|
66
|
+
],
|
|
67
|
+
outputs: [{ name: "success", type: "bool", internalType: "bool" }],
|
|
68
|
+
stateMutability: "nonpayable"
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
type: "function",
|
|
72
|
+
name: "swapDiff",
|
|
73
|
+
inputs: [
|
|
74
|
+
{ name: "leftoverAmount", type: "uint256", internalType: "uint256" },
|
|
75
|
+
{ name: "rateMinRAY", type: "uint256", internalType: "uint256" }
|
|
76
|
+
],
|
|
77
|
+
outputs: [{ name: "success", type: "bool", internalType: "bool" }],
|
|
78
|
+
stateMutability: "nonpayable"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "function",
|
|
82
|
+
name: "targetContract",
|
|
83
|
+
inputs: [],
|
|
84
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
85
|
+
stateMutability: "view"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
type: "function",
|
|
89
|
+
name: "version",
|
|
90
|
+
inputs: [],
|
|
91
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
92
|
+
stateMutability: "view"
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
96
|
+
0 && (module.exports = {
|
|
97
|
+
iSecuritizeOnRampAdapterAbi
|
|
98
|
+
});
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var iSecuritizeRedemptionGateway_exports = {};
|
|
20
|
+
__export(iSecuritizeRedemptionGateway_exports, {
|
|
21
|
+
iSecuritizeRedemptionGatewayAbi: () => iSecuritizeRedemptionGatewayAbi
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(iSecuritizeRedemptionGateway_exports);
|
|
24
|
+
const iSecuritizeRedemptionGatewayAbi = [
|
|
25
|
+
{
|
|
26
|
+
type: "function",
|
|
27
|
+
name: "claim",
|
|
28
|
+
inputs: [
|
|
29
|
+
{ name: "redeemers", type: "address[]", internalType: "address[]" }
|
|
30
|
+
],
|
|
31
|
+
outputs: [],
|
|
32
|
+
stateMutability: "nonpayable"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "function",
|
|
36
|
+
name: "contractType",
|
|
37
|
+
inputs: [],
|
|
38
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
39
|
+
stateMutability: "view"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "function",
|
|
43
|
+
name: "dsToken",
|
|
44
|
+
inputs: [],
|
|
45
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
46
|
+
stateMutability: "view"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "function",
|
|
50
|
+
name: "getRedeemers",
|
|
51
|
+
inputs: [{ name: "account", type: "address", internalType: "address" }],
|
|
52
|
+
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
|
|
53
|
+
stateMutability: "view"
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
type: "function",
|
|
57
|
+
name: "getRedemptionAmount",
|
|
58
|
+
inputs: [{ name: "account", type: "address", internalType: "address" }],
|
|
59
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
60
|
+
stateMutability: "view"
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
type: "function",
|
|
64
|
+
name: "getUnclaimedRedeemers",
|
|
65
|
+
inputs: [{ name: "account", type: "address", internalType: "address" }],
|
|
66
|
+
outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
|
|
67
|
+
stateMutability: "view"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
type: "function",
|
|
71
|
+
name: "masterRedeemer",
|
|
72
|
+
inputs: [],
|
|
73
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
74
|
+
stateMutability: "view"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "function",
|
|
78
|
+
name: "navProvider",
|
|
79
|
+
inputs: [],
|
|
80
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
81
|
+
stateMutability: "view"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "function",
|
|
85
|
+
name: "redeem",
|
|
86
|
+
inputs: [
|
|
87
|
+
{ name: "dsTokenAmount", type: "uint256", internalType: "uint256" }
|
|
88
|
+
],
|
|
89
|
+
outputs: [],
|
|
90
|
+
stateMutability: "nonpayable"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
type: "function",
|
|
94
|
+
name: "redemptionAccount",
|
|
95
|
+
inputs: [],
|
|
96
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
97
|
+
stateMutability: "view"
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "function",
|
|
101
|
+
name: "securitizeWhitelister",
|
|
102
|
+
inputs: [],
|
|
103
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
104
|
+
stateMutability: "view"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
type: "function",
|
|
108
|
+
name: "stableCoinToken",
|
|
109
|
+
inputs: [],
|
|
110
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
111
|
+
stateMutability: "view"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
type: "function",
|
|
115
|
+
name: "transferMaster",
|
|
116
|
+
inputs: [],
|
|
117
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
118
|
+
stateMutability: "view"
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
type: "function",
|
|
122
|
+
name: "transferRedeemer",
|
|
123
|
+
inputs: [
|
|
124
|
+
{ name: "redeemer", type: "address", internalType: "address" },
|
|
125
|
+
{ name: "newAccount", type: "address", internalType: "address" }
|
|
126
|
+
],
|
|
127
|
+
outputs: [],
|
|
128
|
+
stateMutability: "nonpayable"
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
type: "function",
|
|
132
|
+
name: "version",
|
|
133
|
+
inputs: [],
|
|
134
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
135
|
+
stateMutability: "view"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
type: "error",
|
|
139
|
+
name: "MaxUnclaimedRedeemersPerAccountException",
|
|
140
|
+
inputs: []
|
|
141
|
+
},
|
|
142
|
+
{ type: "error", name: "NewAccountNotRegisteredException", inputs: [] },
|
|
143
|
+
{ type: "error", name: "RedeemerNotOwnedByAccountException", inputs: [] },
|
|
144
|
+
{ type: "error", name: "RedeemerTransferNotAllowedException", inputs: [] }
|
|
145
|
+
];
|
|
146
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
147
|
+
0 && (module.exports = {
|
|
148
|
+
iSecuritizeRedemptionGatewayAbi
|
|
149
|
+
});
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var iSecuritizeRedemptionGatewayAdapter_exports = {};
|
|
20
|
+
__export(iSecuritizeRedemptionGatewayAdapter_exports, {
|
|
21
|
+
iSecuritizeRedemptionGatewayAdapterAbi: () => iSecuritizeRedemptionGatewayAdapterAbi
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(iSecuritizeRedemptionGatewayAdapter_exports);
|
|
24
|
+
const iSecuritizeRedemptionGatewayAdapterAbi = [
|
|
25
|
+
{
|
|
26
|
+
type: "function",
|
|
27
|
+
name: "claim",
|
|
28
|
+
inputs: [
|
|
29
|
+
{ name: "redeemers", type: "address[]", internalType: "address[]" }
|
|
30
|
+
],
|
|
31
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
32
|
+
stateMutability: "nonpayable"
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
type: "function",
|
|
36
|
+
name: "contractType",
|
|
37
|
+
inputs: [],
|
|
38
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
39
|
+
stateMutability: "view"
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
type: "function",
|
|
43
|
+
name: "creditManager",
|
|
44
|
+
inputs: [],
|
|
45
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
46
|
+
stateMutability: "view"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "function",
|
|
50
|
+
name: "depositPhantomToken",
|
|
51
|
+
inputs: [
|
|
52
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
53
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
54
|
+
],
|
|
55
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
56
|
+
stateMutability: "nonpayable"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
type: "function",
|
|
60
|
+
name: "dsToken",
|
|
61
|
+
inputs: [],
|
|
62
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
63
|
+
stateMutability: "view"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: "function",
|
|
67
|
+
name: "redeem",
|
|
68
|
+
inputs: [
|
|
69
|
+
{ name: "dsTokenAmount", type: "uint256", internalType: "uint256" }
|
|
70
|
+
],
|
|
71
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
72
|
+
stateMutability: "nonpayable"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
type: "function",
|
|
76
|
+
name: "redeemDiff",
|
|
77
|
+
inputs: [
|
|
78
|
+
{ name: "leftoverAmount", type: "uint256", internalType: "uint256" }
|
|
79
|
+
],
|
|
80
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
81
|
+
stateMutability: "nonpayable"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
type: "function",
|
|
85
|
+
name: "redemptionPhantomToken",
|
|
86
|
+
inputs: [],
|
|
87
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
88
|
+
stateMutability: "view"
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
type: "function",
|
|
92
|
+
name: "serialize",
|
|
93
|
+
inputs: [],
|
|
94
|
+
outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
|
|
95
|
+
stateMutability: "view"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
type: "function",
|
|
99
|
+
name: "stableCoinToken",
|
|
100
|
+
inputs: [],
|
|
101
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
102
|
+
stateMutability: "view"
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: "function",
|
|
106
|
+
name: "targetContract",
|
|
107
|
+
inputs: [],
|
|
108
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
109
|
+
stateMutability: "view"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "function",
|
|
113
|
+
name: "transferRedeemer",
|
|
114
|
+
inputs: [
|
|
115
|
+
{ name: "redeemer", type: "address", internalType: "address" },
|
|
116
|
+
{ name: "newAccount", type: "address", internalType: "address" }
|
|
117
|
+
],
|
|
118
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
119
|
+
stateMutability: "nonpayable"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
type: "function",
|
|
123
|
+
name: "version",
|
|
124
|
+
inputs: [],
|
|
125
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
126
|
+
stateMutability: "view"
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
type: "function",
|
|
130
|
+
name: "withdrawPhantomToken",
|
|
131
|
+
inputs: [
|
|
132
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
133
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
134
|
+
],
|
|
135
|
+
outputs: [{ name: "useSafePrices", type: "bool", internalType: "bool" }],
|
|
136
|
+
stateMutability: "nonpayable"
|
|
137
|
+
},
|
|
138
|
+
{ type: "error", name: "IncorrectStakedPhantomTokenException", inputs: [] },
|
|
139
|
+
{ type: "error", name: "InvalidRedemptionGatewayException", inputs: [] }
|
|
140
|
+
];
|
|
141
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
142
|
+
0 && (module.exports = {
|
|
143
|
+
iSecuritizeRedemptionGatewayAdapterAbi
|
|
144
|
+
});
|
|
@@ -23,9 +23,11 @@ __export(SecuritizeOnRampAdapterContract_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(SecuritizeOnRampAdapterContract_exports);
|
|
24
24
|
var import_viem = require("viem");
|
|
25
25
|
var import_sdk = require("../../../sdk/index.js");
|
|
26
|
+
var import_iSecuritizeOnRamp = require("../abi/securitize/iSecuritizeOnRamp.js");
|
|
27
|
+
var import_iSecuritizeOnRampAdapter = require("../abi/securitize/iSecuritizeOnRampAdapter.js");
|
|
26
28
|
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
-
const abi =
|
|
28
|
-
const protocolAbi =
|
|
29
|
+
const abi = import_iSecuritizeOnRampAdapter.iSecuritizeOnRampAdapterAbi;
|
|
30
|
+
const protocolAbi = import_iSecuritizeOnRamp.iSecuritizeOnRampAbi;
|
|
29
31
|
class SecuritizeOnRampAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
30
32
|
#dsToken;
|
|
31
33
|
#liquidityToken;
|