@compass-labs/api-sdk 0.5.20 → 0.5.22
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/README.md +7 -2
- package/bin/mcp-server.js +881 -761
- package/bin/mcp-server.js.map +21 -19
- package/dist/commonjs/funcs/universalAllowance.js +1 -1
- package/dist/commonjs/funcs/universalAllowance.js.map +1 -1
- package/dist/commonjs/funcs/universalAllowanceSet.d.ts +1 -1
- package/dist/commonjs/funcs/universalAllowanceSet.d.ts.map +1 -1
- package/dist/commonjs/funcs/universalAllowanceSet.js +1 -1
- package/dist/commonjs/funcs/universalAllowanceSet.js.map +1 -1
- package/dist/commonjs/funcs/vaultsERC4626Deposit.d.ts +20 -0
- package/dist/commonjs/funcs/vaultsERC4626Deposit.d.ts.map +1 -0
- package/dist/commonjs/funcs/{morphoAllowance.js → vaultsERC4626Deposit.js} +9 -11
- package/dist/commonjs/funcs/vaultsERC4626Deposit.js.map +1 -0
- package/dist/commonjs/funcs/vaultsERC4626Withdraw.d.ts +22 -0
- package/dist/commonjs/funcs/vaultsERC4626Withdraw.d.ts.map +1 -0
- package/dist/commonjs/funcs/vaultsERC4626Withdraw.js +122 -0
- package/dist/commonjs/funcs/vaultsERC4626Withdraw.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/server.js +5 -3
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/universalAllowanceSet.d.ts +1 -1
- package/dist/commonjs/mcp-server/tools/universalAllowanceSet.js +1 -1
- package/dist/commonjs/mcp-server/tools/universalAllowanceSet.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Deposit.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Deposit.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/{morphoAllowance.js → vaultsERC4626Deposit.js} +10 -12
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Deposit.js.map +1 -0
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Withdraw.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Withdraw.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Withdraw.js +68 -0
- package/dist/commonjs/mcp-server/tools/vaultsERC4626Withdraw.js.map +1 -0
- package/dist/commonjs/models/components/batcheduseroperationsrequest.d.ts +5 -0
- package/dist/commonjs/models/components/batcheduseroperationsrequest.d.ts.map +1 -1
- package/dist/commonjs/models/components/batcheduseroperationsrequest.js +2 -0
- package/dist/commonjs/models/components/batcheduseroperationsrequest.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +4 -4
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +4 -4
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/setallowanceparams.d.ts +173 -0
- package/dist/commonjs/models/components/setallowanceparams.d.ts.map +1 -0
- package/dist/commonjs/models/components/setallowanceparams.js +185 -0
- package/dist/commonjs/models/components/setallowanceparams.js.map +1 -0
- package/dist/commonjs/models/components/setallowancerequest.d.ts +184 -0
- package/dist/commonjs/models/components/setallowancerequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/setallowancerequest.js +193 -0
- package/dist/commonjs/models/components/setallowancerequest.js.map +1 -0
- package/dist/commonjs/models/components/useroperation.d.ts +9 -18
- package/dist/commonjs/models/components/useroperation.d.ts.map +1 -1
- package/dist/commonjs/models/components/useroperation.js +13 -14
- package/dist/commonjs/models/components/useroperation.js.map +1 -1
- package/dist/commonjs/models/components/vaultdepositrequest.d.ts +79 -0
- package/dist/commonjs/models/components/vaultdepositrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/vaultdepositrequest.js +114 -0
- package/dist/commonjs/models/components/vaultdepositrequest.js.map +1 -0
- package/dist/commonjs/models/components/vaultwithdrawrequest.d.ts +55 -0
- package/dist/commonjs/models/components/vaultwithdrawrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/vaultwithdrawrequest.js +91 -0
- package/dist/commonjs/models/components/vaultwithdrawrequest.js.map +1 -0
- package/dist/commonjs/models/operations/genericallowance.d.ts +32 -14
- package/dist/commonjs/models/operations/genericallowance.d.ts.map +1 -1
- package/dist/commonjs/models/operations/genericallowance.js +36 -25
- package/dist/commonjs/models/operations/genericallowance.js.map +1 -1
- package/dist/commonjs/sdk/morpho.d.ts +0 -11
- package/dist/commonjs/sdk/morpho.d.ts.map +1 -1
- package/dist/commonjs/sdk/morpho.js +0 -14
- package/dist/commonjs/sdk/morpho.js.map +1 -1
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/commonjs/sdk/universal.d.ts +1 -1
- package/dist/commonjs/sdk/universal.d.ts.map +1 -1
- package/dist/commonjs/sdk/universal.js.map +1 -1
- package/dist/commonjs/sdk/vaultserc4626.d.ts +25 -0
- package/dist/commonjs/sdk/vaultserc4626.d.ts.map +1 -0
- package/dist/commonjs/sdk/vaultserc4626.js +38 -0
- package/dist/commonjs/sdk/vaultserc4626.js.map +1 -0
- package/dist/esm/funcs/universalAllowance.js +1 -1
- package/dist/esm/funcs/universalAllowance.js.map +1 -1
- package/dist/esm/funcs/universalAllowanceSet.d.ts +1 -1
- package/dist/esm/funcs/universalAllowanceSet.d.ts.map +1 -1
- package/dist/esm/funcs/universalAllowanceSet.js +1 -1
- package/dist/esm/funcs/universalAllowanceSet.js.map +1 -1
- package/dist/esm/funcs/vaultsERC4626Deposit.d.ts +20 -0
- package/dist/esm/funcs/vaultsERC4626Deposit.d.ts.map +1 -0
- package/dist/esm/funcs/{morphoAllowance.js → vaultsERC4626Deposit.js} +8 -10
- package/dist/esm/funcs/vaultsERC4626Deposit.js.map +1 -0
- package/dist/esm/funcs/vaultsERC4626Withdraw.d.ts +22 -0
- package/dist/esm/funcs/vaultsERC4626Withdraw.d.ts.map +1 -0
- package/dist/esm/funcs/vaultsERC4626Withdraw.js +86 -0
- package/dist/esm/funcs/vaultsERC4626Withdraw.js.map +1 -0
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.d.ts.map +1 -1
- package/dist/esm/mcp-server/server.js +5 -3
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/universalAllowanceSet.d.ts +1 -1
- package/dist/esm/mcp-server/tools/universalAllowanceSet.js +1 -1
- package/dist/esm/mcp-server/tools/universalAllowanceSet.js.map +1 -1
- package/dist/esm/mcp-server/tools/vaultsERC4626Deposit.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Deposit.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Deposit.js +30 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Deposit.js.map +1 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Withdraw.d.ts +8 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Withdraw.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Withdraw.js +32 -0
- package/dist/esm/mcp-server/tools/vaultsERC4626Withdraw.js.map +1 -0
- package/dist/esm/models/components/batcheduseroperationsrequest.d.ts +5 -0
- package/dist/esm/models/components/batcheduseroperationsrequest.d.ts.map +1 -1
- package/dist/esm/models/components/batcheduseroperationsrequest.js +2 -0
- package/dist/esm/models/components/batcheduseroperationsrequest.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +4 -4
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +4 -4
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/setallowanceparams.d.ts +173 -0
- package/dist/esm/models/components/setallowanceparams.d.ts.map +1 -0
- package/dist/esm/models/components/setallowanceparams.js +141 -0
- package/dist/esm/models/components/setallowanceparams.js.map +1 -0
- package/dist/esm/models/components/setallowancerequest.d.ts +184 -0
- package/dist/esm/models/components/setallowancerequest.d.ts.map +1 -0
- package/dist/esm/models/components/setallowancerequest.js +149 -0
- package/dist/esm/models/components/setallowancerequest.js.map +1 -0
- package/dist/esm/models/components/useroperation.d.ts +9 -18
- package/dist/esm/models/components/useroperation.d.ts.map +1 -1
- package/dist/esm/models/components/useroperation.js +13 -14
- package/dist/esm/models/components/useroperation.js.map +1 -1
- package/dist/esm/models/components/vaultdepositrequest.d.ts +79 -0
- package/dist/esm/models/components/vaultdepositrequest.d.ts.map +1 -0
- package/dist/esm/models/components/vaultdepositrequest.js +74 -0
- package/dist/esm/models/components/vaultdepositrequest.js.map +1 -0
- package/dist/esm/models/components/vaultwithdrawrequest.d.ts +55 -0
- package/dist/esm/models/components/vaultwithdrawrequest.d.ts.map +1 -0
- package/dist/esm/models/components/vaultwithdrawrequest.js +53 -0
- package/dist/esm/models/components/vaultwithdrawrequest.js.map +1 -0
- package/dist/esm/models/operations/genericallowance.d.ts +32 -14
- package/dist/esm/models/operations/genericallowance.d.ts.map +1 -1
- package/dist/esm/models/operations/genericallowance.js +33 -24
- package/dist/esm/models/operations/genericallowance.js.map +1 -1
- package/dist/esm/sdk/morpho.d.ts +0 -11
- package/dist/esm/sdk/morpho.d.ts.map +1 -1
- package/dist/esm/sdk/morpho.js +0 -14
- package/dist/esm/sdk/morpho.js.map +1 -1
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/dist/esm/sdk/universal.d.ts +1 -1
- package/dist/esm/sdk/universal.d.ts.map +1 -1
- package/dist/esm/sdk/universal.js.map +1 -1
- package/dist/esm/sdk/vaultserc4626.d.ts +25 -0
- package/dist/esm/sdk/vaultserc4626.d.ts.map +1 -0
- package/dist/esm/sdk/vaultserc4626.js +34 -0
- package/dist/esm/sdk/vaultserc4626.js.map +1 -0
- package/docs/sdks/morpho/README.md +0 -84
- package/docs/sdks/smartaccount/README.md +4 -2
- package/docs/sdks/transactionbundler/README.md +2 -2
- package/docs/sdks/universal/README.md +5 -3
- package/docs/sdks/vaultserc4626/README.md +173 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/universalAllowance.ts +1 -1
- package/src/funcs/universalAllowanceSet.ts +3 -3
- package/src/funcs/{morphoAllowance.ts → vaultsERC4626Deposit.ts} +9 -12
- package/src/funcs/vaultsERC4626Withdraw.ts +173 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +5 -3
- package/src/mcp-server/tools/universalAllowanceSet.ts +1 -1
- package/src/mcp-server/tools/{morphoAllowance.ts → vaultsERC4626Deposit.ts} +8 -10
- package/src/mcp-server/tools/vaultsERC4626Withdraw.ts +41 -0
- package/src/models/components/batcheduseroperationsrequest.ts +7 -0
- package/src/models/components/index.ts +4 -4
- package/src/models/components/setallowanceparams.ts +310 -0
- package/src/models/components/setallowancerequest.ts +328 -0
- package/src/models/components/useroperation.ts +30 -64
- package/src/models/components/vaultdepositrequest.ts +166 -0
- package/src/models/components/vaultwithdrawrequest.ts +113 -0
- package/src/models/operations/genericallowance.ts +63 -29
- package/src/sdk/morpho.ts +0 -22
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/universal.ts +1 -1
- package/src/sdk/vaultserc4626.ts +51 -0
- package/dist/commonjs/funcs/morphoAllowance.d.ts +0 -22
- package/dist/commonjs/funcs/morphoAllowance.d.ts.map +0 -1
- package/dist/commonjs/funcs/morphoAllowance.js.map +0 -1
- package/dist/commonjs/mcp-server/tools/morphoAllowance.d.ts +0 -8
- package/dist/commonjs/mcp-server/tools/morphoAllowance.d.ts.map +0 -1
- package/dist/commonjs/mcp-server/tools/morphoAllowance.js.map +0 -1
- package/dist/commonjs/models/components/increaseallowanceparams.d.ts +0 -155
- package/dist/commonjs/models/components/increaseallowanceparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/increaseallowanceparams.js +0 -164
- package/dist/commonjs/models/components/increaseallowanceparams.js.map +0 -1
- package/dist/commonjs/models/components/increaseallowancerequest.d.ts +0 -166
- package/dist/commonjs/models/components/increaseallowancerequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/increaseallowancerequest.js +0 -169
- package/dist/commonjs/models/components/increaseallowancerequest.js.map +0 -1
- package/dist/commonjs/models/components/morphosetvaultallowanceparams.d.ts +0 -63
- package/dist/commonjs/models/components/morphosetvaultallowanceparams.d.ts.map +0 -1
- package/dist/commonjs/models/components/morphosetvaultallowanceparams.js +0 -107
- package/dist/commonjs/models/components/morphosetvaultallowanceparams.js.map +0 -1
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts +0 -96
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.js +0 -130
- package/dist/commonjs/models/components/morphosetvaultallowancerequest.js.map +0 -1
- package/dist/esm/funcs/morphoAllowance.d.ts +0 -22
- package/dist/esm/funcs/morphoAllowance.d.ts.map +0 -1
- package/dist/esm/funcs/morphoAllowance.js.map +0 -1
- package/dist/esm/mcp-server/tools/morphoAllowance.d.ts +0 -8
- package/dist/esm/mcp-server/tools/morphoAllowance.d.ts.map +0 -1
- package/dist/esm/mcp-server/tools/morphoAllowance.js +0 -32
- package/dist/esm/mcp-server/tools/morphoAllowance.js.map +0 -1
- package/dist/esm/models/components/increaseallowanceparams.d.ts +0 -155
- package/dist/esm/models/components/increaseallowanceparams.d.ts.map +0 -1
- package/dist/esm/models/components/increaseallowanceparams.js +0 -122
- package/dist/esm/models/components/increaseallowanceparams.js.map +0 -1
- package/dist/esm/models/components/increaseallowancerequest.d.ts +0 -166
- package/dist/esm/models/components/increaseallowancerequest.d.ts.map +0 -1
- package/dist/esm/models/components/increaseallowancerequest.js +0 -127
- package/dist/esm/models/components/increaseallowancerequest.js.map +0 -1
- package/dist/esm/models/components/morphosetvaultallowanceparams.d.ts +0 -63
- package/dist/esm/models/components/morphosetvaultallowanceparams.d.ts.map +0 -1
- package/dist/esm/models/components/morphosetvaultallowanceparams.js +0 -67
- package/dist/esm/models/components/morphosetvaultallowanceparams.js.map +0 -1
- package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts +0 -96
- package/dist/esm/models/components/morphosetvaultallowancerequest.d.ts.map +0 -1
- package/dist/esm/models/components/morphosetvaultallowancerequest.js +0 -90
- package/dist/esm/models/components/morphosetvaultallowancerequest.js.map +0 -1
- package/src/models/components/increaseallowanceparams.ts +0 -266
- package/src/models/components/increaseallowancerequest.ts +0 -282
- package/src/models/components/morphosetvaultallowanceparams.ts +0 -155
- package/src/models/components/morphosetvaultallowancerequest.ts +0 -198
|
@@ -0,0 +1,310 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import {
|
|
12
|
+
TokenEnum,
|
|
13
|
+
TokenEnum$inboundSchema,
|
|
14
|
+
TokenEnum$outboundSchema,
|
|
15
|
+
} from "./tokenenum.js";
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* The symbol or address of the token for which the allowance is set..
|
|
19
|
+
*/
|
|
20
|
+
export type SetAllowanceParamsToken = TokenEnum | string;
|
|
21
|
+
|
|
22
|
+
export const SetAllowanceParamsContractEnum = {
|
|
23
|
+
AaveV3Pool: "AaveV3Pool",
|
|
24
|
+
AerodromeBasicRouter: "AerodromeBasicRouter",
|
|
25
|
+
AerodromeSlipstreamRouter: "AerodromeSlipstreamRouter",
|
|
26
|
+
AerodromeSlipstreamNonfungiblePositionManager:
|
|
27
|
+
"AerodromeSlipstreamNonfungiblePositionManager",
|
|
28
|
+
UniswapV3Router: "UniswapV3Router",
|
|
29
|
+
UniswapV3NFTPositionManager: "UniswapV3NFTPositionManager",
|
|
30
|
+
Morpho: "Morpho",
|
|
31
|
+
SkyDaiUsdsConverter: "SkyDaiUsdsConverter",
|
|
32
|
+
SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
|
|
33
|
+
SkyUsdsVault: "SkyUsdsVault",
|
|
34
|
+
PendleRouter: "PendleRouter",
|
|
35
|
+
} as const;
|
|
36
|
+
export type SetAllowanceParamsContractEnum = ClosedEnum<
|
|
37
|
+
typeof SetAllowanceParamsContractEnum
|
|
38
|
+
>;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* The name or address of the contract to set spending allowance for.
|
|
42
|
+
*/
|
|
43
|
+
export type SetAllowanceParamsContractUnion =
|
|
44
|
+
| SetAllowanceParamsContractEnum
|
|
45
|
+
| string;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The amount to set the allowance to.
|
|
49
|
+
*/
|
|
50
|
+
export type SetAllowanceParamsAmount = number | string;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Parameters model for setting the token allowance for a given contract.
|
|
54
|
+
*/
|
|
55
|
+
export type SetAllowanceParams = {
|
|
56
|
+
actionType?: "SET_ALLOWANCE" | undefined;
|
|
57
|
+
/**
|
|
58
|
+
* The symbol or address of the token for which the allowance is set..
|
|
59
|
+
*/
|
|
60
|
+
token: TokenEnum | string;
|
|
61
|
+
/**
|
|
62
|
+
* The name or address of the contract to set spending allowance for.
|
|
63
|
+
*/
|
|
64
|
+
contract: SetAllowanceParamsContractEnum | string;
|
|
65
|
+
/**
|
|
66
|
+
* The amount to set the allowance to.
|
|
67
|
+
*/
|
|
68
|
+
amount: number | string;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const SetAllowanceParamsToken$inboundSchema: z.ZodType<
|
|
73
|
+
SetAllowanceParamsToken,
|
|
74
|
+
z.ZodTypeDef,
|
|
75
|
+
unknown
|
|
76
|
+
> = z.union([TokenEnum$inboundSchema, z.string()]);
|
|
77
|
+
|
|
78
|
+
/** @internal */
|
|
79
|
+
export type SetAllowanceParamsToken$Outbound = string | string;
|
|
80
|
+
|
|
81
|
+
/** @internal */
|
|
82
|
+
export const SetAllowanceParamsToken$outboundSchema: z.ZodType<
|
|
83
|
+
SetAllowanceParamsToken$Outbound,
|
|
84
|
+
z.ZodTypeDef,
|
|
85
|
+
SetAllowanceParamsToken
|
|
86
|
+
> = z.union([TokenEnum$outboundSchema, z.string()]);
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* @internal
|
|
90
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
91
|
+
*/
|
|
92
|
+
export namespace SetAllowanceParamsToken$ {
|
|
93
|
+
/** @deprecated use `SetAllowanceParamsToken$inboundSchema` instead. */
|
|
94
|
+
export const inboundSchema = SetAllowanceParamsToken$inboundSchema;
|
|
95
|
+
/** @deprecated use `SetAllowanceParamsToken$outboundSchema` instead. */
|
|
96
|
+
export const outboundSchema = SetAllowanceParamsToken$outboundSchema;
|
|
97
|
+
/** @deprecated use `SetAllowanceParamsToken$Outbound` instead. */
|
|
98
|
+
export type Outbound = SetAllowanceParamsToken$Outbound;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function setAllowanceParamsTokenToJSON(
|
|
102
|
+
setAllowanceParamsToken: SetAllowanceParamsToken,
|
|
103
|
+
): string {
|
|
104
|
+
return JSON.stringify(
|
|
105
|
+
SetAllowanceParamsToken$outboundSchema.parse(setAllowanceParamsToken),
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function setAllowanceParamsTokenFromJSON(
|
|
110
|
+
jsonString: string,
|
|
111
|
+
): SafeParseResult<SetAllowanceParamsToken, SDKValidationError> {
|
|
112
|
+
return safeParse(
|
|
113
|
+
jsonString,
|
|
114
|
+
(x) => SetAllowanceParamsToken$inboundSchema.parse(JSON.parse(x)),
|
|
115
|
+
`Failed to parse 'SetAllowanceParamsToken' from JSON`,
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** @internal */
|
|
120
|
+
export const SetAllowanceParamsContractEnum$inboundSchema: z.ZodNativeEnum<
|
|
121
|
+
typeof SetAllowanceParamsContractEnum
|
|
122
|
+
> = z.nativeEnum(SetAllowanceParamsContractEnum);
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const SetAllowanceParamsContractEnum$outboundSchema: z.ZodNativeEnum<
|
|
126
|
+
typeof SetAllowanceParamsContractEnum
|
|
127
|
+
> = SetAllowanceParamsContractEnum$inboundSchema;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @internal
|
|
131
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
132
|
+
*/
|
|
133
|
+
export namespace SetAllowanceParamsContractEnum$ {
|
|
134
|
+
/** @deprecated use `SetAllowanceParamsContractEnum$inboundSchema` instead. */
|
|
135
|
+
export const inboundSchema = SetAllowanceParamsContractEnum$inboundSchema;
|
|
136
|
+
/** @deprecated use `SetAllowanceParamsContractEnum$outboundSchema` instead. */
|
|
137
|
+
export const outboundSchema = SetAllowanceParamsContractEnum$outboundSchema;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
/** @internal */
|
|
141
|
+
export const SetAllowanceParamsContractUnion$inboundSchema: z.ZodType<
|
|
142
|
+
SetAllowanceParamsContractUnion,
|
|
143
|
+
z.ZodTypeDef,
|
|
144
|
+
unknown
|
|
145
|
+
> = z.union([SetAllowanceParamsContractEnum$inboundSchema, z.string()]);
|
|
146
|
+
|
|
147
|
+
/** @internal */
|
|
148
|
+
export type SetAllowanceParamsContractUnion$Outbound = string | string;
|
|
149
|
+
|
|
150
|
+
/** @internal */
|
|
151
|
+
export const SetAllowanceParamsContractUnion$outboundSchema: z.ZodType<
|
|
152
|
+
SetAllowanceParamsContractUnion$Outbound,
|
|
153
|
+
z.ZodTypeDef,
|
|
154
|
+
SetAllowanceParamsContractUnion
|
|
155
|
+
> = z.union([SetAllowanceParamsContractEnum$outboundSchema, z.string()]);
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* @internal
|
|
159
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
160
|
+
*/
|
|
161
|
+
export namespace SetAllowanceParamsContractUnion$ {
|
|
162
|
+
/** @deprecated use `SetAllowanceParamsContractUnion$inboundSchema` instead. */
|
|
163
|
+
export const inboundSchema = SetAllowanceParamsContractUnion$inboundSchema;
|
|
164
|
+
/** @deprecated use `SetAllowanceParamsContractUnion$outboundSchema` instead. */
|
|
165
|
+
export const outboundSchema = SetAllowanceParamsContractUnion$outboundSchema;
|
|
166
|
+
/** @deprecated use `SetAllowanceParamsContractUnion$Outbound` instead. */
|
|
167
|
+
export type Outbound = SetAllowanceParamsContractUnion$Outbound;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export function setAllowanceParamsContractUnionToJSON(
|
|
171
|
+
setAllowanceParamsContractUnion: SetAllowanceParamsContractUnion,
|
|
172
|
+
): string {
|
|
173
|
+
return JSON.stringify(
|
|
174
|
+
SetAllowanceParamsContractUnion$outboundSchema.parse(
|
|
175
|
+
setAllowanceParamsContractUnion,
|
|
176
|
+
),
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
export function setAllowanceParamsContractUnionFromJSON(
|
|
181
|
+
jsonString: string,
|
|
182
|
+
): SafeParseResult<SetAllowanceParamsContractUnion, SDKValidationError> {
|
|
183
|
+
return safeParse(
|
|
184
|
+
jsonString,
|
|
185
|
+
(x) => SetAllowanceParamsContractUnion$inboundSchema.parse(JSON.parse(x)),
|
|
186
|
+
`Failed to parse 'SetAllowanceParamsContractUnion' from JSON`,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** @internal */
|
|
191
|
+
export const SetAllowanceParamsAmount$inboundSchema: z.ZodType<
|
|
192
|
+
SetAllowanceParamsAmount,
|
|
193
|
+
z.ZodTypeDef,
|
|
194
|
+
unknown
|
|
195
|
+
> = z.union([z.number(), z.string()]);
|
|
196
|
+
|
|
197
|
+
/** @internal */
|
|
198
|
+
export type SetAllowanceParamsAmount$Outbound = number | string;
|
|
199
|
+
|
|
200
|
+
/** @internal */
|
|
201
|
+
export const SetAllowanceParamsAmount$outboundSchema: z.ZodType<
|
|
202
|
+
SetAllowanceParamsAmount$Outbound,
|
|
203
|
+
z.ZodTypeDef,
|
|
204
|
+
SetAllowanceParamsAmount
|
|
205
|
+
> = z.union([z.number(), z.string()]);
|
|
206
|
+
|
|
207
|
+
/**
|
|
208
|
+
* @internal
|
|
209
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
210
|
+
*/
|
|
211
|
+
export namespace SetAllowanceParamsAmount$ {
|
|
212
|
+
/** @deprecated use `SetAllowanceParamsAmount$inboundSchema` instead. */
|
|
213
|
+
export const inboundSchema = SetAllowanceParamsAmount$inboundSchema;
|
|
214
|
+
/** @deprecated use `SetAllowanceParamsAmount$outboundSchema` instead. */
|
|
215
|
+
export const outboundSchema = SetAllowanceParamsAmount$outboundSchema;
|
|
216
|
+
/** @deprecated use `SetAllowanceParamsAmount$Outbound` instead. */
|
|
217
|
+
export type Outbound = SetAllowanceParamsAmount$Outbound;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export function setAllowanceParamsAmountToJSON(
|
|
221
|
+
setAllowanceParamsAmount: SetAllowanceParamsAmount,
|
|
222
|
+
): string {
|
|
223
|
+
return JSON.stringify(
|
|
224
|
+
SetAllowanceParamsAmount$outboundSchema.parse(setAllowanceParamsAmount),
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function setAllowanceParamsAmountFromJSON(
|
|
229
|
+
jsonString: string,
|
|
230
|
+
): SafeParseResult<SetAllowanceParamsAmount, SDKValidationError> {
|
|
231
|
+
return safeParse(
|
|
232
|
+
jsonString,
|
|
233
|
+
(x) => SetAllowanceParamsAmount$inboundSchema.parse(JSON.parse(x)),
|
|
234
|
+
`Failed to parse 'SetAllowanceParamsAmount' from JSON`,
|
|
235
|
+
);
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
/** @internal */
|
|
239
|
+
export const SetAllowanceParams$inboundSchema: z.ZodType<
|
|
240
|
+
SetAllowanceParams,
|
|
241
|
+
z.ZodTypeDef,
|
|
242
|
+
unknown
|
|
243
|
+
> = z.object({
|
|
244
|
+
action_type: z.literal("SET_ALLOWANCE").default("SET_ALLOWANCE"),
|
|
245
|
+
token: z.union([TokenEnum$inboundSchema, z.string()]),
|
|
246
|
+
contract: z.union([SetAllowanceParamsContractEnum$inboundSchema, z.string()]),
|
|
247
|
+
amount: z.union([z.number(), z.string()]),
|
|
248
|
+
}).transform((v) => {
|
|
249
|
+
return remap$(v, {
|
|
250
|
+
"action_type": "actionType",
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
|
|
254
|
+
/** @internal */
|
|
255
|
+
export type SetAllowanceParams$Outbound = {
|
|
256
|
+
action_type: "SET_ALLOWANCE";
|
|
257
|
+
token: string | string;
|
|
258
|
+
contract: string | string;
|
|
259
|
+
amount: number | string;
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
/** @internal */
|
|
263
|
+
export const SetAllowanceParams$outboundSchema: z.ZodType<
|
|
264
|
+
SetAllowanceParams$Outbound,
|
|
265
|
+
z.ZodTypeDef,
|
|
266
|
+
SetAllowanceParams
|
|
267
|
+
> = z.object({
|
|
268
|
+
actionType: z.literal("SET_ALLOWANCE").default("SET_ALLOWANCE" as const),
|
|
269
|
+
token: z.union([TokenEnum$outboundSchema, z.string()]),
|
|
270
|
+
contract: z.union([
|
|
271
|
+
SetAllowanceParamsContractEnum$outboundSchema,
|
|
272
|
+
z.string(),
|
|
273
|
+
]),
|
|
274
|
+
amount: z.union([z.number(), z.string()]),
|
|
275
|
+
}).transform((v) => {
|
|
276
|
+
return remap$(v, {
|
|
277
|
+
actionType: "action_type",
|
|
278
|
+
});
|
|
279
|
+
});
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* @internal
|
|
283
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
284
|
+
*/
|
|
285
|
+
export namespace SetAllowanceParams$ {
|
|
286
|
+
/** @deprecated use `SetAllowanceParams$inboundSchema` instead. */
|
|
287
|
+
export const inboundSchema = SetAllowanceParams$inboundSchema;
|
|
288
|
+
/** @deprecated use `SetAllowanceParams$outboundSchema` instead. */
|
|
289
|
+
export const outboundSchema = SetAllowanceParams$outboundSchema;
|
|
290
|
+
/** @deprecated use `SetAllowanceParams$Outbound` instead. */
|
|
291
|
+
export type Outbound = SetAllowanceParams$Outbound;
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export function setAllowanceParamsToJSON(
|
|
295
|
+
setAllowanceParams: SetAllowanceParams,
|
|
296
|
+
): string {
|
|
297
|
+
return JSON.stringify(
|
|
298
|
+
SetAllowanceParams$outboundSchema.parse(setAllowanceParams),
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
export function setAllowanceParamsFromJSON(
|
|
303
|
+
jsonString: string,
|
|
304
|
+
): SafeParseResult<SetAllowanceParams, SDKValidationError> {
|
|
305
|
+
return safeParse(
|
|
306
|
+
jsonString,
|
|
307
|
+
(x) => SetAllowanceParams$inboundSchema.parse(JSON.parse(x)),
|
|
308
|
+
`Failed to parse 'SetAllowanceParams' from JSON`,
|
|
309
|
+
);
|
|
310
|
+
}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
8
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
9
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
|
+
import { Chain, Chain$inboundSchema, Chain$outboundSchema } from "./chain.js";
|
|
12
|
+
import {
|
|
13
|
+
TokenEnum,
|
|
14
|
+
TokenEnum$inboundSchema,
|
|
15
|
+
TokenEnum$outboundSchema,
|
|
16
|
+
} from "./tokenenum.js";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The symbol or address of the token for which the allowance is set..
|
|
20
|
+
*/
|
|
21
|
+
export type SetAllowanceRequestToken = TokenEnum | string;
|
|
22
|
+
|
|
23
|
+
export const SetAllowanceRequestContractEnum = {
|
|
24
|
+
AaveV3Pool: "AaveV3Pool",
|
|
25
|
+
AerodromeBasicRouter: "AerodromeBasicRouter",
|
|
26
|
+
AerodromeSlipstreamRouter: "AerodromeSlipstreamRouter",
|
|
27
|
+
AerodromeSlipstreamNonfungiblePositionManager:
|
|
28
|
+
"AerodromeSlipstreamNonfungiblePositionManager",
|
|
29
|
+
UniswapV3Router: "UniswapV3Router",
|
|
30
|
+
UniswapV3NFTPositionManager: "UniswapV3NFTPositionManager",
|
|
31
|
+
Morpho: "Morpho",
|
|
32
|
+
SkyDaiUsdsConverter: "SkyDaiUsdsConverter",
|
|
33
|
+
SkyUsdcUsdsConverter: "SkyUsdcUsdsConverter",
|
|
34
|
+
SkyUsdsVault: "SkyUsdsVault",
|
|
35
|
+
PendleRouter: "PendleRouter",
|
|
36
|
+
} as const;
|
|
37
|
+
export type SetAllowanceRequestContractEnum = ClosedEnum<
|
|
38
|
+
typeof SetAllowanceRequestContractEnum
|
|
39
|
+
>;
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* The name or address of the contract to set spending allowance for.
|
|
43
|
+
*/
|
|
44
|
+
export type SetAllowanceRequestContractUnion =
|
|
45
|
+
| SetAllowanceRequestContractEnum
|
|
46
|
+
| string;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* The amount to set the allowance to.
|
|
50
|
+
*/
|
|
51
|
+
export type SetAllowanceRequestAmount = number | string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Request model for increasing token allowance for a contract.
|
|
55
|
+
*/
|
|
56
|
+
export type SetAllowanceRequest = {
|
|
57
|
+
actionType?: "SET_ALLOWANCE" | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The symbol or address of the token for which the allowance is set..
|
|
60
|
+
*/
|
|
61
|
+
token: TokenEnum | string;
|
|
62
|
+
/**
|
|
63
|
+
* The name or address of the contract to set spending allowance for.
|
|
64
|
+
*/
|
|
65
|
+
contract: SetAllowanceRequestContractEnum | string;
|
|
66
|
+
/**
|
|
67
|
+
* The amount to set the allowance to.
|
|
68
|
+
*/
|
|
69
|
+
amount: number | string;
|
|
70
|
+
/**
|
|
71
|
+
* The chain to use.
|
|
72
|
+
*/
|
|
73
|
+
chain: Chain;
|
|
74
|
+
/**
|
|
75
|
+
* The address of the transaction sender.
|
|
76
|
+
*/
|
|
77
|
+
sender: string;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const SetAllowanceRequestToken$inboundSchema: z.ZodType<
|
|
82
|
+
SetAllowanceRequestToken,
|
|
83
|
+
z.ZodTypeDef,
|
|
84
|
+
unknown
|
|
85
|
+
> = z.union([TokenEnum$inboundSchema, z.string()]);
|
|
86
|
+
|
|
87
|
+
/** @internal */
|
|
88
|
+
export type SetAllowanceRequestToken$Outbound = string | string;
|
|
89
|
+
|
|
90
|
+
/** @internal */
|
|
91
|
+
export const SetAllowanceRequestToken$outboundSchema: z.ZodType<
|
|
92
|
+
SetAllowanceRequestToken$Outbound,
|
|
93
|
+
z.ZodTypeDef,
|
|
94
|
+
SetAllowanceRequestToken
|
|
95
|
+
> = z.union([TokenEnum$outboundSchema, z.string()]);
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @internal
|
|
99
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
100
|
+
*/
|
|
101
|
+
export namespace SetAllowanceRequestToken$ {
|
|
102
|
+
/** @deprecated use `SetAllowanceRequestToken$inboundSchema` instead. */
|
|
103
|
+
export const inboundSchema = SetAllowanceRequestToken$inboundSchema;
|
|
104
|
+
/** @deprecated use `SetAllowanceRequestToken$outboundSchema` instead. */
|
|
105
|
+
export const outboundSchema = SetAllowanceRequestToken$outboundSchema;
|
|
106
|
+
/** @deprecated use `SetAllowanceRequestToken$Outbound` instead. */
|
|
107
|
+
export type Outbound = SetAllowanceRequestToken$Outbound;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export function setAllowanceRequestTokenToJSON(
|
|
111
|
+
setAllowanceRequestToken: SetAllowanceRequestToken,
|
|
112
|
+
): string {
|
|
113
|
+
return JSON.stringify(
|
|
114
|
+
SetAllowanceRequestToken$outboundSchema.parse(setAllowanceRequestToken),
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export function setAllowanceRequestTokenFromJSON(
|
|
119
|
+
jsonString: string,
|
|
120
|
+
): SafeParseResult<SetAllowanceRequestToken, SDKValidationError> {
|
|
121
|
+
return safeParse(
|
|
122
|
+
jsonString,
|
|
123
|
+
(x) => SetAllowanceRequestToken$inboundSchema.parse(JSON.parse(x)),
|
|
124
|
+
`Failed to parse 'SetAllowanceRequestToken' from JSON`,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/** @internal */
|
|
129
|
+
export const SetAllowanceRequestContractEnum$inboundSchema: z.ZodNativeEnum<
|
|
130
|
+
typeof SetAllowanceRequestContractEnum
|
|
131
|
+
> = z.nativeEnum(SetAllowanceRequestContractEnum);
|
|
132
|
+
|
|
133
|
+
/** @internal */
|
|
134
|
+
export const SetAllowanceRequestContractEnum$outboundSchema: z.ZodNativeEnum<
|
|
135
|
+
typeof SetAllowanceRequestContractEnum
|
|
136
|
+
> = SetAllowanceRequestContractEnum$inboundSchema;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @internal
|
|
140
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
141
|
+
*/
|
|
142
|
+
export namespace SetAllowanceRequestContractEnum$ {
|
|
143
|
+
/** @deprecated use `SetAllowanceRequestContractEnum$inboundSchema` instead. */
|
|
144
|
+
export const inboundSchema = SetAllowanceRequestContractEnum$inboundSchema;
|
|
145
|
+
/** @deprecated use `SetAllowanceRequestContractEnum$outboundSchema` instead. */
|
|
146
|
+
export const outboundSchema = SetAllowanceRequestContractEnum$outboundSchema;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** @internal */
|
|
150
|
+
export const SetAllowanceRequestContractUnion$inboundSchema: z.ZodType<
|
|
151
|
+
SetAllowanceRequestContractUnion,
|
|
152
|
+
z.ZodTypeDef,
|
|
153
|
+
unknown
|
|
154
|
+
> = z.union([SetAllowanceRequestContractEnum$inboundSchema, z.string()]);
|
|
155
|
+
|
|
156
|
+
/** @internal */
|
|
157
|
+
export type SetAllowanceRequestContractUnion$Outbound = string | string;
|
|
158
|
+
|
|
159
|
+
/** @internal */
|
|
160
|
+
export const SetAllowanceRequestContractUnion$outboundSchema: z.ZodType<
|
|
161
|
+
SetAllowanceRequestContractUnion$Outbound,
|
|
162
|
+
z.ZodTypeDef,
|
|
163
|
+
SetAllowanceRequestContractUnion
|
|
164
|
+
> = z.union([SetAllowanceRequestContractEnum$outboundSchema, z.string()]);
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* @internal
|
|
168
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
169
|
+
*/
|
|
170
|
+
export namespace SetAllowanceRequestContractUnion$ {
|
|
171
|
+
/** @deprecated use `SetAllowanceRequestContractUnion$inboundSchema` instead. */
|
|
172
|
+
export const inboundSchema = SetAllowanceRequestContractUnion$inboundSchema;
|
|
173
|
+
/** @deprecated use `SetAllowanceRequestContractUnion$outboundSchema` instead. */
|
|
174
|
+
export const outboundSchema = SetAllowanceRequestContractUnion$outboundSchema;
|
|
175
|
+
/** @deprecated use `SetAllowanceRequestContractUnion$Outbound` instead. */
|
|
176
|
+
export type Outbound = SetAllowanceRequestContractUnion$Outbound;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export function setAllowanceRequestContractUnionToJSON(
|
|
180
|
+
setAllowanceRequestContractUnion: SetAllowanceRequestContractUnion,
|
|
181
|
+
): string {
|
|
182
|
+
return JSON.stringify(
|
|
183
|
+
SetAllowanceRequestContractUnion$outboundSchema.parse(
|
|
184
|
+
setAllowanceRequestContractUnion,
|
|
185
|
+
),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function setAllowanceRequestContractUnionFromJSON(
|
|
190
|
+
jsonString: string,
|
|
191
|
+
): SafeParseResult<SetAllowanceRequestContractUnion, SDKValidationError> {
|
|
192
|
+
return safeParse(
|
|
193
|
+
jsonString,
|
|
194
|
+
(x) => SetAllowanceRequestContractUnion$inboundSchema.parse(JSON.parse(x)),
|
|
195
|
+
`Failed to parse 'SetAllowanceRequestContractUnion' from JSON`,
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** @internal */
|
|
200
|
+
export const SetAllowanceRequestAmount$inboundSchema: z.ZodType<
|
|
201
|
+
SetAllowanceRequestAmount,
|
|
202
|
+
z.ZodTypeDef,
|
|
203
|
+
unknown
|
|
204
|
+
> = z.union([z.number(), z.string()]);
|
|
205
|
+
|
|
206
|
+
/** @internal */
|
|
207
|
+
export type SetAllowanceRequestAmount$Outbound = number | string;
|
|
208
|
+
|
|
209
|
+
/** @internal */
|
|
210
|
+
export const SetAllowanceRequestAmount$outboundSchema: z.ZodType<
|
|
211
|
+
SetAllowanceRequestAmount$Outbound,
|
|
212
|
+
z.ZodTypeDef,
|
|
213
|
+
SetAllowanceRequestAmount
|
|
214
|
+
> = z.union([z.number(), z.string()]);
|
|
215
|
+
|
|
216
|
+
/**
|
|
217
|
+
* @internal
|
|
218
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
219
|
+
*/
|
|
220
|
+
export namespace SetAllowanceRequestAmount$ {
|
|
221
|
+
/** @deprecated use `SetAllowanceRequestAmount$inboundSchema` instead. */
|
|
222
|
+
export const inboundSchema = SetAllowanceRequestAmount$inboundSchema;
|
|
223
|
+
/** @deprecated use `SetAllowanceRequestAmount$outboundSchema` instead. */
|
|
224
|
+
export const outboundSchema = SetAllowanceRequestAmount$outboundSchema;
|
|
225
|
+
/** @deprecated use `SetAllowanceRequestAmount$Outbound` instead. */
|
|
226
|
+
export type Outbound = SetAllowanceRequestAmount$Outbound;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function setAllowanceRequestAmountToJSON(
|
|
230
|
+
setAllowanceRequestAmount: SetAllowanceRequestAmount,
|
|
231
|
+
): string {
|
|
232
|
+
return JSON.stringify(
|
|
233
|
+
SetAllowanceRequestAmount$outboundSchema.parse(setAllowanceRequestAmount),
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
export function setAllowanceRequestAmountFromJSON(
|
|
238
|
+
jsonString: string,
|
|
239
|
+
): SafeParseResult<SetAllowanceRequestAmount, SDKValidationError> {
|
|
240
|
+
return safeParse(
|
|
241
|
+
jsonString,
|
|
242
|
+
(x) => SetAllowanceRequestAmount$inboundSchema.parse(JSON.parse(x)),
|
|
243
|
+
`Failed to parse 'SetAllowanceRequestAmount' from JSON`,
|
|
244
|
+
);
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** @internal */
|
|
248
|
+
export const SetAllowanceRequest$inboundSchema: z.ZodType<
|
|
249
|
+
SetAllowanceRequest,
|
|
250
|
+
z.ZodTypeDef,
|
|
251
|
+
unknown
|
|
252
|
+
> = z.object({
|
|
253
|
+
action_type: z.literal("SET_ALLOWANCE").default("SET_ALLOWANCE"),
|
|
254
|
+
token: z.union([TokenEnum$inboundSchema, z.string()]),
|
|
255
|
+
contract: z.union([
|
|
256
|
+
SetAllowanceRequestContractEnum$inboundSchema,
|
|
257
|
+
z.string(),
|
|
258
|
+
]),
|
|
259
|
+
amount: z.union([z.number(), z.string()]),
|
|
260
|
+
chain: Chain$inboundSchema,
|
|
261
|
+
sender: z.string(),
|
|
262
|
+
}).transform((v) => {
|
|
263
|
+
return remap$(v, {
|
|
264
|
+
"action_type": "actionType",
|
|
265
|
+
});
|
|
266
|
+
});
|
|
267
|
+
|
|
268
|
+
/** @internal */
|
|
269
|
+
export type SetAllowanceRequest$Outbound = {
|
|
270
|
+
action_type: "SET_ALLOWANCE";
|
|
271
|
+
token: string | string;
|
|
272
|
+
contract: string | string;
|
|
273
|
+
amount: number | string;
|
|
274
|
+
chain: string;
|
|
275
|
+
sender: string;
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/** @internal */
|
|
279
|
+
export const SetAllowanceRequest$outboundSchema: z.ZodType<
|
|
280
|
+
SetAllowanceRequest$Outbound,
|
|
281
|
+
z.ZodTypeDef,
|
|
282
|
+
SetAllowanceRequest
|
|
283
|
+
> = z.object({
|
|
284
|
+
actionType: z.literal("SET_ALLOWANCE").default("SET_ALLOWANCE" as const),
|
|
285
|
+
token: z.union([TokenEnum$outboundSchema, z.string()]),
|
|
286
|
+
contract: z.union([
|
|
287
|
+
SetAllowanceRequestContractEnum$outboundSchema,
|
|
288
|
+
z.string(),
|
|
289
|
+
]),
|
|
290
|
+
amount: z.union([z.number(), z.string()]),
|
|
291
|
+
chain: Chain$outboundSchema,
|
|
292
|
+
sender: z.string(),
|
|
293
|
+
}).transform((v) => {
|
|
294
|
+
return remap$(v, {
|
|
295
|
+
actionType: "action_type",
|
|
296
|
+
});
|
|
297
|
+
});
|
|
298
|
+
|
|
299
|
+
/**
|
|
300
|
+
* @internal
|
|
301
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
302
|
+
*/
|
|
303
|
+
export namespace SetAllowanceRequest$ {
|
|
304
|
+
/** @deprecated use `SetAllowanceRequest$inboundSchema` instead. */
|
|
305
|
+
export const inboundSchema = SetAllowanceRequest$inboundSchema;
|
|
306
|
+
/** @deprecated use `SetAllowanceRequest$outboundSchema` instead. */
|
|
307
|
+
export const outboundSchema = SetAllowanceRequest$outboundSchema;
|
|
308
|
+
/** @deprecated use `SetAllowanceRequest$Outbound` instead. */
|
|
309
|
+
export type Outbound = SetAllowanceRequest$Outbound;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
export function setAllowanceRequestToJSON(
|
|
313
|
+
setAllowanceRequest: SetAllowanceRequest,
|
|
314
|
+
): string {
|
|
315
|
+
return JSON.stringify(
|
|
316
|
+
SetAllowanceRequest$outboundSchema.parse(setAllowanceRequest),
|
|
317
|
+
);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export function setAllowanceRequestFromJSON(
|
|
321
|
+
jsonString: string,
|
|
322
|
+
): SafeParseResult<SetAllowanceRequest, SDKValidationError> {
|
|
323
|
+
return safeParse(
|
|
324
|
+
jsonString,
|
|
325
|
+
(x) => SetAllowanceRequest$inboundSchema.parse(JSON.parse(x)),
|
|
326
|
+
`Failed to parse 'SetAllowanceRequest' from JSON`,
|
|
327
|
+
);
|
|
328
|
+
}
|