@bosonprotocol/agentic-commerce 1.0.0-alpha.98 → 1.2.2-alpha.2
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/LICENSE +201 -0
- package/README.md +19 -6
- package/dist/boson/goat-sdk-plugin/boson-protocol-plugin.service.d.ts +14 -5
- package/dist/boson/goat-sdk-plugin/boson-protocol-plugin.service.d.ts.map +1 -1
- package/dist/boson/goat-sdk-plugin/boson-protocol-plugin.service.js +26 -0
- package/dist/boson/goat-sdk-plugin/boson-protocol-plugin.service.js.map +1 -1
- package/dist/boson/goat-sdk-plugin/parameters.d.ts +525 -320
- package/dist/boson/goat-sdk-plugin/parameters.d.ts.map +1 -1
- package/dist/boson/goat-sdk-plugin/parameters.js +4 -1
- package/dist/boson/goat-sdk-plugin/parameters.js.map +1 -1
- package/dist/boson/mcp-client/index.d.ts +407 -1
- package/dist/boson/mcp-client/index.d.ts.map +1 -1
- package/dist/boson/mcp-client/index.js +12 -0
- package/dist/boson/mcp-client/index.js.map +1 -1
- package/dist/boson/mcp-server/handlers/accounts.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/accounts.js +30 -2
- package/dist/boson/mcp-server/handlers/accounts.js.map +1 -1
- package/dist/boson/mcp-server/handlers/bosonMetaTx.d.ts +53 -0
- package/dist/boson/mcp-server/handlers/bosonMetaTx.d.ts.map +1 -0
- package/dist/boson/mcp-server/handlers/bosonMetaTx.js +65 -0
- package/dist/boson/mcp-server/handlers/bosonMetaTx.js.map +1 -0
- package/dist/boson/mcp-server/handlers/disputes.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/disputes.js +53 -5
- package/dist/boson/mcp-server/handlers/disputes.js.map +1 -1
- package/dist/boson/mcp-server/handlers/exchanges.d.ts +2 -1
- package/dist/boson/mcp-server/handlers/exchanges.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/exchanges.js +38 -1
- package/dist/boson/mcp-server/handlers/exchanges.js.map +1 -1
- package/dist/boson/mcp-server/handlers/funds.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/funds.js +25 -4
- package/dist/boson/mcp-server/handlers/funds.js.map +1 -1
- package/dist/boson/mcp-server/handlers/metaTx.d.ts +21 -0
- package/dist/boson/mcp-server/handlers/metaTx.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/metaTx.js +13 -6
- package/dist/boson/mcp-server/handlers/metaTx.js.map +1 -1
- package/dist/boson/mcp-server/handlers/offers.d.ts +2 -1
- package/dist/boson/mcp-server/handlers/offers.d.ts.map +1 -1
- package/dist/boson/mcp-server/handlers/offers.js +79 -6
- package/dist/boson/mcp-server/handlers/offers.js.map +1 -1
- package/dist/boson/mcp-server/index.d.ts +1 -0
- package/dist/boson/mcp-server/index.d.ts.map +1 -1
- package/dist/boson/mcp-server/index.js +131 -67
- package/dist/boson/mcp-server/index.js.map +1 -1
- package/dist/boson/mcp-server/validation.d.ts +636 -383
- package/dist/boson/mcp-server/validation.d.ts.map +1 -1
- package/dist/boson/mcp-server/validation.js +263 -100
- package/dist/boson/mcp-server/validation.js.map +1 -1
- package/dist/common/mcp-server/configValidation.d.ts.map +1 -1
- package/dist/common/mcp-server/configValidation.js +25 -10
- package/dist/common/mcp-server/configValidation.js.map +1 -1
- package/dist/common/mcp-server/transactionSigning.d.ts +3 -3
- package/dist/common/mcp-server/transactionSigning.d.ts.map +1 -1
- package/dist/common/mcp-server/transactionSigning.js +89 -34
- package/dist/common/mcp-server/transactionSigning.js.map +1 -1
- package/dist/common/mcp-server/validationUtils.d.ts.map +1 -1
- package/dist/common/mcp-server/validationUtils.js +7 -3
- package/dist/common/mcp-server/validationUtils.js.map +1 -1
- package/package.json +14 -14
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../../../src/boson/mcp-server/validation.ts"],"names":[],"mappings":"AAKA,OAAO,EAAiB,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAMf,CAAC;AAEnC,eAAO,MAAM,0CAA0C;;;;;;;;;;;;gCAMvC,CAAC;AAEjB,eAAO,MAAM,oCAAoC;;;;;;;;;;;;gCAMjC,CAAC;AAEjB,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,yBAAyB,EACzB,4BAA4B,GAC7B,MAAM,+CAA+C,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4CAA4C,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
exports.
|
|
3
|
+
exports.completeExchangeValidation = exports.completeExchangeValidationShape = exports.getDisputeByIdValidation = exports.getDisputeByIdValidationShape = exports.expireEscalatedDisputeValidation = exports.expireEscalatedDisputeValidationShape = exports.refuseEscalatedDisputeValidation = exports.refuseEscalatedDisputeValidationShape = exports.decideDisputeValidation = exports.decideDisputeValidationShape = exports.escalateDisputeValidation = exports.escalateDisputeValidationShape = exports.retractDisputeValidation = exports.retractDisputeValidationShape = exports.raiseDisputeValidation = exports.raiseDisputeValidationShape = exports.expireDisputeBatchValidation = exports.expireDisputeBatchValidationShape = exports.expireDisputeValidation = exports.expireDisputeValidationShape = exports.extendDisputeTimeoutValidation = exports.extendDisputeTimeoutValidationShape = exports.updateSellerValidationSimple = exports.createSellerValidationSimple = exports.updateSellerValidation = exports.createSellerValidation = exports.updateSellerNonMetadataFields = exports.createSellerNonMetadataFields = exports.getFundsResourceValidation = exports.getFundsValidationShape = exports.getFundsValidation = exports.depositFundsValidation = exports.depositFundsValidationShape = exports.withdrawFundsValidation = exports.withdrawFundsValidationShape = exports.validateMetadataValidation = exports.storeBaseMetadataValidation = exports.storeBundleMetadataValidation = exports.createBuyerValidation = exports.fullOfferUnsignedValidation = exports.voidNonListedOfferBatchValidation = exports.voidNonListedOfferValidation = exports.createOfferWithConditionValidation = exports.conditionValidation = exports.storeProductV1MetadataValidation = exports.createOfferValidation = exports.createOfferNonMetadataFields = exports.executionModeValidation = exports.royaltyInfoValidation = exports.contextValidation = void 0;
|
|
4
|
+
exports.signTransactionValidation = exports.signedTransactionValidationZod = exports.signedTransactionValidation = exports.storeBundleItemNftMetadataValidation = exports.storeBundleItemProductV1MetadataValidation = exports.renderContractualAgreementValidation = exports.getTokensValidation = exports.registerAgentValidation = exports.getRegisteredAgentsValidation = exports.getConfigIdsValidation = exports.getAllProductsWithNotVoidedVariantsResourceValidation = exports.getAllProductsWithNotVoidedVariantsValidationShape = exports.getAllProductsWithNotVoidedVariantsValidation = exports.getOffersResourceValidation = exports.getOffersValidationShape = exports.getOffersValidation = exports.getDisputeResolversResourceValidation = exports.getDisputeResolversValidationShape = exports.getDisputeResolversValidation = exports.getSellersByAddressResourceValidation = exports.getSellersByAddressValidationShape = exports.getSellersByAddressValidation = exports.getSellersResourceValidation = exports.getSellersValidationShape = exports.getSellersValidation = exports.getExchangesResourceValidation = exports.getExchangesValidationShape = exports.getExchangesValidation = exports.redeemVoucherValidation = exports.redeemVoucherValidationShape = exports.cancelVoucherValidation = exports.cancelVoucherValidationShape = exports.voidOfferValidation = exports.voidOfferValidationShape = exports.approveExchangeTokenValidation = exports.approveExchangeTokenValidationShape = exports.createOfferAndCommitValidation = exports.commitToBuyerOfferValidation = exports.commitToBuyerOfferValidationShape = exports.commitToOfferValidation = exports.commitToOfferValidationShape = exports.revokeVoucherValidation = exports.revokeVoucherValidationShape = exports.getDisputesResourceValidation = exports.getDisputesValidationShape = exports.getDisputesValidation = exports.createDisputeResolutionProposalValidation = exports.createDisputeResolutionProposalValidationShape = exports.resolveDisputeValidation = exports.resolveDisputeValidationShape = void 0;
|
|
5
|
+
exports.ecdsaSignatureString = exports.signTransactionValidationZod = void 0;
|
|
5
6
|
const bignumber_js_1 = require("@ethersproject/bignumber/lib/bignumber.js");
|
|
6
7
|
const ethers_1 = require("ethers");
|
|
7
8
|
const zod_1 = require("zod");
|
|
@@ -10,58 +11,158 @@ const jsonSchemaToZodShape_js_1 = require("../../common/mcp-server/jsonSchemaToZ
|
|
|
10
11
|
const validationUtils_js_1 = require("../../common/mcp-server/validationUtils.js");
|
|
11
12
|
const resourceParameterTypes_js_1 = require("./resourceParameterTypes.js");
|
|
12
13
|
const schemas_js_1 = require("./schemas.js");
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
min,
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
const bigNumberValidationMessage = "Number values must be safe integers (within Number.MIN_SAFE_INTEGER and Number.MAX_SAFE_INTEGER). Use string or bigint for large numbers.";
|
|
15
|
+
const isBigNumber = (value) => value !== null;
|
|
16
|
+
const bigNumberExt = ({ min, max, } = {}) => {
|
|
17
|
+
const minValue = min !== undefined ? bignumber_js_1.BigNumber.from(min) : undefined;
|
|
18
|
+
const maxValue = max !== undefined ? bignumber_js_1.BigNumber.from(max) : undefined;
|
|
19
|
+
return zod_1.z.string().superRefine((value, ctx) => {
|
|
20
|
+
let parsedValue;
|
|
21
|
+
try {
|
|
22
|
+
parsedValue = bignumber_js_1.BigNumber.from(value);
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
25
|
+
ctx.addIssue({
|
|
26
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
27
|
+
message: bigNumberValidationMessage,
|
|
28
|
+
});
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
if (minValue && parsedValue.lt(minValue)) {
|
|
32
|
+
ctx.addIssue({
|
|
33
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
34
|
+
message: `Value must be greater than or equal to ${minValue.toString()}.`,
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
if (maxValue && parsedValue.gt(maxValue)) {
|
|
38
|
+
ctx.addIssue({
|
|
39
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
40
|
+
message: `Value must be less than or equal to ${maxValue.toString()}.`,
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
};
|
|
18
45
|
const bigNumber = bigNumberExt();
|
|
19
46
|
const metadataUriAndHashFields = zod_1.z.object({
|
|
20
|
-
metadataUri: zod_1.z
|
|
21
|
-
|
|
47
|
+
metadataUri: zod_1.z
|
|
48
|
+
.string()
|
|
49
|
+
.describe("IPFS URI pointing to the offer metadata JSON. Obtain by calling store_product_v1_metadata, store_bundle_metadata, or store_base_metadata."),
|
|
50
|
+
metadataHash: zod_1.z
|
|
51
|
+
.string()
|
|
52
|
+
.describe("Keccak256 hash of the metadata JSON. Returned alongside metadataUri from the store_*_metadata tools."),
|
|
22
53
|
});
|
|
23
54
|
// Shared context validation for all tools
|
|
24
55
|
exports.contextValidation = zod_1.z.object({
|
|
25
56
|
configId: configValidation_js_1.configIdValidation,
|
|
26
|
-
signerAddress: validationUtils_js_1.ethereumAddressValidation,
|
|
57
|
+
signerAddress: validationUtils_js_1.ethereumAddressValidation.describe("Ethereum address that will sign and send this transaction. Must match the wallet whose private key is used in sign_transaction."),
|
|
27
58
|
});
|
|
28
59
|
// Read-only context validation (without signerAddress)
|
|
29
60
|
const readOnlyContextValidation = zod_1.z.object({
|
|
30
61
|
configId: configValidation_js_1.configIdValidation,
|
|
31
62
|
});
|
|
32
|
-
exports.royaltyInfoValidation = zod_1.z
|
|
63
|
+
exports.royaltyInfoValidation = zod_1.z
|
|
64
|
+
.object({
|
|
33
65
|
recipients: zod_1.z
|
|
34
66
|
.array(validationUtils_js_1.ethereumAddressValidation, {
|
|
35
67
|
required_error: "recipients is required",
|
|
36
68
|
})
|
|
37
|
-
.min(0)
|
|
69
|
+
.min(0)
|
|
70
|
+
.describe("Array of addresses receiving resale royalties."),
|
|
38
71
|
bps: zod_1.z
|
|
39
72
|
.array(bigNumberExt({ min: 0, max: 10000 }), {
|
|
40
73
|
required_error: "bps is required",
|
|
41
74
|
})
|
|
42
|
-
.min(0)
|
|
75
|
+
.min(0)
|
|
76
|
+
.describe("Royalty amounts per recipient in basis points (1 bp = 0.01%). Parallel to recipients. Total must not exceed 10000."),
|
|
77
|
+
})
|
|
78
|
+
.superRefine((data, ctx) => {
|
|
79
|
+
if (data.recipients.length !== data.bps.length) {
|
|
80
|
+
ctx.addIssue({
|
|
81
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
82
|
+
path: ["bps"],
|
|
83
|
+
message: "recipients and bps arrays must both be empty or have the same length",
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
const parsedBps = data.bps.map((value) => {
|
|
87
|
+
try {
|
|
88
|
+
return bignumber_js_1.BigNumber.from(value);
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
if (!parsedBps.every(isBigNumber)) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
const totalBps = parsedBps.reduce((sum, value) => sum.add(value), bignumber_js_1.BigNumber.from(0));
|
|
98
|
+
if (totalBps.gt(10000)) {
|
|
99
|
+
ctx.addIssue({
|
|
100
|
+
code: zod_1.z.ZodIssueCode.custom,
|
|
101
|
+
path: ["bps"],
|
|
102
|
+
message: "Total basis points (bps) cannot exceed 10000 (100%)",
|
|
103
|
+
});
|
|
104
|
+
}
|
|
43
105
|
});
|
|
106
|
+
exports.executionModeValidation = zod_1.z
|
|
107
|
+
.enum(["direct", "metaTx"])
|
|
108
|
+
.describe("'direct' = standard on-chain tx (sign_transaction → send_signed_transaction). 'metaTx' = gasless relay via Biconomy (send_meta_transaction). Defaults to 'direct'.");
|
|
44
109
|
exports.createOfferNonMetadataFields = zod_1.z.object({
|
|
45
|
-
exchangeTokenAddress:
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
110
|
+
exchangeTokenAddress: validationUtils_js_1.ethereumAddressValidation
|
|
111
|
+
.optional()
|
|
112
|
+
.describe("ERC-20 token accepted for payment. Omit or use address(0) for native ETH. Call get_supported_tokens for valid values."),
|
|
113
|
+
price: bigNumber.describe("Offer price in the exchange token's smallest unit (wei). Pass as string to avoid precision loss, e.g. '1000000000000000000' = 1 ETH."),
|
|
114
|
+
sellerDeposit: bigNumber.describe("Seller collateral in same unit as price. Released to seller on completion or forfeited on dispute. Pass as string."),
|
|
115
|
+
agentId: bigNumber
|
|
116
|
+
.optional()
|
|
117
|
+
.describe("Optional dACP agent facilitating this offer. Omit or pass '0' if no agent."),
|
|
118
|
+
buyerCancellationPenalty: bigNumber.describe("Amount buyer forfeits on cancel, in same unit as price. Must be <= price. Pass as string."),
|
|
119
|
+
quantityAvailable: zod_1.z
|
|
120
|
+
.number()
|
|
121
|
+
.positive()
|
|
122
|
+
.describe("How many times this offer can be committed to. Must be 1 when creator='BUYER'."),
|
|
123
|
+
validFromDateInMS: zod_1.z
|
|
124
|
+
.number()
|
|
125
|
+
.describe("Unix timestamp in milliseconds when the offer becomes active. Example: Date.now() for immediate."),
|
|
126
|
+
validUntilDateInMS: zod_1.z
|
|
127
|
+
.number()
|
|
128
|
+
.describe("Unix timestamp in milliseconds when the offer can no longer be committed to."),
|
|
129
|
+
voucherRedeemableFromDateInMS: zod_1.z
|
|
130
|
+
.number()
|
|
131
|
+
.describe("Timestamp in ms from which buyer can redeem. Must be >= validFromDateInMS."),
|
|
132
|
+
voucherRedeemableUntilDateInMS: zod_1.z
|
|
133
|
+
.number()
|
|
134
|
+
.describe("Timestamp in ms after which voucher cannot be redeemed. Set to 0 to use voucherValidDurationInMS instead."),
|
|
135
|
+
disputePeriodDurationInMS: zod_1.z
|
|
136
|
+
.number()
|
|
137
|
+
.describe("Duration in ms for buyer to raise a dispute after redeeming. Example: 604800000 = 7 days."),
|
|
138
|
+
voucherValidDurationInMS: zod_1.z
|
|
139
|
+
.number()
|
|
140
|
+
.describe("Voucher is redeemable for this many ms after commit. Set to 0 to use voucherRedeemableUntilDateInMS instead."),
|
|
141
|
+
resolutionPeriodDurationInMS: zod_1.z
|
|
142
|
+
.number()
|
|
143
|
+
.describe("Duration in ms to respond to a resolution proposal before it expires. Example: 259200000 = 3 days."),
|
|
144
|
+
disputeResolverId: zod_1.z
|
|
145
|
+
.string()
|
|
146
|
+
.optional()
|
|
147
|
+
.describe("ID of the dispute resolver for escalated disputes. Call get_dispute_resolvers to list available resolvers."),
|
|
148
|
+
collectionIndex: bigNumber
|
|
149
|
+
.optional()
|
|
150
|
+
.describe("Index of the seller's NFT collection for vouchers. Omit to use default (index 0)."),
|
|
151
|
+
feeLimit: bigNumber
|
|
152
|
+
.optional()
|
|
153
|
+
.describe("Max protocol fee the seller accepts in same token unit. Pass as string."),
|
|
154
|
+
priceType: zod_1.z
|
|
155
|
+
.number()
|
|
156
|
+
.optional()
|
|
157
|
+
.describe("0 = static price, 1 = discovery price (auction)."),
|
|
62
158
|
royaltyInfo: exports.royaltyInfoValidation.optional(),
|
|
63
|
-
creator: zod_1.z
|
|
64
|
-
|
|
159
|
+
creator: zod_1.z
|
|
160
|
+
.enum(["SELLER", "BUYER"])
|
|
161
|
+
.optional()
|
|
162
|
+
.describe("'SELLER' (default) = seller creates offer. 'BUYER' = buyer-initiated offer, quantity must be 1."),
|
|
163
|
+
drMutualizerAddress: validationUtils_js_1.ethereumAddressValidation
|
|
164
|
+
.optional()
|
|
165
|
+
.describe("Optional dispute resolver mutualizer contract address that pools resolution funds."),
|
|
65
166
|
});
|
|
66
167
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
67
168
|
const refineCreateOfferArgs = (data, ctx) => {
|
|
@@ -108,6 +209,7 @@ const refineFullOfferArgs = (data, ctx) => {
|
|
|
108
209
|
};
|
|
109
210
|
exports.createOfferValidation = zod_1.z
|
|
110
211
|
.object({
|
|
212
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
111
213
|
...metadataUriAndHashFields.shape,
|
|
112
214
|
...exports.createOfferNonMetadataFields.shape,
|
|
113
215
|
})
|
|
@@ -121,14 +223,20 @@ exports.storeProductV1MetadataValidation = zod_1.z
|
|
|
121
223
|
})
|
|
122
224
|
.passthrough();
|
|
123
225
|
exports.conditionValidation = zod_1.z.object({
|
|
124
|
-
method: zod_1.z
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
226
|
+
method: zod_1.z
|
|
227
|
+
.number()
|
|
228
|
+
.describe("Gating method: 0=None, 1=Threshold (hold >= threshold tokens), 2=SpecificToken (hold specific token ID)."),
|
|
229
|
+
tokenType: zod_1.z
|
|
230
|
+
.number()
|
|
231
|
+
.describe("Token standard: 0=ERC-20, 1=ERC-721, 2=ERC-1155."),
|
|
232
|
+
tokenAddress: validationUtils_js_1.ethereumAddressValidation.describe("Address of the gate token contract buyers must hold."),
|
|
233
|
+
gatingType: zod_1.z
|
|
234
|
+
.number()
|
|
235
|
+
.describe("0=PerAddress (each address commits once), 1=PerTokenId (each token ID can be used once)."),
|
|
236
|
+
minTokenId: bigNumber.describe("Min token ID (inclusive) for ERC-721/1155 criteria. Pass as string."),
|
|
237
|
+
maxTokenId: bigNumber.describe("Max token ID (inclusive) for ERC-721/1155 criteria. Pass as string."),
|
|
238
|
+
threshold: bigNumber.describe("Minimum token balance required. Pass as string."),
|
|
239
|
+
maxCommits: bigNumber.describe("Max commits per qualifying address or token ID. Pass as string."),
|
|
132
240
|
});
|
|
133
241
|
exports.createOfferWithConditionValidation = zod_1.z
|
|
134
242
|
.object({
|
|
@@ -139,9 +247,12 @@ exports.createOfferWithConditionValidation = zod_1.z
|
|
|
139
247
|
exports.voidNonListedOfferValidation = zod_1.z
|
|
140
248
|
.object({
|
|
141
249
|
condition: exports.conditionValidation.optional(),
|
|
142
|
-
useDepositedFunds: zod_1.z
|
|
143
|
-
|
|
144
|
-
|
|
250
|
+
useDepositedFunds: zod_1.z
|
|
251
|
+
.boolean()
|
|
252
|
+
.optional()
|
|
253
|
+
.describe("If true, use funds already deposited in the protocol treasury instead of transferring from the wallet."),
|
|
254
|
+
sellerId: bigNumber.describe("Numeric ID of the seller entity. Obtain via get_sellers_by_address."),
|
|
255
|
+
buyerId: bigNumber.describe("Numeric ID of the buyer entity. Use '0' for seller-initiated offers."),
|
|
145
256
|
})
|
|
146
257
|
.extend(exports.createOfferValidation.shape)
|
|
147
258
|
.passthrough();
|
|
@@ -164,12 +275,14 @@ exports.voidNonListedOfferBatchValidation = zod_1.z
|
|
|
164
275
|
.passthrough();
|
|
165
276
|
exports.fullOfferUnsignedValidation = zod_1.z
|
|
166
277
|
.object({
|
|
167
|
-
offerCreator: validationUtils_js_1.ethereumAddressValidation,
|
|
168
|
-
committer: validationUtils_js_1.ethereumAddressValidation,
|
|
278
|
+
offerCreator: validationUtils_js_1.ethereumAddressValidation.describe("Ethereum address of the seller creating this non-listed offer. Must match the seller's assistant address."),
|
|
279
|
+
committer: validationUtils_js_1.ethereumAddressValidation.describe("Ethereum address of the buyer committing in the same transaction."),
|
|
169
280
|
collectionIndex: bigNumber.optional(),
|
|
170
281
|
royaltyInfo: exports.royaltyInfoValidation.optional(),
|
|
171
282
|
drMutualizerAddress: validationUtils_js_1.ethereumAddressValidation.optional(),
|
|
172
|
-
conditionalTokenId: bigNumber
|
|
283
|
+
conditionalTokenId: bigNumber
|
|
284
|
+
.optional()
|
|
285
|
+
.describe("Optional token ID of the NFT gate token used by this specific commit (for SpecificToken gating type)."),
|
|
173
286
|
})
|
|
174
287
|
.extend(exports.voidNonListedOfferValidation.shape)
|
|
175
288
|
.passthrough();
|
|
@@ -192,26 +305,35 @@ exports.storeBaseMetadataValidation = zod_1.z
|
|
|
192
305
|
...exports.contextValidation.shape,
|
|
193
306
|
})
|
|
194
307
|
.passthrough();
|
|
308
|
+
exports.validateMetadataValidation = zod_1.z.object({
|
|
309
|
+
metadata: zod_1.z
|
|
310
|
+
.object({
|
|
311
|
+
type: zod_1.z.string().min(1),
|
|
312
|
+
})
|
|
313
|
+
.passthrough(),
|
|
314
|
+
});
|
|
195
315
|
exports.withdrawFundsValidationShape = {
|
|
196
|
-
entityId: bigNumber,
|
|
316
|
+
entityId: bigNumber.describe("Numeric ID of the seller or buyer entity withdrawing funds."),
|
|
197
317
|
list: zod_1.z
|
|
198
318
|
.array(zod_1.z.object({
|
|
199
|
-
tokenAddress: validationUtils_js_1.ethereumAddressValidation,
|
|
200
|
-
amount: bigNumber,
|
|
319
|
+
tokenAddress: validationUtils_js_1.ethereumAddressValidation.describe("ERC-20 token address to withdraw. Use address(0) for native ETH."),
|
|
320
|
+
amount: bigNumber.describe("Amount in token's smallest unit (wei). Use '0' to withdraw full available balance. Pass as string."),
|
|
201
321
|
}))
|
|
202
322
|
.min(1, "List must contain at least 1 item"),
|
|
203
323
|
};
|
|
204
324
|
exports.withdrawFundsValidation = zod_1.z
|
|
205
325
|
.object(exports.withdrawFundsValidationShape)
|
|
206
|
-
.extend(exports.contextValidation.shape)
|
|
326
|
+
.extend(exports.contextValidation.shape)
|
|
327
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
207
328
|
exports.depositFundsValidationShape = {
|
|
208
|
-
entityId: bigNumber,
|
|
209
|
-
tokenAddress: validationUtils_js_1.ethereumAddressValidation,
|
|
210
|
-
amount: bigNumber,
|
|
329
|
+
entityId: bigNumber.describe("Numeric ID of the entity to credit. Must match signerAddress's seller account."),
|
|
330
|
+
tokenAddress: validationUtils_js_1.ethereumAddressValidation.describe("ERC-20 token to deposit. Use address(0) for native ETH."),
|
|
331
|
+
amount: bigNumber.describe("Amount in wei. For ERC-20, approve_exchange_token must be called first. Pass as string."),
|
|
211
332
|
};
|
|
212
333
|
exports.depositFundsValidation = zod_1.z
|
|
213
334
|
.object(exports.depositFundsValidationShape)
|
|
214
|
-
.extend(exports.contextValidation.shape)
|
|
335
|
+
.extend(exports.contextValidation.shape)
|
|
336
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
215
337
|
// Use the centralized resource validation schemas
|
|
216
338
|
// Tool validation (requires only configId for read-only operations)
|
|
217
339
|
exports.getFundsValidation = resourceParameterTypes_js_1.resourceValidationSchemas.funds.extend(readOnlyContextValidation.shape);
|
|
@@ -219,20 +341,29 @@ exports.getFundsValidationShape = exports.getFundsValidation.shape;
|
|
|
219
341
|
// Resource validation (does not require configId and signerAddress)
|
|
220
342
|
exports.getFundsResourceValidation = resourceParameterTypes_js_1.resourceValidationSchemas.funds;
|
|
221
343
|
exports.createSellerNonMetadataFields = zod_1.z.object({
|
|
222
|
-
assistant: validationUtils_js_1.ethereumAddressValidation,
|
|
223
|
-
admin: validationUtils_js_1.ethereumAddressValidation,
|
|
224
|
-
treasury: validationUtils_js_1.ethereumAddressValidation,
|
|
225
|
-
contractUri: zod_1.z
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
344
|
+
assistant: validationUtils_js_1.ethereumAddressValidation.describe("Address authorized for day-to-day operations (create/void offers, revoke vouchers). Typically signerAddress."),
|
|
345
|
+
admin: validationUtils_js_1.ethereumAddressValidation.describe("Address that can update the seller account. Typically signerAddress."),
|
|
346
|
+
treasury: validationUtils_js_1.ethereumAddressValidation.describe("Address that receives proceeds and from which deposits are made. Typically signerAddress."),
|
|
347
|
+
contractUri: zod_1.z
|
|
348
|
+
.string()
|
|
349
|
+
.describe("URI for OpenSea-style storefront metadata. Can be IPFS URI or empty string."),
|
|
350
|
+
royaltyPercentage: bigNumber.describe("Default resale royalty in basis points (0–10000). Applied to all offers unless overridden."),
|
|
351
|
+
authTokenId: bigNumber.describe("NFT token ID used as auth token (e.g. Lens profile ID). Pass '0' if not using auth tokens."),
|
|
352
|
+
authTokenType: zod_1.z
|
|
353
|
+
.number()
|
|
354
|
+
.describe("Auth token type: 0=None, 1=Lens Protocol profile NFT."),
|
|
229
355
|
});
|
|
230
|
-
exports.updateSellerNonMetadataFields = zod_1.z
|
|
356
|
+
exports.updateSellerNonMetadataFields = zod_1.z
|
|
357
|
+
.object({
|
|
358
|
+
id: bigNumber.describe("Numeric ID of the existing seller entity to update. Obtain from get_sellers_by_address."),
|
|
359
|
+
})
|
|
360
|
+
.extend(exports.createSellerNonMetadataFields.omit({
|
|
231
361
|
contractUri: true,
|
|
232
362
|
royaltyPercentage: true,
|
|
233
363
|
}).shape);
|
|
234
364
|
exports.createSellerValidation = zod_1.z
|
|
235
365
|
.object({
|
|
366
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
236
367
|
...(0, jsonSchemaToZodShape_js_1.jsonSchemaToZodShape)(schemas_js_1.sellerSchema),
|
|
237
368
|
...exports.createSellerNonMetadataFields.shape,
|
|
238
369
|
})
|
|
@@ -240,6 +371,7 @@ exports.createSellerValidation = zod_1.z
|
|
|
240
371
|
.passthrough();
|
|
241
372
|
exports.updateSellerValidation = zod_1.z
|
|
242
373
|
.object({
|
|
374
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
243
375
|
...(0, jsonSchemaToZodShape_js_1.jsonSchemaToZodShape)(schemas_js_1.sellerSchema),
|
|
244
376
|
...exports.updateSellerNonMetadataFields.shape,
|
|
245
377
|
})
|
|
@@ -247,6 +379,7 @@ exports.updateSellerValidation = zod_1.z
|
|
|
247
379
|
.passthrough();
|
|
248
380
|
exports.createSellerValidationSimple = zod_1.z
|
|
249
381
|
.object({
|
|
382
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
250
383
|
...(0, jsonSchemaToZodShape_js_1.jsonSchemaToZodShape)(schemas_js_1.sellerSchema),
|
|
251
384
|
...exports.createSellerNonMetadataFields.pick({
|
|
252
385
|
contractUri: true,
|
|
@@ -259,6 +392,7 @@ exports.createSellerValidationSimple = zod_1.z
|
|
|
259
392
|
.passthrough();
|
|
260
393
|
exports.updateSellerValidationSimple = zod_1.z
|
|
261
394
|
.object({
|
|
395
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
262
396
|
...(0, jsonSchemaToZodShape_js_1.jsonSchemaToZodShape)(schemas_js_1.sellerSchema),
|
|
263
397
|
...exports.updateSellerNonMetadataFields.pick({
|
|
264
398
|
authTokenId: true,
|
|
@@ -270,14 +404,16 @@ exports.updateSellerValidationSimple = zod_1.z
|
|
|
270
404
|
.passthrough();
|
|
271
405
|
// Disputes validation schemas
|
|
272
406
|
exports.extendDisputeTimeoutValidationShape = {
|
|
273
|
-
exchangeId: bigNumber,
|
|
274
|
-
newDisputeTimeout: bigNumber,
|
|
407
|
+
exchangeId: bigNumber.describe("Numeric ID of the exchange/dispute to act on. Obtain from get_exchanges or the response of commit_to_offer."),
|
|
408
|
+
newDisputeTimeout: bigNumber.describe("New absolute Unix timestamp in SECONDS (not ms) for the dispute deadline. Must be later than current timeout."),
|
|
275
409
|
};
|
|
276
410
|
exports.extendDisputeTimeoutValidation = zod_1.z
|
|
277
411
|
.object(exports.extendDisputeTimeoutValidationShape)
|
|
278
|
-
.extend(exports.contextValidation.shape)
|
|
412
|
+
.extend(exports.contextValidation.shape)
|
|
413
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
414
|
+
const exchangeIdField = bigNumber.describe("Numeric ID of the exchange/dispute to act on. Obtain from get_exchanges or the response of commit_to_offer.");
|
|
279
415
|
exports.expireDisputeValidationShape = {
|
|
280
|
-
exchangeId:
|
|
416
|
+
exchangeId: exchangeIdField,
|
|
281
417
|
};
|
|
282
418
|
exports.expireDisputeValidation = zod_1.z
|
|
283
419
|
.object(exports.expireDisputeValidationShape)
|
|
@@ -285,74 +421,86 @@ exports.expireDisputeValidation = zod_1.z
|
|
|
285
421
|
exports.expireDisputeBatchValidationShape = {
|
|
286
422
|
exchangeIds: zod_1.z
|
|
287
423
|
.array(bigNumber)
|
|
288
|
-
.min(1, "Exchange IDs array must contain at least 1 item")
|
|
424
|
+
.min(1, "Exchange IDs array must contain at least 1 item")
|
|
425
|
+
.describe("Array of exchange IDs whose dispute period has passed. All must be in 'Disputed' state past their timeout."),
|
|
289
426
|
};
|
|
290
427
|
exports.expireDisputeBatchValidation = zod_1.z
|
|
291
428
|
.object(exports.expireDisputeBatchValidationShape)
|
|
292
429
|
.extend(exports.contextValidation.shape);
|
|
293
430
|
exports.raiseDisputeValidationShape = {
|
|
294
|
-
exchangeId:
|
|
431
|
+
exchangeId: exchangeIdField,
|
|
295
432
|
};
|
|
296
433
|
exports.raiseDisputeValidation = zod_1.z
|
|
297
434
|
.object(exports.raiseDisputeValidationShape)
|
|
298
|
-
.extend(exports.contextValidation.shape)
|
|
435
|
+
.extend(exports.contextValidation.shape)
|
|
436
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
299
437
|
exports.retractDisputeValidationShape = {
|
|
300
|
-
exchangeId:
|
|
438
|
+
exchangeId: exchangeIdField,
|
|
301
439
|
};
|
|
302
440
|
exports.retractDisputeValidation = zod_1.z
|
|
303
441
|
.object(exports.retractDisputeValidationShape)
|
|
304
|
-
.extend(exports.contextValidation.shape)
|
|
442
|
+
.extend(exports.contextValidation.shape)
|
|
443
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
305
444
|
exports.escalateDisputeValidationShape = {
|
|
306
|
-
exchangeId:
|
|
445
|
+
exchangeId: exchangeIdField,
|
|
307
446
|
};
|
|
308
447
|
exports.escalateDisputeValidation = zod_1.z
|
|
309
448
|
.object(exports.escalateDisputeValidationShape)
|
|
310
|
-
.extend(exports.contextValidation.shape)
|
|
449
|
+
.extend(exports.contextValidation.shape)
|
|
450
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
311
451
|
exports.decideDisputeValidationShape = {
|
|
312
|
-
exchangeId:
|
|
313
|
-
buyerPercent: bigNumber,
|
|
452
|
+
exchangeId: exchangeIdField,
|
|
453
|
+
buyerPercent: bigNumber.describe("Percentage of disputed funds to buyer in basis points (0–10000). 10000 = all to buyer, 0 = all to seller."),
|
|
314
454
|
};
|
|
315
455
|
exports.decideDisputeValidation = zod_1.z
|
|
316
456
|
.object(exports.decideDisputeValidationShape)
|
|
317
457
|
.extend(exports.contextValidation.shape);
|
|
318
458
|
exports.refuseEscalatedDisputeValidationShape = {
|
|
319
|
-
exchangeId:
|
|
459
|
+
exchangeId: exchangeIdField,
|
|
320
460
|
};
|
|
321
461
|
exports.refuseEscalatedDisputeValidation = zod_1.z
|
|
322
462
|
.object(exports.refuseEscalatedDisputeValidationShape)
|
|
323
463
|
.extend(exports.contextValidation.shape);
|
|
324
464
|
exports.expireEscalatedDisputeValidationShape = {
|
|
325
|
-
exchangeId:
|
|
465
|
+
exchangeId: exchangeIdField,
|
|
326
466
|
};
|
|
327
467
|
exports.expireEscalatedDisputeValidation = zod_1.z
|
|
328
468
|
.object(exports.expireEscalatedDisputeValidationShape)
|
|
329
469
|
.extend(exports.contextValidation.shape);
|
|
330
470
|
exports.getDisputeByIdValidationShape = {
|
|
331
|
-
disputeId: bigNumber,
|
|
332
|
-
queryVars: zod_1.z
|
|
471
|
+
disputeId: bigNumber.describe("Numeric ID of the dispute to retrieve. Note: disputeId equals the exchangeId of the associated exchange."),
|
|
472
|
+
queryVars: zod_1.z
|
|
473
|
+
.any()
|
|
474
|
+
.optional()
|
|
475
|
+
.describe("Optional additional subgraph query variables for field selection. Leave empty for default fields."),
|
|
333
476
|
};
|
|
334
477
|
exports.getDisputeByIdValidation = zod_1.z
|
|
335
478
|
.object(exports.getDisputeByIdValidationShape)
|
|
336
479
|
.extend(readOnlyContextValidation.shape);
|
|
337
480
|
exports.completeExchangeValidationShape = {
|
|
338
|
-
exchangeId:
|
|
481
|
+
exchangeId: exchangeIdField,
|
|
339
482
|
};
|
|
340
483
|
exports.completeExchangeValidation = zod_1.z
|
|
341
484
|
.object(exports.completeExchangeValidationShape)
|
|
342
485
|
.extend(exports.contextValidation.shape);
|
|
343
486
|
exports.resolveDisputeValidationShape = {
|
|
344
|
-
exchangeId:
|
|
345
|
-
buyerPercentBasisPoints: bigNumber,
|
|
346
|
-
sigR: zod_1.z
|
|
347
|
-
|
|
348
|
-
|
|
487
|
+
exchangeId: exchangeIdField,
|
|
488
|
+
buyerPercentBasisPoints: bigNumber.describe("Agreed buyer share in basis points (0–10000). Both parties must sign the same value. Obtain via create_dispute_resolution_proposal → sign_typed_data."),
|
|
489
|
+
sigR: zod_1.z
|
|
490
|
+
.string()
|
|
491
|
+
.describe("32-byte R component of the ECDSA resolution signature as 0x-prefixed hex. From sign_typed_data output (signatureParams.r)."),
|
|
492
|
+
sigS: zod_1.z
|
|
493
|
+
.string()
|
|
494
|
+
.describe("32-byte S component as 0x-prefixed hex. From sign_typed_data output (signatureParams.s)."),
|
|
495
|
+
sigV: bigNumber.describe("Recovery byte V: 27 or 28. From sign_typed_data output (signatureParams.v)."),
|
|
349
496
|
};
|
|
350
497
|
exports.resolveDisputeValidation = zod_1.z
|
|
351
498
|
.object(exports.resolveDisputeValidationShape)
|
|
352
|
-
.extend(exports.contextValidation.shape)
|
|
499
|
+
.extend(exports.contextValidation.shape)
|
|
500
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
353
501
|
exports.createDisputeResolutionProposalValidationShape = {
|
|
354
|
-
exchangeId:
|
|
355
|
-
buyerPercentBasisPoints: bigNumber,
|
|
502
|
+
exchangeId: exchangeIdField,
|
|
503
|
+
buyerPercentBasisPoints: bigNumber.describe("Proposed percentage of disputed funds for the buyer, 0–10000 (basis points). The counterparty must sign this same value."),
|
|
356
504
|
};
|
|
357
505
|
exports.createDisputeResolutionProposalValidation = zod_1.z
|
|
358
506
|
.object(exports.createDisputeResolutionProposalValidationShape)
|
|
@@ -363,51 +511,66 @@ exports.getDisputesValidationShape = exports.getDisputesValidation.shape;
|
|
|
363
511
|
// Resource validation (does not require configId and signerAddress)
|
|
364
512
|
exports.getDisputesResourceValidation = resourceParameterTypes_js_1.resourceValidationSchemas.disputes;
|
|
365
513
|
exports.revokeVoucherValidationShape = {
|
|
366
|
-
exchangeId:
|
|
514
|
+
exchangeId: exchangeIdField,
|
|
367
515
|
};
|
|
368
516
|
exports.revokeVoucherValidation = zod_1.z
|
|
369
517
|
.object(exports.revokeVoucherValidationShape)
|
|
370
518
|
.extend(exports.contextValidation.shape);
|
|
371
519
|
exports.commitToOfferValidationShape = {
|
|
372
|
-
offerId: bigNumber,
|
|
373
|
-
buyer: validationUtils_js_1.ethereumAddressValidation
|
|
520
|
+
offerId: bigNumber.describe("ID of the active offer to commit to. Creates an exchange and mints a voucher NFT."),
|
|
521
|
+
buyer: validationUtils_js_1.ethereumAddressValidation
|
|
522
|
+
.optional()
|
|
523
|
+
.describe("Optional buyer address if different from signerAddress. When set, executionMode must be 'direct'."),
|
|
374
524
|
};
|
|
375
525
|
exports.commitToOfferValidation = zod_1.z
|
|
376
526
|
.object(exports.commitToOfferValidationShape)
|
|
377
|
-
.extend(exports.contextValidation.shape)
|
|
527
|
+
.extend(exports.contextValidation.shape)
|
|
528
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
378
529
|
exports.commitToBuyerOfferValidationShape = {
|
|
379
|
-
offerId: bigNumber,
|
|
530
|
+
offerId: bigNumber.describe("ID of a buyer-initiated offer (creator='BUYER') to commit to. The seller fulfils the offer."),
|
|
380
531
|
collectionIndex: bigNumber.optional(),
|
|
381
532
|
royaltyInfo: exports.royaltyInfoValidation.optional(),
|
|
382
533
|
drMutualizerAddress: validationUtils_js_1.ethereumAddressValidation.optional(),
|
|
383
534
|
};
|
|
384
535
|
exports.commitToBuyerOfferValidation = zod_1.z
|
|
385
536
|
.object(exports.commitToBuyerOfferValidationShape)
|
|
386
|
-
.extend(exports.contextValidation.shape)
|
|
537
|
+
.extend(exports.contextValidation.shape)
|
|
538
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
387
539
|
exports.createOfferAndCommitValidation = zod_1.z
|
|
388
540
|
.object({
|
|
389
|
-
|
|
541
|
+
executionMode: exports.executionModeValidation.optional(),
|
|
542
|
+
signature: validationUtils_js_1.ecdsaSignatureString.describe("ECDSA signature over the offer typed data. Workflow: sign_full_offer → sign_typed_data → use result here."),
|
|
390
543
|
})
|
|
391
544
|
.extend(exports.fullOfferUnsignedValidation.shape)
|
|
392
545
|
.passthrough();
|
|
546
|
+
exports.approveExchangeTokenValidationShape = {
|
|
547
|
+
exchangeTokenAddress: validationUtils_js_1.ethereumAddressValidation.describe("ERC-20 token contract address to approve for the Boson Protocol diamond."),
|
|
548
|
+
amount: bigNumber.describe("Allowance in wei. Use max uint256 string for unlimited: '115792089237316195423570985008687907853269984665640564039457584007913129639935'."),
|
|
549
|
+
};
|
|
550
|
+
exports.approveExchangeTokenValidation = zod_1.z
|
|
551
|
+
.object(exports.approveExchangeTokenValidationShape)
|
|
552
|
+
.extend(exports.contextValidation.shape)
|
|
553
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
393
554
|
exports.voidOfferValidationShape = {
|
|
394
|
-
offerId: bigNumber,
|
|
555
|
+
offerId: bigNumber.describe("ID of the listed offer to void. Caller must be the seller assistant. Existing exchanges are unaffected."),
|
|
395
556
|
};
|
|
396
557
|
exports.voidOfferValidation = zod_1.z
|
|
397
558
|
.object(exports.voidOfferValidationShape)
|
|
398
|
-
.extend(exports.contextValidation.shape)
|
|
559
|
+
.extend(exports.contextValidation.shape)
|
|
560
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
399
561
|
exports.cancelVoucherValidationShape = {
|
|
400
|
-
exchangeId:
|
|
562
|
+
exchangeId: exchangeIdField,
|
|
401
563
|
};
|
|
402
564
|
exports.cancelVoucherValidation = zod_1.z
|
|
403
565
|
.object(exports.cancelVoucherValidationShape)
|
|
404
566
|
.extend(exports.contextValidation.shape);
|
|
405
567
|
exports.redeemVoucherValidationShape = {
|
|
406
|
-
exchangeId:
|
|
568
|
+
exchangeId: exchangeIdField,
|
|
407
569
|
};
|
|
408
570
|
exports.redeemVoucherValidation = zod_1.z
|
|
409
571
|
.object(exports.redeemVoucherValidationShape)
|
|
410
|
-
.extend(exports.contextValidation.shape)
|
|
572
|
+
.extend(exports.contextValidation.shape)
|
|
573
|
+
.extend({ executionMode: exports.executionModeValidation.optional() });
|
|
411
574
|
// Tool validation (requires only configId for read-only operations)
|
|
412
575
|
exports.getExchangesValidation = resourceParameterTypes_js_1.resourceValidationSchemas.exchanges.extend(readOnlyContextValidation.shape);
|
|
413
576
|
exports.getExchangesValidationShape = exports.getExchangesValidation.shape;
|