@compass-labs/api-sdk 1.0.10 → 1.0.12
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 -0
- package/bin/mcp-server.js +331 -132
- package/bin/mcp-server.js.map +12 -8
- package/dist/commonjs/funcs/swapSwapOdos.d.ts +1 -1
- package/dist/commonjs/funcs/swapSwapOdos.d.ts.map +1 -1
- package/dist/commonjs/funcs/swapSwapOdos.js +1 -1
- package/dist/commonjs/funcs/swapSwapOdos.js.map +1 -1
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +19 -0
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +1 -0
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js +119 -0
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- 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 +3 -1
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +8 -0
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +1 -0
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js +65 -0
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js.map +1 -0
- package/dist/commonjs/models/components/index.d.ts +2 -0
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +2 -0
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/models/components/metamaskdelegatorrequest.d.ts +78 -0
- package/dist/commonjs/models/components/metamaskdelegatorrequest.d.ts.map +1 -0
- package/dist/commonjs/models/components/metamaskdelegatorrequest.js +108 -0
- package/dist/commonjs/models/components/metamaskdelegatorrequest.js.map +1 -0
- package/dist/commonjs/models/components/odostransactionresponse.d.ts +63 -0
- package/dist/commonjs/models/components/odostransactionresponse.d.ts.map +1 -0
- package/dist/commonjs/models/components/odostransactionresponse.js +117 -0
- package/dist/commonjs/models/components/odostransactionresponse.js.map +1 -0
- package/dist/commonjs/sdk/swap.d.ts +1 -1
- package/dist/commonjs/sdk/swap.d.ts.map +1 -1
- package/dist/commonjs/sdk/transactionbundler.d.ts +8 -0
- package/dist/commonjs/sdk/transactionbundler.d.ts.map +1 -1
- package/dist/commonjs/sdk/transactionbundler.js +11 -0
- package/dist/commonjs/sdk/transactionbundler.js.map +1 -1
- package/dist/esm/funcs/swapSwapOdos.d.ts +1 -1
- package/dist/esm/funcs/swapSwapOdos.d.ts.map +1 -1
- package/dist/esm/funcs/swapSwapOdos.js +1 -1
- package/dist/esm/funcs/swapSwapOdos.js.map +1 -1
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +19 -0
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +1 -0
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js +83 -0
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- 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 +3 -1
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +8 -0
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +1 -0
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js +29 -0
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js.map +1 -0
- package/dist/esm/models/components/index.d.ts +2 -0
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +2 -0
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/models/components/metamaskdelegatorrequest.d.ts +78 -0
- package/dist/esm/models/components/metamaskdelegatorrequest.d.ts.map +1 -0
- package/dist/esm/models/components/metamaskdelegatorrequest.js +70 -0
- package/dist/esm/models/components/metamaskdelegatorrequest.js.map +1 -0
- package/dist/esm/models/components/odostransactionresponse.d.ts +63 -0
- package/dist/esm/models/components/odostransactionresponse.d.ts.map +1 -0
- package/dist/esm/models/components/odostransactionresponse.js +77 -0
- package/dist/esm/models/components/odostransactionresponse.js.map +1 -0
- package/dist/esm/sdk/swap.d.ts +1 -1
- package/dist/esm/sdk/swap.d.ts.map +1 -1
- package/dist/esm/sdk/transactionbundler.d.ts +8 -0
- package/dist/esm/sdk/transactionbundler.d.ts.map +1 -1
- package/dist/esm/sdk/transactionbundler.js +11 -0
- package/dist/esm/sdk/transactionbundler.js.map +1 -1
- package/docs/sdks/swap/README.md +1 -1
- package/docs/sdks/transactionbundler/README.md +114 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/swapSwapOdos.ts +4 -4
- package/src/funcs/transactionBundlerTransactionBundlerMetamaskExecute.ts +170 -0
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.ts +40 -0
- package/src/models/components/index.ts +2 -0
- package/src/models/components/metamaskdelegatorrequest.ts +144 -0
- package/src/models/components/odostransactionresponse.ts +170 -0
- package/src/sdk/swap.ts +1 -1
- package/src/sdk/transactionbundler.ts +19 -0
|
@@ -0,0 +1,170 @@
|
|
|
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 { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
UnsignedTransaction,
|
|
12
|
+
UnsignedTransaction$inboundSchema,
|
|
13
|
+
UnsignedTransaction$Outbound,
|
|
14
|
+
UnsignedTransaction$outboundSchema,
|
|
15
|
+
} from "./unsignedtransaction.js";
|
|
16
|
+
import {
|
|
17
|
+
UserOperationResponse,
|
|
18
|
+
UserOperationResponse$inboundSchema,
|
|
19
|
+
UserOperationResponse$Outbound,
|
|
20
|
+
UserOperationResponse$outboundSchema,
|
|
21
|
+
} from "./useroperationresponse.js";
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The unsigned transaction data. User must sign and broadcast to network.
|
|
25
|
+
*/
|
|
26
|
+
export type OdosTransactionResponseTransaction =
|
|
27
|
+
| UnsignedTransaction
|
|
28
|
+
| UserOperationResponse;
|
|
29
|
+
|
|
30
|
+
export type OdosTransactionResponse = {
|
|
31
|
+
/**
|
|
32
|
+
* The unsigned transaction data. User must sign and broadcast to network.
|
|
33
|
+
*/
|
|
34
|
+
transaction: UnsignedTransaction | UserOperationResponse;
|
|
35
|
+
/**
|
|
36
|
+
* The estimated amount out for the transaction. The actual output amount for this transaction is guaranteed be within the acceptable threshold, defined by the `max_slippage_percent`, relative to this quote.
|
|
37
|
+
*/
|
|
38
|
+
amountOutQuote: string;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
/** @internal */
|
|
42
|
+
export const OdosTransactionResponseTransaction$inboundSchema: z.ZodType<
|
|
43
|
+
OdosTransactionResponseTransaction,
|
|
44
|
+
z.ZodTypeDef,
|
|
45
|
+
unknown
|
|
46
|
+
> = z.union([
|
|
47
|
+
UnsignedTransaction$inboundSchema,
|
|
48
|
+
UserOperationResponse$inboundSchema,
|
|
49
|
+
]);
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export type OdosTransactionResponseTransaction$Outbound =
|
|
53
|
+
| UnsignedTransaction$Outbound
|
|
54
|
+
| UserOperationResponse$Outbound;
|
|
55
|
+
|
|
56
|
+
/** @internal */
|
|
57
|
+
export const OdosTransactionResponseTransaction$outboundSchema: z.ZodType<
|
|
58
|
+
OdosTransactionResponseTransaction$Outbound,
|
|
59
|
+
z.ZodTypeDef,
|
|
60
|
+
OdosTransactionResponseTransaction
|
|
61
|
+
> = z.union([
|
|
62
|
+
UnsignedTransaction$outboundSchema,
|
|
63
|
+
UserOperationResponse$outboundSchema,
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* @internal
|
|
68
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
69
|
+
*/
|
|
70
|
+
export namespace OdosTransactionResponseTransaction$ {
|
|
71
|
+
/** @deprecated use `OdosTransactionResponseTransaction$inboundSchema` instead. */
|
|
72
|
+
export const inboundSchema = OdosTransactionResponseTransaction$inboundSchema;
|
|
73
|
+
/** @deprecated use `OdosTransactionResponseTransaction$outboundSchema` instead. */
|
|
74
|
+
export const outboundSchema =
|
|
75
|
+
OdosTransactionResponseTransaction$outboundSchema;
|
|
76
|
+
/** @deprecated use `OdosTransactionResponseTransaction$Outbound` instead. */
|
|
77
|
+
export type Outbound = OdosTransactionResponseTransaction$Outbound;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export function odosTransactionResponseTransactionToJSON(
|
|
81
|
+
odosTransactionResponseTransaction: OdosTransactionResponseTransaction,
|
|
82
|
+
): string {
|
|
83
|
+
return JSON.stringify(
|
|
84
|
+
OdosTransactionResponseTransaction$outboundSchema.parse(
|
|
85
|
+
odosTransactionResponseTransaction,
|
|
86
|
+
),
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function odosTransactionResponseTransactionFromJSON(
|
|
91
|
+
jsonString: string,
|
|
92
|
+
): SafeParseResult<OdosTransactionResponseTransaction, SDKValidationError> {
|
|
93
|
+
return safeParse(
|
|
94
|
+
jsonString,
|
|
95
|
+
(x) =>
|
|
96
|
+
OdosTransactionResponseTransaction$inboundSchema.parse(JSON.parse(x)),
|
|
97
|
+
`Failed to parse 'OdosTransactionResponseTransaction' from JSON`,
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** @internal */
|
|
102
|
+
export const OdosTransactionResponse$inboundSchema: z.ZodType<
|
|
103
|
+
OdosTransactionResponse,
|
|
104
|
+
z.ZodTypeDef,
|
|
105
|
+
unknown
|
|
106
|
+
> = z.object({
|
|
107
|
+
transaction: z.union([
|
|
108
|
+
UnsignedTransaction$inboundSchema,
|
|
109
|
+
UserOperationResponse$inboundSchema,
|
|
110
|
+
]),
|
|
111
|
+
amount_out_quote: z.string(),
|
|
112
|
+
}).transform((v) => {
|
|
113
|
+
return remap$(v, {
|
|
114
|
+
"amount_out_quote": "amountOutQuote",
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
/** @internal */
|
|
119
|
+
export type OdosTransactionResponse$Outbound = {
|
|
120
|
+
transaction: UnsignedTransaction$Outbound | UserOperationResponse$Outbound;
|
|
121
|
+
amount_out_quote: string;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
/** @internal */
|
|
125
|
+
export const OdosTransactionResponse$outboundSchema: z.ZodType<
|
|
126
|
+
OdosTransactionResponse$Outbound,
|
|
127
|
+
z.ZodTypeDef,
|
|
128
|
+
OdosTransactionResponse
|
|
129
|
+
> = z.object({
|
|
130
|
+
transaction: z.union([
|
|
131
|
+
UnsignedTransaction$outboundSchema,
|
|
132
|
+
UserOperationResponse$outboundSchema,
|
|
133
|
+
]),
|
|
134
|
+
amountOutQuote: z.string(),
|
|
135
|
+
}).transform((v) => {
|
|
136
|
+
return remap$(v, {
|
|
137
|
+
amountOutQuote: "amount_out_quote",
|
|
138
|
+
});
|
|
139
|
+
});
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* @internal
|
|
143
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
144
|
+
*/
|
|
145
|
+
export namespace OdosTransactionResponse$ {
|
|
146
|
+
/** @deprecated use `OdosTransactionResponse$inboundSchema` instead. */
|
|
147
|
+
export const inboundSchema = OdosTransactionResponse$inboundSchema;
|
|
148
|
+
/** @deprecated use `OdosTransactionResponse$outboundSchema` instead. */
|
|
149
|
+
export const outboundSchema = OdosTransactionResponse$outboundSchema;
|
|
150
|
+
/** @deprecated use `OdosTransactionResponse$Outbound` instead. */
|
|
151
|
+
export type Outbound = OdosTransactionResponse$Outbound;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function odosTransactionResponseToJSON(
|
|
155
|
+
odosTransactionResponse: OdosTransactionResponse,
|
|
156
|
+
): string {
|
|
157
|
+
return JSON.stringify(
|
|
158
|
+
OdosTransactionResponse$outboundSchema.parse(odosTransactionResponse),
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function odosTransactionResponseFromJSON(
|
|
163
|
+
jsonString: string,
|
|
164
|
+
): SafeParseResult<OdosTransactionResponse, SDKValidationError> {
|
|
165
|
+
return safeParse(
|
|
166
|
+
jsonString,
|
|
167
|
+
(x) => OdosTransactionResponse$inboundSchema.parse(JSON.parse(x)),
|
|
168
|
+
`Failed to parse 'OdosTransactionResponse' from JSON`,
|
|
169
|
+
);
|
|
170
|
+
}
|
package/src/sdk/swap.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Swap extends ClientSDK {
|
|
|
24
24
|
async swapOdos(
|
|
25
25
|
request: components.OdosSwapRequest,
|
|
26
26
|
options?: RequestOptions,
|
|
27
|
-
): Promise<components.
|
|
27
|
+
): Promise<components.OdosTransactionResponse> {
|
|
28
28
|
return unwrapAsync(swapSwapOdos(
|
|
29
29
|
this,
|
|
30
30
|
request,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import { transactionBundlerTransactionBundlerAaveLoop } from "../funcs/transactionBundlerTransactionBundlerAaveLoop.js";
|
|
6
6
|
import { transactionBundlerTransactionBundlerAuthorization } from "../funcs/transactionBundlerTransactionBundlerAuthorization.js";
|
|
7
7
|
import { transactionBundlerTransactionBundlerExecute } from "../funcs/transactionBundlerTransactionBundlerExecute.js";
|
|
8
|
+
import { transactionBundlerTransactionBundlerMetamaskExecute } from "../funcs/transactionBundlerTransactionBundlerMetamaskExecute.js";
|
|
8
9
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
9
10
|
import * as components from "../models/components/index.js";
|
|
10
11
|
import * as operations from "../models/operations/index.js";
|
|
@@ -82,4 +83,22 @@ export class TransactionBundler extends ClientSDK {
|
|
|
82
83
|
options,
|
|
83
84
|
));
|
|
84
85
|
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Construct Bundled Transaction
|
|
89
|
+
*
|
|
90
|
+
* @remarks
|
|
91
|
+
* Bundle arbitrary transactions together into a single metamask delegator
|
|
92
|
+
* transaction.
|
|
93
|
+
*/
|
|
94
|
+
async transactionBundlerMetamaskExecute(
|
|
95
|
+
request: components.MetamaskDelegatorRequest,
|
|
96
|
+
options?: RequestOptions,
|
|
97
|
+
): Promise<components.BundlerTransactionResponse> {
|
|
98
|
+
return unwrapAsync(transactionBundlerTransactionBundlerMetamaskExecute(
|
|
99
|
+
this,
|
|
100
|
+
request,
|
|
101
|
+
options,
|
|
102
|
+
));
|
|
103
|
+
}
|
|
85
104
|
}
|