@gearbox-protocol/sdk 14.12.0-next.19 → 14.12.0-next.20
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/plugins/adapters/abi/{securitize/iSecuritizeOnRampAdapter.js → adapters/iSecuritizeOnRampAdapterV310.js} +6 -6
- package/dist/cjs/plugins/adapters/abi/{securitize/iSecuritizeRedemptionGatewayAdapter.js → adapters/iSecuritizeRedemptionGatewayAdapterV311.js} +26 -6
- package/dist/cjs/plugins/adapters/abi/adapters/index.js +4 -0
- package/dist/cjs/plugins/adapters/abi/securitize/{iSecuritizeRedemptionGateway.js → iSecuritizeRedemptionGatewayV311.js} +15 -7
- package/dist/cjs/plugins/adapters/abi/securitize/index.js +2 -6
- package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +28 -4
- package/dist/cjs/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +3 -3
- package/dist/cjs/sdk/accounts/withdrawal-compressor/index.js +2 -2
- package/dist/cjs/sdk/accounts/withdrawal-compressor/{intent.js → intent-codec.js} +14 -68
- package/dist/esm/plugins/adapters/abi/{securitize/iSecuritizeOnRampAdapter.js → adapters/iSecuritizeOnRampAdapterV310.js} +2 -2
- package/dist/esm/plugins/adapters/abi/{securitize/iSecuritizeRedemptionGatewayAdapter.js → adapters/iSecuritizeRedemptionGatewayAdapterV311.js} +22 -2
- package/dist/esm/plugins/adapters/abi/adapters/index.js +2 -0
- package/dist/esm/plugins/adapters/abi/securitize/{iSecuritizeRedemptionGateway.js → iSecuritizeRedemptionGatewayV311.js} +11 -3
- package/dist/esm/plugins/adapters/abi/securitize/index.js +1 -3
- package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +2 -2
- package/dist/esm/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.js +31 -5
- package/dist/esm/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/index.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/{intent.js → intent-codec.js} +11 -57
- package/dist/types/plugins/adapters/abi/{securitize/iSecuritizeOnRampAdapter.d.ts → adapters/iSecuritizeOnRampAdapterV310.d.ts} +1 -1
- package/dist/types/plugins/adapters/abi/{securitize/iSecuritizeRedemptionGatewayAdapter.d.ts → adapters/iSecuritizeRedemptionGatewayAdapterV311.d.ts} +37 -1
- package/dist/types/plugins/adapters/abi/adapters/index.d.ts +2 -0
- package/dist/types/plugins/adapters/abi/securitize/{iSecuritizeRedemptionGateway.d.ts → iSecuritizeRedemptionGatewayV311.d.ts} +15 -1
- package/dist/types/plugins/adapters/abi/securitize/index.d.ts +1 -3
- package/dist/types/plugins/adapters/contracts/SecuritizeRedemptionGatewayAdapterContract.d.ts +54 -2
- package/dist/types/sdk/accounts/withdrawal-compressor/AbstractWithdrawalCompressorContract.d.ts +1 -2
- package/dist/types/sdk/accounts/withdrawal-compressor/index.d.ts +1 -1
- package/dist/types/sdk/accounts/withdrawal-compressor/intent-codec.d.ts +26 -0
- package/dist/types/sdk/accounts/withdrawal-compressor/types.d.ts +167 -6
- package/package.json +1 -1
- package/dist/types/sdk/accounts/withdrawal-compressor/intent.d.ts +0 -106
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { Hex } from "viem";
|
|
2
|
-
import { z } from "zod/v4";
|
|
3
|
-
/**
|
|
4
|
-
* App: 1.1 Deposit and 4.1 Adjust leverage — raise leverage at fixed TVL.
|
|
5
|
-
* Borrow `underlying` -> swap `underlying` into `targetToken` -> [withdraw to wallet].
|
|
6
|
-
**/
|
|
7
|
-
export declare const delayedIncreaseLeverageIntentSchema: z.ZodObject<{
|
|
8
|
-
type: z.ZodLiteral<"INCREASE_LEVERAGE">;
|
|
9
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
10
|
-
}, z.core.$strip>;
|
|
11
|
-
export type DelayedIncreaseLeverageIntent = z.infer<typeof delayedIncreaseLeverageIntentSchema>;
|
|
12
|
-
/**
|
|
13
|
-
* App: 1.2 Deposit — `amount > 0`, leverage = current (grow net value at same L).
|
|
14
|
-
**/
|
|
15
|
-
export declare const delayedDepositIntentSchema: z.ZodObject<{
|
|
16
|
-
type: z.ZodLiteral<"DEPOSIT">;
|
|
17
|
-
}, z.core.$strip>;
|
|
18
|
-
export type DelayedDepositIntent = z.infer<typeof delayedDepositIntentSchema>;
|
|
19
|
-
/**
|
|
20
|
-
* App: 1.3 Deposit and Adjust leverage — `amount > 0`, leverage > current.
|
|
21
|
-
**/
|
|
22
|
-
export declare const delayedDepositAndIncreaseLeverageIntentSchema: z.ZodObject<{
|
|
23
|
-
type: z.ZodLiteral<"DEPOSIT_AND_INCREASE_LEVERAGE">;
|
|
24
|
-
}, z.core.$strip>;
|
|
25
|
-
export type DelayedDepositAndIncreaseLeverageIntent = z.infer<typeof delayedDepositAndIncreaseLeverageIntentSchema>;
|
|
26
|
-
/**
|
|
27
|
-
* App: 2.1 Withdraw — withdraw selected token at fixed leverage.
|
|
28
|
-
**/
|
|
29
|
-
export declare const delayedWithdrawCollateralIntentSchema: z.ZodObject<{
|
|
30
|
-
type: z.ZodLiteral<"WITHDRAW_COLLATERAL">;
|
|
31
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
32
|
-
withdrawToken: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
33
|
-
withdrawAmount: z.ZodBigInt;
|
|
34
|
-
}, z.core.$strip>;
|
|
35
|
-
export type DelayedWithdrawCollateralIntent = z.infer<typeof delayedWithdrawCollateralIntentSchema>;
|
|
36
|
-
/**
|
|
37
|
-
* App: 2.2 Withdraw — close account (receive leftover to wallet).
|
|
38
|
-
**/
|
|
39
|
-
export declare const delayedCloseAccountIntentSchema: z.ZodObject<{
|
|
40
|
-
type: z.ZodLiteral<"CLOSE_ACCOUNT">;
|
|
41
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
42
|
-
}, z.core.$strip>;
|
|
43
|
-
export type DelayedCloseAccountIntent = z.infer<typeof delayedCloseAccountIntentSchema>;
|
|
44
|
-
/**
|
|
45
|
-
* App: 3.1 Add collateral — fixed debt.
|
|
46
|
-
**/
|
|
47
|
-
export declare const delayedAddCollateralIntentSchema: z.ZodObject<{
|
|
48
|
-
type: z.ZodLiteral<"ADD_COLLATERAL">;
|
|
49
|
-
}, z.core.$strip>;
|
|
50
|
-
export type DelayedAddCollateralIntent = z.infer<typeof delayedAddCollateralIntentSchema>;
|
|
51
|
-
/**
|
|
52
|
-
* App: 4.2 Adjust leverage — lower leverage at fixed TVL.
|
|
53
|
-
**/
|
|
54
|
-
export declare const delayedDecreaseLeverageIntentSchema: z.ZodObject<{
|
|
55
|
-
type: z.ZodLiteral<"DECREASE_LEVERAGE">;
|
|
56
|
-
}, z.core.$strip>;
|
|
57
|
-
export type DelayedDecreaseLeverageIntent = z.infer<typeof delayedDecreaseLeverageIntentSchema>;
|
|
58
|
-
/**
|
|
59
|
-
* Lean intent that is abi-encoded into `extraData` of a delayed withdrawal
|
|
60
|
-
* request and decoded back when reading claimable withdrawals.
|
|
61
|
-
**/
|
|
62
|
-
export declare const delayedIntentSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
63
|
-
type: z.ZodLiteral<"INCREASE_LEVERAGE">;
|
|
64
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
65
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
66
|
-
type: z.ZodLiteral<"DEPOSIT">;
|
|
67
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
68
|
-
type: z.ZodLiteral<"DEPOSIT_AND_INCREASE_LEVERAGE">;
|
|
69
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
70
|
-
type: z.ZodLiteral<"WITHDRAW_COLLATERAL">;
|
|
71
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
72
|
-
withdrawToken: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
73
|
-
withdrawAmount: z.ZodBigInt;
|
|
74
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
75
|
-
type: z.ZodLiteral<"CLOSE_ACCOUNT">;
|
|
76
|
-
to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
|
|
77
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
78
|
-
type: z.ZodLiteral<"ADD_COLLATERAL">;
|
|
79
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
80
|
-
type: z.ZodLiteral<"DECREASE_LEVERAGE">;
|
|
81
|
-
}, z.core.$strip>], "type">;
|
|
82
|
-
export type DelayedIntent = z.infer<typeof delayedIntentSchema>;
|
|
83
|
-
/**
|
|
84
|
-
* Current version of the delayed intent encoding schema.
|
|
85
|
-
* Bump when the layout of any intent type changes.
|
|
86
|
-
**/
|
|
87
|
-
export declare const DELAYED_INTENT_VERSION = 1;
|
|
88
|
-
/**
|
|
89
|
-
* Stable uint8 discriminants for intent types.
|
|
90
|
-
* Starts at 1 so that all-zero data cannot decode as a valid intent.
|
|
91
|
-
* Never reuse or renumber existing values.
|
|
92
|
-
**/
|
|
93
|
-
export declare const DELAYED_INTENT_TYPES: Record<DelayedIntent["type"], number>;
|
|
94
|
-
/**
|
|
95
|
-
* ABI-encodes a delayed intent as
|
|
96
|
-
* `(uint8 version, uint8 intentType, ...intent-specific fields)`.
|
|
97
|
-
* @throws if the intent does not match {@link delayedIntentSchema}
|
|
98
|
-
**/
|
|
99
|
-
export declare function encodeDelayedIntent(intent: DelayedIntent): Hex;
|
|
100
|
-
/**
|
|
101
|
-
* Decodes a delayed intent from abi-encoded `extraData` and validates it
|
|
102
|
-
* against {@link delayedIntentSchema}.
|
|
103
|
-
* @throws if data is empty, has an unsupported version, an unknown intent
|
|
104
|
-
* type, or does not match the schema
|
|
105
|
-
**/
|
|
106
|
-
export declare function decodeDelayedIntent(data: Hex): DelayedIntent;
|