@compass-labs/api-sdk 1.0.12 → 1.0.13
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 +0 -2
- package/bin/mcp-server.js +131 -282
- package/bin/mcp-server.js.map +7 -10
- 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 +1 -3
- package/dist/commonjs/mcp-server/server.js.map +1 -1
- package/dist/commonjs/models/components/index.d.ts +0 -1
- package/dist/commonjs/models/components/index.d.ts.map +1 -1
- package/dist/commonjs/models/components/index.js +0 -1
- package/dist/commonjs/models/components/index.js.map +1 -1
- package/dist/commonjs/sdk/transactionbundler.d.ts +0 -8
- package/dist/commonjs/sdk/transactionbundler.d.ts.map +1 -1
- package/dist/commonjs/sdk/transactionbundler.js +0 -11
- package/dist/commonjs/sdk/transactionbundler.js.map +1 -1
- 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 +1 -3
- package/dist/esm/mcp-server/server.js.map +1 -1
- package/dist/esm/models/components/index.d.ts +0 -1
- package/dist/esm/models/components/index.d.ts.map +1 -1
- package/dist/esm/models/components/index.js +0 -1
- package/dist/esm/models/components/index.js.map +1 -1
- package/dist/esm/sdk/transactionbundler.d.ts +0 -8
- package/dist/esm/sdk/transactionbundler.d.ts.map +1 -1
- package/dist/esm/sdk/transactionbundler.js +0 -11
- package/dist/esm/sdk/transactionbundler.js.map +1 -1
- package/docs/sdks/transactionbundler/README.md +0 -114
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/lib/config.ts +2 -2
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -3
- package/src/models/components/index.ts +0 -1
- package/src/sdk/transactionbundler.ts +0 -19
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +0 -19
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +0 -1
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js +0 -119
- package/dist/commonjs/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js.map +0 -1
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +0 -8
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +0 -1
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js +0 -65
- package/dist/commonjs/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js.map +0 -1
- package/dist/commonjs/models/components/metamaskdelegatorrequest.d.ts +0 -78
- package/dist/commonjs/models/components/metamaskdelegatorrequest.d.ts.map +0 -1
- package/dist/commonjs/models/components/metamaskdelegatorrequest.js +0 -108
- package/dist/commonjs/models/components/metamaskdelegatorrequest.js.map +0 -1
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +0 -19
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +0 -1
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js +0 -83
- package/dist/esm/funcs/transactionBundlerTransactionBundlerMetamaskExecute.js.map +0 -1
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts +0 -8
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.d.ts.map +0 -1
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js +0 -29
- package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js.map +0 -1
- package/dist/esm/models/components/metamaskdelegatorrequest.d.ts +0 -78
- package/dist/esm/models/components/metamaskdelegatorrequest.d.ts.map +0 -1
- package/dist/esm/models/components/metamaskdelegatorrequest.js +0 -70
- package/dist/esm/models/components/metamaskdelegatorrequest.js.map +0 -1
- package/src/funcs/transactionBundlerTransactionBundlerMetamaskExecute.ts +0 -170
- package/src/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.ts +0 -40
- package/src/models/components/metamaskdelegatorrequest.ts +0 -144
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
import { transactionBundlerTransactionBundlerMetamaskExecute } from "../../funcs/transactionBundlerTransactionBundlerMetamaskExecute.js";
|
|
5
|
-
import * as components from "../../models/components/index.js";
|
|
6
|
-
import { formatResult } from "../tools.js";
|
|
7
|
-
const args = {
|
|
8
|
-
request: components.MetamaskDelegatorRequest$inboundSchema,
|
|
9
|
-
};
|
|
10
|
-
export const tool$transactionBundlerTransactionBundlerMetamaskExecute = {
|
|
11
|
-
name: "transaction-bundler-transaction-bundler-metamask-execute",
|
|
12
|
-
description: `Construct Bundled Transaction
|
|
13
|
-
|
|
14
|
-
Bundle arbitrary transactions together into a single metamask delegator
|
|
15
|
-
transaction.`,
|
|
16
|
-
args,
|
|
17
|
-
tool: async (client, args, ctx) => {
|
|
18
|
-
const [result, apiCall] = await transactionBundlerTransactionBundlerMetamaskExecute(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
|
|
19
|
-
if (!result.ok) {
|
|
20
|
-
return {
|
|
21
|
-
content: [{ type: "text", text: result.error.message }],
|
|
22
|
-
isError: true,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
const value = result.value;
|
|
26
|
-
return formatResult(value, apiCall);
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
//# sourceMappingURL=transactionBundlerTransactionBundlerMetamaskExecute.js.map
|
package/dist/esm/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transactionBundlerTransactionBundlerMetamaskExecute.js","sourceRoot":"","sources":["../../../../src/mcp-server/tools/transactionBundlerTransactionBundlerMetamaskExecute.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,mDAAmD,EAAE,MAAM,oEAAoE,CAAC;AACzI,OAAO,KAAK,UAAU,MAAM,kCAAkC,CAAC;AAC/D,OAAO,EAAE,YAAY,EAAkB,MAAM,aAAa,CAAC;AAE3D,MAAM,IAAI,GAAG;IACX,OAAO,EAAE,UAAU,CAAC,sCAAsC;CAC3D,CAAC;AAEF,MAAM,CAAC,MAAM,wDAAwD,GACrC;IAC5B,IAAI,EAAE,0DAA0D;IAChE,WAAW,EAAE;;;aAGJ;IACT,IAAI;IACJ,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,EAAE;QAChC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACrB,MAAM,mDAAmD,CACvD,MAAM,EACN,IAAI,CAAC,OAAO,EACZ,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,EAAE,CACzC,CAAC,QAAQ,EAAE,CAAC;QAEf,IAAI,CAAC,MAAM,CAAC,EAAE,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACvD,OAAO,EAAE,IAAI;aACd,CAAC;QACJ,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC;QAE3B,OAAO,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;IACtC,CAAC;CACF,CAAC"}
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import * as z from "zod";
|
|
2
|
-
import { ClosedEnum } from "../../types/enums.js";
|
|
3
|
-
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
4
|
-
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
5
|
-
import { SignedAuthorization, SignedAuthorization$Outbound } from "./signedauthorization.js";
|
|
6
|
-
import { UserOperation, UserOperation$Outbound } from "./useroperation.js";
|
|
7
|
-
export declare const MetamaskDelegatorRequestChain: {
|
|
8
|
-
readonly Arbitrum: "arbitrum";
|
|
9
|
-
readonly Base: "base";
|
|
10
|
-
readonly Ethereum: "ethereum";
|
|
11
|
-
};
|
|
12
|
-
export type MetamaskDelegatorRequestChain = ClosedEnum<typeof MetamaskDelegatorRequestChain>;
|
|
13
|
-
/**
|
|
14
|
-
* Request model for executing a multicall.
|
|
15
|
-
*/
|
|
16
|
-
export type MetamaskDelegatorRequest = {
|
|
17
|
-
chain: MetamaskDelegatorRequestChain;
|
|
18
|
-
/**
|
|
19
|
-
* The address of the transaction sender.
|
|
20
|
-
*/
|
|
21
|
-
sender: string;
|
|
22
|
-
/**
|
|
23
|
-
* Signed authorization for the transaction
|
|
24
|
-
*/
|
|
25
|
-
signedAuthorization?: SignedAuthorization | null | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* List of possible actions for multicall
|
|
28
|
-
*/
|
|
29
|
-
actions: Array<UserOperation>;
|
|
30
|
-
};
|
|
31
|
-
/** @internal */
|
|
32
|
-
export declare const MetamaskDelegatorRequestChain$inboundSchema: z.ZodNativeEnum<typeof MetamaskDelegatorRequestChain>;
|
|
33
|
-
/** @internal */
|
|
34
|
-
export declare const MetamaskDelegatorRequestChain$outboundSchema: z.ZodNativeEnum<typeof MetamaskDelegatorRequestChain>;
|
|
35
|
-
/**
|
|
36
|
-
* @internal
|
|
37
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
38
|
-
*/
|
|
39
|
-
export declare namespace MetamaskDelegatorRequestChain$ {
|
|
40
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$inboundSchema` instead. */
|
|
41
|
-
const inboundSchema: z.ZodNativeEnum<{
|
|
42
|
-
readonly Arbitrum: "arbitrum";
|
|
43
|
-
readonly Base: "base";
|
|
44
|
-
readonly Ethereum: "ethereum";
|
|
45
|
-
}>;
|
|
46
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$outboundSchema` instead. */
|
|
47
|
-
const outboundSchema: z.ZodNativeEnum<{
|
|
48
|
-
readonly Arbitrum: "arbitrum";
|
|
49
|
-
readonly Base: "base";
|
|
50
|
-
readonly Ethereum: "ethereum";
|
|
51
|
-
}>;
|
|
52
|
-
}
|
|
53
|
-
/** @internal */
|
|
54
|
-
export declare const MetamaskDelegatorRequest$inboundSchema: z.ZodType<MetamaskDelegatorRequest, z.ZodTypeDef, unknown>;
|
|
55
|
-
/** @internal */
|
|
56
|
-
export type MetamaskDelegatorRequest$Outbound = {
|
|
57
|
-
chain: string;
|
|
58
|
-
sender: string;
|
|
59
|
-
signed_authorization?: SignedAuthorization$Outbound | null | undefined;
|
|
60
|
-
actions: Array<UserOperation$Outbound>;
|
|
61
|
-
};
|
|
62
|
-
/** @internal */
|
|
63
|
-
export declare const MetamaskDelegatorRequest$outboundSchema: z.ZodType<MetamaskDelegatorRequest$Outbound, z.ZodTypeDef, MetamaskDelegatorRequest>;
|
|
64
|
-
/**
|
|
65
|
-
* @internal
|
|
66
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
67
|
-
*/
|
|
68
|
-
export declare namespace MetamaskDelegatorRequest$ {
|
|
69
|
-
/** @deprecated use `MetamaskDelegatorRequest$inboundSchema` instead. */
|
|
70
|
-
const inboundSchema: z.ZodType<MetamaskDelegatorRequest, z.ZodTypeDef, unknown>;
|
|
71
|
-
/** @deprecated use `MetamaskDelegatorRequest$outboundSchema` instead. */
|
|
72
|
-
const outboundSchema: z.ZodType<MetamaskDelegatorRequest$Outbound, z.ZodTypeDef, MetamaskDelegatorRequest>;
|
|
73
|
-
/** @deprecated use `MetamaskDelegatorRequest$Outbound` instead. */
|
|
74
|
-
type Outbound = MetamaskDelegatorRequest$Outbound;
|
|
75
|
-
}
|
|
76
|
-
export declare function metamaskDelegatorRequestToJSON(metamaskDelegatorRequest: MetamaskDelegatorRequest): string;
|
|
77
|
-
export declare function metamaskDelegatorRequestFromJSON(jsonString: string): SafeParseResult<MetamaskDelegatorRequest, SDKValidationError>;
|
|
78
|
-
//# sourceMappingURL=metamaskdelegatorrequest.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metamaskdelegatorrequest.d.ts","sourceRoot":"","sources":["../../../../src/models/components/metamaskdelegatorrequest.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAGzB,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AACrE,OAAO,EACL,mBAAmB,EAEnB,4BAA4B,EAE7B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,aAAa,EAEb,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAE5B,eAAO,MAAM,6BAA6B;;;;CAIhC,CAAC;AACX,MAAM,MAAM,6BAA6B,GAAG,UAAU,CACpD,OAAO,6BAA6B,CACrC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,wBAAwB,GAAG;IACrC,KAAK,EAAE,6BAA6B,CAAC;IACrC;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,GAAG,IAAI,GAAG,SAAS,CAAC;IAC7D;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC;CAC/B,CAAC;AAEF,gBAAgB;AAChB,eAAO,MAAM,2CAA2C,EAAE,CAAC,CAAC,aAAa,CACvE,OAAO,6BAA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
*/
|
|
4
|
-
import * as z from "zod";
|
|
5
|
-
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
-
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
-
import { SignedAuthorization$inboundSchema, SignedAuthorization$outboundSchema, } from "./signedauthorization.js";
|
|
8
|
-
import { UserOperation$inboundSchema, UserOperation$outboundSchema, } from "./useroperation.js";
|
|
9
|
-
export const MetamaskDelegatorRequestChain = {
|
|
10
|
-
Arbitrum: "arbitrum",
|
|
11
|
-
Base: "base",
|
|
12
|
-
Ethereum: "ethereum",
|
|
13
|
-
};
|
|
14
|
-
/** @internal */
|
|
15
|
-
export const MetamaskDelegatorRequestChain$inboundSchema = z.nativeEnum(MetamaskDelegatorRequestChain);
|
|
16
|
-
/** @internal */
|
|
17
|
-
export const MetamaskDelegatorRequestChain$outboundSchema = MetamaskDelegatorRequestChain$inboundSchema;
|
|
18
|
-
/**
|
|
19
|
-
* @internal
|
|
20
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
21
|
-
*/
|
|
22
|
-
export var MetamaskDelegatorRequestChain$;
|
|
23
|
-
(function (MetamaskDelegatorRequestChain$) {
|
|
24
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$inboundSchema` instead. */
|
|
25
|
-
MetamaskDelegatorRequestChain$.inboundSchema = MetamaskDelegatorRequestChain$inboundSchema;
|
|
26
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$outboundSchema` instead. */
|
|
27
|
-
MetamaskDelegatorRequestChain$.outboundSchema = MetamaskDelegatorRequestChain$outboundSchema;
|
|
28
|
-
})(MetamaskDelegatorRequestChain$ || (MetamaskDelegatorRequestChain$ = {}));
|
|
29
|
-
/** @internal */
|
|
30
|
-
export const MetamaskDelegatorRequest$inboundSchema = z.object({
|
|
31
|
-
chain: MetamaskDelegatorRequestChain$inboundSchema,
|
|
32
|
-
sender: z.string(),
|
|
33
|
-
signed_authorization: z.nullable(SignedAuthorization$inboundSchema)
|
|
34
|
-
.optional(),
|
|
35
|
-
actions: z.array(UserOperation$inboundSchema),
|
|
36
|
-
}).transform((v) => {
|
|
37
|
-
return remap$(v, {
|
|
38
|
-
"signed_authorization": "signedAuthorization",
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
/** @internal */
|
|
42
|
-
export const MetamaskDelegatorRequest$outboundSchema = z.object({
|
|
43
|
-
chain: MetamaskDelegatorRequestChain$outboundSchema,
|
|
44
|
-
sender: z.string(),
|
|
45
|
-
signedAuthorization: z.nullable(SignedAuthorization$outboundSchema)
|
|
46
|
-
.optional(),
|
|
47
|
-
actions: z.array(UserOperation$outboundSchema),
|
|
48
|
-
}).transform((v) => {
|
|
49
|
-
return remap$(v, {
|
|
50
|
-
signedAuthorization: "signed_authorization",
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
/**
|
|
54
|
-
* @internal
|
|
55
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
-
*/
|
|
57
|
-
export var MetamaskDelegatorRequest$;
|
|
58
|
-
(function (MetamaskDelegatorRequest$) {
|
|
59
|
-
/** @deprecated use `MetamaskDelegatorRequest$inboundSchema` instead. */
|
|
60
|
-
MetamaskDelegatorRequest$.inboundSchema = MetamaskDelegatorRequest$inboundSchema;
|
|
61
|
-
/** @deprecated use `MetamaskDelegatorRequest$outboundSchema` instead. */
|
|
62
|
-
MetamaskDelegatorRequest$.outboundSchema = MetamaskDelegatorRequest$outboundSchema;
|
|
63
|
-
})(MetamaskDelegatorRequest$ || (MetamaskDelegatorRequest$ = {}));
|
|
64
|
-
export function metamaskDelegatorRequestToJSON(metamaskDelegatorRequest) {
|
|
65
|
-
return JSON.stringify(MetamaskDelegatorRequest$outboundSchema.parse(metamaskDelegatorRequest));
|
|
66
|
-
}
|
|
67
|
-
export function metamaskDelegatorRequestFromJSON(jsonString) {
|
|
68
|
-
return safeParse(jsonString, (x) => MetamaskDelegatorRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'MetamaskDelegatorRequest' from JSON`);
|
|
69
|
-
}
|
|
70
|
-
//# sourceMappingURL=metamaskdelegatorrequest.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"metamaskdelegatorrequest.js","sourceRoot":"","sources":["../../../../src/models/components/metamaskdelegatorrequest.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AACzB,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAIjD,OAAO,EAEL,iCAAiC,EAEjC,kCAAkC,GACnC,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAEL,2BAA2B,EAE3B,4BAA4B,GAC7B,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ,QAAQ,EAAE,UAAU;CACZ,CAAC;AAwBX,gBAAgB;AAChB,MAAM,CAAC,MAAM,2CAA2C,GAEpD,CAAC,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;AAEhD,gBAAgB;AAChB,MAAM,CAAC,MAAM,4CAA4C,GAErD,2CAA2C,CAAC;AAEhD;;;GAGG;AACH,MAAM,KAAW,8BAA8B,CAK9C;AALD,WAAiB,8BAA8B;IAC7C,6EAA6E;IAChE,4CAAa,GAAG,2CAA2C,CAAC;IACzE,8EAA8E;IACjE,6CAAc,GAAG,4CAA4C,CAAC;AAC7E,CAAC,EALgB,8BAA8B,KAA9B,8BAA8B,QAK9C;AAED,gBAAgB;AAChB,MAAM,CAAC,MAAM,sCAAsC,GAI/C,CAAC,CAAC,MAAM,CAAC;IACX,KAAK,EAAE,2CAA2C;IAClD,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,oBAAoB,EAAE,CAAC,CAAC,QAAQ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EAClE,sDAAsD,CACvD,CAAC;AACJ,CAAC"}
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { CompassApiSDKCore } from "../core.js";
|
|
6
|
-
import { encodeJSON } from "../lib/encodings.js";
|
|
7
|
-
import * as M from "../lib/matchers.js";
|
|
8
|
-
import { compactMap } from "../lib/primitives.js";
|
|
9
|
-
import { safeParse } from "../lib/schemas.js";
|
|
10
|
-
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
-
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
-
import { pathToFunc } from "../lib/url.js";
|
|
13
|
-
import * as components from "../models/components/index.js";
|
|
14
|
-
import { CompassAPISDKError } from "../models/errors/compassapisdkerror.js";
|
|
15
|
-
import {
|
|
16
|
-
ConnectionError,
|
|
17
|
-
InvalidRequestError,
|
|
18
|
-
RequestAbortedError,
|
|
19
|
-
RequestTimeoutError,
|
|
20
|
-
UnexpectedClientError,
|
|
21
|
-
} from "../models/errors/httpclienterrors.js";
|
|
22
|
-
import * as errors from "../models/errors/index.js";
|
|
23
|
-
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
24
|
-
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
25
|
-
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
-
import { Result } from "../types/fp.js";
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Construct Bundled Transaction
|
|
30
|
-
*
|
|
31
|
-
* @remarks
|
|
32
|
-
* Bundle arbitrary transactions together into a single metamask delegator
|
|
33
|
-
* transaction.
|
|
34
|
-
*/
|
|
35
|
-
export function transactionBundlerTransactionBundlerMetamaskExecute(
|
|
36
|
-
client: CompassApiSDKCore,
|
|
37
|
-
request: components.MetamaskDelegatorRequest,
|
|
38
|
-
options?: RequestOptions,
|
|
39
|
-
): APIPromise<
|
|
40
|
-
Result<
|
|
41
|
-
components.BundlerTransactionResponse,
|
|
42
|
-
| errors.HTTPValidationError
|
|
43
|
-
| CompassAPISDKError
|
|
44
|
-
| ResponseValidationError
|
|
45
|
-
| ConnectionError
|
|
46
|
-
| RequestAbortedError
|
|
47
|
-
| RequestTimeoutError
|
|
48
|
-
| InvalidRequestError
|
|
49
|
-
| UnexpectedClientError
|
|
50
|
-
| SDKValidationError
|
|
51
|
-
>
|
|
52
|
-
> {
|
|
53
|
-
return new APIPromise($do(
|
|
54
|
-
client,
|
|
55
|
-
request,
|
|
56
|
-
options,
|
|
57
|
-
));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async function $do(
|
|
61
|
-
client: CompassApiSDKCore,
|
|
62
|
-
request: components.MetamaskDelegatorRequest,
|
|
63
|
-
options?: RequestOptions,
|
|
64
|
-
): Promise<
|
|
65
|
-
[
|
|
66
|
-
Result<
|
|
67
|
-
components.BundlerTransactionResponse,
|
|
68
|
-
| errors.HTTPValidationError
|
|
69
|
-
| CompassAPISDKError
|
|
70
|
-
| ResponseValidationError
|
|
71
|
-
| ConnectionError
|
|
72
|
-
| RequestAbortedError
|
|
73
|
-
| RequestTimeoutError
|
|
74
|
-
| InvalidRequestError
|
|
75
|
-
| UnexpectedClientError
|
|
76
|
-
| SDKValidationError
|
|
77
|
-
>,
|
|
78
|
-
APICall,
|
|
79
|
-
]
|
|
80
|
-
> {
|
|
81
|
-
const parsed = safeParse(
|
|
82
|
-
request,
|
|
83
|
-
(value) => components.MetamaskDelegatorRequest$outboundSchema.parse(value),
|
|
84
|
-
"Input validation failed",
|
|
85
|
-
);
|
|
86
|
-
if (!parsed.ok) {
|
|
87
|
-
return [parsed, { status: "invalid" }];
|
|
88
|
-
}
|
|
89
|
-
const payload = parsed.value;
|
|
90
|
-
const body = encodeJSON("body", payload, { explode: true });
|
|
91
|
-
|
|
92
|
-
const path = pathToFunc("/v1/transaction_bundler/metamask/execute")();
|
|
93
|
-
|
|
94
|
-
const headers = new Headers(compactMap({
|
|
95
|
-
"Content-Type": "application/json",
|
|
96
|
-
Accept: "application/json",
|
|
97
|
-
}));
|
|
98
|
-
|
|
99
|
-
const secConfig = await extractSecurity(client._options.apiKeyAuth);
|
|
100
|
-
const securityInput = secConfig == null ? {} : { apiKeyAuth: secConfig };
|
|
101
|
-
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
-
|
|
103
|
-
const context = {
|
|
104
|
-
options: client._options,
|
|
105
|
-
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
106
|
-
operationID: "v1_transaction_bundler_metamask_execute",
|
|
107
|
-
oAuth2Scopes: [],
|
|
108
|
-
|
|
109
|
-
resolvedSecurity: requestSecurity,
|
|
110
|
-
|
|
111
|
-
securitySource: client._options.apiKeyAuth,
|
|
112
|
-
retryConfig: options?.retries
|
|
113
|
-
|| client._options.retryConfig
|
|
114
|
-
|| { strategy: "none" },
|
|
115
|
-
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
const requestRes = client._createRequest(context, {
|
|
119
|
-
security: requestSecurity,
|
|
120
|
-
method: "POST",
|
|
121
|
-
baseURL: options?.serverURL,
|
|
122
|
-
path: path,
|
|
123
|
-
headers: headers,
|
|
124
|
-
body: body,
|
|
125
|
-
userAgent: client._options.userAgent,
|
|
126
|
-
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
127
|
-
}, options);
|
|
128
|
-
if (!requestRes.ok) {
|
|
129
|
-
return [requestRes, { status: "invalid" }];
|
|
130
|
-
}
|
|
131
|
-
const req = requestRes.value;
|
|
132
|
-
|
|
133
|
-
const doResult = await client._do(req, {
|
|
134
|
-
context,
|
|
135
|
-
errorCodes: ["422", "4XX", "5XX"],
|
|
136
|
-
retryConfig: context.retryConfig,
|
|
137
|
-
retryCodes: context.retryCodes,
|
|
138
|
-
});
|
|
139
|
-
if (!doResult.ok) {
|
|
140
|
-
return [doResult, { status: "request-error", request: req }];
|
|
141
|
-
}
|
|
142
|
-
const response = doResult.value;
|
|
143
|
-
|
|
144
|
-
const responseFields = {
|
|
145
|
-
HttpMeta: { Response: response, Request: req },
|
|
146
|
-
};
|
|
147
|
-
|
|
148
|
-
const [result] = await M.match<
|
|
149
|
-
components.BundlerTransactionResponse,
|
|
150
|
-
| errors.HTTPValidationError
|
|
151
|
-
| CompassAPISDKError
|
|
152
|
-
| ResponseValidationError
|
|
153
|
-
| ConnectionError
|
|
154
|
-
| RequestAbortedError
|
|
155
|
-
| RequestTimeoutError
|
|
156
|
-
| InvalidRequestError
|
|
157
|
-
| UnexpectedClientError
|
|
158
|
-
| SDKValidationError
|
|
159
|
-
>(
|
|
160
|
-
M.json(200, components.BundlerTransactionResponse$inboundSchema),
|
|
161
|
-
M.jsonErr(422, errors.HTTPValidationError$inboundSchema),
|
|
162
|
-
M.fail("4XX"),
|
|
163
|
-
M.fail("5XX"),
|
|
164
|
-
)(response, req, { extraFields: responseFields });
|
|
165
|
-
if (!result.ok) {
|
|
166
|
-
return [result, { status: "complete", request: req, response }];
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
return [result, { status: "complete", request: req, response }];
|
|
170
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
-
*/
|
|
4
|
-
|
|
5
|
-
import { transactionBundlerTransactionBundlerMetamaskExecute } from "../../funcs/transactionBundlerTransactionBundlerMetamaskExecute.js";
|
|
6
|
-
import * as components from "../../models/components/index.js";
|
|
7
|
-
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
-
|
|
9
|
-
const args = {
|
|
10
|
-
request: components.MetamaskDelegatorRequest$inboundSchema,
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const tool$transactionBundlerTransactionBundlerMetamaskExecute:
|
|
14
|
-
ToolDefinition<typeof args> = {
|
|
15
|
-
name: "transaction-bundler-transaction-bundler-metamask-execute",
|
|
16
|
-
description: `Construct Bundled Transaction
|
|
17
|
-
|
|
18
|
-
Bundle arbitrary transactions together into a single metamask delegator
|
|
19
|
-
transaction.`,
|
|
20
|
-
args,
|
|
21
|
-
tool: async (client, args, ctx) => {
|
|
22
|
-
const [result, apiCall] =
|
|
23
|
-
await transactionBundlerTransactionBundlerMetamaskExecute(
|
|
24
|
-
client,
|
|
25
|
-
args.request,
|
|
26
|
-
{ fetchOptions: { signal: ctx.signal } },
|
|
27
|
-
).$inspect();
|
|
28
|
-
|
|
29
|
-
if (!result.ok) {
|
|
30
|
-
return {
|
|
31
|
-
content: [{ type: "text", text: result.error.message }],
|
|
32
|
-
isError: true,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const value = result.value;
|
|
37
|
-
|
|
38
|
-
return formatResult(value, apiCall);
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,144 +0,0 @@
|
|
|
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
|
-
SignedAuthorization,
|
|
13
|
-
SignedAuthorization$inboundSchema,
|
|
14
|
-
SignedAuthorization$Outbound,
|
|
15
|
-
SignedAuthorization$outboundSchema,
|
|
16
|
-
} from "./signedauthorization.js";
|
|
17
|
-
import {
|
|
18
|
-
UserOperation,
|
|
19
|
-
UserOperation$inboundSchema,
|
|
20
|
-
UserOperation$Outbound,
|
|
21
|
-
UserOperation$outboundSchema,
|
|
22
|
-
} from "./useroperation.js";
|
|
23
|
-
|
|
24
|
-
export const MetamaskDelegatorRequestChain = {
|
|
25
|
-
Arbitrum: "arbitrum",
|
|
26
|
-
Base: "base",
|
|
27
|
-
Ethereum: "ethereum",
|
|
28
|
-
} as const;
|
|
29
|
-
export type MetamaskDelegatorRequestChain = ClosedEnum<
|
|
30
|
-
typeof MetamaskDelegatorRequestChain
|
|
31
|
-
>;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Request model for executing a multicall.
|
|
35
|
-
*/
|
|
36
|
-
export type MetamaskDelegatorRequest = {
|
|
37
|
-
chain: MetamaskDelegatorRequestChain;
|
|
38
|
-
/**
|
|
39
|
-
* The address of the transaction sender.
|
|
40
|
-
*/
|
|
41
|
-
sender: string;
|
|
42
|
-
/**
|
|
43
|
-
* Signed authorization for the transaction
|
|
44
|
-
*/
|
|
45
|
-
signedAuthorization?: SignedAuthorization | null | undefined;
|
|
46
|
-
/**
|
|
47
|
-
* List of possible actions for multicall
|
|
48
|
-
*/
|
|
49
|
-
actions: Array<UserOperation>;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
/** @internal */
|
|
53
|
-
export const MetamaskDelegatorRequestChain$inboundSchema: z.ZodNativeEnum<
|
|
54
|
-
typeof MetamaskDelegatorRequestChain
|
|
55
|
-
> = z.nativeEnum(MetamaskDelegatorRequestChain);
|
|
56
|
-
|
|
57
|
-
/** @internal */
|
|
58
|
-
export const MetamaskDelegatorRequestChain$outboundSchema: z.ZodNativeEnum<
|
|
59
|
-
typeof MetamaskDelegatorRequestChain
|
|
60
|
-
> = MetamaskDelegatorRequestChain$inboundSchema;
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* @internal
|
|
64
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
65
|
-
*/
|
|
66
|
-
export namespace MetamaskDelegatorRequestChain$ {
|
|
67
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$inboundSchema` instead. */
|
|
68
|
-
export const inboundSchema = MetamaskDelegatorRequestChain$inboundSchema;
|
|
69
|
-
/** @deprecated use `MetamaskDelegatorRequestChain$outboundSchema` instead. */
|
|
70
|
-
export const outboundSchema = MetamaskDelegatorRequestChain$outboundSchema;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/** @internal */
|
|
74
|
-
export const MetamaskDelegatorRequest$inboundSchema: z.ZodType<
|
|
75
|
-
MetamaskDelegatorRequest,
|
|
76
|
-
z.ZodTypeDef,
|
|
77
|
-
unknown
|
|
78
|
-
> = z.object({
|
|
79
|
-
chain: MetamaskDelegatorRequestChain$inboundSchema,
|
|
80
|
-
sender: z.string(),
|
|
81
|
-
signed_authorization: z.nullable(SignedAuthorization$inboundSchema)
|
|
82
|
-
.optional(),
|
|
83
|
-
actions: z.array(UserOperation$inboundSchema),
|
|
84
|
-
}).transform((v) => {
|
|
85
|
-
return remap$(v, {
|
|
86
|
-
"signed_authorization": "signedAuthorization",
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
|
|
90
|
-
/** @internal */
|
|
91
|
-
export type MetamaskDelegatorRequest$Outbound = {
|
|
92
|
-
chain: string;
|
|
93
|
-
sender: string;
|
|
94
|
-
signed_authorization?: SignedAuthorization$Outbound | null | undefined;
|
|
95
|
-
actions: Array<UserOperation$Outbound>;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/** @internal */
|
|
99
|
-
export const MetamaskDelegatorRequest$outboundSchema: z.ZodType<
|
|
100
|
-
MetamaskDelegatorRequest$Outbound,
|
|
101
|
-
z.ZodTypeDef,
|
|
102
|
-
MetamaskDelegatorRequest
|
|
103
|
-
> = z.object({
|
|
104
|
-
chain: MetamaskDelegatorRequestChain$outboundSchema,
|
|
105
|
-
sender: z.string(),
|
|
106
|
-
signedAuthorization: z.nullable(SignedAuthorization$outboundSchema)
|
|
107
|
-
.optional(),
|
|
108
|
-
actions: z.array(UserOperation$outboundSchema),
|
|
109
|
-
}).transform((v) => {
|
|
110
|
-
return remap$(v, {
|
|
111
|
-
signedAuthorization: "signed_authorization",
|
|
112
|
-
});
|
|
113
|
-
});
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* @internal
|
|
117
|
-
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
118
|
-
*/
|
|
119
|
-
export namespace MetamaskDelegatorRequest$ {
|
|
120
|
-
/** @deprecated use `MetamaskDelegatorRequest$inboundSchema` instead. */
|
|
121
|
-
export const inboundSchema = MetamaskDelegatorRequest$inboundSchema;
|
|
122
|
-
/** @deprecated use `MetamaskDelegatorRequest$outboundSchema` instead. */
|
|
123
|
-
export const outboundSchema = MetamaskDelegatorRequest$outboundSchema;
|
|
124
|
-
/** @deprecated use `MetamaskDelegatorRequest$Outbound` instead. */
|
|
125
|
-
export type Outbound = MetamaskDelegatorRequest$Outbound;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export function metamaskDelegatorRequestToJSON(
|
|
129
|
-
metamaskDelegatorRequest: MetamaskDelegatorRequest,
|
|
130
|
-
): string {
|
|
131
|
-
return JSON.stringify(
|
|
132
|
-
MetamaskDelegatorRequest$outboundSchema.parse(metamaskDelegatorRequest),
|
|
133
|
-
);
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export function metamaskDelegatorRequestFromJSON(
|
|
137
|
-
jsonString: string,
|
|
138
|
-
): SafeParseResult<MetamaskDelegatorRequest, SDKValidationError> {
|
|
139
|
-
return safeParse(
|
|
140
|
-
jsonString,
|
|
141
|
-
(x) => MetamaskDelegatorRequest$inboundSchema.parse(JSON.parse(x)),
|
|
142
|
-
`Failed to parse 'MetamaskDelegatorRequest' from JSON`,
|
|
143
|
-
);
|
|
144
|
-
}
|