@compass-labs/api-sdk 0.5.17 → 0.5.19
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 +2 -2
- package/bin/mcp-server.js +15 -61
- package/bin/mcp-server.js.map +10 -10
- package/dist/commonjs/funcs/transactionBatchingAuthorization.d.ts +1 -1
- package/dist/commonjs/funcs/transactionBatchingAuthorization.js +1 -1
- package/dist/commonjs/lib/config.d.ts +3 -3
- package/dist/commonjs/lib/config.js +3 -3
- package/dist/commonjs/lib/security.d.ts +2 -2
- package/dist/commonjs/lib/security.d.ts.map +1 -1
- package/dist/commonjs/mcp-server/mcp-server.js +1 -1
- package/dist/commonjs/mcp-server/server.js +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBatchingAuthorization.js +1 -1
- package/dist/commonjs/models/components/allowanceinforesponse.d.ts +2 -8
- package/dist/commonjs/models/components/allowanceinforesponse.d.ts.map +1 -1
- package/dist/commonjs/models/components/allowanceinforesponse.js +2 -3
- package/dist/commonjs/models/components/allowanceinforesponse.js.map +1 -1
- package/dist/commonjs/models/operations/genericallowance.d.ts +16 -158
- package/dist/commonjs/models/operations/genericallowance.d.ts.map +1 -1
- package/dist/commonjs/models/operations/genericallowance.js +14 -59
- package/dist/commonjs/models/operations/genericallowance.js.map +1 -1
- package/dist/commonjs/sdk/transactionbatching.d.ts +1 -1
- package/dist/commonjs/sdk/transactionbatching.js +1 -1
- package/dist/esm/funcs/transactionBatchingAuthorization.d.ts +1 -1
- package/dist/esm/funcs/transactionBatchingAuthorization.js +1 -1
- package/dist/esm/lib/config.d.ts +3 -3
- package/dist/esm/lib/config.js +3 -3
- package/dist/esm/lib/security.d.ts +2 -2
- package/dist/esm/lib/security.d.ts.map +1 -1
- package/dist/esm/mcp-server/mcp-server.js +1 -1
- package/dist/esm/mcp-server/server.js +1 -1
- package/dist/esm/mcp-server/tools/transactionBatchingAuthorization.js +1 -1
- package/dist/esm/models/components/allowanceinforesponse.d.ts +2 -8
- package/dist/esm/models/components/allowanceinforesponse.d.ts.map +1 -1
- package/dist/esm/models/components/allowanceinforesponse.js +2 -3
- package/dist/esm/models/components/allowanceinforesponse.js.map +1 -1
- package/dist/esm/models/operations/genericallowance.d.ts +16 -158
- package/dist/esm/models/operations/genericallowance.d.ts.map +1 -1
- package/dist/esm/models/operations/genericallowance.js +11 -58
- package/dist/esm/models/operations/genericallowance.js.map +1 -1
- package/dist/esm/sdk/transactionbatching.d.ts +1 -1
- package/dist/esm/sdk/transactionbatching.js +1 -1
- package/docs/sdks/transactionbatching/README.md +1 -1
- package/docs/sdks/universal/README.md +6 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/transactionBatchingAuthorization.ts +1 -1
- package/src/lib/config.ts +3 -3
- package/src/lib/security.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/src/mcp-server/tools/transactionBatchingAuthorization.ts +1 -1
- package/src/models/components/allowanceinforesponse.ts +4 -14
- package/src/models/operations/genericallowance.ts +41 -72
- package/src/sdk/transactionbatching.ts +1 -1
|
@@ -7,11 +7,6 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
9
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
-
import {
|
|
11
|
-
TokenEnum,
|
|
12
|
-
TokenEnum$inboundSchema,
|
|
13
|
-
TokenEnum$outboundSchema,
|
|
14
|
-
} from "./tokenenum.js";
|
|
15
10
|
|
|
16
11
|
/**
|
|
17
12
|
* Response model for token allowance information.
|
|
@@ -26,14 +21,9 @@ export type AllowanceInfoResponse = {
|
|
|
26
21
|
*/
|
|
27
22
|
decimals: number;
|
|
28
23
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
*
|
|
33
|
-
* This class is used to represent the token in the system. Notice individual
|
|
34
|
-
* endpoints' documentation where per chain tokens are presented.
|
|
24
|
+
* Symbol of the token.
|
|
35
25
|
*/
|
|
36
|
-
tokenSymbol:
|
|
26
|
+
tokenSymbol: string;
|
|
37
27
|
/**
|
|
38
28
|
* Address of the token
|
|
39
29
|
*/
|
|
@@ -52,7 +42,7 @@ export const AllowanceInfoResponse$inboundSchema: z.ZodType<
|
|
|
52
42
|
> = z.object({
|
|
53
43
|
amount: z.string(),
|
|
54
44
|
decimals: z.number().int(),
|
|
55
|
-
token_symbol:
|
|
45
|
+
token_symbol: z.string(),
|
|
56
46
|
token_address: z.string(),
|
|
57
47
|
contract_address: z.string(),
|
|
58
48
|
}).transform((v) => {
|
|
@@ -80,7 +70,7 @@ export const AllowanceInfoResponse$outboundSchema: z.ZodType<
|
|
|
80
70
|
> = z.object({
|
|
81
71
|
amount: z.string(),
|
|
82
72
|
decimals: z.number().int(),
|
|
83
|
-
tokenSymbol:
|
|
73
|
+
tokenSymbol: z.string(),
|
|
84
74
|
tokenAddress: z.string(),
|
|
85
75
|
contractAddress: z.string(),
|
|
86
76
|
}).transform((v) => {
|
|
@@ -7,6 +7,7 @@ import { remap as remap$ } from "../../lib/primitives.js";
|
|
|
7
7
|
import { safeParse } from "../../lib/schemas.js";
|
|
8
8
|
import { ClosedEnum } from "../../types/enums.js";
|
|
9
9
|
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
10
|
+
import * as components from "../components/index.js";
|
|
10
11
|
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -23,68 +24,9 @@ export const GenericAllowanceChain = {
|
|
|
23
24
|
export type GenericAllowanceChain = ClosedEnum<typeof GenericAllowanceChain>;
|
|
24
25
|
|
|
25
26
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
* @remarks
|
|
29
|
-
*
|
|
30
|
-
* This class is used to represent the token in the system. Notice individual
|
|
31
|
-
* endpoints' documentation where per chain tokens are presented.
|
|
27
|
+
* The symbol or address of the token for which the allowance is checked..
|
|
32
28
|
*/
|
|
33
|
-
export
|
|
34
|
-
OneINCH: "1INCH",
|
|
35
|
-
Aave: "AAVE",
|
|
36
|
-
Bal: "BAL",
|
|
37
|
-
CbBTC: "cbBTC",
|
|
38
|
-
CbETH: "cbETH",
|
|
39
|
-
Crv: "CRV",
|
|
40
|
-
CrvUSD: "crvUSD",
|
|
41
|
-
Dai: "DAI",
|
|
42
|
-
Ens: "ENS",
|
|
43
|
-
ETHx: "ETHx",
|
|
44
|
-
Frax: "FRAX",
|
|
45
|
-
Fxs: "FXS",
|
|
46
|
-
Gho: "GHO",
|
|
47
|
-
Knc: "KNC",
|
|
48
|
-
Ldo: "LDO",
|
|
49
|
-
Link: "LINK",
|
|
50
|
-
Lusd: "LUSD",
|
|
51
|
-
Mkr: "MKR",
|
|
52
|
-
OsETH: "osETH",
|
|
53
|
-
Pyusd: "PYUSD",
|
|
54
|
-
RETH: "rETH",
|
|
55
|
-
Rpl: "RPL",
|
|
56
|
-
RsETH: "rsETH",
|
|
57
|
-
SDAI: "sDAI",
|
|
58
|
-
Snx: "SNX",
|
|
59
|
-
Stg: "STG",
|
|
60
|
-
SUSDe: "sUSDe",
|
|
61
|
-
TBTC: "tBTC",
|
|
62
|
-
Uni: "UNI",
|
|
63
|
-
Usdc: "USDC",
|
|
64
|
-
USDe: "USDe",
|
|
65
|
-
Usds: "USDS",
|
|
66
|
-
Usdt: "USDT",
|
|
67
|
-
Wbtc: "WBTC",
|
|
68
|
-
WeETH: "weETH",
|
|
69
|
-
Weth: "WETH",
|
|
70
|
-
WstETH: "wstETH",
|
|
71
|
-
Arb: "ARB",
|
|
72
|
-
Eurs: "EURS",
|
|
73
|
-
Mai: "MAI",
|
|
74
|
-
USDCe: "USDCe",
|
|
75
|
-
Aero: "AERO",
|
|
76
|
-
Eur: "EUR",
|
|
77
|
-
Virtual: "VIRTUAL",
|
|
78
|
-
} as const;
|
|
79
|
-
/**
|
|
80
|
-
* A class representing the token.
|
|
81
|
-
*
|
|
82
|
-
* @remarks
|
|
83
|
-
*
|
|
84
|
-
* This class is used to represent the token in the system. Notice individual
|
|
85
|
-
* endpoints' documentation where per chain tokens are presented.
|
|
86
|
-
*/
|
|
87
|
-
export type GenericAllowanceToken = ClosedEnum<typeof GenericAllowanceToken>;
|
|
29
|
+
export type GenericAllowanceToken = components.TokenEnum | string;
|
|
88
30
|
|
|
89
31
|
/**
|
|
90
32
|
* The name of the contract to check allowance for.
|
|
@@ -118,9 +60,9 @@ export type GenericAllowanceRequest = {
|
|
|
118
60
|
*/
|
|
119
61
|
user?: string | undefined;
|
|
120
62
|
/**
|
|
121
|
-
* The symbol of the token for which the allowance is checked..
|
|
63
|
+
* The symbol or address of the token for which the allowance is checked..
|
|
122
64
|
*/
|
|
123
|
-
token
|
|
65
|
+
token: components.TokenEnum | string;
|
|
124
66
|
/**
|
|
125
67
|
* The name of the contract to check allowance for.
|
|
126
68
|
*/
|
|
@@ -149,14 +91,21 @@ export namespace GenericAllowanceChain$ {
|
|
|
149
91
|
}
|
|
150
92
|
|
|
151
93
|
/** @internal */
|
|
152
|
-
export const GenericAllowanceToken$inboundSchema: z.
|
|
153
|
-
|
|
154
|
-
|
|
94
|
+
export const GenericAllowanceToken$inboundSchema: z.ZodType<
|
|
95
|
+
GenericAllowanceToken,
|
|
96
|
+
z.ZodTypeDef,
|
|
97
|
+
unknown
|
|
98
|
+
> = z.union([components.TokenEnum$inboundSchema, z.string()]);
|
|
99
|
+
|
|
100
|
+
/** @internal */
|
|
101
|
+
export type GenericAllowanceToken$Outbound = string | string;
|
|
155
102
|
|
|
156
103
|
/** @internal */
|
|
157
|
-
export const GenericAllowanceToken$outboundSchema: z.
|
|
158
|
-
|
|
159
|
-
|
|
104
|
+
export const GenericAllowanceToken$outboundSchema: z.ZodType<
|
|
105
|
+
GenericAllowanceToken$Outbound,
|
|
106
|
+
z.ZodTypeDef,
|
|
107
|
+
GenericAllowanceToken
|
|
108
|
+
> = z.union([components.TokenEnum$outboundSchema, z.string()]);
|
|
160
109
|
|
|
161
110
|
/**
|
|
162
111
|
* @internal
|
|
@@ -167,6 +116,26 @@ export namespace GenericAllowanceToken$ {
|
|
|
167
116
|
export const inboundSchema = GenericAllowanceToken$inboundSchema;
|
|
168
117
|
/** @deprecated use `GenericAllowanceToken$outboundSchema` instead. */
|
|
169
118
|
export const outboundSchema = GenericAllowanceToken$outboundSchema;
|
|
119
|
+
/** @deprecated use `GenericAllowanceToken$Outbound` instead. */
|
|
120
|
+
export type Outbound = GenericAllowanceToken$Outbound;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export function genericAllowanceTokenToJSON(
|
|
124
|
+
genericAllowanceToken: GenericAllowanceToken,
|
|
125
|
+
): string {
|
|
126
|
+
return JSON.stringify(
|
|
127
|
+
GenericAllowanceToken$outboundSchema.parse(genericAllowanceToken),
|
|
128
|
+
);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function genericAllowanceTokenFromJSON(
|
|
132
|
+
jsonString: string,
|
|
133
|
+
): SafeParseResult<GenericAllowanceToken, SDKValidationError> {
|
|
134
|
+
return safeParse(
|
|
135
|
+
jsonString,
|
|
136
|
+
(x) => GenericAllowanceToken$inboundSchema.parse(JSON.parse(x)),
|
|
137
|
+
`Failed to parse 'GenericAllowanceToken' from JSON`,
|
|
138
|
+
);
|
|
170
139
|
}
|
|
171
140
|
|
|
172
141
|
/** @internal */
|
|
@@ -196,7 +165,7 @@ export const GenericAllowanceRequest$inboundSchema: z.ZodType<
|
|
|
196
165
|
> = z.object({
|
|
197
166
|
chain: GenericAllowanceChain$inboundSchema.default("arbitrum:mainnet"),
|
|
198
167
|
user: z.string().default("0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"),
|
|
199
|
-
token:
|
|
168
|
+
token: z.union([components.TokenEnum$inboundSchema, z.string()]),
|
|
200
169
|
contract_name: ContractName$inboundSchema.default("AaveV3Pool"),
|
|
201
170
|
}).transform((v) => {
|
|
202
171
|
return remap$(v, {
|
|
@@ -208,7 +177,7 @@ export const GenericAllowanceRequest$inboundSchema: z.ZodType<
|
|
|
208
177
|
export type GenericAllowanceRequest$Outbound = {
|
|
209
178
|
chain: string;
|
|
210
179
|
user: string;
|
|
211
|
-
token: string;
|
|
180
|
+
token: string | string;
|
|
212
181
|
contract_name: string;
|
|
213
182
|
};
|
|
214
183
|
|
|
@@ -220,7 +189,7 @@ export const GenericAllowanceRequest$outboundSchema: z.ZodType<
|
|
|
220
189
|
> = z.object({
|
|
221
190
|
chain: GenericAllowanceChain$outboundSchema.default("arbitrum:mainnet"),
|
|
222
191
|
user: z.string().default("0x29F20a192328eF1aD35e1564aBFf4Be9C5ce5f7B"),
|
|
223
|
-
token:
|
|
192
|
+
token: z.union([components.TokenEnum$outboundSchema, z.string()]),
|
|
224
193
|
contractName: ContractName$outboundSchema.default("AaveV3Pool"),
|
|
225
194
|
}).transform((v) => {
|
|
226
195
|
return remap$(v, {
|