tapimo 0.13.0 → 0.14.0
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/dist/App.d.ts +6064 -4829
- package/dist/App.d.ts.map +1 -1
- package/dist/App.js +1 -0
- package/dist/App.js.map +1 -1
- package/dist/Webhooks.js +2 -2
- package/dist/Webhooks.js.map +1 -1
- package/dist/admin/App.d.ts +1008 -917
- package/dist/admin/App.d.ts.map +1 -1
- package/dist/admin/apps/earn-vaults.d.ts +48 -0
- package/dist/admin/apps/earn-vaults.d.ts.map +1 -1
- package/dist/admin/apps/earn-vaults.js +2 -1
- package/dist/admin/apps/earn-vaults.js.map +1 -1
- package/dist/admin/apps/organizations.d.ts +92 -3
- package/dist/admin/apps/organizations.d.ts.map +1 -1
- package/dist/admin/apps/organizations.js +69 -7
- package/dist/admin/apps/organizations.js.map +1 -1
- package/dist/admin/apps/verified-tokens.d.ts +74 -74
- package/dist/admin/ui.generated.d.ts +1 -1
- package/dist/admin/ui.generated.js +69 -69
- package/dist/admin/ui.generated.js.map +1 -1
- package/dist/apps/Zones.d.ts +12 -12
- package/dist/apps/Zones.js +3 -3
- package/dist/apps/data/App.d.ts +2909 -2523
- package/dist/apps/data/App.d.ts.map +1 -1
- package/dist/apps/data/App.js +11 -6
- package/dist/apps/data/App.js.map +1 -1
- package/dist/apps/data/routes/addresses.d.ts +22 -22
- package/dist/apps/data/routes/earn.d.ts +183 -7
- package/dist/apps/data/routes/earn.d.ts.map +1 -1
- package/dist/apps/data/routes/earn.js +434 -75
- package/dist/apps/data/routes/earn.js.map +1 -1
- package/dist/apps/data/routes/exchanges.d.ts +15 -0
- package/dist/apps/data/routes/exchanges.d.ts.map +1 -1
- package/dist/apps/data/routes/exchanges.js +180 -114
- package/dist/apps/data/routes/exchanges.js.map +1 -1
- package/dist/apps/data/routes/fee-amm.d.ts.map +1 -1
- package/dist/apps/data/routes/fee-amm.js +18 -19
- package/dist/apps/data/routes/fee-amm.js.map +1 -1
- package/dist/apps/data/routes/tokens.d.ts +93 -93
- package/dist/apps/data/routes/transfers.d.ts +12 -12
- package/dist/apps/data/routes/valuation.d.ts +30 -30
- package/dist/apps/data/routes/verified-tokens.d.ts +5 -5
- package/dist/apps/data/routes/webhooks.d.ts +805 -102
- package/dist/apps/data/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/data/routes/webhooks.js +47 -5
- package/dist/apps/data/routes/webhooks.js.map +1 -1
- package/dist/apps/funding/App.d.ts +456 -45
- package/dist/apps/funding/App.d.ts.map +1 -1
- package/dist/apps/funding/App.js +1 -1
- package/dist/apps/funding/App.js.map +1 -1
- package/dist/apps/funding/routes/deposit-addresses.d.ts +17 -17
- package/dist/apps/funding/routes/deposit-addresses.d.ts.map +1 -1
- package/dist/apps/funding/routes/deposit-addresses.js +1 -1
- package/dist/apps/funding/routes/deposit-addresses.js.map +1 -1
- package/dist/apps/funding/routes/transfers.d.ts +654 -73
- package/dist/apps/funding/routes/transfers.d.ts.map +1 -1
- package/dist/apps/funding/routes/transfers.js +211 -5
- package/dist/apps/funding/routes/transfers.js.map +1 -1
- package/dist/apps/management/App.d.ts +831 -387
- package/dist/apps/management/App.d.ts.map +1 -1
- package/dist/apps/management/Billing.d.ts +1 -1
- package/dist/apps/management/Billing.d.ts.map +1 -1
- package/dist/apps/management/Billing.js +17 -1
- package/dist/apps/management/Billing.js.map +1 -1
- package/dist/apps/management/routes/api-keys.d.ts +76 -76
- package/dist/apps/management/routes/billing.d.ts +76 -76
- package/dist/apps/management/routes/faucet.d.ts +12 -12
- package/dist/apps/management/routes/invitations.d.ts +24 -24
- package/dist/apps/management/routes/invite-links.d.ts +46 -46
- package/dist/apps/management/routes/members.d.ts +46 -46
- package/dist/apps/management/routes/orgs.d.ts +20 -20
- package/dist/apps/management/routes/projects.d.ts +44 -44
- package/dist/apps/management/routes/usage.d.ts +32 -32
- package/dist/apps/management/routes/verified-token-requests.d.ts +16 -16
- package/dist/apps/management/routes/webhooks.d.ts +707 -57
- package/dist/apps/management/routes/webhooks.d.ts.map +1 -1
- package/dist/apps/management/routes/webhooks.js +21 -21
- package/dist/apps/management/routes/webhooks.js.map +1 -1
- package/dist/apps/relay/App.d.ts.map +1 -1
- package/dist/apps/relay/App.js +115 -23
- package/dist/apps/relay/App.js.map +1 -1
- package/dist/apps/relay/Sponsorships.d.ts.map +1 -1
- package/dist/apps/relay/Sponsorships.js +27 -1
- package/dist/apps/relay/Sponsorships.js.map +1 -1
- package/dist/db/Db.d.ts.map +1 -1
- package/dist/db/Db.js +22 -0
- package/dist/db/Db.js.map +1 -1
- package/dist/db/Schema.d.ts +8 -3
- package/dist/db/Schema.d.ts.map +1 -1
- package/dist/db/Schema.js +16 -1
- package/dist/db/Schema.js.map +1 -1
- package/dist/db/tables/fundingTransferTransactions.d.ts +38 -0
- package/dist/db/tables/fundingTransferTransactions.d.ts.map +1 -1
- package/dist/db/tables/fundingTransferTransactions.js +44 -3
- package/dist/db/tables/fundingTransferTransactions.js.map +1 -1
- package/dist/db/tables/fundingTransfers.d.ts +17 -0
- package/dist/db/tables/fundingTransfers.d.ts.map +1 -1
- package/dist/db/tables/fundingTransfers.js +21 -0
- package/dist/db/tables/fundingTransfers.js.map +1 -1
- package/dist/db/tables/organizations.d.ts +24 -0
- package/dist/db/tables/organizations.d.ts.map +1 -1
- package/dist/db/tables/organizations.js +27 -0
- package/dist/db/tables/organizations.js.map +1 -1
- package/dist/db/tables/projects.d.ts +25 -1
- package/dist/db/tables/projects.d.ts.map +1 -1
- package/dist/db/tables/projects.js +26 -0
- package/dist/db/tables/projects.js.map +1 -1
- package/dist/db/tables/sponsoredTransactions.d.ts +44 -0
- package/dist/db/tables/sponsoredTransactions.d.ts.map +1 -1
- package/dist/db/tables/sponsoredTransactions.js +146 -13
- package/dist/db/tables/sponsoredTransactions.js.map +1 -1
- package/dist/db/tables/webhookSubscriptions.d.ts +10 -6
- package/dist/db/tables/webhookSubscriptions.d.ts.map +1 -1
- package/dist/db/tables/webhookSubscriptions.js +9 -6
- package/dist/db/tables/webhookSubscriptions.js.map +1 -1
- package/dist/internal/EarnVaults.js +5 -5
- package/dist/internal/EarnVaults.js.map +1 -1
- package/dist/internal/Log.d.ts +1 -1
- package/dist/internal/Log.d.ts.map +1 -1
- package/dist/internal/Log.js.map +1 -1
- package/dist/internal/Viem.d.ts +16 -1
- package/dist/internal/Viem.d.ts.map +1 -1
- package/dist/internal/Viem.js +12 -2
- package/dist/internal/Viem.js.map +1 -1
- package/dist/internal/funding/DepositWebhook.d.ts.map +1 -1
- package/dist/internal/funding/DepositWebhook.js +2 -1
- package/dist/internal/funding/DepositWebhook.js.map +1 -1
- package/dist/internal/funding/Evidence.d.ts.map +1 -1
- package/dist/internal/funding/Evidence.js +2 -10
- package/dist/internal/funding/Evidence.js.map +1 -1
- package/dist/internal/funding/Provider.d.ts +40 -0
- package/dist/internal/funding/Provider.d.ts.map +1 -1
- package/dist/internal/funding/Provider.js +5 -0
- package/dist/internal/funding/Provider.js.map +1 -1
- package/dist/internal/funding/SourceObservation.d.ts.map +1 -1
- package/dist/internal/funding/SourceObservation.js +5 -7
- package/dist/internal/funding/SourceObservation.js.map +1 -1
- package/dist/internal/funding/Transfer.d.ts +101 -6
- package/dist/internal/funding/Transfer.d.ts.map +1 -1
- package/dist/internal/funding/Transfer.js +162 -34
- package/dist/internal/funding/Transfer.js.map +1 -1
- package/dist/internal/funding/TransferReconciliation.d.ts +52 -0
- package/dist/internal/funding/TransferReconciliation.d.ts.map +1 -0
- package/dist/internal/funding/TransferReconciliation.js +192 -0
- package/dist/internal/funding/TransferReconciliation.js.map +1 -0
- package/dist/internal/funding/TransferWebhook.d.ts +21 -0
- package/dist/internal/funding/TransferWebhook.d.ts.map +1 -0
- package/dist/internal/funding/TransferWebhook.js +43 -0
- package/dist/internal/funding/TransferWebhook.js.map +1 -0
- package/dist/internal/funding/index.d.ts +1 -0
- package/dist/internal/funding/index.d.ts.map +1 -1
- package/dist/internal/funding/index.js +1 -0
- package/dist/internal/funding/index.js.map +1 -1
- package/dist/internal/funding/providers/relay.d.ts.map +1 -1
- package/dist/internal/funding/providers/relay.js +3 -12
- package/dist/internal/funding/providers/relay.js.map +1 -1
- package/dist/internal/funding/providers/stargate.d.ts +99 -0
- package/dist/internal/funding/providers/stargate.d.ts.map +1 -1
- package/dist/internal/funding/providers/stargate.js +337 -35
- package/dist/internal/funding/providers/stargate.js.map +1 -1
- package/dist/internal/webhookDestinations/slack.d.ts.map +1 -1
- package/dist/internal/webhookDestinations/slack.js +16 -0
- package/dist/internal/webhookDestinations/slack.js.map +1 -1
- package/package.json +1 -1
- package/src/App.ts +1 -0
- package/src/Client.test-d.ts +83 -2
- package/src/Webhooks.ts +2 -2
- package/src/admin/apps/earn-vaults.ts +2 -1
- package/src/admin/apps/organizations.test.ts +53 -1
- package/src/admin/apps/organizations.ts +90 -5
- package/src/admin/ui/src/lib/organizations.test.ts +112 -1
- package/src/admin/ui/src/lib/organizations.ts +55 -0
- package/src/admin/ui/src/routes/organizations_.$orgId.tsx +116 -0
- package/src/admin/ui.generated.ts +69 -69
- package/src/apps/Zones.test.ts +3 -3
- package/src/apps/Zones.ts +3 -3
- package/src/apps/composition.test.ts +1 -0
- package/src/apps/data/App.ts +15 -6
- package/src/apps/data/routes/earn.test.ts +369 -14
- package/src/apps/data/routes/earn.ts +548 -79
- package/src/apps/data/routes/exchanges.test.ts +740 -15
- package/src/apps/data/routes/exchanges.ts +954 -753
- package/src/apps/data/routes/fee-amm.ts +17 -18
- package/src/apps/data/routes/webhooks.test.ts +21 -5
- package/src/apps/data/routes/webhooks.ts +63 -8
- package/src/apps/funding/App.ts +12 -2
- package/src/apps/funding/routes/deposit-addresses.test.ts +4 -4
- package/src/apps/funding/routes/deposit-addresses.ts +2 -2
- package/src/apps/funding/routes/transfers.test.ts +510 -19
- package/src/apps/funding/routes/transfers.ts +271 -5
- package/src/apps/management/Billing.ts +18 -5
- package/src/apps/management/routes/webhooks.test.ts +3 -3
- package/src/apps/management/routes/webhooks.ts +24 -25
- package/src/apps/relay/App.test.ts +212 -1
- package/src/apps/relay/App.ts +158 -29
- package/src/apps/relay/Sponsorships.ts +24 -1
- package/src/db/Db.ts +35 -0
- package/src/db/Schema.ts +17 -2
- package/src/db/tables/fundingTransferTransactions.test.ts +43 -0
- package/src/db/tables/fundingTransferTransactions.ts +79 -3
- package/src/db/tables/fundingTransfers.test.ts +26 -0
- package/src/db/tables/fundingTransfers.ts +36 -0
- package/src/db/tables/organizations.test.ts +41 -0
- package/src/db/tables/organizations.ts +49 -0
- package/src/db/tables/projects.test.ts +55 -0
- package/src/db/tables/projects.ts +46 -1
- package/src/db/tables/sponsoredTransactions.test.ts +338 -0
- package/src/db/tables/sponsoredTransactions.ts +197 -13
- package/src/db/tables/webhookSubscriptions.ts +18 -11
- package/src/internal/EarnVaults.ts +5 -5
- package/src/internal/Log.test-d.ts +2 -0
- package/src/internal/Log.ts +2 -0
- package/src/internal/Viem.ts +39 -3
- package/src/internal/Webhooks.test.ts +45 -0
- package/src/internal/funding/DepositWebhook.ts +2 -1
- package/src/internal/funding/Evidence.ts +2 -13
- package/src/internal/funding/Provider.ts +43 -0
- package/src/internal/funding/SourceObservation.ts +5 -9
- package/src/internal/funding/Transfer.test.ts +155 -0
- package/src/internal/funding/Transfer.ts +254 -37
- package/src/internal/funding/TransferReconciliation.test.ts +147 -0
- package/src/internal/funding/TransferReconciliation.ts +264 -0
- package/src/internal/funding/TransferWebhook.test.ts +128 -0
- package/src/internal/funding/TransferWebhook.ts +67 -0
- package/src/internal/funding/index.test.ts +1 -0
- package/src/internal/funding/index.ts +1 -0
- package/src/internal/funding/providers/relay.ts +3 -15
- package/src/internal/funding/providers/stargate.test.ts +169 -4
- package/src/internal/funding/providers/stargate.ts +498 -51
- package/src/internal/webhookDestinations/slack.ts +15 -0
|
@@ -157,7 +157,7 @@ export var schema;
|
|
|
157
157
|
* are absent on the base (no-`include`) response and best-effort when
|
|
158
158
|
* requested (a token whose metadata is unavailable keeps just `address`).
|
|
159
159
|
*/
|
|
160
|
-
schema.PairToken = Schema.describe(z.object({
|
|
160
|
+
schema.PairToken = OpenApi.component(Schema.describe(z.object({
|
|
161
161
|
address: Schema.tokenAddress(Tokens.tokenExample.address).check(z.describe('TIP-20 token contract address — the `0x`-prefixed 20-byte identifier for this token.'), z.meta({ examples: [Tokens.tokenExample.address] })),
|
|
162
162
|
currency: z
|
|
163
163
|
.optional(z.string())
|
|
@@ -177,14 +177,13 @@ export var schema;
|
|
|
177
177
|
verified: z
|
|
178
178
|
.optional(z.boolean())
|
|
179
179
|
.check(z.describe('Whether Tempo has verified this token metadata.'), z.meta({ examples: [true] })),
|
|
180
|
-
}), 'One side of a trading pair (with metadata when requested via `include=tokens`).');
|
|
181
|
-
|
|
182
|
-
const ValuedAmount = z.extend(Schema.TokenAmount, {
|
|
180
|
+
}), 'One side of a trading pair (with metadata when requested via `include=tokens`).'), 'ExchangePairToken');
|
|
181
|
+
const ValuedAmount = OpenApi.component(Schema.describe(z.extend(Schema.TokenAmount, {
|
|
183
182
|
valuation: z
|
|
184
183
|
.optional(z.nullable(Valuation.schema.Value))
|
|
185
184
|
.check(z.describe('The amount’s nominal value in the requested `valuation.currency`. `null` when the token is ' +
|
|
186
185
|
'unverified, its display currency has no rate, or rates were unavailable.')),
|
|
187
|
-
});
|
|
186
|
+
}), 'A token amount carrying its nominal value in the requested denomination.'), 'ExchangeValuedAmount');
|
|
188
187
|
/** Schemas for creating an executable exchange quote. */
|
|
189
188
|
let createQuote;
|
|
190
189
|
(function (createQuote) {
|
|
@@ -210,7 +209,7 @@ export var schema;
|
|
|
210
209
|
})
|
|
211
210
|
.check(z.describe('Query parameters for creating an exchange quote.'));
|
|
212
211
|
/** Quote request with one pinned side and caller-selected slippage. */
|
|
213
|
-
createQuote.Request = z
|
|
212
|
+
createQuote.Request = OpenApi.component(z
|
|
214
213
|
.strictObject({
|
|
215
214
|
account: z
|
|
216
215
|
.optional(Schema.Address)
|
|
@@ -227,26 +226,26 @@ export var schema;
|
|
|
227
226
|
})
|
|
228
227
|
.check(z.refine((request) => request.sourceToken !== request.destinationToken, {
|
|
229
228
|
error: 'Source and destination tokens must differ.',
|
|
230
|
-
}), z.describe('Request for an executable quote from the configured exchange providers.'));
|
|
229
|
+
}), z.describe('Request for an executable quote from the configured exchange providers.')), 'CreateExchangeQuoteRequest');
|
|
231
230
|
/** One call in the unsigned Tempo transaction plan. */
|
|
232
|
-
createQuote.Call = z
|
|
231
|
+
createQuote.Call = OpenApi.component(z
|
|
233
232
|
.object({
|
|
234
233
|
data: Schema.Hex.check(z.describe('ABI-encoded call data.'), z.meta({ examples: ['0x095ea7b3'] })),
|
|
235
234
|
to: Schema.Address.check(z.describe('Contract or precompile that receives the call.'), z.meta({ examples: [Addresses.stablecoinDex] })),
|
|
236
235
|
value: Schema.Quantity.check(z.describe('Native token value sent with the call.'), z.meta({ examples: ['0x0'] })),
|
|
237
236
|
})
|
|
238
|
-
.check(z.describe('One unsigned call in the Tempo transaction plan.'));
|
|
237
|
+
.check(z.describe('One unsigned call in the Tempo transaction plan.')), 'ExchangeQuoteCall');
|
|
239
238
|
const QuoteToken = Schema.describe(z.partial(z.omit(Tokens.schema.Token, { id: true }), {
|
|
240
239
|
logoUri: true,
|
|
241
240
|
verified: true,
|
|
242
241
|
}), 'A token referenced by an exchange quote, with RPC metadata and optional enrichments.');
|
|
243
|
-
const DestinationToken = z.extend(QuoteToken, {
|
|
242
|
+
const DestinationToken = OpenApi.component(Schema.describe(z.extend(QuoteToken, {
|
|
244
243
|
address: DestinationTokenAddress.check(z.describe('TIP-20 token the swap receives.')),
|
|
245
|
-
});
|
|
246
|
-
const SourceToken = z.extend(QuoteToken, {
|
|
244
|
+
}), 'The token received by an exchange quote.'), 'ExchangeQuoteDestinationToken');
|
|
245
|
+
const SourceToken = OpenApi.component(Schema.describe(z.extend(QuoteToken, {
|
|
247
246
|
address: SourceTokenAddress.check(z.describe('TIP-20 token the swap spends.')),
|
|
248
|
-
});
|
|
249
|
-
createQuote.Transaction = z
|
|
247
|
+
}), 'The token spent by an exchange quote.'), 'ExchangeQuoteSourceToken');
|
|
248
|
+
createQuote.Transaction = OpenApi.component(z
|
|
250
249
|
.object({
|
|
251
250
|
calls: z.array(createQuote.Call).check(z.minLength(1), z.describe('Calls to execute in order.'), z.meta({
|
|
252
251
|
examples: [
|
|
@@ -262,17 +261,17 @@ export var schema;
|
|
|
262
261
|
})),
|
|
263
262
|
chainId: Schema.ChainId.check(z.describe('Tempo chain where these calls execute.')),
|
|
264
263
|
})
|
|
265
|
-
.check(z.describe('Unsigned Tempo transaction plan.'));
|
|
264
|
+
.check(z.describe('Unsigned Tempo transaction plan.')), 'ExchangeQuoteTransaction');
|
|
266
265
|
/** Response-level valuation rate provenance. */
|
|
267
|
-
createQuote.Meta = z
|
|
266
|
+
createQuote.Meta = OpenApi.component(z
|
|
268
267
|
.object({
|
|
269
268
|
valuation: z
|
|
270
269
|
.optional(Valuation.schema.Pricing)
|
|
271
270
|
.check(z.describe('Rate provenance for amount valuations. Present when conversion rates were consulted.')),
|
|
272
271
|
})
|
|
273
|
-
.check(z.describe('Response-level resources attached to this quote.'));
|
|
272
|
+
.check(z.describe('Response-level resources attached to this quote.')), 'ExchangeQuoteMeta');
|
|
274
273
|
/** Provider-neutral EIP-712 payload to sign before finalizing a quote. */
|
|
275
|
-
createQuote.TypedData = z
|
|
274
|
+
createQuote.TypedData = OpenApi.component(z
|
|
276
275
|
.object({
|
|
277
276
|
domain: z.record(z.string(), z.unknown()).check(z.describe('EIP-712 signing domain.'), z.meta({
|
|
278
277
|
examples: [
|
|
@@ -324,7 +323,7 @@ export var schema;
|
|
|
324
323
|
],
|
|
325
324
|
})),
|
|
326
325
|
})
|
|
327
|
-
.check(z.describe('EIP-712 payload the wallet must sign before execution can continue.'));
|
|
326
|
+
.check(z.describe('EIP-712 payload the wallet must sign before execution can continue.')), 'ExchangeQuoteTypedData');
|
|
328
327
|
const Provider = z
|
|
329
328
|
.string()
|
|
330
329
|
.check(z.describe('Provider selected for this route.'), z.meta({ examples: ['nativeDex'] }));
|
|
@@ -332,20 +331,23 @@ export var schema;
|
|
|
332
331
|
gasEstimate: Schema.DecimalString.check(z.describe('Estimated network fee in the chain native token’s base unit.'), z.meta({ examples: ['150000000000000'] })),
|
|
333
332
|
provider: Provider,
|
|
334
333
|
};
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
],
|
|
334
|
+
const Approval = OpenApi.component(z
|
|
335
|
+
.object({
|
|
336
|
+
calls: z.array(createQuote.Call).check(z.minLength(1), z.describe('Approval calls to confirm before requesting a fresh quote.'), z.meta({
|
|
337
|
+
examples: [
|
|
338
|
+
[
|
|
339
|
+
{
|
|
340
|
+
data: exampleApprovalCall.data,
|
|
341
|
+
to: exampleApprovalCall.to,
|
|
342
|
+
value: '0x0',
|
|
343
|
+
},
|
|
346
344
|
],
|
|
347
|
-
|
|
348
|
-
}),
|
|
345
|
+
],
|
|
346
|
+
})),
|
|
347
|
+
})
|
|
348
|
+
.check(z.describe('Token approval calls required before requesting a fresh quote.')), 'ExchangeQuoteApproval');
|
|
349
|
+
const ApprovalRequired = {
|
|
350
|
+
approval: Approval,
|
|
349
351
|
status: z
|
|
350
352
|
.literal('approvalRequired')
|
|
351
353
|
.check(z.describe('Confirm the approvals, then request a fresh quote.'), z.meta({ examples: ['approvalRequired'] })),
|
|
@@ -366,44 +368,63 @@ export var schema;
|
|
|
366
368
|
typedData: createQuote.TypedData,
|
|
367
369
|
};
|
|
368
370
|
const ExactSource = {
|
|
369
|
-
destinationAmount: ValuedAmount
|
|
370
|
-
destinationAmountMin: ValuedAmount
|
|
371
|
+
destinationAmount: ValuedAmount,
|
|
372
|
+
destinationAmountMin: ValuedAmount,
|
|
371
373
|
destinationToken: DestinationToken,
|
|
372
374
|
meta: z.optional(createQuote.Meta).check(z.describe('Valuation rate provenance for this quote.')),
|
|
373
375
|
mode: z
|
|
374
376
|
.literal('exactSource')
|
|
375
377
|
.check(z.describe('The source amount is fixed and the destination has a minimum.'), z.meta({ examples: ['exactSource'] })),
|
|
376
|
-
sourceAmount: ValuedAmount
|
|
377
|
-
sourceToken: SourceToken
|
|
378
|
+
sourceAmount: ValuedAmount,
|
|
379
|
+
sourceToken: SourceToken,
|
|
378
380
|
};
|
|
379
381
|
const ExactDestination = {
|
|
380
|
-
destinationAmount: ValuedAmount
|
|
381
|
-
destinationToken: DestinationToken
|
|
382
|
+
destinationAmount: ValuedAmount,
|
|
383
|
+
destinationToken: DestinationToken,
|
|
382
384
|
meta: z.optional(createQuote.Meta).check(z.describe('Valuation rate provenance for this quote.')),
|
|
383
385
|
mode: z
|
|
384
386
|
.literal('exactDestination')
|
|
385
387
|
.check(z.describe('The destination amount is fixed and the source has a maximum.'), z.meta({ examples: ['exactDestination'] })),
|
|
386
|
-
sourceAmount: ValuedAmount
|
|
387
|
-
sourceAmountMax: ValuedAmount
|
|
388
|
+
sourceAmount: ValuedAmount,
|
|
389
|
+
sourceAmountMax: ValuedAmount,
|
|
388
390
|
sourceToken: SourceToken,
|
|
389
391
|
};
|
|
392
|
+
const ExactSourceApprovalRequired = OpenApi.component(z
|
|
393
|
+
.object({ ...ApprovalRequired, ...ExactSource, ...Quote })
|
|
394
|
+
.check(z.describe('An exact-source quote that requires token approval.')), 'ExchangeQuoteExactSourceApprovalRequired');
|
|
395
|
+
const ExactSourceReady = OpenApi.component(z
|
|
396
|
+
.object({ ...ExactSource, ...Quote, ...Ready })
|
|
397
|
+
.check(z.describe('An exact-source quote ready to execute.')), 'ExchangeQuoteExactSourceReady');
|
|
398
|
+
const ExactSourceSignatureRequired = OpenApi.component(z
|
|
399
|
+
.object({ ...ExactSource, ...Quote, ...SignatureRequired })
|
|
400
|
+
.check(z.describe('An exact-source quote that requires a signature.')), 'ExchangeQuoteExactSourceSignatureRequired');
|
|
401
|
+
const ExactDestinationApprovalRequired = OpenApi.component(z
|
|
402
|
+
.object({ ...ApprovalRequired, ...ExactDestination, ...Quote })
|
|
403
|
+
.check(z.describe('An exact-destination quote that requires token approval.')), 'ExchangeQuoteExactDestinationApprovalRequired');
|
|
404
|
+
const ExactDestinationReady = OpenApi.component(z
|
|
405
|
+
.object({ ...ExactDestination, ...Quote, ...Ready })
|
|
406
|
+
.check(z.describe('An exact-destination quote ready to execute.')), 'ExchangeQuoteExactDestinationReady');
|
|
407
|
+
const ExactDestinationSignatureRequired = OpenApi.component(z
|
|
408
|
+
.object({ ...ExactDestination, ...Quote, ...SignatureRequired })
|
|
409
|
+
.check(z.describe('An exact-destination quote that requires a signature.')), 'ExchangeQuoteExactDestinationSignatureRequired');
|
|
390
410
|
/** Provider-neutral quote and the action needed to execute it. */
|
|
391
|
-
createQuote.Response = z
|
|
411
|
+
createQuote.Response = OpenApi.component(z
|
|
392
412
|
.union([
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
413
|
+
ExactSourceApprovalRequired,
|
|
414
|
+
ExactSourceReady,
|
|
415
|
+
ExactSourceSignatureRequired,
|
|
416
|
+
ExactDestinationApprovalRequired,
|
|
417
|
+
ExactDestinationReady,
|
|
418
|
+
ExactDestinationSignatureRequired,
|
|
399
419
|
])
|
|
400
|
-
.check(z.describe('Provider-neutral exchange quote with its next execution action.'));
|
|
420
|
+
.check(z.describe('Provider-neutral exchange quote with its next execution action.')), 'ExchangeQuote');
|
|
401
421
|
})(createQuote = schema.createQuote || (schema.createQuote = {}));
|
|
402
422
|
/** Schemas for finishing a quote after a provider-requested signature. */
|
|
403
423
|
let executeQuote;
|
|
404
424
|
(function (executeQuote) {
|
|
405
425
|
/** Signed continuation request. */
|
|
406
|
-
executeQuote.Request =
|
|
426
|
+
executeQuote.Request = OpenApi.component(z
|
|
427
|
+
.strictObject({
|
|
407
428
|
account: Schema.Address.check(z.describe('Wallet that signed and will execute the swap.'), z.meta({ examples: ['0x1111111111111111111111111111111111111111'] })),
|
|
408
429
|
continuation: z
|
|
409
430
|
.string()
|
|
@@ -412,14 +433,17 @@ export var schema;
|
|
|
412
433
|
.string()
|
|
413
434
|
.check(z.minLength(1), z.describe('Provider that issued the continuation.'), z.meta({ examples: ['uniswap'] })),
|
|
414
435
|
signature: Schema.Hex.check(z.refine((value) => value.length === 132, { error: 'Signature must be 65 bytes.' }), z.describe('65-byte EIP-712 signature requested by the quote.'), z.meta({ examples: [`0x${'11'.repeat(65)}`] })),
|
|
415
|
-
})
|
|
436
|
+
})
|
|
437
|
+
.check(z.describe('Request to finalize a provider quote after signing its typed data.')), 'FinalizeExchangeQuoteRequest');
|
|
416
438
|
/** Final transaction plan. */
|
|
417
|
-
executeQuote.Response =
|
|
439
|
+
executeQuote.Response = OpenApi.component(z
|
|
440
|
+
.object({
|
|
418
441
|
provider: z
|
|
419
442
|
.string()
|
|
420
443
|
.check(z.describe('Provider that built the transaction.'), z.meta({ examples: ['uniswap'] })),
|
|
421
444
|
transaction: createQuote.Transaction,
|
|
422
|
-
})
|
|
445
|
+
})
|
|
446
|
+
.check(z.describe('Final unsigned transaction plan for a signed provider quote.')), 'FinalizedExchangeQuote');
|
|
423
447
|
})(executeQuote = schema.executeQuote || (schema.executeQuote = {}));
|
|
424
448
|
/** Schemas for the getPairs operation. */
|
|
425
449
|
let getPairs;
|
|
@@ -453,9 +477,9 @@ export var schema;
|
|
|
453
477
|
})
|
|
454
478
|
.check(...Schema.pageChecks(), z.describe('Filters, pagination, and sorting options for listing exchange trading pairs.'));
|
|
455
479
|
/** A single trading pair on the stablecoin DEX. */
|
|
456
|
-
getPairs.Pair = z
|
|
480
|
+
getPairs.Pair = OpenApi.component(z
|
|
457
481
|
.object({
|
|
458
|
-
base: schema.PairToken
|
|
482
|
+
base: schema.PairToken,
|
|
459
483
|
blockNumber: z
|
|
460
484
|
.number()
|
|
461
485
|
.check(z.int(), z.nonnegative(), z.describe('Block number where the pair was created.'), z.meta({ examples: [23456789] })),
|
|
@@ -466,23 +490,25 @@ export var schema;
|
|
|
466
490
|
.string()
|
|
467
491
|
.check(z.regex(/^\d+$/), z.describe('Liquidity signal for the pair: the base-token balance held by the DEX, returned as a decimal integer string in the token’s smallest units. Present only when `sort=liquidity`.')))
|
|
468
492
|
.check(z.describe('Liquidity signal for the pair, present only when you request `sort=liquidity`.'), z.meta({ examples: ['1000000'] })),
|
|
469
|
-
quote: schema.PairToken
|
|
493
|
+
quote: schema.PairToken,
|
|
470
494
|
timestamp: z.iso
|
|
471
495
|
.datetime()
|
|
472
496
|
.check(z.describe('Block timestamp when the pair was created.'), z.meta({ examples: ['2024-01-01T00:00:00Z'] })),
|
|
473
497
|
transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction that created the pair.')),
|
|
474
498
|
})
|
|
475
|
-
.check(z.describe('One trading pair on Tempo’s built-in stablecoin exchange.'));
|
|
499
|
+
.check(z.describe('One trading pair on Tempo’s built-in stablecoin exchange.')), 'ExchangePair');
|
|
500
|
+
/** Response metadata requested through `include`, such as capped counts. */
|
|
501
|
+
getPairs.Meta = OpenApi.component(Schema.CountMeta, 'ExchangePairListMeta');
|
|
476
502
|
/** Page of trading pairs on the stablecoin DEX, ordered by creation. */
|
|
477
|
-
getPairs.Response = z
|
|
503
|
+
getPairs.Response = OpenApi.component(z
|
|
478
504
|
.object({
|
|
479
505
|
data: z.array(getPairs.Pair).check(z.describe('Trading pairs returned on this page.')),
|
|
480
506
|
meta: z
|
|
481
|
-
.optional(
|
|
507
|
+
.optional(getPairs.Meta)
|
|
482
508
|
.check(z.describe('Response-level resources requested with `include`, such as `totalCount`.')),
|
|
483
509
|
nextCursor: Schema.NextCursor,
|
|
484
510
|
})
|
|
485
|
-
.check(z.describe('A paginated list of trading pairs on Tempo’s built-in stablecoin exchange.'));
|
|
511
|
+
.check(z.describe('A paginated list of trading pairs on Tempo’s built-in stablecoin exchange.')), 'ExchangePairList');
|
|
486
512
|
})(getPairs = schema.getPairs || (schema.getPairs = {}));
|
|
487
513
|
/** Schemas for the getPair operation (single trading pair detail). */
|
|
488
514
|
let getPair;
|
|
@@ -555,12 +581,12 @@ export var schema;
|
|
|
555
581
|
'transaction expands one fill group into a variable number of swap rows, so a ' +
|
|
556
582
|
'positional `page` has no stable meaning on this feed.'));
|
|
557
583
|
/** One swap-side token with RPC metadata and optional curated fields. */
|
|
558
|
-
getSwaps.SwapSide = Schema.describe(Tokens.schema.TokenReference, 'A token referenced by one side of a swap.');
|
|
584
|
+
getSwaps.SwapSide = OpenApi.component(Schema.describe(Tokens.schema.TokenReference, 'A token referenced by one side of a swap.'), 'ExchangeSwapToken');
|
|
559
585
|
/** A single maker-order fill within a swap, framed from the taker's perspective. */
|
|
560
|
-
getSwaps.Fill = z
|
|
586
|
+
getSwaps.Fill = OpenApi.component(z
|
|
561
587
|
.object({
|
|
562
|
-
destinationAmount: ValuedAmount
|
|
563
|
-
destinationToken: getSwaps.SwapSide
|
|
588
|
+
destinationAmount: ValuedAmount,
|
|
589
|
+
destinationToken: getSwaps.SwapSide,
|
|
564
590
|
logIndex: z
|
|
565
591
|
.number()
|
|
566
592
|
.check(z.int(), z.nonnegative(), z.describe('Log index of this fill within its block.'), z.meta({ examples: [0] })),
|
|
@@ -572,10 +598,10 @@ export var schema;
|
|
|
572
598
|
price: z
|
|
573
599
|
.string()
|
|
574
600
|
.check(z.regex(/^\d+(\.\d+)?$/), z.describe('Quote-per-base price at fill time, returned as a fixed-decimal string with 5 decimal places. This value is direction-independent and works well for charts.'), z.meta({ examples: ['1.00000'] })),
|
|
575
|
-
sourceAmount: ValuedAmount
|
|
576
|
-
sourceToken: getSwaps.SwapSide
|
|
601
|
+
sourceAmount: ValuedAmount,
|
|
602
|
+
sourceToken: getSwaps.SwapSide,
|
|
577
603
|
})
|
|
578
|
-
.check(z.describe('One maker-order fill within a swap, described from the taker’s perspective.'));
|
|
604
|
+
.check(z.describe('One maker-order fill within a swap, described from the taker’s perspective.')), 'ExchangeSwapFill');
|
|
579
605
|
/**
|
|
580
606
|
* A single logical taker swap on the stablecoin DEX: every maker-order
|
|
581
607
|
* fill one taker's swap produced in one transaction, assembled into a
|
|
@@ -583,13 +609,13 @@ export var schema;
|
|
|
583
609
|
* intermediate token, e.g. pathUSD) are one row; the intermediate hops
|
|
584
610
|
* are visible via `route` and `fills`.
|
|
585
611
|
*/
|
|
586
|
-
getSwaps.Swap = z
|
|
612
|
+
getSwaps.Swap = OpenApi.component(z
|
|
587
613
|
.object({
|
|
588
614
|
blockNumber: z
|
|
589
615
|
.number()
|
|
590
616
|
.check(z.int(), z.nonnegative(), z.describe('Block number where the swap was included.'), z.meta({ examples: [23456789] })),
|
|
591
|
-
destinationAmount: ValuedAmount
|
|
592
|
-
destinationToken: getSwaps.SwapSide
|
|
617
|
+
destinationAmount: ValuedAmount,
|
|
618
|
+
destinationToken: getSwaps.SwapSide,
|
|
593
619
|
filledAt: z.iso
|
|
594
620
|
.datetime()
|
|
595
621
|
.check(z.describe('Block timestamp when the swap was filled onchain.'), z.meta({ examples: ['2024-01-01T00:00:00Z'] })),
|
|
@@ -611,12 +637,12 @@ export var schema;
|
|
|
611
637
|
route: z
|
|
612
638
|
.array(Schema.TokenAddress)
|
|
613
639
|
.check(z.describe('Token path for the swap, from source through any intermediate tokens to destination. `route.length - 1` is the hop count; two entries means a direct swap.')),
|
|
614
|
-
sourceAmount: ValuedAmount
|
|
615
|
-
sourceToken: getSwaps.SwapSide
|
|
640
|
+
sourceAmount: ValuedAmount,
|
|
641
|
+
sourceToken: getSwaps.SwapSide,
|
|
616
642
|
taker: Schema.Address.check(z.describe('Taker address that initiated the swap.')),
|
|
617
643
|
transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction containing the swap.')),
|
|
618
644
|
})
|
|
619
|
-
.check(z.describe('One logical taker swap on Tempo’s built-in stablecoin exchange.'));
|
|
645
|
+
.check(z.describe('One logical taker swap on Tempo’s built-in stablecoin exchange.')), 'ExchangeSwap');
|
|
620
646
|
/**
|
|
621
647
|
* Page of swaps. A row is one logical taker swap — the fills of one
|
|
622
648
|
* `(transaction, taker)` group chained source → destination — so the
|
|
@@ -625,15 +651,15 @@ export var schema;
|
|
|
625
651
|
* taker may have its rows split across consecutive pages.
|
|
626
652
|
*/
|
|
627
653
|
/** Page-level resources: valuation rate provenance. */
|
|
628
|
-
getSwaps.Meta = z
|
|
654
|
+
getSwaps.Meta = OpenApi.component(z
|
|
629
655
|
.object({
|
|
630
656
|
valuation: z
|
|
631
657
|
.optional(Valuation.schema.Pricing)
|
|
632
658
|
.check(z.describe('Rate provenance for amount valuations. Present when conversion rates were ' +
|
|
633
659
|
'consulted; absent when every value was identity-valued or rates were unavailable.')),
|
|
634
660
|
})
|
|
635
|
-
.check(z.describe('Page-level resources attached to this response.'));
|
|
636
|
-
getSwaps.Response = z
|
|
661
|
+
.check(z.describe('Page-level resources attached to this response.')), 'ExchangeSwapListMeta');
|
|
662
|
+
getSwaps.Response = OpenApi.component(z
|
|
637
663
|
.object({
|
|
638
664
|
data: z.array(getSwaps.Swap).check(z.describe('Swaps returned on this page.')),
|
|
639
665
|
meta: z
|
|
@@ -641,7 +667,7 @@ export var schema;
|
|
|
641
667
|
.check(z.describe('Page-level resources, such as valuation rate provenance.')),
|
|
642
668
|
nextCursor: Schema.NextCursor,
|
|
643
669
|
})
|
|
644
|
-
.check(z.describe('A paginated list of swaps on Tempo’s built-in stablecoin exchange.'));
|
|
670
|
+
.check(z.describe('A paginated list of swaps on Tempo’s built-in stablecoin exchange.')), 'ExchangeSwapList');
|
|
645
671
|
})(getSwaps = schema.getSwaps || (schema.getSwaps = {}));
|
|
646
672
|
/** Schemas for the getPairOhlc operation (candlestick aggregations). */
|
|
647
673
|
let getPairOhlc;
|
|
@@ -695,7 +721,7 @@ export var schema;
|
|
|
695
721
|
* and low are the extrema across all fills in the bucket. Volumes are
|
|
696
722
|
* the sum of per-fill base- and quote-side amounts in base units.
|
|
697
723
|
*/
|
|
698
|
-
getPairOhlc.Bucket = z
|
|
724
|
+
getPairOhlc.Bucket = OpenApi.component(z
|
|
699
725
|
.object({
|
|
700
726
|
close: z
|
|
701
727
|
.string()
|
|
@@ -727,22 +753,22 @@ export var schema;
|
|
|
727
753
|
})
|
|
728
754
|
.check(z.describe('Total filled volume in this bucket, split by pair side.')),
|
|
729
755
|
})
|
|
730
|
-
.check(z.describe('One OHLC candle bucket for charting a trading pair.'));
|
|
756
|
+
.check(z.describe('One OHLC candle bucket for charting a trading pair.')), 'ExchangeOhlcBucket');
|
|
731
757
|
/** Page of candlestick buckets for a single trading pair. */
|
|
732
|
-
getPairOhlc.Response = z
|
|
758
|
+
getPairOhlc.Response = OpenApi.component(z
|
|
733
759
|
.object({
|
|
734
|
-
base: schema.PairToken
|
|
760
|
+
base: schema.PairToken,
|
|
735
761
|
data: z
|
|
736
762
|
.array(getPairOhlc.Bucket)
|
|
737
763
|
.check(z.describe('OHLC candle buckets ordered oldest to newest; empty buckets are omitted.')),
|
|
738
764
|
interval: getPairOhlc.Interval,
|
|
739
|
-
quote: schema.PairToken
|
|
765
|
+
quote: schema.PairToken,
|
|
740
766
|
truncated: z
|
|
741
767
|
.boolean()
|
|
742
768
|
.check(z.describe('`true` when the fill scan hit its hard cap, meaning OHLC values were computed from only the most recent fills.'), z.meta({ examples: [false] })),
|
|
743
769
|
window: getPairOhlc.Window,
|
|
744
770
|
})
|
|
745
|
-
.check(z.describe('OHLC candle data for one trading pair over a rolling time window.'));
|
|
771
|
+
.check(z.describe('OHLC candle data for one trading pair over a rolling time window.')), 'ExchangePairOhlc');
|
|
746
772
|
})(getPairOhlc = schema.getPairOhlc || (schema.getPairOhlc = {}));
|
|
747
773
|
/** Schemas shared by the order detail and order fills handlers. */
|
|
748
774
|
let order;
|
|
@@ -754,11 +780,11 @@ export var schema;
|
|
|
754
780
|
})
|
|
755
781
|
.check(z.describe('Path parameters for routes that look up one order.'));
|
|
756
782
|
/** The pair the order is placed against. */
|
|
757
|
-
order.Pair = Schema.describe(z.object({
|
|
758
|
-
base: schema.PairToken
|
|
783
|
+
order.Pair = OpenApi.component(Schema.describe(z.object({
|
|
784
|
+
base: schema.PairToken,
|
|
759
785
|
key: Schema.Hash.check(z.describe('On-chain key for this `(base, quote)` trading pair.')),
|
|
760
|
-
quote: schema.PairToken
|
|
761
|
-
}), 'The trading pair the order belongs to.');
|
|
786
|
+
quote: schema.PairToken,
|
|
787
|
+
}), 'The trading pair the order belongs to.'), 'ExchangeOrderPair');
|
|
762
788
|
})(order = schema.order || (schema.order = {}));
|
|
763
789
|
/** Schemas for the getOrder operation. */
|
|
764
790
|
let getOrder;
|
|
@@ -796,7 +822,7 @@ export var schema;
|
|
|
796
822
|
* over time and would otherwise force this resource to revalidate on
|
|
797
823
|
* every new fill.
|
|
798
824
|
*/
|
|
799
|
-
getOrder.Response = Schema.describe(z.object({
|
|
825
|
+
getOrder.Response = OpenApi.component(Schema.describe(z.object({
|
|
800
826
|
amount: Schema.DecimalString.check(z.describe('Initial order size, returned as a decimal integer string in base-token smallest units.')),
|
|
801
827
|
flipTick: z
|
|
802
828
|
.number()
|
|
@@ -824,7 +850,7 @@ export var schema;
|
|
|
824
850
|
tick: z
|
|
825
851
|
.number()
|
|
826
852
|
.check(z.int(), z.describe('On-chain signed tick, scaled by `1/priceScale`; use `price` for the decoded ratio.'), z.meta({ examples: [0] })),
|
|
827
|
-
}), 'A single DEX order with live onchain state.');
|
|
853
|
+
}), 'A single DEX order with live onchain state.'), 'ExchangeOrder');
|
|
828
854
|
})(getOrder = schema.getOrder || (schema.getOrder = {}));
|
|
829
855
|
/** Schemas for the getOrders operation (the resting-order feed, optionally pair-scoped). */
|
|
830
856
|
let getOrders;
|
|
@@ -875,8 +901,7 @@ export var schema;
|
|
|
875
901
|
* Orders for which `remaining <= 0` or that have an `OrderCancelled`
|
|
876
902
|
* event are excluded from the response.
|
|
877
903
|
*/
|
|
878
|
-
getOrders.RestingOrder = z
|
|
879
|
-
.object({
|
|
904
|
+
getOrders.RestingOrder = Schema.describe(z.object({
|
|
880
905
|
amount: Schema.DecimalString.check(z.describe('Original placed amount, returned as a decimal integer string in base-token smallest units.')),
|
|
881
906
|
blockNumber: z
|
|
882
907
|
.number()
|
|
@@ -904,27 +929,26 @@ export var schema;
|
|
|
904
929
|
.number()
|
|
905
930
|
.check(z.int(), z.describe('Order tick as a signed offset from peg; one tick equals `1/priceScale`.'), z.meta({ examples: [0] })),
|
|
906
931
|
transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction that placed the order.')),
|
|
907
|
-
})
|
|
908
|
-
.check(z.describe('One resting maker order on Tempo’s built-in stablecoin exchange.'));
|
|
932
|
+
}), 'One resting maker order on Tempo’s built-in stablecoin exchange.');
|
|
909
933
|
/** A resting maker order annotated with the trading pair it belongs to. */
|
|
910
|
-
getOrders.Order = z
|
|
911
|
-
.extend(getOrders.RestingOrder, {
|
|
934
|
+
getOrders.Order = OpenApi.component(Schema.describe(z.extend(getOrders.RestingOrder, {
|
|
912
935
|
pair: order.Pair,
|
|
913
|
-
})
|
|
914
|
-
|
|
936
|
+
}), 'A resting maker order plus its trading pair.'), 'ExchangeRestingOrder');
|
|
937
|
+
/** Response metadata requested through `include`, such as capped counts. */
|
|
938
|
+
getOrders.Meta = OpenApi.component(Schema.CountMeta, 'ExchangeOrderListMeta');
|
|
915
939
|
/** Page of resting maker orders, each annotated with its trading pair. */
|
|
916
|
-
getOrders.Response = z
|
|
940
|
+
getOrders.Response = OpenApi.component(z
|
|
917
941
|
.object({
|
|
918
942
|
data: z.array(getOrders.Order).check(z.describe('Resting orders returned on this page.')),
|
|
919
943
|
meta: z
|
|
920
|
-
.optional(
|
|
944
|
+
.optional(getOrders.Meta)
|
|
921
945
|
.check(z.describe('Response-level resources requested with `include`, such as `totalCount`.')),
|
|
922
946
|
nextCursor: Schema.NextCursor,
|
|
923
947
|
truncated: z
|
|
924
948
|
.boolean()
|
|
925
949
|
.check(z.describe('`true` when the `OrderPlaced` scan hit its hard cap, meaning the resting set was computed from only the most recent placements.'), z.meta({ examples: [false] })),
|
|
926
950
|
})
|
|
927
|
-
.check(z.describe('A paginated list of resting maker orders on Tempo’s built-in stablecoin exchange.'));
|
|
951
|
+
.check(z.describe('A paginated list of resting maker orders on Tempo’s built-in stablecoin exchange.')), 'ExchangeOrderList');
|
|
928
952
|
})(getOrders = schema.getOrders || (schema.getOrders = {}));
|
|
929
953
|
/** Schemas for the getOrderFills operation. */
|
|
930
954
|
let getOrderFills;
|
|
@@ -947,7 +971,7 @@ export var schema;
|
|
|
947
971
|
* rate are constant across all fills, so they live on the `Order`
|
|
948
972
|
* resource rather than being repeated per row.
|
|
949
973
|
*/
|
|
950
|
-
getOrderFills.Fill = z
|
|
974
|
+
getOrderFills.Fill = OpenApi.component(z
|
|
951
975
|
.object({
|
|
952
976
|
amountFilled: Schema.DecimalString.check(z.describe('Base-side amount filled by this event, returned as a decimal integer string in base-token smallest units.')),
|
|
953
977
|
blockNumber: z
|
|
@@ -969,17 +993,19 @@ export var schema;
|
|
|
969
993
|
taker: Schema.Address.check(z.describe('Taker address that submitted the incoming order.')),
|
|
970
994
|
transactionHash: Schema.Hash.check(z.describe('Transaction hash for the transaction containing the fill.')),
|
|
971
995
|
})
|
|
972
|
-
.check(z.describe('One `OrderFilled` event against this order.'));
|
|
996
|
+
.check(z.describe('One `OrderFilled` event against this order.')), 'ExchangeOrderFill');
|
|
997
|
+
/** Response metadata requested through `include`, such as capped counts. */
|
|
998
|
+
getOrderFills.Meta = OpenApi.component(Schema.CountMeta, 'ExchangeOrderFillListMeta');
|
|
973
999
|
/** Paginated page of fills for one order. */
|
|
974
|
-
getOrderFills.Response = z
|
|
1000
|
+
getOrderFills.Response = OpenApi.component(z
|
|
975
1001
|
.object({
|
|
976
1002
|
data: z.array(getOrderFills.Fill).check(z.describe('Fills returned on this page.')),
|
|
977
1003
|
meta: z
|
|
978
|
-
.optional(
|
|
1004
|
+
.optional(getOrderFills.Meta)
|
|
979
1005
|
.check(z.describe('Response-level resources requested with `include`.')),
|
|
980
1006
|
nextCursor: Schema.NextCursor,
|
|
981
1007
|
})
|
|
982
|
-
.check(z.describe('A paginated list of fill events for one DEX order.'));
|
|
1008
|
+
.check(z.describe('A paginated list of fill events for one DEX order.')), 'ExchangeOrderFillList');
|
|
983
1009
|
})(getOrderFills = schema.getOrderFills || (schema.getOrderFills = {}));
|
|
984
1010
|
/** Schemas for the getPairDepth operation (orderbook depth aggregation). */
|
|
985
1011
|
let getPairDepth;
|
|
@@ -1023,11 +1049,13 @@ export var schema;
|
|
|
1023
1049
|
* side, starting from the best (peg-adjacent) populated tick and walking
|
|
1024
1050
|
* outward.
|
|
1025
1051
|
*/
|
|
1026
|
-
getPairDepth.Level = z
|
|
1052
|
+
getPairDepth.Level = OpenApi.component(z
|
|
1027
1053
|
.object({
|
|
1028
1054
|
cumulativeSize: Schema.DecimalString.check(z.describe('Running sum of `size` from the best populated tick outward to this level, in base-token smallest units.')),
|
|
1029
1055
|
id: z.string().check(z.describe('Stable API id built from the pair key, orderbook side, and tick.'), z.meta({
|
|
1030
|
-
examples: [
|
|
1056
|
+
examples: [
|
|
1057
|
+
'0x515801d7f9a5ac705e793e85904c9c69b3f1694b465cc8fb6ba3f0298dc82665-bid-0',
|
|
1058
|
+
],
|
|
1031
1059
|
})),
|
|
1032
1060
|
price: z
|
|
1033
1061
|
.string()
|
|
@@ -1037,20 +1065,20 @@ export var schema;
|
|
|
1037
1065
|
.number()
|
|
1038
1066
|
.check(z.int(), z.describe('Signed price tick (`int16`), always a multiple of the DEX tick spacing.'), z.meta({ examples: [0] })),
|
|
1039
1067
|
})
|
|
1040
|
-
.check(z.describe('One price level in the orderbook depth response.'));
|
|
1068
|
+
.check(z.describe('One price level in the orderbook depth response.')), 'ExchangeDepthLevel');
|
|
1041
1069
|
/** Orderbook depth (cumulative size per tick) for a single trading pair. */
|
|
1042
|
-
getPairDepth.Response = z
|
|
1070
|
+
getPairDepth.Response = OpenApi.component(z
|
|
1043
1071
|
.object({
|
|
1044
1072
|
asks: z
|
|
1045
1073
|
.array(getPairDepth.Level)
|
|
1046
1074
|
.check(z.describe('Ask-side levels, where makers sell base and takers buy it, ordered from best lowest ask outward.')),
|
|
1047
|
-
base: schema.PairToken
|
|
1075
|
+
base: schema.PairToken,
|
|
1048
1076
|
bids: z
|
|
1049
1077
|
.array(getPairDepth.Level)
|
|
1050
1078
|
.check(z.describe('Bid-side levels, where makers buy base and takers sell it, ordered from best highest bid outward.')),
|
|
1051
|
-
quote: schema.PairToken
|
|
1079
|
+
quote: schema.PairToken,
|
|
1052
1080
|
})
|
|
1053
|
-
.check(z.describe('Orderbook depth for one trading pair, with cumulative size at each tick.'));
|
|
1081
|
+
.check(z.describe('Orderbook depth for one trading pair, with cumulative size at each tick.')), 'ExchangePairDepth');
|
|
1054
1082
|
})(getPairDepth = schema.getPairDepth || (schema.getPairDepth = {}));
|
|
1055
1083
|
})(schema || (schema = {}));
|
|
1056
1084
|
/**
|
|
@@ -1086,7 +1114,15 @@ export function exchanges(options = {}) {
|
|
|
1086
1114
|
operationId: 'createExchangeQuote',
|
|
1087
1115
|
responses: OpenApi.responses({
|
|
1088
1116
|
errors: {
|
|
1089
|
-
400: {
|
|
1117
|
+
400: {
|
|
1118
|
+
codes: [
|
|
1119
|
+
'body_invalid',
|
|
1120
|
+
'chain_id_invalid',
|
|
1121
|
+
'chain_id_unsupported',
|
|
1122
|
+
'query_invalid',
|
|
1123
|
+
'quote_amount_out_of_range',
|
|
1124
|
+
],
|
|
1125
|
+
},
|
|
1090
1126
|
404: {
|
|
1091
1127
|
codes: ['quote_not_available'],
|
|
1092
1128
|
description: 'No configured provider can price an executable exchange for these terms.',
|
|
@@ -1372,6 +1408,8 @@ export function exchanges(options = {}) {
|
|
|
1372
1408
|
400: {
|
|
1373
1409
|
codes: [
|
|
1374
1410
|
'body_invalid',
|
|
1411
|
+
'chain_id_invalid',
|
|
1412
|
+
'chain_id_unsupported',
|
|
1375
1413
|
'query_invalid',
|
|
1376
1414
|
'swap_continuation_invalid',
|
|
1377
1415
|
'swap_provider_invalid',
|
|
@@ -1455,6 +1493,9 @@ export function exchanges(options = {}) {
|
|
|
1455
1493
|
operationId: 'getSwaps',
|
|
1456
1494
|
responses: OpenApi.responses({
|
|
1457
1495
|
errors: {
|
|
1496
|
+
400: {
|
|
1497
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
|
|
1498
|
+
},
|
|
1458
1499
|
502: 'The indexer or Tempo RPC could not serve the exchange data right now.',
|
|
1459
1500
|
},
|
|
1460
1501
|
success: {
|
|
@@ -1600,7 +1641,12 @@ export function exchanges(options = {}) {
|
|
|
1600
1641
|
description: 'List trading pairs available on Tempo’s built-in stablecoin exchange.',
|
|
1601
1642
|
operationId: 'getPairs',
|
|
1602
1643
|
responses: OpenApi.responses({
|
|
1603
|
-
errors: {
|
|
1644
|
+
errors: {
|
|
1645
|
+
400: {
|
|
1646
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
|
|
1647
|
+
},
|
|
1648
|
+
502: 'The indexer could not serve the exchange data right now.',
|
|
1649
|
+
},
|
|
1604
1650
|
success: {
|
|
1605
1651
|
description: 'A page of exchange trading pairs.',
|
|
1606
1652
|
schema: schema.getPairs.Response,
|
|
@@ -1700,6 +1746,9 @@ export function exchanges(options = {}) {
|
|
|
1700
1746
|
operationId: 'getPair',
|
|
1701
1747
|
responses: OpenApi.responses({
|
|
1702
1748
|
errors: {
|
|
1749
|
+
400: {
|
|
1750
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
|
|
1751
|
+
},
|
|
1703
1752
|
404: {
|
|
1704
1753
|
description: 'No exchange pair was found for that base token.',
|
|
1705
1754
|
codes: ['pair_not_found'],
|
|
@@ -1781,6 +1830,9 @@ export function exchanges(options = {}) {
|
|
|
1781
1830
|
operationId: 'getOrders',
|
|
1782
1831
|
responses: OpenApi.responses({
|
|
1783
1832
|
errors: {
|
|
1833
|
+
400: {
|
|
1834
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'query_invalid'],
|
|
1835
|
+
},
|
|
1784
1836
|
404: {
|
|
1785
1837
|
description: 'No exchange pair was found for the requested `base` filter.',
|
|
1786
1838
|
codes: ['pair_not_found'],
|
|
@@ -1897,6 +1949,9 @@ export function exchanges(options = {}) {
|
|
|
1897
1949
|
operationId: 'getOrder',
|
|
1898
1950
|
responses: OpenApi.responses({
|
|
1899
1951
|
errors: {
|
|
1952
|
+
400: {
|
|
1953
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'order_invalid', 'query_invalid'],
|
|
1954
|
+
},
|
|
1900
1955
|
404: {
|
|
1901
1956
|
description: 'No exchange order was found for that id.',
|
|
1902
1957
|
codes: ['order_not_found'],
|
|
@@ -1989,7 +2044,12 @@ export function exchanges(options = {}) {
|
|
|
1989
2044
|
description: 'List fills for one order. A fill records an execution against the maker order.',
|
|
1990
2045
|
operationId: 'getOrderFills',
|
|
1991
2046
|
responses: OpenApi.responses({
|
|
1992
|
-
errors: {
|
|
2047
|
+
errors: {
|
|
2048
|
+
400: {
|
|
2049
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'order_invalid', 'query_invalid'],
|
|
2050
|
+
},
|
|
2051
|
+
502: 'The indexer could not serve the exchange data right now.',
|
|
2052
|
+
},
|
|
1993
2053
|
success: {
|
|
1994
2054
|
description: 'A page of fills for one order.',
|
|
1995
2055
|
schema: schema.getOrderFills.Response,
|
|
@@ -2065,6 +2125,9 @@ export function exchanges(options = {}) {
|
|
|
2065
2125
|
operationId: 'getPairOhlc',
|
|
2066
2126
|
responses: OpenApi.responses({
|
|
2067
2127
|
errors: {
|
|
2128
|
+
400: {
|
|
2129
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
|
|
2130
|
+
},
|
|
2068
2131
|
404: {
|
|
2069
2132
|
description: 'No exchange pair was found for that base token.',
|
|
2070
2133
|
codes: ['pair_not_found'],
|
|
@@ -2162,6 +2225,9 @@ export function exchanges(options = {}) {
|
|
|
2162
2225
|
operationId: 'getPairDepth',
|
|
2163
2226
|
responses: OpenApi.responses({
|
|
2164
2227
|
errors: {
|
|
2228
|
+
400: {
|
|
2229
|
+
codes: ['chain_id_invalid', 'chain_id_unsupported', 'pair_invalid', 'query_invalid'],
|
|
2230
|
+
},
|
|
2165
2231
|
404: {
|
|
2166
2232
|
description: 'No exchange pair was found for that base token.',
|
|
2167
2233
|
codes: ['pair_not_found'],
|