@totalis/hip4-client 0.124.0 → 0.126.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/CHANGELOG.md +389 -0
- package/README.md +9 -5
- package/dist/api-keys.d.ts +21 -2
- package/dist/api-keys.js +12 -10
- package/dist/audience-contract.d.ts +1 -2
- package/dist/client.d.ts +1 -1
- package/dist/client.js +1 -1
- package/dist/flow-errors.d.ts +1 -1
- package/dist/flow-errors.js +1 -1
- package/dist/generated/account-read.d.ts +150 -126
- package/dist/generated/api-keys.d.ts +19 -10
- package/dist/generated/browse.d.ts +12 -12
- package/dist/generated/client.d.ts +5 -2
- package/dist/generated/errors.d.ts +15 -8
- package/dist/generated/errors.js +47 -35
- package/dist/generated/maker.d.ts +3 -4
- package/dist/generated/openapi.d.ts +833 -893
- package/dist/generated/realtime.d.ts +66 -93
- package/dist/generated/vault-abi.d.ts +57 -0
- package/dist/generated/vault-abi.js +77 -0
- package/dist/generated/version.d.ts +16 -16
- package/dist/generated/version.js +20 -18
- package/dist/maker.d.ts +134 -54
- package/dist/maker.js +257 -147
- package/dist/money.d.ts +8 -6
- package/dist/money.js +7 -7
- package/dist/partner.d.ts +2 -0
- package/dist/partner.js +2 -1
- package/dist/request.d.ts +11 -2
- package/dist/request.js +7 -2
- package/dist/totalis.d.ts +147 -232
- package/dist/totalis.js +290 -269
- package/dist/typed-data.d.ts +6 -0
- package/dist/typed-data.js +8 -0
- package/dist/ui.d.ts +6 -10
- package/dist/ui.js +15 -13
- package/dist/vault-reads.d.ts +46 -0
- package/dist/vault-reads.js +72 -0
- package/examples/browser-wallet.mjs +1 -1
- package/examples/node-bot.mjs +15 -12
- package/package.json +1 -1
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
export declare const sdkVersion = "
|
|
2
|
-
export declare const openapiSha256 = "
|
|
3
|
-
export declare const realtimeSha256 = "
|
|
1
|
+
export declare const sdkVersion = "280.0.0-win-rate";
|
|
2
|
+
export declare const openapiSha256 = "da880ecc0cae0a5414a3c4191ba2d30840c06ec1b703cb0f5b34129ebb883770";
|
|
3
|
+
export declare const realtimeSha256 = "bde8ada386aaa01c6d6ff7b2a0734916afde1d39e475b3019d6eb71334a48b42";
|
|
4
4
|
export declare const jsonSchemaSha256: {
|
|
5
|
-
readonly "account.schema.json": "
|
|
5
|
+
readonly "account.schema.json": "3120357249f55f8481d5afb7a99112f803c22c6a1cbe3adadca478bb313f8160";
|
|
6
6
|
readonly "comments.schema.json": "5773471b4442ba9d8af0dc012d71561baaf50d0e1c2571039241780848edb4a4";
|
|
7
|
-
readonly "common.schema.json": "
|
|
8
|
-
readonly "core-exit.schema.json": "
|
|
9
|
-
readonly "error.schema.json": "
|
|
10
|
-
readonly "hypercore.schema.json": "
|
|
11
|
-
readonly "identity.schema.json": "
|
|
7
|
+
readonly "common.schema.json": "e7b414609c7eefa2e649882d251290993832aa484eddce41fda472af9b7ca40b";
|
|
8
|
+
readonly "core-exit.schema.json": "6208a8dc775e8a9f858ec802e9b013a3e2363279a7b24ff7dfecf89fe0462eb9";
|
|
9
|
+
readonly "error.schema.json": "72ae55c34aa9e265669cf7f0cc5ad7862906c42918661f2b47c995abe34bd17e";
|
|
10
|
+
readonly "hypercore.schema.json": "38685dc8ee900f9d1c7d1eeda40cc622bc74a10d7dd702163085ab1e0c1437e3";
|
|
11
|
+
readonly "identity.schema.json": "06d5d3f175761af1f96c2367524ee5f736325c78999f471accfd9662bfa85373";
|
|
12
12
|
readonly "maker-access.schema.json": "49698ee0235e42064aae0397db1e0f646bdc10d9dfa10121714ba06dd69fee3b";
|
|
13
|
-
readonly "maker-action.schema.json": "
|
|
13
|
+
readonly "maker-action.schema.json": "07a5cb07976d06315733282d1bb4f1416c23d3e7a8a4e8941228ac559a2f7467";
|
|
14
14
|
readonly "maker-telemetry.schema.json": "85b111ce0f4935299d1116071b43de12e775bef4e0c283c12f19046d34374a9c";
|
|
15
|
-
readonly "market-data.schema.json": "
|
|
15
|
+
readonly "market-data.schema.json": "fd00eaf6524d25019db1dce6c20a3c6f0b9786608583aa6bd1cc14cd2388702f";
|
|
16
16
|
readonly "product-metadata.schema.json": "7c8ffbde878a0aedaed16814fcfd2e80038054b140886cc8736bb7b508042631";
|
|
17
|
-
readonly "quote.schema.json": "
|
|
18
|
-
readonly "realtime.schema.json": "
|
|
19
|
-
readonly "social.schema.json": "
|
|
17
|
+
readonly "quote.schema.json": "5c16a54c428656a4e8c1042b2057ce8290e6eebcc02b237f5dce7e4c13b7ded0";
|
|
18
|
+
readonly "realtime.schema.json": "bde8ada386aaa01c6d6ff7b2a0734916afde1d39e475b3019d6eb71334a48b42";
|
|
19
|
+
readonly "social.schema.json": "98e5c2a3159e5833e9af5e776231875bc42133144476e771e73575cec3f36380";
|
|
20
20
|
};
|
|
21
21
|
export declare const operations: {
|
|
22
|
-
readonly client: readonly ["abandonCoreExit", "acceptQuote", "activeCoreExits", "admitOwnMaker", "admitPartnerWallet", "approveWallet", "bindEmbeddedWallet", "cancelRfq", "claimGoldenLink", "confirmComboCopyAgent", "confirmCoreCopyAgent", "createCashout", "createComment", "createCoreExit", "createDeposit", "createGoldenRfq", "createRfq", "createRunOffClaim", "createWalletChallenge", "createWalletSession", "createWithdrawal", "deleteComment", "editComment", "endWalletSession", "followTrader", "getAcceptance", "getAccountActivity", "getAccountPnl", "getAccountPosition", "getAccountValue", "getBalances", "getChart", "getCopyAgents", "getCopyBudget", "getCopySettings", "getCopySummary", "getCoreExit", "getDeployment", "getGenesis", "getGolden", "getGoldenLinkSuggestions", "getGoldenMarkets", "getGoldenOffer", "getGoldenSuggestions", "getHypercoreBalance", "getHypercorePortfolio", "getHypercoreSettlementCredits", "getIdentity", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDataConfig", "getMarketDefinitions", "getMarketDisplay", "
|
|
23
|
-
readonly maker: readonly ["cancelQuote", "confirmQuote", "createCollateralReduction", "createQuote", "getAccountActivity", "getAccountPosition", "getChart", "getCollateralReduction", "getDeployment", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerTelemetryPublication", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDisplay", "
|
|
22
|
+
readonly client: readonly ["abandonCoreExit", "acceptQuote", "activeCoreExits", "admitOwnMaker", "admitPartnerWallet", "approveWallet", "bindEmbeddedWallet", "cancelRfq", "claimGoldenLink", "confirmComboCopyAgent", "confirmCoreCopyAgent", "createCashout", "createComment", "createCoreExit", "createDeposit", "createGoldenRfq", "createRfq", "createRunOffClaim", "createWalletChallenge", "createWalletSession", "createWithdrawal", "deleteComment", "editComment", "endWalletSession", "followTrader", "getAcceptance", "getAccountActivity", "getAccountPnl", "getAccountPosition", "getAccountValue", "getBalances", "getChart", "getCopyAgents", "getCopyBudget", "getCopySettings", "getCopySummary", "getCoreExit", "getDeployment", "getGenesis", "getGolden", "getGoldenLinkSuggestions", "getGoldenMarkets", "getGoldenOffer", "getGoldenSuggestions", "getHypercoreBalance", "getHypercoreOrders", "getHypercorePortfolio", "getHypercoreSettlementCredits", "getIdentity", "getLiveMarks", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDataConfig", "getMarketDefinitions", "getMarketDisplay", "getMarketRecurringRound", "getMarketReferenceCloses", "getMarketResults", "getMarketRoundHistory", "getMarketScoreTimeline", "getMarketStats", "getMyGenesis", "getMyReferralBonus", "getMyTradingRewards", "getOperation", "getOutcomeMetadata", "getOwnMaker", "getPartnerAccountValue", "getPartnerReport", "getPerpMarks", "getPicture", "getProfitLeaderboard", "getPublicGoldenMarkets", "getQuestion", "getQuestionRecurringRound", "getQuestionScoreTimeline", "getRfq", "getSeries", "getSocialLeaderboard", "getSocialPerson", "getSocialPosition", "getSuggestedCombo", "getTaxonomy", "getTrader", "getTraderPnl", "getUsernameAvailability", "getVaultAgents", "getVolumeLeaderboard", "getWalletApproval", "getWithdrawal", "grantComboCopyAgent", "grantVaultAgent", "likeComment", "listAccountActivity", "listAccountPositions", "listComboCopies", "listComboFeed", "listCommentReplies", "listComments", "listControlledMakers", "listCopiedFills", "listCopyTrades", "listDiscovery", "listFollowers", "listFollowingFeed", "listFollowingPositions", "listFollows", "listHypercorePositions", "listMakerActivity", "listMakerPositions", "listMakerQuoteHistory", "listMarketTrades", "listMarkets", "listMyNotifications", "listOperations", "listPartnerFills", "listPartnerWebhookEvents", "listQuotes", "listSocialActivity", "listSocialFeed", "listSocialFollowers", "listSocialFollowing", "listSocialPositions", "listTraderPositions", "listTraderTrades", "markMyNotificationsRead", "placeGolden", "reactComment", "recordAcquisition", "recordCopiedTrade", "recordGoldenTelegramClick", "refreshPicture", "removeUploadedPicture", "requestComboCopyAgent", "requestCoreCopyAgent", "revokeComboCopyAgent", "searchCatalog", "searchTraders", "setAvatar", "setCopyAllocation", "setCopySettings", "setPublicProfile", "setUsername", "setXHandleShown", "setXPictureShown", "signGoldenGift", "stream", "streamMarkets", "switchOffComboCopyAgent", "switchOffCoreCopyAgent", "unfollowTrader", "unlikeComment", "unlockGolden", "unreactComment", "uploadPicture"];
|
|
23
|
+
readonly maker: readonly ["cancelAllQuotes", "cancelQuote", "confirmQuote", "createCollateralReduction", "createQuote", "getAccountActivity", "getAccountPosition", "getChart", "getCollateralReduction", "getDeployment", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerTelemetryPublication", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDisplay", "getMarketRecurringRound", "getMarketReferenceCloses", "getMarketResults", "getMarketRoundHistory", "getOperation", "getQuestion", "getQuestionRecurringRound", "getRfq", "getSeries", "getTaxonomy", "listAccountActivity", "listAccountPositions", "listDiscovery", "listMakerAcceptances", "listMakerActivity", "listMakerPositions", "listMakerQuoteHistory", "listMarkets", "listOperations", "listRfqs", "publishMakerTelemetry", "searchCatalog", "stream", "submitMakerSelfFundedTransaction"];
|
|
24
24
|
readonly operator: readonly ["live", "ready"];
|
|
25
25
|
};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Generated by scripts/generate.mjs; do not edit.
|
|
2
|
-
export const sdkVersion = "
|
|
3
|
-
export const openapiSha256 = "
|
|
4
|
-
export const realtimeSha256 = "
|
|
2
|
+
export const sdkVersion = "280.0.0-win-rate";
|
|
3
|
+
export const openapiSha256 = "da880ecc0cae0a5414a3c4191ba2d30840c06ec1b703cb0f5b34129ebb883770";
|
|
4
|
+
export const realtimeSha256 = "bde8ada386aaa01c6d6ff7b2a0734916afde1d39e475b3019d6eb71334a48b42";
|
|
5
5
|
export const jsonSchemaSha256 = {
|
|
6
|
-
"account.schema.json": "
|
|
6
|
+
"account.schema.json": "3120357249f55f8481d5afb7a99112f803c22c6a1cbe3adadca478bb313f8160",
|
|
7
7
|
"comments.schema.json": "5773471b4442ba9d8af0dc012d71561baaf50d0e1c2571039241780848edb4a4",
|
|
8
|
-
"common.schema.json": "
|
|
9
|
-
"core-exit.schema.json": "
|
|
10
|
-
"error.schema.json": "
|
|
11
|
-
"hypercore.schema.json": "
|
|
12
|
-
"identity.schema.json": "
|
|
8
|
+
"common.schema.json": "e7b414609c7eefa2e649882d251290993832aa484eddce41fda472af9b7ca40b",
|
|
9
|
+
"core-exit.schema.json": "6208a8dc775e8a9f858ec802e9b013a3e2363279a7b24ff7dfecf89fe0462eb9",
|
|
10
|
+
"error.schema.json": "72ae55c34aa9e265669cf7f0cc5ad7862906c42918661f2b47c995abe34bd17e",
|
|
11
|
+
"hypercore.schema.json": "38685dc8ee900f9d1c7d1eeda40cc622bc74a10d7dd702163085ab1e0c1437e3",
|
|
12
|
+
"identity.schema.json": "06d5d3f175761af1f96c2367524ee5f736325c78999f471accfd9662bfa85373",
|
|
13
13
|
"maker-access.schema.json": "49698ee0235e42064aae0397db1e0f646bdc10d9dfa10121714ba06dd69fee3b",
|
|
14
|
-
"maker-action.schema.json": "
|
|
14
|
+
"maker-action.schema.json": "07a5cb07976d06315733282d1bb4f1416c23d3e7a8a4e8941228ac559a2f7467",
|
|
15
15
|
"maker-telemetry.schema.json": "85b111ce0f4935299d1116071b43de12e775bef4e0c283c12f19046d34374a9c",
|
|
16
|
-
"market-data.schema.json": "
|
|
16
|
+
"market-data.schema.json": "fd00eaf6524d25019db1dce6c20a3c6f0b9786608583aa6bd1cc14cd2388702f",
|
|
17
17
|
"product-metadata.schema.json": "7c8ffbde878a0aedaed16814fcfd2e80038054b140886cc8736bb7b508042631",
|
|
18
|
-
"quote.schema.json": "
|
|
19
|
-
"realtime.schema.json": "
|
|
20
|
-
"social.schema.json": "
|
|
18
|
+
"quote.schema.json": "5c16a54c428656a4e8c1042b2057ce8290e6eebcc02b237f5dce7e4c13b7ded0",
|
|
19
|
+
"realtime.schema.json": "bde8ada386aaa01c6d6ff7b2a0734916afde1d39e475b3019d6eb71334a48b42",
|
|
20
|
+
"social.schema.json": "98e5c2a3159e5833e9af5e776231875bc42133144476e771e73575cec3f36380"
|
|
21
21
|
};
|
|
22
22
|
export const operations = {
|
|
23
23
|
"client": [
|
|
@@ -66,9 +66,11 @@ export const operations = {
|
|
|
66
66
|
"getGoldenOffer",
|
|
67
67
|
"getGoldenSuggestions",
|
|
68
68
|
"getHypercoreBalance",
|
|
69
|
+
"getHypercoreOrders",
|
|
69
70
|
"getHypercorePortfolio",
|
|
70
71
|
"getHypercoreSettlementCredits",
|
|
71
72
|
"getIdentity",
|
|
73
|
+
"getLiveMarks",
|
|
72
74
|
"getMakerActivity",
|
|
73
75
|
"getMakerCapital",
|
|
74
76
|
"getMakerExposure",
|
|
@@ -82,9 +84,9 @@ export const operations = {
|
|
|
82
84
|
"getMarketDataConfig",
|
|
83
85
|
"getMarketDefinitions",
|
|
84
86
|
"getMarketDisplay",
|
|
85
|
-
"getMarketHistory",
|
|
86
87
|
"getMarketRecurringRound",
|
|
87
88
|
"getMarketReferenceCloses",
|
|
89
|
+
"getMarketResults",
|
|
88
90
|
"getMarketRoundHistory",
|
|
89
91
|
"getMarketScoreTimeline",
|
|
90
92
|
"getMarketStats",
|
|
@@ -134,6 +136,7 @@ export const operations = {
|
|
|
134
136
|
"listFollowingFeed",
|
|
135
137
|
"listFollowingPositions",
|
|
136
138
|
"listFollows",
|
|
139
|
+
"listHypercorePositions",
|
|
137
140
|
"listMakerActivity",
|
|
138
141
|
"listMakerPositions",
|
|
139
142
|
"listMakerQuoteHistory",
|
|
@@ -183,6 +186,7 @@ export const operations = {
|
|
|
183
186
|
"uploadPicture"
|
|
184
187
|
],
|
|
185
188
|
"maker": [
|
|
189
|
+
"cancelAllQuotes",
|
|
186
190
|
"cancelQuote",
|
|
187
191
|
"confirmQuote",
|
|
188
192
|
"createCollateralReduction",
|
|
@@ -204,9 +208,9 @@ export const operations = {
|
|
|
204
208
|
"getMakerWithdrawal",
|
|
205
209
|
"getMarket",
|
|
206
210
|
"getMarketDisplay",
|
|
207
|
-
"getMarketHistory",
|
|
208
211
|
"getMarketRecurringRound",
|
|
209
212
|
"getMarketReferenceCloses",
|
|
213
|
+
"getMarketResults",
|
|
210
214
|
"getMarketRoundHistory",
|
|
211
215
|
"getOperation",
|
|
212
216
|
"getQuestion",
|
|
@@ -225,8 +229,6 @@ export const operations = {
|
|
|
225
229
|
"listOperations",
|
|
226
230
|
"listRfqs",
|
|
227
231
|
"publishMakerTelemetry",
|
|
228
|
-
"releaseQuoteLease",
|
|
229
|
-
"renewQuoteLease",
|
|
230
232
|
"searchCatalog",
|
|
231
233
|
"stream",
|
|
232
234
|
"submitMakerSelfFundedTransaction"
|
package/dist/maker.d.ts
CHANGED
|
@@ -3,10 +3,13 @@ import type { paths } from "./generated/maker.js";
|
|
|
3
3
|
import type { paths as ClientPaths } from "./generated/client.js";
|
|
4
4
|
import { type SignerInput } from "./signer.js";
|
|
5
5
|
import { TotalisStream, type StreamEventOf, type StreamOptions, type StreamSubscription } from "./stream.js";
|
|
6
|
-
import { type ResponseOf } from "./totalis.js";
|
|
6
|
+
import { type MarketFilters, type ResponseOf } from "./totalis.js";
|
|
7
7
|
import { type TransactionCall } from "./controller.js";
|
|
8
|
+
import { type ChainReader } from "./vault-reads.js";
|
|
8
9
|
export type { components, operations, paths } from "./generated/maker.js";
|
|
9
10
|
export { controllerTransactions, encodeCall, openMakerVaultTransaction, type ControllerTransactions, type TransactionCall } from "./controller.js";
|
|
11
|
+
export { legsHash } from "./typed-data.js";
|
|
12
|
+
export { legStateOfCall, legStateReadGas, readCashoutPosition, readLegState, readTicket, ticketsCall, type CashoutPosition, type ChainReader, type VaultTicket, } from "./vault-reads.js";
|
|
10
13
|
export declare function createMakerClient(environment: PublicEnvironment, options?: ApiClientOptions): import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
11
14
|
type Ok<P extends keyof paths, M extends keyof paths[P], S extends number = 200> = ResponseOf<paths, P, M, S>;
|
|
12
15
|
export type Rfq = Ok<"/v1/rfqs/{rfq_id}", "get">;
|
|
@@ -26,43 +29,51 @@ export type SelfFundedAccepted = Ok<"/v1/makers/{maker_id}/operations/{operation
|
|
|
26
29
|
export type Decision = "CONFIRM" | "DECLINE";
|
|
27
30
|
/** An RFQ as `onRfq` delivers it: open, as `GET /v1/rfqs/{rfq_id}` reads it. */
|
|
28
31
|
export type OpenedRfq = Rfq;
|
|
29
|
-
/**
|
|
30
|
-
|
|
31
|
-
* awaits its answer. Publishing would replace that quote, which the venue
|
|
32
|
-
* refuses with 409 `STATE_CONFLICT`. Nothing was published: answer the
|
|
33
|
-
* acceptance (`confirm`, or `onAcceptance`) first, or let its deadline pass.
|
|
34
|
-
*/
|
|
35
|
-
export declare class AcceptancePendingError extends Error {
|
|
36
|
-
readonly rfqId: string;
|
|
37
|
-
readonly quoteId: string;
|
|
38
|
-
readonly deadline: string;
|
|
39
|
-
readonly name = "AcceptancePendingError";
|
|
40
|
-
readonly code = "ACCEPTANCE_PENDING";
|
|
41
|
-
constructor(rfqId: string, quoteId: string, deadline: string);
|
|
42
|
-
}
|
|
32
|
+
/** The last look: whether to sign an acceptance's terms, which are already checked against what this maker published. */
|
|
33
|
+
export type LastLook = (acceptance: MakerAcceptance) => Decision | Promise<Decision>;
|
|
43
34
|
export type MakerOptions = Omit<ApiClientOptions, "accessToken"> & {
|
|
44
35
|
readonly environment: PublicEnvironment;
|
|
45
36
|
/** The WebSocket origin for the stream. Defaults to `baseUrl` if set, else the environment's stream host (`wss://hip4-ws.totalis.trade` in production). */
|
|
46
37
|
readonly streamBaseUrl?: string;
|
|
47
38
|
/** The maker's scoped `ttk_` key. */
|
|
48
39
|
readonly apiKey: AccessToken;
|
|
40
|
+
/** A HyperEVM JSON-RPC URL or EIP-1193 provider for `readCashoutPosition`; only `eth_call` is sent. */
|
|
41
|
+
readonly chain?: ChainReader;
|
|
49
42
|
readonly makerId: string;
|
|
50
43
|
/** The maker's current quote signer (`signer` in GET /v1/makers/{maker_id}/capital). Never stored. */
|
|
51
44
|
readonly signer: SignerInput;
|
|
52
45
|
/**
|
|
53
|
-
* Where this maker records
|
|
54
|
-
*
|
|
55
|
-
*
|
|
46
|
+
* Where this maker records what it publishes: the only terms its quote signer
|
|
47
|
+
* will sign: each quote and bid by its priced terms, everything but the
|
|
48
|
+
* expiry and salt the venue fills in.
|
|
49
|
+
* Defaults to memory; pass a durable store so a restarted or separate
|
|
50
|
+
* confirming process can answer quotes published elsewhere.
|
|
56
51
|
*/
|
|
57
52
|
readonly published?: PublishedStore;
|
|
53
|
+
/**
|
|
54
|
+
* The SDK confirms every acceptance of a quote this instance's `published`
|
|
55
|
+
* store holds, and leaves any other to the process that published it.
|
|
56
|
+
* `lastLook` may decline it instead, for example because the price moved.
|
|
57
|
+
* An `onAcceptance` handler, while attached, answers in place of this.
|
|
58
|
+
*/
|
|
59
|
+
readonly lastLook?: LastLook;
|
|
60
|
+
/**
|
|
61
|
+
* Default true. Pass false when another process answers this maker's
|
|
62
|
+
* acceptances, such as a quoter sharing its `published` store with a
|
|
63
|
+
* separate confirmer: this instance then answers only through
|
|
64
|
+
* `onAcceptance` or `confirm`.
|
|
65
|
+
*/
|
|
66
|
+
readonly autoConfirm?: boolean;
|
|
67
|
+
/** Where an answer the SDK sent on its own failed, or reading the pending acceptances failed (no acceptance). */
|
|
68
|
+
readonly onConfirmError?: (error: unknown, acceptance?: MakerAcceptance) => void;
|
|
58
69
|
/** Resume the maker stream after this cursor: the stream replays the events after it. Persist `stream.cursor` to use it. */
|
|
59
70
|
readonly stream?: Omit<StreamOptions, "subscription" | "accessToken" | "environment" | "baseUrl" | "streamBaseUrl"> & {
|
|
60
71
|
readonly subscription?: Omit<Extract<StreamSubscription, {
|
|
61
|
-
readonly
|
|
62
|
-
}>, "
|
|
72
|
+
readonly kind: "maker";
|
|
73
|
+
}>, "kind" | "maker_id">;
|
|
63
74
|
};
|
|
64
75
|
};
|
|
65
|
-
/** The maker-owned record of published
|
|
76
|
+
/** The maker-owned record of published quotes, by key, and until when they may be signed (unix seconds). */
|
|
66
77
|
export type PublishedStore = {
|
|
67
78
|
record(digest: string, expiry: number): void | Promise<void>;
|
|
68
79
|
forget(digest: string): void | Promise<void>;
|
|
@@ -72,8 +83,8 @@ export type PublishedStore = {
|
|
|
72
83
|
export declare function memoryPublished(): PublishedStore;
|
|
73
84
|
/**
|
|
74
85
|
* The maker SDK over the public maker surface (the one Totalis MM uses):
|
|
75
|
-
* publish
|
|
76
|
-
*
|
|
86
|
+
* publish a price on entry and cash-out RFQs, and the SDK confirms the exact
|
|
87
|
+
* terms a taker accepts when QUOTE_ACCEPTED arrives.
|
|
77
88
|
*/
|
|
78
89
|
export declare function createMaker(options: MakerOptions): {
|
|
79
90
|
client: import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
@@ -95,49 +106,109 @@ export declare function createMaker(options: MakerOptions): {
|
|
|
95
106
|
};
|
|
96
107
|
};
|
|
97
108
|
}>;
|
|
109
|
+
listMarkets: (filters?: MarketFilters, limit?: number) => AsyncGenerator<{
|
|
110
|
+
readonly outcome_id: import("./generated/openapi.js").components["schemas"]["UInt32String"];
|
|
111
|
+
readonly native_question_id: import("./generated/openapi.js").components["schemas"]["RealQuestionId"] | null;
|
|
112
|
+
readonly title: string;
|
|
113
|
+
readonly status: import("./generated/openapi.js").components["schemas"]["MarketState"];
|
|
114
|
+
readonly result: {
|
|
115
|
+
readonly availability: "AVAILABLE";
|
|
116
|
+
readonly result_state: "UNRESOLVED";
|
|
117
|
+
} | {
|
|
118
|
+
readonly availability: "AVAILABLE";
|
|
119
|
+
readonly result_state: "NUMERIC_RECORDED";
|
|
120
|
+
readonly yes_factor_numerator: import("./generated/openapi.js").components["schemas"]["FactorNumerator"];
|
|
121
|
+
readonly factor_scale: "100000000";
|
|
122
|
+
readonly recorded_at_block: import("./generated/openapi.js").components["schemas"]["PositiveInt64"];
|
|
123
|
+
readonly evidence_digest: import("./generated/openapi.js").components["schemas"]["NonZeroBytes32"];
|
|
124
|
+
} | {
|
|
125
|
+
readonly availability: "AVAILABLE";
|
|
126
|
+
readonly result_state: "RECOGNIZED_NONNUMERIC_OBSERVED";
|
|
127
|
+
readonly recorded_at_block: import("./generated/openapi.js").components["schemas"]["PositiveInt64"];
|
|
128
|
+
readonly evidence_digest: import("./generated/openapi.js").components["schemas"]["NonZeroBytes32"];
|
|
129
|
+
} | {
|
|
130
|
+
readonly availability: "UNAVAILABLE";
|
|
131
|
+
readonly reason: "NOT_QUERIED" | "NATIVE_READ_FAILED" | "RPC_UNAVAILABLE" | "MALFORMED_RETURN" | "PROVIDER_DISAGREEMENT" | "UNSUPPORTED_PROTOCOL_VERSION";
|
|
132
|
+
};
|
|
133
|
+
readonly metadata_revision: import("./generated/openapi.js").components["schemas"]["PositiveInt64"];
|
|
134
|
+
readonly eligibility: {
|
|
135
|
+
readonly status: "ENABLED";
|
|
136
|
+
} | {
|
|
137
|
+
readonly status: "DISABLED";
|
|
138
|
+
readonly reason: "UNSUPPORTED_PROTOCOL_VERSION" | "UNSUPPORTED_QUOTE_ASSET" | "IDENTITY_CONFLICT" | "DEADLINE_UNAVAILABLE" | "SOURCE_UNQUALIFIED" | "FINANCIAL_PROFILE_DISABLED" | "MARKET_NOT_ACTIVE" | "NATIVE_STATE_UNAVAILABLE" | "NATIVE_STATE_STALE" | "DEADLINE_BUFFER_ENTERED" | "REFERENCE_UNAVAILABLE" | "REFERENCE_STALE" | "SOURCE_GENERATION_MISMATCH";
|
|
139
|
+
};
|
|
140
|
+
readonly combo: {
|
|
141
|
+
readonly status: "OPEN";
|
|
142
|
+
} | {
|
|
143
|
+
readonly status: "CLOSED";
|
|
144
|
+
readonly reason: "EXCLUDED" | "UNLISTED_DEPLOYER" | "OUTSIDE_WINDOW" | "EVENT_PASSED";
|
|
145
|
+
readonly opens_at: import("./generated/openapi.js").components["schemas"]["PositiveInt64"] | null;
|
|
146
|
+
};
|
|
147
|
+
readonly deployer: {
|
|
148
|
+
readonly name: string | null;
|
|
149
|
+
readonly address: string | null;
|
|
150
|
+
};
|
|
151
|
+
readonly category: import("./generated/openapi.js").components["schemas"]["Category"];
|
|
152
|
+
readonly subcategory: import("./generated/openapi.js").components["schemas"]["Subcategory"];
|
|
153
|
+
readonly sides: readonly {
|
|
154
|
+
readonly side: import("./generated/openapi.js").components["schemas"]["Side"];
|
|
155
|
+
readonly coin: string;
|
|
156
|
+
readonly reference: {
|
|
157
|
+
readonly availability: "AVAILABLE";
|
|
158
|
+
readonly quality: import("./generated/openapi.js").components["schemas"]["Quality"];
|
|
159
|
+
readonly value: import("./generated/openapi.js").components["schemas"]["IntegerValue"];
|
|
160
|
+
readonly best_bid?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
161
|
+
readonly best_ask?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
162
|
+
readonly last_trade?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
163
|
+
readonly last_trade_at?: import("./generated/openapi.js").components["schemas"]["$defs-Timestamp"] | null;
|
|
164
|
+
readonly chance?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
165
|
+
readonly chance_basis?: ("MID" | "LAST_TRADE" | "HELD") | null;
|
|
166
|
+
readonly mark?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
167
|
+
readonly scale: import("./generated/openapi.js").components["schemas"]["Scale"];
|
|
168
|
+
readonly freshness: "FRESH" | "STALE";
|
|
169
|
+
readonly received_at: import("./generated/openapi.js").components["schemas"]["$defs-Timestamp"];
|
|
170
|
+
} | {
|
|
171
|
+
readonly availability: "UNAVAILABLE";
|
|
172
|
+
readonly reason: "NOT_OBSERVED" | "AMBIGUOUS_SOURCE" | "STALE_GENERATION" | "UNSUPPORTED_MARKET" | "SOURCE_UNQUALIFIED";
|
|
173
|
+
readonly freshness: "UNKNOWN";
|
|
174
|
+
readonly received_at: import("./generated/openapi.js").components["schemas"]["$defs-Timestamp"];
|
|
175
|
+
};
|
|
176
|
+
readonly last_chance?: import("./generated/openapi.js").components["schemas"]["IntegerValue"] | null;
|
|
177
|
+
}[];
|
|
178
|
+
readonly dates: {
|
|
179
|
+
readonly event: {
|
|
180
|
+
readonly kind: "START" | "DECISION" | "DEADLINE";
|
|
181
|
+
readonly at: import("./generated/openapi.js").components["schemas"]["PositiveInt64"];
|
|
182
|
+
} | null;
|
|
183
|
+
readonly result_by: import("./generated/openapi.js").components["schemas"]["PositiveInt64"] | null;
|
|
184
|
+
readonly resolves_after: import("./generated/openapi.js").components["schemas"]["PositiveInt64"] | null;
|
|
185
|
+
readonly scheduled_event_at: import("./generated/openapi.js").components["schemas"]["PositiveInt64"] | null;
|
|
186
|
+
readonly observation_ends_at: import("./generated/openapi.js").components["schemas"]["PositiveInt64"] | null;
|
|
187
|
+
readonly market_class: string | null;
|
|
188
|
+
} | null;
|
|
189
|
+
readonly awaiting_result?: boolean | null;
|
|
190
|
+
}, void, any>;
|
|
98
191
|
quote: (rfq: Pick<EntryRfq, "rfq_id" | "taker" | "stake" | "legs">, terms: {
|
|
99
192
|
readonly payout: bigint | string;
|
|
100
|
-
readonly lifetimeSeconds?: number;
|
|
101
|
-
readonly salt?: string;
|
|
102
193
|
}) => Promise<{
|
|
103
|
-
quoteId:
|
|
104
|
-
entry: {
|
|
105
|
-
maker_id: string;
|
|
106
|
-
legs: {
|
|
107
|
-
readonly outcome_id: import("./generated/openapi.js").components["schemas"]["UInt32String"];
|
|
108
|
-
readonly side: import("./generated/openapi.js").components["schemas"]["Side"];
|
|
109
|
-
}[];
|
|
110
|
-
stake: string;
|
|
111
|
-
payout: string;
|
|
112
|
-
fee_bps: number;
|
|
113
|
-
taker_fee_bps: number;
|
|
114
|
-
taker: string;
|
|
115
|
-
expiry: string;
|
|
116
|
-
salt: string;
|
|
117
|
-
};
|
|
194
|
+
quoteId: string;
|
|
118
195
|
}>;
|
|
119
|
-
bid: (rfq: Pick<CashoutRfq, "rfq_id" | "position_id" | "
|
|
196
|
+
bid: (rfq: Pick<CashoutRfq, "rfq_id" | "position_id" | "taker">, terms: {
|
|
120
197
|
readonly price: bigint | string;
|
|
121
|
-
readonly
|
|
122
|
-
readonly salt?: string;
|
|
198
|
+
readonly legState?: string;
|
|
123
199
|
}) => Promise<{
|
|
124
|
-
quote_id: import("./generated/openapi.js").components["schemas"]["Bytes32"];
|
|
125
|
-
sell_back: import("./generated/openapi.js").components["schemas"]["schemas-SellBackTerms"];
|
|
126
200
|
quoteId: string;
|
|
127
201
|
}>;
|
|
202
|
+
readCashoutPosition: (rfq: Pick<CashoutRfq, "position_id" | "legs">) => Promise<import("./vault-reads.js").CashoutPosition>;
|
|
128
203
|
cancelQuote: (quoteId: string) => Promise<{
|
|
129
204
|
readonly status: "CANCELLED" | "REPLACED" | "ACCEPTED";
|
|
130
205
|
}>;
|
|
131
|
-
|
|
132
|
-
readonly
|
|
133
|
-
readonly
|
|
134
|
-
}>;
|
|
135
|
-
releaseQuoteLease: () => Promise<{
|
|
136
|
-
readonly released: boolean;
|
|
206
|
+
cancelAllQuotes: () => Promise<{
|
|
207
|
+
readonly cancelled: number;
|
|
208
|
+
readonly pending: number;
|
|
137
209
|
}>;
|
|
138
|
-
keepQuoteLease: (leaseMs: number, onError?: (error: unknown) => void) => () => void;
|
|
139
210
|
confirm: (acceptance: MakerAcceptance, decision?: Decision) => Promise<Acceptance>;
|
|
140
|
-
onAcceptance: (handler:
|
|
211
|
+
onAcceptance: (handler: LastLook, onError?: (error: unknown, acceptance?: MakerAcceptance) => void) => () => void;
|
|
141
212
|
onRfq: (handler: (rfq: OpenedRfq) => unknown, onError?: (error: unknown) => void) => () => void;
|
|
142
213
|
controller: () => Promise<{
|
|
143
214
|
approveUsdc: (amount: string | bigint) => TransactionCall;
|
|
@@ -157,7 +228,16 @@ export declare function createMaker(options: MakerOptions): {
|
|
|
157
228
|
readonly idempotencyKey: string;
|
|
158
229
|
readonly submitted?: SelfFundedAccepted;
|
|
159
230
|
}>;
|
|
160
|
-
|
|
231
|
+
/**
|
|
232
|
+
* Stop quoting: cancel all open quotes and close the stream. Await it
|
|
233
|
+
* before exiting. It never rejects: it resolves to `cancelAllQuotes()`'s
|
|
234
|
+
* result, or undefined if that failed, and then a missed confirm
|
|
235
|
+
* withdraws what is left.
|
|
236
|
+
*/
|
|
237
|
+
close: () => Promise<Awaited<ReturnType<() => Promise<{
|
|
238
|
+
readonly cancelled: number;
|
|
239
|
+
readonly pending: number;
|
|
240
|
+
}>>> | undefined>;
|
|
161
241
|
};
|
|
162
242
|
export type Maker = ReturnType<typeof createMaker>;
|
|
163
243
|
/** `GET /v1/me/maker`'s `ownership`: the account's maker as the venue has indexed it. */
|