@gearbox-protocol/sdk 14.4.3 → 14.5.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/dist/cjs/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.js +187 -0
- package/dist/cjs/abi/router/securitizeOnrampWorker.js +541 -0
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +9 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +68 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +77 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +68 -0
- package/dist/cjs/plugins/adapters/createAdapter.js +9 -0
- package/dist/cjs/plugins/adapters/types.js +3 -0
- package/dist/cjs/sdk/chain/chains.js +1 -1
- package/dist/esm/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.js +163 -0
- package/dist/esm/abi/router/securitizeOnrampWorker.js +517 -0
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +9 -0
- package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +46 -0
- package/dist/esm/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +55 -0
- package/dist/esm/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +46 -0
- package/dist/esm/plugins/adapters/createAdapter.js +9 -0
- package/dist/esm/plugins/adapters/types.js +3 -0
- package/dist/esm/sdk/chain/chains.js +1 -1
- package/dist/types/abi/compressors/subcompressors/securitizeRedemptionSubcompressor.d.ts +220 -0
- package/dist/types/abi/router/securitizeOnrampWorker.d.ts +726 -0
- package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +24 -0
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +26 -0
- package/dist/types/plugins/adapters/contracts/SecuritizeSwapAdapterContract.d.ts +24 -0
- package/dist/types/plugins/adapters/types.d.ts +4 -1
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,77 @@
|
|
|
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 SecuritizeRedemptionGatewayAdapterContract_exports = {};
|
|
20
|
+
__export(SecuritizeRedemptionGatewayAdapterContract_exports, {
|
|
21
|
+
SecuritizeRedemptionGatewayAdapterContract: () => SecuritizeRedemptionGatewayAdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(SecuritizeRedemptionGatewayAdapterContract_exports);
|
|
24
|
+
var import_viem = require("viem");
|
|
25
|
+
var import_sdk = require("../../../sdk/index.js");
|
|
26
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
+
const abi = [];
|
|
28
|
+
const protocolAbi = [];
|
|
29
|
+
class SecuritizeRedemptionGatewayAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
30
|
+
#dsToken;
|
|
31
|
+
#stableCoinToken;
|
|
32
|
+
#redemptionPhantomToken;
|
|
33
|
+
constructor(options, args) {
|
|
34
|
+
super(options, { ...args, abi, protocolAbi });
|
|
35
|
+
if (args.baseParams.serializedParams) {
|
|
36
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
37
|
+
[
|
|
38
|
+
{ type: "address", name: "creditManager" },
|
|
39
|
+
{ type: "address", name: "targetContract" },
|
|
40
|
+
{ type: "address", name: "dsToken" },
|
|
41
|
+
{ type: "address", name: "stableCoinToken" },
|
|
42
|
+
{ type: "address", name: "redemptionPhantomToken" }
|
|
43
|
+
],
|
|
44
|
+
args.baseParams.serializedParams
|
|
45
|
+
);
|
|
46
|
+
this.#dsToken = decoded[2];
|
|
47
|
+
this.#stableCoinToken = decoded[3];
|
|
48
|
+
this.#redemptionPhantomToken = decoded[4];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
get dsToken() {
|
|
52
|
+
if (!this.#dsToken) throw new import_sdk.MissingSerializedParamsError("dsToken");
|
|
53
|
+
return this.#dsToken;
|
|
54
|
+
}
|
|
55
|
+
get stableCoinToken() {
|
|
56
|
+
if (!this.#stableCoinToken)
|
|
57
|
+
throw new import_sdk.MissingSerializedParamsError("stableCoinToken");
|
|
58
|
+
return this.#stableCoinToken;
|
|
59
|
+
}
|
|
60
|
+
get redemptionPhantomToken() {
|
|
61
|
+
if (!this.#redemptionPhantomToken)
|
|
62
|
+
throw new import_sdk.MissingSerializedParamsError("redemptionPhantomToken");
|
|
63
|
+
return this.#redemptionPhantomToken;
|
|
64
|
+
}
|
|
65
|
+
stateHuman(raw) {
|
|
66
|
+
return {
|
|
67
|
+
...super.stateHuman(raw),
|
|
68
|
+
dsToken: this.#dsToken ? this.labelAddress(this.#dsToken) : void 0,
|
|
69
|
+
stableCoinToken: this.#stableCoinToken ? this.labelAddress(this.#stableCoinToken) : void 0,
|
|
70
|
+
redemptionPhantomToken: this.#redemptionPhantomToken ? this.labelAddress(this.#redemptionPhantomToken) : void 0
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
75
|
+
0 && (module.exports = {
|
|
76
|
+
SecuritizeRedemptionGatewayAdapterContract
|
|
77
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
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 SecuritizeSwapAdapterContract_exports = {};
|
|
20
|
+
__export(SecuritizeSwapAdapterContract_exports, {
|
|
21
|
+
SecuritizeSwapAdapterContract: () => SecuritizeSwapAdapterContract
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(SecuritizeSwapAdapterContract_exports);
|
|
24
|
+
var import_viem = require("viem");
|
|
25
|
+
var import_sdk = require("../../../sdk/index.js");
|
|
26
|
+
var import_AbstractAdapter = require("./AbstractAdapter.js");
|
|
27
|
+
const abi = [];
|
|
28
|
+
const protocolAbi = [];
|
|
29
|
+
class SecuritizeSwapAdapterContract extends import_AbstractAdapter.AbstractAdapterContract {
|
|
30
|
+
#dsToken;
|
|
31
|
+
#stableCoinToken;
|
|
32
|
+
constructor(options, args) {
|
|
33
|
+
super(options, { ...args, abi, protocolAbi });
|
|
34
|
+
if (args.baseParams.serializedParams) {
|
|
35
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
36
|
+
[
|
|
37
|
+
{ type: "address", name: "creditManager" },
|
|
38
|
+
{ type: "address", name: "targetContract" },
|
|
39
|
+
{ type: "address", name: "dsToken" },
|
|
40
|
+
{ type: "address", name: "stableCoinToken" }
|
|
41
|
+
],
|
|
42
|
+
args.baseParams.serializedParams
|
|
43
|
+
);
|
|
44
|
+
this.#dsToken = decoded[2];
|
|
45
|
+
this.#stableCoinToken = decoded[3];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
get dsToken() {
|
|
49
|
+
if (!this.#dsToken) throw new import_sdk.MissingSerializedParamsError("dsToken");
|
|
50
|
+
return this.#dsToken;
|
|
51
|
+
}
|
|
52
|
+
get stableCoinToken() {
|
|
53
|
+
if (!this.#stableCoinToken)
|
|
54
|
+
throw new import_sdk.MissingSerializedParamsError("stableCoinToken");
|
|
55
|
+
return this.#stableCoinToken;
|
|
56
|
+
}
|
|
57
|
+
stateHuman(raw) {
|
|
58
|
+
return {
|
|
59
|
+
...super.stateHuman(raw),
|
|
60
|
+
dsToken: this.#dsToken ? this.labelAddress(this.#dsToken) : void 0,
|
|
61
|
+
stableCoinToken: this.#stableCoinToken ? this.labelAddress(this.#stableCoinToken) : void 0
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
66
|
+
0 && (module.exports = {
|
|
67
|
+
SecuritizeSwapAdapterContract
|
|
68
|
+
});
|
|
@@ -24,6 +24,9 @@ module.exports = __toCommonJS(createAdapter_exports);
|
|
|
24
24
|
var import_viem = require("viem");
|
|
25
25
|
var import_sdk = require("../../sdk/index.js");
|
|
26
26
|
var import_contracts = require("./contracts/index.js");
|
|
27
|
+
var import_SecuritizeOnRampAdapterContract = require("./contracts/SecuritizeOnRampAdapterContract.js");
|
|
28
|
+
var import_SecuritizeRedemptionGatewayAdapterContract = require("./contracts/SecuritizeRedemptionGatewayAdapterContract.js");
|
|
29
|
+
var import_SecuritizeSwapAdapterContract = require("./contracts/SecuritizeSwapAdapterContract.js");
|
|
27
30
|
var import_UniswapV4AdapterContract = require("./contracts/UniswapV4AdapterContract.js");
|
|
28
31
|
function createAdapter(options, data, strict) {
|
|
29
32
|
const contractType = data.baseParams.contractType;
|
|
@@ -91,6 +94,12 @@ function createAdapter(options, data, strict) {
|
|
|
91
94
|
return new import_contracts.MidasRedemptionVaultAdapterContract(options, data);
|
|
92
95
|
case "ADAPTER::PENDLE_ROUTER":
|
|
93
96
|
return new import_contracts.PendleRouterAdapterContract(options, data);
|
|
97
|
+
case "ADAPTER::SECURITIZE_ONRAMP":
|
|
98
|
+
return new import_SecuritizeOnRampAdapterContract.SecuritizeOnRampAdapterContract(options, data);
|
|
99
|
+
case "ADAPTER::SECURITIZE_REDEMPTION":
|
|
100
|
+
return new import_SecuritizeRedemptionGatewayAdapterContract.SecuritizeRedemptionGatewayAdapterContract(options, data);
|
|
101
|
+
case "ADAPTER::SECURITIZE_SWAP":
|
|
102
|
+
return new import_SecuritizeSwapAdapterContract.SecuritizeSwapAdapterContract(options, data);
|
|
94
103
|
case "ADAPTER::STAKING_REWARDS":
|
|
95
104
|
return new import_contracts.StakingRewardsAdapterContract(options, data);
|
|
96
105
|
case "ADAPTER::TRADER_JOE_ROUTER":
|
|
@@ -58,6 +58,9 @@ var AdapterType = /* @__PURE__ */ ((AdapterType2) => {
|
|
|
58
58
|
AdapterType2["MIDAS_ISSUANCE_VAULT"] = "MIDAS_ISSUANCE_VAULT";
|
|
59
59
|
AdapterType2["MIDAS_REDEMPTION_VAULT"] = "MIDAS_REDEMPTION_VAULT";
|
|
60
60
|
AdapterType2["PENDLE_ROUTER"] = "PENDLE_ROUTER";
|
|
61
|
+
AdapterType2["SECURITIZE_ONRAMP"] = "SECURITIZE_ONRAMP";
|
|
62
|
+
AdapterType2["SECURITIZE_REDEMPTION"] = "SECURITIZE_REDEMPTION";
|
|
63
|
+
AdapterType2["SECURITIZE_SWAP"] = "SECURITIZE_SWAP";
|
|
61
64
|
AdapterType2["STAKING_REWARDS"] = "STAKING_REWARDS";
|
|
62
65
|
AdapterType2["TRADER_JOE_ROUTER"] = "TRADER_JOE_ROUTER";
|
|
63
66
|
AdapterType2["UNISWAP_V2_ROUTER"] = "UNISWAP_V2_ROUTER";
|
|
@@ -74,7 +74,7 @@ const chains = {
|
|
|
74
74
|
"0x3b56538833fc02f4f0e75609390f26ded0c32e42": "Re7",
|
|
75
75
|
"0x7a133fbd01736fd076158307c9476cc3877f1af5": "Invariant Group",
|
|
76
76
|
"0x09d8305F49374AEA6A78aF6C996df2913e8f3b19": "Tulipa",
|
|
77
|
-
"0x1b265b97eb169fb6668e3258007c3b0242c7bdbe": "
|
|
77
|
+
"0x1b265b97eb169fb6668e3258007c3b0242c7bdbe": "KPK",
|
|
78
78
|
"0x9dddd1b9ce0ac8aa0c80e4ec141600b9bf0101c3": "UltraYield",
|
|
79
79
|
"0x601067eba24bb5b558a184fc082525637e96a42d": "Gami Labs"
|
|
80
80
|
},
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
const securitizeRedemptionSubcompressorAbi = [
|
|
2
|
+
{
|
|
3
|
+
type: "function",
|
|
4
|
+
name: "contractType",
|
|
5
|
+
inputs: [],
|
|
6
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
7
|
+
stateMutability: "view"
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
type: "function",
|
|
11
|
+
name: "getCurrentWithdrawals",
|
|
12
|
+
inputs: [
|
|
13
|
+
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
14
|
+
{ name: "token", type: "address", internalType: "address" }
|
|
15
|
+
],
|
|
16
|
+
outputs: [
|
|
17
|
+
{
|
|
18
|
+
name: "",
|
|
19
|
+
type: "tuple[]",
|
|
20
|
+
internalType: "struct ClaimableWithdrawal[]",
|
|
21
|
+
components: [
|
|
22
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
23
|
+
{
|
|
24
|
+
name: "withdrawalPhantomToken",
|
|
25
|
+
type: "address",
|
|
26
|
+
internalType: "address"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "withdrawalTokenSpent",
|
|
30
|
+
type: "uint256",
|
|
31
|
+
internalType: "uint256"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: "outputs",
|
|
35
|
+
type: "tuple[]",
|
|
36
|
+
internalType: "struct WithdrawalOutput[]",
|
|
37
|
+
components: [
|
|
38
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
39
|
+
{ name: "isDelayed", type: "bool", internalType: "bool" },
|
|
40
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: "claimCalls",
|
|
45
|
+
type: "tuple[]",
|
|
46
|
+
internalType: "struct MultiCall[]",
|
|
47
|
+
components: [
|
|
48
|
+
{ name: "target", type: "address", internalType: "address" },
|
|
49
|
+
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
name: "",
|
|
56
|
+
type: "tuple[]",
|
|
57
|
+
internalType: "struct PendingWithdrawal[]",
|
|
58
|
+
components: [
|
|
59
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
60
|
+
{
|
|
61
|
+
name: "withdrawalPhantomToken",
|
|
62
|
+
type: "address",
|
|
63
|
+
internalType: "address"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
name: "expectedOutputs",
|
|
67
|
+
type: "tuple[]",
|
|
68
|
+
internalType: "struct WithdrawalOutput[]",
|
|
69
|
+
components: [
|
|
70
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
71
|
+
{ name: "isDelayed", type: "bool", internalType: "bool" },
|
|
72
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
73
|
+
]
|
|
74
|
+
},
|
|
75
|
+
{ name: "claimableAt", type: "uint256", internalType: "uint256" }
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
],
|
|
79
|
+
stateMutability: "view"
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
type: "function",
|
|
83
|
+
name: "getWithdrawableAssets",
|
|
84
|
+
inputs: [
|
|
85
|
+
{ name: "", type: "address", internalType: "address" },
|
|
86
|
+
{ name: "token", type: "address", internalType: "address" }
|
|
87
|
+
],
|
|
88
|
+
outputs: [
|
|
89
|
+
{
|
|
90
|
+
name: "",
|
|
91
|
+
type: "tuple[]",
|
|
92
|
+
internalType: "struct WithdrawableAsset[]",
|
|
93
|
+
components: [
|
|
94
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
95
|
+
{
|
|
96
|
+
name: "withdrawalPhantomToken",
|
|
97
|
+
type: "address",
|
|
98
|
+
internalType: "address"
|
|
99
|
+
},
|
|
100
|
+
{ name: "underlying", type: "address", internalType: "address" },
|
|
101
|
+
{
|
|
102
|
+
name: "withdrawalLength",
|
|
103
|
+
type: "uint256",
|
|
104
|
+
internalType: "uint256"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
],
|
|
109
|
+
stateMutability: "view"
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
type: "function",
|
|
113
|
+
name: "getWithdrawalRequestResult",
|
|
114
|
+
inputs: [
|
|
115
|
+
{ name: "creditAccount", type: "address", internalType: "address" },
|
|
116
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
117
|
+
{ name: "withdrawalToken", type: "address", internalType: "address" },
|
|
118
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
119
|
+
],
|
|
120
|
+
outputs: [
|
|
121
|
+
{
|
|
122
|
+
name: "requestableWithdrawal",
|
|
123
|
+
type: "tuple",
|
|
124
|
+
internalType: "struct RequestableWithdrawal",
|
|
125
|
+
components: [
|
|
126
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
127
|
+
{ name: "amountIn", type: "uint256", internalType: "uint256" },
|
|
128
|
+
{
|
|
129
|
+
name: "outputs",
|
|
130
|
+
type: "tuple[]",
|
|
131
|
+
internalType: "struct WithdrawalOutput[]",
|
|
132
|
+
components: [
|
|
133
|
+
{ name: "token", type: "address", internalType: "address" },
|
|
134
|
+
{ name: "isDelayed", type: "bool", internalType: "bool" },
|
|
135
|
+
{ name: "amount", type: "uint256", internalType: "uint256" }
|
|
136
|
+
]
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
name: "requestCalls",
|
|
140
|
+
type: "tuple[]",
|
|
141
|
+
internalType: "struct MultiCall[]",
|
|
142
|
+
components: [
|
|
143
|
+
{ name: "target", type: "address", internalType: "address" },
|
|
144
|
+
{ name: "callData", type: "bytes", internalType: "bytes" }
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
{ name: "claimableAt", type: "uint256", internalType: "uint256" }
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
],
|
|
151
|
+
stateMutability: "view"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
type: "function",
|
|
155
|
+
name: "version",
|
|
156
|
+
inputs: [],
|
|
157
|
+
outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
|
|
158
|
+
stateMutability: "view"
|
|
159
|
+
}
|
|
160
|
+
];
|
|
161
|
+
export {
|
|
162
|
+
securitizeRedemptionSubcompressorAbi
|
|
163
|
+
};
|