@totalis/hip4-client 0.97.0 → 0.98.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 +21 -0
- package/dist/generated/client.d.ts +3 -1
- package/dist/generated/errors.d.ts +2 -0
- package/dist/generated/errors.js +18 -0
- package/dist/generated/openapi.d.ts +173 -0
- package/dist/generated/version.d.ts +5 -5
- package/dist/generated/version.js +6 -4
- package/dist/partner.d.ts +16 -1
- package/dist/partner.js +13 -1
- package/dist/totalis.d.ts +17 -0
- package/dist/totalis.js +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
`@totalis/hip4-client` follows [semantic versioning](https://semver.org).
|
|
4
4
|
The contract version the generated types come from is `sdkVersion` in `./version`.
|
|
5
5
|
|
|
6
|
+
## 0.98.0
|
|
7
|
+
|
|
8
|
+
### Added
|
|
9
|
+
|
|
10
|
+
- Partner webhook replay (TT-2794, contract `231.0.0-partner-webhook-events`,
|
|
11
|
+
major 227, additive). `listPartnerWebhookEvents`
|
|
12
|
+
(`GET /v1/partner/webhook-events`, partner server key) lists every webhook
|
|
13
|
+
event Totalis queued for the partner in the last 30 days, oldest first, with
|
|
14
|
+
the body as posted, its `status` (`PENDING`, `DELIVERED` or `FAILED`),
|
|
15
|
+
`attempts`, `queued_at` and `delivered_at`. Page with `cursor` and narrow
|
|
16
|
+
with `since`. `createPartnerServer` gains `webhookEvents` for it.
|
|
17
|
+
- Account value (TT-2787, contract `230.0.0-account-value`, major 226,
|
|
18
|
+
additive). `getAccountValue` (`GET /v1/me/account-value`, scope
|
|
19
|
+
`account:read`) answers everything an account holds at Totalis, every
|
|
20
|
+
amount read at one HyperEVM block (`block_number`): `wallet_usdc`,
|
|
21
|
+
`vault_cash` (all of it, including cash held for an operation that has not
|
|
22
|
+
landed), `run_off_cash`, `open_positions` and their `open_cost` (the sum of
|
|
23
|
+
`acquisition_cost`), and `claimable_profit` (unclaimed profit net of the
|
|
24
|
+
fee), with `amount` their total. When `state` is `UNKNOWN` every amount is
|
|
25
|
+
null. `totalis.accountValue()` reads it.
|
|
26
|
+
|
|
6
27
|
## 0.97.0
|
|
7
28
|
|
|
8
29
|
### Changed
|
|
@@ -26,6 +26,7 @@ export type paths = {
|
|
|
26
26
|
readonly "/v1/partner/wallet-admissions": Pick<SharedPaths["/v1/partner/wallet-admissions"], "parameters" | "post">;
|
|
27
27
|
readonly "/v1/partner/report": Pick<SharedPaths["/v1/partner/report"], "parameters" | "get">;
|
|
28
28
|
readonly "/v1/partner/fills": Pick<SharedPaths["/v1/partner/fills"], "parameters" | "get">;
|
|
29
|
+
readonly "/v1/partner/webhook-events": Pick<SharedPaths["/v1/partner/webhook-events"], "parameters" | "get">;
|
|
29
30
|
readonly "/v1/me/acquisition": Pick<SharedPaths["/v1/me/acquisition"], "parameters" | "put">;
|
|
30
31
|
readonly "/v1/me/username": Pick<SharedPaths["/v1/me/username"], "parameters" | "put">;
|
|
31
32
|
readonly "/v1/me/username/availability": Pick<SharedPaths["/v1/me/username/availability"], "parameters" | "get">;
|
|
@@ -102,6 +103,7 @@ export type paths = {
|
|
|
102
103
|
readonly "/v1/rfqs/{rfq_id}": Pick<SharedPaths["/v1/rfqs/{rfq_id}"], "parameters" | "get">;
|
|
103
104
|
readonly "/v1/rfqs/{rfq_id}/cancel": Pick<SharedPaths["/v1/rfqs/{rfq_id}/cancel"], "parameters" | "post">;
|
|
104
105
|
readonly "/v1/me/balances": Pick<SharedPaths["/v1/me/balances"], "parameters" | "get">;
|
|
106
|
+
readonly "/v1/me/account-value": Pick<SharedPaths["/v1/me/account-value"], "parameters" | "get">;
|
|
105
107
|
readonly "/v1/me/operations": Pick<SharedPaths["/v1/me/operations"], "parameters" | "get">;
|
|
106
108
|
readonly "/v1/me/operations/{operation_id}": Pick<SharedPaths["/v1/me/operations/{operation_id}"], "parameters" | "get">;
|
|
107
109
|
readonly "/v1/makers/{maker_id}/funding-transaction": Pick<SharedPaths["/v1/makers/{maker_id}/funding-transaction"], "parameters" | "get">;
|
|
@@ -120,4 +122,4 @@ export type paths = {
|
|
|
120
122
|
readonly "/v1/makers/{maker_id}/exposure": Pick<SharedPaths["/v1/makers/{maker_id}/exposure"], "parameters" | "get">;
|
|
121
123
|
readonly "/v1/makers/{maker_id}/performance": Pick<SharedPaths["/v1/makers/{maker_id}/performance"], "parameters" | "get">;
|
|
122
124
|
};
|
|
123
|
-
export type operations = Pick<SharedOperations, "abandonCoreExit" | "acceptQuote" | "activeCoreExits" | "admitOwnMaker" | "admitPartnerWallet" | "approveWallet" | "bindEmbeddedWallet" | "cancelRfq" | "confirmComboCopyAgent" | "confirmCoreCopyAgent" | "createCashout" | "createComment" | "createCoreExit" | "createDeposit" | "createGoldenRfq" | "createRfq" | "createRunOffClaim" | "createWalletChallenge" | "createWalletSession" | "createWithdrawal" | "deleteComment" | "editComment" | "endWalletSession" | "followTrader" | "getAcceptance" | "getAccountActivity" | "getAccountPnl" | "getAccountPosition" | "getBalances" | "getCopyAgents" | "getCopyBudget" | "getCopySettings" | "getCopySummary" | "getCoreExit" | "getDeployment" | "getGolden" | "getGoldenMarkets" | "getGoldenOffer" | "getGoldenSuggestions" | "getHypercoreBalance" | "getHypercorePortfolio" | "getHypercoreSettlementCredits" | "getIdentity" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDataConfig" | "getMarketDefinitions" | "getMarketHistory" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketScoreTimeline" | "getMarketStats" | "getMyGenesis" | "getMyReferralBonus" | "getOperation" | "getOwnMaker" | "getPartnerReport" | "getPerpMarks" | "getProfitLeaderboard" | "getQuestion" | "getQuestionRecurringRound" | "getQuestionScoreTimeline" | "getRfq" | "getSeries" | "getSuggestedCombo" | "getTaxonomy" | "getTrader" | "getTraderPnl" | "getUsernameAvailability" | "getVaultAgents" | "getVolumeLeaderboard" | "getWalletApproval" | "getWithdrawal" | "grantComboCopyAgent" | "grantVaultAgent" | "likeComment" | "listAccountActivity" | "listAccountPositions" | "listComboCopies" | "listComboFeed" | "listCommentReplies" | "listComments" | "listControlledMakers" | "listCopiedFills" | "listCopyTrades" | "listDiscovery" | "listFollows" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarkets" | "listMyNotifications" | "listOperations" | "listPartnerFills" | "listQuotes" | "listTraderPositions" | "listTraderTrades" | "markMyNotificationsRead" | "placeGolden" | "reactComment" | "recordAcquisition" | "recordGoldenTelegramClick" | "refreshPicture" | "requestComboCopyAgent" | "requestCoreCopyAgent" | "revokeComboCopyAgent" | "searchCatalog" | "setAvatar" | "setCopyAllocation" | "setCopySettings" | "setPublicProfile" | "setUsername" | "setXHandleShown" | "signGoldenGift" | "stream" | "streamMarkets" | "switchOffComboCopyAgent" | "switchOffCoreCopyAgent" | "unfollowTrader" | "unlikeComment" | "unlockGolden" | "unreactComment">;
|
|
125
|
+
export type operations = Pick<SharedOperations, "abandonCoreExit" | "acceptQuote" | "activeCoreExits" | "admitOwnMaker" | "admitPartnerWallet" | "approveWallet" | "bindEmbeddedWallet" | "cancelRfq" | "confirmComboCopyAgent" | "confirmCoreCopyAgent" | "createCashout" | "createComment" | "createCoreExit" | "createDeposit" | "createGoldenRfq" | "createRfq" | "createRunOffClaim" | "createWalletChallenge" | "createWalletSession" | "createWithdrawal" | "deleteComment" | "editComment" | "endWalletSession" | "followTrader" | "getAcceptance" | "getAccountActivity" | "getAccountPnl" | "getAccountPosition" | "getAccountValue" | "getBalances" | "getCopyAgents" | "getCopyBudget" | "getCopySettings" | "getCopySummary" | "getCoreExit" | "getDeployment" | "getGolden" | "getGoldenMarkets" | "getGoldenOffer" | "getGoldenSuggestions" | "getHypercoreBalance" | "getHypercorePortfolio" | "getHypercoreSettlementCredits" | "getIdentity" | "getMakerActivity" | "getMakerCapital" | "getMakerExposure" | "getMakerPerformance" | "getMakerPosition" | "getMakerQuotes" | "getMakerTelemetry" | "getMakerVaultFundingTransaction" | "getMakerWithdrawal" | "getMarket" | "getMarketDataConfig" | "getMarketDefinitions" | "getMarketHistory" | "getMarketRecurringRound" | "getMarketReferenceCloses" | "getMarketScoreTimeline" | "getMarketStats" | "getMyGenesis" | "getMyReferralBonus" | "getOperation" | "getOwnMaker" | "getPartnerReport" | "getPerpMarks" | "getProfitLeaderboard" | "getQuestion" | "getQuestionRecurringRound" | "getQuestionScoreTimeline" | "getRfq" | "getSeries" | "getSuggestedCombo" | "getTaxonomy" | "getTrader" | "getTraderPnl" | "getUsernameAvailability" | "getVaultAgents" | "getVolumeLeaderboard" | "getWalletApproval" | "getWithdrawal" | "grantComboCopyAgent" | "grantVaultAgent" | "likeComment" | "listAccountActivity" | "listAccountPositions" | "listComboCopies" | "listComboFeed" | "listCommentReplies" | "listComments" | "listControlledMakers" | "listCopiedFills" | "listCopyTrades" | "listDiscovery" | "listFollows" | "listMakerActivity" | "listMakerPositions" | "listMakerQuoteHistory" | "listMarkets" | "listMyNotifications" | "listOperations" | "listPartnerFills" | "listPartnerWebhookEvents" | "listQuotes" | "listTraderPositions" | "listTraderTrades" | "markMyNotificationsRead" | "placeGolden" | "reactComment" | "recordAcquisition" | "recordGoldenTelegramClick" | "refreshPicture" | "requestComboCopyAgent" | "requestCoreCopyAgent" | "revokeComboCopyAgent" | "searchCatalog" | "setAvatar" | "setCopyAllocation" | "setCopySettings" | "setPublicProfile" | "setUsername" | "setXHandleShown" | "signGoldenGift" | "stream" | "streamMarkets" | "switchOffComboCopyAgent" | "switchOffCoreCopyAgent" | "unfollowTrader" | "unlikeComment" | "unlockGolden" | "unreactComment">;
|
|
@@ -437,6 +437,7 @@ export declare const operationErrors: {
|
|
|
437
437
|
readonly getAccountActivity: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_QUERY", "ORIGIN_REQUIRED", "NOT_FOUND", "SOURCE_UNAVAILABLE", "CONTRACT_UNAVAILABLE", "IDENTITY_NOT_FOUND"];
|
|
438
438
|
readonly getAccountPnl: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "RATE_LIMITED", "INVALID_QUERY", "ORIGIN_REQUIRED", "SOURCE_UNAVAILABLE", "CONTRACT_UNAVAILABLE", "IDENTITY_NOT_FOUND"];
|
|
439
439
|
readonly getAccountPosition: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_QUERY", "ORIGIN_REQUIRED", "NOT_FOUND", "SOURCE_UNAVAILABLE", "CONTRACT_UNAVAILABLE", "IDENTITY_NOT_FOUND"];
|
|
440
|
+
readonly getAccountValue: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "IDENTITY_NOT_FOUND", "SOURCE_UNAVAILABLE"];
|
|
440
441
|
readonly getBalances: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "IDENTITY_NOT_FOUND"];
|
|
441
442
|
readonly getCollateralReduction: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "NOT_FOUND", "IDENTITY_NOT_FOUND"];
|
|
442
443
|
readonly getCopyAgents: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "RATE_LIMITED", "ORIGIN_REQUIRED", "IDENTITY_NOT_FOUND", "CONTRACT_UNAVAILABLE", "INVALID_QUERY"];
|
|
@@ -518,6 +519,7 @@ export declare const operationErrors: {
|
|
|
518
519
|
readonly listOperations: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_QUERY", "INVALID_CURSOR", "IDENTITY_NOT_FOUND"];
|
|
519
520
|
readonly listOperatorApiKeys: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "NOT_FOUND"];
|
|
520
521
|
readonly listPartnerFills: readonly ["INVALID_QUERY", "INVALID_CURSOR", "UNAUTHENTICATED", "FORBIDDEN", "RATE_LIMITED", "AUTHORIZATION_UNAVAILABLE", "SOURCE_UNAVAILABLE"];
|
|
522
|
+
readonly listPartnerWebhookEvents: readonly ["INVALID_QUERY", "INVALID_CURSOR", "UNAUTHENTICATED", "FORBIDDEN", "RATE_LIMITED", "AUTHORIZATION_UNAVAILABLE", "SOURCE_UNAVAILABLE"];
|
|
521
523
|
readonly listPersonalApiKeys: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "NOT_FOUND"];
|
|
522
524
|
readonly listQuotes: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_REQUEST", "NOT_FOUND", "IDENTITY_NOT_FOUND"];
|
|
523
525
|
readonly listRfqs: readonly ["UNAUTHENTICATED", "FORBIDDEN", "AUTHORIZATION_UNAVAILABLE", "DEPENDENCY_STALE", "RATE_LIMITED", "INVALID_QUERY", "INVALID_CURSOR"];
|
package/dist/generated/errors.js
CHANGED
|
@@ -917,6 +917,15 @@ export const operationErrors = {
|
|
|
917
917
|
"CONTRACT_UNAVAILABLE",
|
|
918
918
|
"IDENTITY_NOT_FOUND"
|
|
919
919
|
],
|
|
920
|
+
"getAccountValue": [
|
|
921
|
+
"UNAUTHENTICATED",
|
|
922
|
+
"FORBIDDEN",
|
|
923
|
+
"AUTHORIZATION_UNAVAILABLE",
|
|
924
|
+
"DEPENDENCY_STALE",
|
|
925
|
+
"RATE_LIMITED",
|
|
926
|
+
"IDENTITY_NOT_FOUND",
|
|
927
|
+
"SOURCE_UNAVAILABLE"
|
|
928
|
+
],
|
|
920
929
|
"getBalances": [
|
|
921
930
|
"UNAUTHENTICATED",
|
|
922
931
|
"FORBIDDEN",
|
|
@@ -1710,6 +1719,15 @@ export const operationErrors = {
|
|
|
1710
1719
|
"AUTHORIZATION_UNAVAILABLE",
|
|
1711
1720
|
"SOURCE_UNAVAILABLE"
|
|
1712
1721
|
],
|
|
1722
|
+
"listPartnerWebhookEvents": [
|
|
1723
|
+
"INVALID_QUERY",
|
|
1724
|
+
"INVALID_CURSOR",
|
|
1725
|
+
"UNAUTHENTICATED",
|
|
1726
|
+
"FORBIDDEN",
|
|
1727
|
+
"RATE_LIMITED",
|
|
1728
|
+
"AUTHORIZATION_UNAVAILABLE",
|
|
1729
|
+
"SOURCE_UNAVAILABLE"
|
|
1730
|
+
],
|
|
1713
1731
|
"listPersonalApiKeys": [
|
|
1714
1732
|
"UNAUTHENTICATED",
|
|
1715
1733
|
"FORBIDDEN",
|
|
@@ -555,6 +555,26 @@ export type paths = {
|
|
|
555
555
|
readonly patch?: never;
|
|
556
556
|
readonly trace?: never;
|
|
557
557
|
};
|
|
558
|
+
readonly "/v1/partner/webhook-events": {
|
|
559
|
+
readonly parameters: {
|
|
560
|
+
readonly query?: never;
|
|
561
|
+
readonly header?: never;
|
|
562
|
+
readonly path?: never;
|
|
563
|
+
readonly cookie?: never;
|
|
564
|
+
};
|
|
565
|
+
/**
|
|
566
|
+
* List your webhook events
|
|
567
|
+
* @description Every webhook event Totalis queued for you in the last 30 days, delivered or not, in the order it queued them, each with the body it posts and how its delivery stands, so you can recover events your endpoint missed.
|
|
568
|
+
*/
|
|
569
|
+
readonly get: operations["listPartnerWebhookEvents"];
|
|
570
|
+
readonly put?: never;
|
|
571
|
+
readonly post?: never;
|
|
572
|
+
readonly delete?: never;
|
|
573
|
+
readonly options?: never;
|
|
574
|
+
readonly head?: never;
|
|
575
|
+
readonly patch?: never;
|
|
576
|
+
readonly trace?: never;
|
|
577
|
+
};
|
|
558
578
|
readonly "/v1/me/acquisition": {
|
|
559
579
|
readonly parameters: {
|
|
560
580
|
readonly query?: never;
|
|
@@ -2332,6 +2352,26 @@ export type paths = {
|
|
|
2332
2352
|
readonly patch?: never;
|
|
2333
2353
|
readonly trace?: never;
|
|
2334
2354
|
};
|
|
2355
|
+
readonly "/v1/me/account-value": {
|
|
2356
|
+
readonly parameters: {
|
|
2357
|
+
readonly query?: never;
|
|
2358
|
+
readonly header?: never;
|
|
2359
|
+
readonly path?: never;
|
|
2360
|
+
readonly cookie?: never;
|
|
2361
|
+
};
|
|
2362
|
+
/**
|
|
2363
|
+
* Get account value
|
|
2364
|
+
* @description Everything your account holds at Totalis, all read at one HyperEVM block: wallet USDC, your cash in the vault and in vaults running off, what you paid for your open positions, and the profit you can still claim, net of the fee.
|
|
2365
|
+
*/
|
|
2366
|
+
readonly get: operations["getAccountValue"];
|
|
2367
|
+
readonly put?: never;
|
|
2368
|
+
readonly post?: never;
|
|
2369
|
+
readonly delete?: never;
|
|
2370
|
+
readonly options?: never;
|
|
2371
|
+
readonly head?: never;
|
|
2372
|
+
readonly patch?: never;
|
|
2373
|
+
readonly trace?: never;
|
|
2374
|
+
};
|
|
2335
2375
|
readonly "/v1/me/operations": {
|
|
2336
2376
|
readonly parameters: {
|
|
2337
2377
|
readonly query?: never;
|
|
@@ -4524,6 +4564,41 @@ export type components = {
|
|
|
4524
4564
|
/** @description Whether more fills follow in the range. */
|
|
4525
4565
|
readonly has_more: boolean;
|
|
4526
4566
|
};
|
|
4567
|
+
readonly PartnerWebhookEvent: {
|
|
4568
|
+
/** @description The event body exactly as Totalis posts it to the webhook. */
|
|
4569
|
+
readonly event: {
|
|
4570
|
+
/** @description The event's id, as the webhook-id header carried it; dedupe on it. */
|
|
4571
|
+
readonly id: string;
|
|
4572
|
+
/** @description The event type, such as position.opened or balance.updated. */
|
|
4573
|
+
readonly type: string;
|
|
4574
|
+
/** @description When the event happened. */
|
|
4575
|
+
readonly created_at: string;
|
|
4576
|
+
/** @description The event's data, as posted. */
|
|
4577
|
+
readonly data: unknown;
|
|
4578
|
+
};
|
|
4579
|
+
/**
|
|
4580
|
+
* @description PENDING while Totalis still sends it, DELIVERED once the webhook answered 2xx, FAILED after the last attempt failed.
|
|
4581
|
+
* @enum {string}
|
|
4582
|
+
*/
|
|
4583
|
+
readonly status: "PENDING" | "DELIVERED" | "FAILED";
|
|
4584
|
+
/** @description How many times Totalis has sent it. */
|
|
4585
|
+
readonly attempts: number;
|
|
4586
|
+
/** @description When Totalis queued it. */
|
|
4587
|
+
readonly queued_at: components["schemas"]["$defs-Timestamp"];
|
|
4588
|
+
/**
|
|
4589
|
+
* Format: date-time
|
|
4590
|
+
* @description When the webhook accepted it, or null.
|
|
4591
|
+
*/
|
|
4592
|
+
readonly delivered_at: string | null;
|
|
4593
|
+
};
|
|
4594
|
+
readonly PartnerWebhookEventPage: {
|
|
4595
|
+
/** @description Events in the order Totalis queued them, oldest first. */
|
|
4596
|
+
readonly events: readonly components["schemas"]["PartnerWebhookEvent"][];
|
|
4597
|
+
/** @description Send it as cursor for the events after this page. It follows the last event even when has_more is false, so keep it and read again later for new events. Null only when no event has been returned yet. */
|
|
4598
|
+
readonly next_cursor: components["schemas"]["NextCursor"];
|
|
4599
|
+
/** @description Whether more events follow. */
|
|
4600
|
+
readonly has_more: boolean;
|
|
4601
|
+
};
|
|
4527
4602
|
/** @description One tagged landing on the app. Values come from utm_source, utm_medium, utm_campaign and ref; the path carries no query string. */
|
|
4528
4603
|
readonly AcquisitionTouch: {
|
|
4529
4604
|
readonly source?: string;
|
|
@@ -5895,6 +5970,34 @@ export type components = {
|
|
|
5895
5970
|
/** @description The account's cash in vaults running off, one item per vault holding any or with a claim in flight, outside amount: it is owned but never spendable here. A Totalis embedded wallet's moves to its HyperCore spot balance automatically. Any other wallet claims it to its own wallet, part of Cash, with one Exit signed for that vault and sent with Create run-off claim; a sponsored claim must move at least 1 USDC (1000000), so offer it only when state is CURRENT, vault_free is at least that and claim is null. Smaller amounts stay in the vault. Empty when no vault is running off. */
|
|
5896
5971
|
readonly run_off: readonly components["schemas"]["RunOffCash"][];
|
|
5897
5972
|
};
|
|
5973
|
+
/** @description What the account holds at Totalis at one HyperEVM block, in atomic USDC (6 decimals, "1000000" = 1 USDC): wallet USDC, its cash in the vault and in vaults running off, what it paid for its open positions, and the profit it can still claim, net of the fee. Every amount is read from the chain at block_number. HyperCore balances are not included; read them from Hyperliquid. */
|
|
5974
|
+
readonly AccountValue: {
|
|
5975
|
+
/** @description The account's wallet, lowercase. */
|
|
5976
|
+
readonly account: components["schemas"]["LowercaseNonZeroAddress"];
|
|
5977
|
+
/**
|
|
5978
|
+
* @description CURRENT when every amount was read at block_number; UNKNOWN when the chain could not be read, or the projection did not reach that block in time, and every amount is null. Read again later.
|
|
5979
|
+
* @enum {unknown}
|
|
5980
|
+
*/
|
|
5981
|
+
readonly state: "CURRENT" | "UNKNOWN";
|
|
5982
|
+
/** @description The account's value: wallet_usdc + vault_cash + run_off_cash + open_cost + claimable_profit. Null unless state is CURRENT. */
|
|
5983
|
+
readonly amount: components["schemas"]["$defs-Amount"] | null;
|
|
5984
|
+
/** @description The HyperEVM block every amount was read at. Null unless state is CURRENT. */
|
|
5985
|
+
readonly block_number: components["schemas"]["UInt64String"] | null;
|
|
5986
|
+
/** @description USDC in the account's wallet on HyperEVM, including any already committed to a Totalis withdrawal or stake that has not landed. Null unless state is CURRENT. */
|
|
5987
|
+
readonly wallet_usdc: components["schemas"]["$defs-Amount"] | null;
|
|
5988
|
+
/** @description All the account's cash in the vault, including any held for an operation that has not landed, so it can exceed GET /v1/me/balances' free vault cash. Null unless state is CURRENT. */
|
|
5989
|
+
readonly vault_cash: components["schemas"]["$defs-Amount"] | null;
|
|
5990
|
+
/** @description The account's cash in vaults running off, all together; GET /v1/me/balances lists it per vault. Null unless state is CURRENT. */
|
|
5991
|
+
readonly run_off_cash: components["schemas"]["$defs-Amount"] | null;
|
|
5992
|
+
/** @description How many positions the account holds that have not settled: OPEN and AWAITING_SETTLEMENT in GET /v1/me/positions. Null unless state is CURRENT. */
|
|
5993
|
+
readonly open_positions: number | null;
|
|
5994
|
+
/** @description What the account paid for those positions: the sum of their acquisition_cost. Null unless state is CURRENT. */
|
|
5995
|
+
readonly open_cost: components["schemas"]["$defs-Amount"] | null;
|
|
5996
|
+
/** @description What claiming every SETTLED_UNCLAIMED position would pay the account: each one's unclaimed_profit minus floor(unclaimed_profit * fee_bps / 10000). Null unless state is CURRENT. */
|
|
5997
|
+
readonly claimable_profit: components["schemas"]["$defs-Amount"] | null;
|
|
5998
|
+
/** @description The vault projection the read used to find the account's positions. When state is CURRENT it has reached block_number. */
|
|
5999
|
+
readonly checkpoint: components["schemas"]["Checkpoint"];
|
|
6000
|
+
};
|
|
5898
6001
|
readonly OperationList: {
|
|
5899
6002
|
/** @description Operations newest first by creation time. */
|
|
5900
6003
|
readonly operations: readonly components["schemas"]["Operation"][];
|
|
@@ -7996,6 +8099,51 @@ export interface operations {
|
|
|
7996
8099
|
readonly 503: components["responses"]["Unavailable"];
|
|
7997
8100
|
};
|
|
7998
8101
|
};
|
|
8102
|
+
readonly listPartnerWebhookEvents: {
|
|
8103
|
+
readonly parameters: {
|
|
8104
|
+
readonly query?: {
|
|
8105
|
+
/**
|
|
8106
|
+
* @description List only events queued at or after this RFC 3339 time.
|
|
8107
|
+
* @example 2026-11-13T00:00:00Z
|
|
8108
|
+
*/
|
|
8109
|
+
readonly since?: string;
|
|
8110
|
+
/**
|
|
8111
|
+
* @description Omit for the oldest events kept; then send a previous response's next_cursor unchanged.
|
|
8112
|
+
* @example v1:812:balance_01933a5e-6f1c-7c3a-9b1e-2f4d5c6b7a81
|
|
8113
|
+
*/
|
|
8114
|
+
readonly cursor?: components["schemas"]["PageCursor"];
|
|
8115
|
+
/**
|
|
8116
|
+
* @description Maximum items per page, 1 to 200, default 50. A page may hold fewer, even none, while has_more is true.
|
|
8117
|
+
* @example 50
|
|
8118
|
+
*/
|
|
8119
|
+
readonly limit?: components["parameters"]["Limit"];
|
|
8120
|
+
};
|
|
8121
|
+
readonly header?: never;
|
|
8122
|
+
readonly path?: never;
|
|
8123
|
+
readonly cookie?: never;
|
|
8124
|
+
};
|
|
8125
|
+
readonly requestBody?: never;
|
|
8126
|
+
readonly responses: {
|
|
8127
|
+
/** @description A page of your webhook events. No caching. */
|
|
8128
|
+
readonly 200: {
|
|
8129
|
+
headers: {
|
|
8130
|
+
readonly [name: string]: unknown;
|
|
8131
|
+
};
|
|
8132
|
+
content: {
|
|
8133
|
+
readonly "application/json": components["schemas"]["PartnerWebhookEventPage"];
|
|
8134
|
+
};
|
|
8135
|
+
};
|
|
8136
|
+
/** @description `INVALID_QUERY`: since is not an RFC 3339 time, or limit is not 1 to 200. `INVALID_CURSOR`: the cursor is not one this endpoint returned. */
|
|
8137
|
+
readonly 400: components["responses"]["Error"];
|
|
8138
|
+
/** @description The partner server key is missing, unknown or revoked, or your partner is suspended. */
|
|
8139
|
+
readonly 401: components["responses"]["Error"];
|
|
8140
|
+
/** @description Any credential but a partner server key, or any request with an `Origin`, is refused: read webhook events from your server. */
|
|
8141
|
+
readonly 403: components["responses"]["Error"];
|
|
8142
|
+
readonly 429: components["responses"]["RateLimited"];
|
|
8143
|
+
/** @description Webhook events are temporarily unavailable; resend after `Retry-After`. */
|
|
8144
|
+
readonly 503: components["responses"]["Unavailable"];
|
|
8145
|
+
};
|
|
8146
|
+
};
|
|
7999
8147
|
readonly recordAcquisition: {
|
|
8000
8148
|
readonly parameters: {
|
|
8001
8149
|
readonly query?: never;
|
|
@@ -11653,6 +11801,31 @@ export interface operations {
|
|
|
11653
11801
|
readonly 503: components["responses"]["Unavailable"];
|
|
11654
11802
|
};
|
|
11655
11803
|
};
|
|
11804
|
+
readonly getAccountValue: {
|
|
11805
|
+
readonly parameters: {
|
|
11806
|
+
readonly query?: never;
|
|
11807
|
+
readonly header?: never;
|
|
11808
|
+
readonly path?: never;
|
|
11809
|
+
readonly cookie?: never;
|
|
11810
|
+
};
|
|
11811
|
+
readonly requestBody?: never;
|
|
11812
|
+
readonly responses: {
|
|
11813
|
+
/** @description Your account's value and its parts. When state is UNKNOWN every amount is null; read again later. No caching. */
|
|
11814
|
+
readonly 200: {
|
|
11815
|
+
headers: {
|
|
11816
|
+
readonly [name: string]: unknown;
|
|
11817
|
+
};
|
|
11818
|
+
content: {
|
|
11819
|
+
readonly "application/json": components["schemas"]["AccountValue"];
|
|
11820
|
+
};
|
|
11821
|
+
};
|
|
11822
|
+
readonly 401: components["responses"]["Error"];
|
|
11823
|
+
readonly 403: components["responses"]["Error"];
|
|
11824
|
+
readonly 404: components["responses"]["Error"];
|
|
11825
|
+
readonly 429: components["responses"]["RateLimited"];
|
|
11826
|
+
readonly 503: components["responses"]["Unavailable"];
|
|
11827
|
+
};
|
|
11828
|
+
};
|
|
11656
11829
|
readonly listOperations: {
|
|
11657
11830
|
readonly parameters: {
|
|
11658
11831
|
readonly query?: {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const sdkVersion = "
|
|
2
|
-
export declare const openapiSha256 = "
|
|
1
|
+
export declare const sdkVersion = "231.0.0-partner-webhook-events";
|
|
2
|
+
export declare const openapiSha256 = "153af0c29c1c8e4c69d5223c04b30f32186065262348f4c4713a5b6ea53d851d";
|
|
3
3
|
export declare const realtimeSha256 = "32e56c8bb642401f5b03e9c38274087c09bebb73ffe60c0d34432c2e78ce1e15";
|
|
4
4
|
export declare const jsonSchemaSha256: {
|
|
5
|
-
readonly "account.schema.json": "
|
|
5
|
+
readonly "account.schema.json": "e6cd5a75429d074f23bd7f6ffd370fa59d0e3f7dbd6aef6433e5ba0d21b5baeb";
|
|
6
6
|
readonly "comments.schema.json": "b3e35b9b1bd90b763658fcd25910ec123d44713cdf608b4e52667c91b78f0aa5";
|
|
7
7
|
readonly "common.schema.json": "04f51deb3cbea448e59195e26ede3212598d58a7940fe67eb2123fd9161c5edb";
|
|
8
8
|
readonly "core-exit.schema.json": "c7f617e815225cdcac95c236f8b73fbe288ee5713ff444c3be90eb915fc3a401";
|
|
9
9
|
readonly "error.schema.json": "f98be7f7a0fa7d46479743fb040684627658abc3a04b0dccdf3f089a22454715";
|
|
10
10
|
readonly "hypercore.schema.json": "5b89b2bbff7ec8cc1b8717375d12ce9cd5ab6aa5af03c4fdc6cc753ef9583a2c";
|
|
11
|
-
readonly "identity.schema.json": "
|
|
11
|
+
readonly "identity.schema.json": "a97ec2f4319a16619d3a3ab613989fb1dba8107713e0fb8f1f9ad5aea25a67e3";
|
|
12
12
|
readonly "maker-access.schema.json": "49698ee0235e42064aae0397db1e0f646bdc10d9dfa10121714ba06dd69fee3b";
|
|
13
13
|
readonly "maker-action.schema.json": "dc41e52c868848e85cdeb918992cb710d34616d2803a63f6d9a658e016744a50";
|
|
14
14
|
readonly "maker-telemetry.schema.json": "85b111ce0f4935299d1116071b43de12e775bef4e0c283c12f19046d34374a9c";
|
|
@@ -18,7 +18,7 @@ export declare const jsonSchemaSha256: {
|
|
|
18
18
|
readonly "realtime.schema.json": "32e56c8bb642401f5b03e9c38274087c09bebb73ffe60c0d34432c2e78ce1e15";
|
|
19
19
|
};
|
|
20
20
|
export declare const operations: {
|
|
21
|
-
readonly client: readonly ["abandonCoreExit", "acceptQuote", "activeCoreExits", "admitOwnMaker", "admitPartnerWallet", "approveWallet", "bindEmbeddedWallet", "cancelRfq", "confirmComboCopyAgent", "confirmCoreCopyAgent", "createCashout", "createComment", "createCoreExit", "createDeposit", "createGoldenRfq", "createRfq", "createRunOffClaim", "createWalletChallenge", "createWalletSession", "createWithdrawal", "deleteComment", "editComment", "endWalletSession", "followTrader", "getAcceptance", "getAccountActivity", "getAccountPnl", "getAccountPosition", "getBalances", "getCopyAgents", "getCopyBudget", "getCopySettings", "getCopySummary", "getCoreExit", "getDeployment", "getGolden", "getGoldenMarkets", "getGoldenOffer", "getGoldenSuggestions", "getHypercoreBalance", "getHypercorePortfolio", "getHypercoreSettlementCredits", "getIdentity", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDataConfig", "getMarketDefinitions", "getMarketHistory", "getMarketRecurringRound", "getMarketReferenceCloses", "getMarketScoreTimeline", "getMarketStats", "getMyGenesis", "getMyReferralBonus", "getOperation", "getOwnMaker", "getPartnerReport", "getPerpMarks", "getProfitLeaderboard", "getQuestion", "getQuestionRecurringRound", "getQuestionScoreTimeline", "getRfq", "getSeries", "getSuggestedCombo", "getTaxonomy", "getTrader", "getTraderPnl", "getUsernameAvailability", "getVaultAgents", "getVolumeLeaderboard", "getWalletApproval", "getWithdrawal", "grantComboCopyAgent", "grantVaultAgent", "likeComment", "listAccountActivity", "listAccountPositions", "listComboCopies", "listComboFeed", "listCommentReplies", "listComments", "listControlledMakers", "listCopiedFills", "listCopyTrades", "listDiscovery", "listFollows", "listMakerActivity", "listMakerPositions", "listMakerQuoteHistory", "listMarkets", "listMyNotifications", "listOperations", "listPartnerFills", "listQuotes", "listTraderPositions", "listTraderTrades", "markMyNotificationsRead", "placeGolden", "reactComment", "recordAcquisition", "recordGoldenTelegramClick", "refreshPicture", "requestComboCopyAgent", "requestCoreCopyAgent", "revokeComboCopyAgent", "searchCatalog", "setAvatar", "setCopyAllocation", "setCopySettings", "setPublicProfile", "setUsername", "setXHandleShown", "signGoldenGift", "stream", "streamMarkets", "switchOffComboCopyAgent", "switchOffCoreCopyAgent", "unfollowTrader", "unlikeComment", "unlockGolden", "unreactComment"];
|
|
21
|
+
readonly client: readonly ["abandonCoreExit", "acceptQuote", "activeCoreExits", "admitOwnMaker", "admitPartnerWallet", "approveWallet", "bindEmbeddedWallet", "cancelRfq", "confirmComboCopyAgent", "confirmCoreCopyAgent", "createCashout", "createComment", "createCoreExit", "createDeposit", "createGoldenRfq", "createRfq", "createRunOffClaim", "createWalletChallenge", "createWalletSession", "createWithdrawal", "deleteComment", "editComment", "endWalletSession", "followTrader", "getAcceptance", "getAccountActivity", "getAccountPnl", "getAccountPosition", "getAccountValue", "getBalances", "getCopyAgents", "getCopyBudget", "getCopySettings", "getCopySummary", "getCoreExit", "getDeployment", "getGolden", "getGoldenMarkets", "getGoldenOffer", "getGoldenSuggestions", "getHypercoreBalance", "getHypercorePortfolio", "getHypercoreSettlementCredits", "getIdentity", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketDataConfig", "getMarketDefinitions", "getMarketHistory", "getMarketRecurringRound", "getMarketReferenceCloses", "getMarketScoreTimeline", "getMarketStats", "getMyGenesis", "getMyReferralBonus", "getOperation", "getOwnMaker", "getPartnerReport", "getPerpMarks", "getProfitLeaderboard", "getQuestion", "getQuestionRecurringRound", "getQuestionScoreTimeline", "getRfq", "getSeries", "getSuggestedCombo", "getTaxonomy", "getTrader", "getTraderPnl", "getUsernameAvailability", "getVaultAgents", "getVolumeLeaderboard", "getWalletApproval", "getWithdrawal", "grantComboCopyAgent", "grantVaultAgent", "likeComment", "listAccountActivity", "listAccountPositions", "listComboCopies", "listComboFeed", "listCommentReplies", "listComments", "listControlledMakers", "listCopiedFills", "listCopyTrades", "listDiscovery", "listFollows", "listMakerActivity", "listMakerPositions", "listMakerQuoteHistory", "listMarkets", "listMyNotifications", "listOperations", "listPartnerFills", "listPartnerWebhookEvents", "listQuotes", "listTraderPositions", "listTraderTrades", "markMyNotificationsRead", "placeGolden", "reactComment", "recordAcquisition", "recordGoldenTelegramClick", "refreshPicture", "requestComboCopyAgent", "requestCoreCopyAgent", "revokeComboCopyAgent", "searchCatalog", "setAvatar", "setCopyAllocation", "setCopySettings", "setPublicProfile", "setUsername", "setXHandleShown", "signGoldenGift", "stream", "streamMarkets", "switchOffComboCopyAgent", "switchOffCoreCopyAgent", "unfollowTrader", "unlikeComment", "unlockGolden", "unreactComment"];
|
|
22
22
|
readonly maker: readonly ["cancelQuote", "confirmQuote", "createCollateralReduction", "createQuote", "getAccountActivity", "getAccountPosition", "getCollateralReduction", "getDeployment", "getMakerActivity", "getMakerCapital", "getMakerExposure", "getMakerPerformance", "getMakerPosition", "getMakerQuotes", "getMakerTelemetry", "getMakerTelemetryPublication", "getMakerVaultFundingTransaction", "getMakerWithdrawal", "getMarket", "getMarketHistory", "getMarketRecurringRound", "getMarketReferenceCloses", "getOperation", "getQuestion", "getQuestionRecurringRound", "getRfq", "getSeries", "getTaxonomy", "listAccountActivity", "listAccountPositions", "listDiscovery", "listMakerAcceptances", "listMakerActivity", "listMakerPositions", "listMakerQuoteHistory", "listMarkets", "listOperations", "listRfqs", "publishMakerTelemetry", "releaseQuoteLease", "renewQuoteLease", "searchCatalog", "stream", "submitMakerSelfFundedTransaction"];
|
|
23
23
|
readonly operator: readonly ["live", "ready"];
|
|
24
24
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Generated by scripts/generate.mjs; do not edit.
|
|
2
|
-
export const sdkVersion = "
|
|
3
|
-
export const openapiSha256 = "
|
|
2
|
+
export const sdkVersion = "231.0.0-partner-webhook-events";
|
|
3
|
+
export const openapiSha256 = "153af0c29c1c8e4c69d5223c04b30f32186065262348f4c4713a5b6ea53d851d";
|
|
4
4
|
export const realtimeSha256 = "32e56c8bb642401f5b03e9c38274087c09bebb73ffe60c0d34432c2e78ce1e15";
|
|
5
5
|
export const jsonSchemaSha256 = {
|
|
6
|
-
"account.schema.json": "
|
|
6
|
+
"account.schema.json": "e6cd5a75429d074f23bd7f6ffd370fa59d0e3f7dbd6aef6433e5ba0d21b5baeb",
|
|
7
7
|
"comments.schema.json": "b3e35b9b1bd90b763658fcd25910ec123d44713cdf608b4e52667c91b78f0aa5",
|
|
8
8
|
"common.schema.json": "04f51deb3cbea448e59195e26ede3212598d58a7940fe67eb2123fd9161c5edb",
|
|
9
9
|
"core-exit.schema.json": "c7f617e815225cdcac95c236f8b73fbe288ee5713ff444c3be90eb915fc3a401",
|
|
10
10
|
"error.schema.json": "f98be7f7a0fa7d46479743fb040684627658abc3a04b0dccdf3f089a22454715",
|
|
11
11
|
"hypercore.schema.json": "5b89b2bbff7ec8cc1b8717375d12ce9cd5ab6aa5af03c4fdc6cc753ef9583a2c",
|
|
12
|
-
"identity.schema.json": "
|
|
12
|
+
"identity.schema.json": "a97ec2f4319a16619d3a3ab613989fb1dba8107713e0fb8f1f9ad5aea25a67e3",
|
|
13
13
|
"maker-access.schema.json": "49698ee0235e42064aae0397db1e0f646bdc10d9dfa10121714ba06dd69fee3b",
|
|
14
14
|
"maker-action.schema.json": "dc41e52c868848e85cdeb918992cb710d34616d2803a63f6d9a658e016744a50",
|
|
15
15
|
"maker-telemetry.schema.json": "85b111ce0f4935299d1116071b43de12e775bef4e0c283c12f19046d34374a9c",
|
|
@@ -48,6 +48,7 @@ export const operations = {
|
|
|
48
48
|
"getAccountActivity",
|
|
49
49
|
"getAccountPnl",
|
|
50
50
|
"getAccountPosition",
|
|
51
|
+
"getAccountValue",
|
|
51
52
|
"getBalances",
|
|
52
53
|
"getCopyAgents",
|
|
53
54
|
"getCopyBudget",
|
|
@@ -122,6 +123,7 @@ export const operations = {
|
|
|
122
123
|
"listMyNotifications",
|
|
123
124
|
"listOperations",
|
|
124
125
|
"listPartnerFills",
|
|
126
|
+
"listPartnerWebhookEvents",
|
|
125
127
|
"listQuotes",
|
|
126
128
|
"listTraderPositions",
|
|
127
129
|
"listTraderTrades",
|
package/dist/partner.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type WalletAdmission = components["schemas"]["WalletAdmission"];
|
|
|
6
6
|
export type PartnerReport = components["schemas"]["PartnerReport"];
|
|
7
7
|
/** A page of fee events on your users' positions (TT-2749). Amounts are atomic USDC strings. */
|
|
8
8
|
export type PartnerFillPage = components["schemas"]["PartnerFillPage"];
|
|
9
|
+
export type PartnerWebhookEventPage = components["schemas"]["PartnerWebhookEventPage"];
|
|
9
10
|
/** A wallet's signed consent to one partner opening its account (TT-1688). */
|
|
10
11
|
export type AdmissionConsent = {
|
|
11
12
|
readonly expires_at: string;
|
|
@@ -51,7 +52,8 @@ export type PartnerServerOptions = Omit<ApiClientOptions, "accessToken" | "partn
|
|
|
51
52
|
* wallet's consent (`signAdmissionConsent` in your frontend), and its next
|
|
52
53
|
* wallet sign-in creates the account, attributed to you. `report` reads your
|
|
53
54
|
* fees, terms and payouts (TT-2420), and `fills` each fee event on your
|
|
54
|
-
* users' positions (TT-2749)
|
|
55
|
+
* users' positions (TT-2749), and `webhookEvents` reads back the webhook
|
|
56
|
+
* events Totalis queued for you (TT-2794). Refuses to run in a browser or a React Native
|
|
55
57
|
* app, where the server key would be exposed.
|
|
56
58
|
*/
|
|
57
59
|
export declare function createPartnerServer(options: PartnerServerOptions): {
|
|
@@ -83,5 +85,18 @@ export declare function createPartnerServer(options: PartnerServerOptions): {
|
|
|
83
85
|
readonly cursor?: string;
|
|
84
86
|
readonly limit?: number;
|
|
85
87
|
}): Promise<PartnerFillPage>;
|
|
88
|
+
/**
|
|
89
|
+
* Your webhook events from the last 30 days, delivered or not, oldest
|
|
90
|
+
* first, each with the body as it was posted and how its delivery stands:
|
|
91
|
+
* recover what your endpoint missed. `since` (RFC 3339) narrows to events
|
|
92
|
+
* queued from then on. Pass `next_cursor` as `cursor` for the next page;
|
|
93
|
+
* it follows the last event even when `has_more` is false, so keep it to
|
|
94
|
+
* read new events later.
|
|
95
|
+
*/
|
|
96
|
+
webhookEvents(query?: {
|
|
97
|
+
readonly since?: string;
|
|
98
|
+
readonly cursor?: string;
|
|
99
|
+
readonly limit?: number;
|
|
100
|
+
}): Promise<PartnerWebhookEventPage>;
|
|
86
101
|
};
|
|
87
102
|
export type PartnerServer = ReturnType<typeof createPartnerServer>;
|
package/dist/partner.js
CHANGED
|
@@ -34,7 +34,8 @@ export async function signAdmissionConsent(request) {
|
|
|
34
34
|
* wallet's consent (`signAdmissionConsent` in your frontend), and its next
|
|
35
35
|
* wallet sign-in creates the account, attributed to you. `report` reads your
|
|
36
36
|
* fees, terms and payouts (TT-2420), and `fills` each fee event on your
|
|
37
|
-
* users' positions (TT-2749)
|
|
37
|
+
* users' positions (TT-2749), and `webhookEvents` reads back the webhook
|
|
38
|
+
* events Totalis queued for you (TT-2794). Refuses to run in a browser or a React Native
|
|
38
39
|
* app, where the server key would be exposed.
|
|
39
40
|
*/
|
|
40
41
|
export function createPartnerServer(options) {
|
|
@@ -74,5 +75,16 @@ export function createPartnerServer(options) {
|
|
|
74
75
|
async fills(query) {
|
|
75
76
|
return unwrap(await client.GET("/v1/partner/fills", { params: { query: query ?? {} } }));
|
|
76
77
|
},
|
|
78
|
+
/**
|
|
79
|
+
* Your webhook events from the last 30 days, delivered or not, oldest
|
|
80
|
+
* first, each with the body as it was posted and how its delivery stands:
|
|
81
|
+
* recover what your endpoint missed. `since` (RFC 3339) narrows to events
|
|
82
|
+
* queued from then on. Pass `next_cursor` as `cursor` for the next page;
|
|
83
|
+
* it follows the last event even when `has_more` is false, so keep it to
|
|
84
|
+
* read new events later.
|
|
85
|
+
*/
|
|
86
|
+
async webhookEvents(query) {
|
|
87
|
+
return unwrap(await client.GET("/v1/partner/webhook-events", { params: { query: query ?? {} } }));
|
|
88
|
+
},
|
|
77
89
|
};
|
|
78
90
|
}
|
package/dist/totalis.d.ts
CHANGED
|
@@ -319,6 +319,23 @@ export declare function createTotalis(options: TotalisOptions): {
|
|
|
319
319
|
readonly wallet: bigint | null;
|
|
320
320
|
readonly total: bigint | null;
|
|
321
321
|
}>;
|
|
322
|
+
/** What the account holds at Totalis, every amount read at one block (`GET /v1/me/account-value`). */
|
|
323
|
+
accountValue: (signal?: AbortSignal) => Promise<{
|
|
324
|
+
readonly account: import("./generated/openapi.js").components["schemas"]["LowercaseNonZeroAddress"];
|
|
325
|
+
readonly state: "CURRENT" | "UNKNOWN";
|
|
326
|
+
readonly amount: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
327
|
+
readonly block_number: import("./generated/openapi.js").components["schemas"]["UInt64String"] | null;
|
|
328
|
+
readonly wallet_usdc: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
329
|
+
readonly vault_cash: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
330
|
+
readonly run_off_cash: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
331
|
+
readonly open_positions: number | null;
|
|
332
|
+
readonly open_cost: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
333
|
+
readonly claimable_profit: import("./generated/openapi.js").components["schemas"]["$defs-Amount"] | null;
|
|
334
|
+
readonly checkpoint: {
|
|
335
|
+
readonly block_number: import("./generated/openapi.js").components["schemas"]["UInt64String"];
|
|
336
|
+
readonly projection_state: "CURRENT" | "STALE";
|
|
337
|
+
};
|
|
338
|
+
}>;
|
|
322
339
|
readComboCash: (options?: {
|
|
323
340
|
readonly info?: HyperliquidInfo;
|
|
324
341
|
readonly signal?: AbortSignal;
|
package/dist/totalis.js
CHANGED
|
@@ -449,6 +449,10 @@ export function createTotalis(options) {
|
|
|
449
449
|
async function readSpendableCash(signal) {
|
|
450
450
|
return spendableCash(unwrap(await client.GET("/v1/me/balances", signal === undefined ? {} : { signal })));
|
|
451
451
|
}
|
|
452
|
+
/** A fresh `GET /v1/me/account-value`: what the account holds at Totalis, every amount read at one block; all null when `state` is `UNKNOWN`. */
|
|
453
|
+
async function readAccountValue(signal) {
|
|
454
|
+
return unwrap(await client.GET("/v1/me/account-value", signal === undefined ? {} : { signal }));
|
|
455
|
+
}
|
|
452
456
|
/**
|
|
453
457
|
* The account's Combo cash now (`ComboCash`): one venue balances read and
|
|
454
458
|
* the signer's HyperCore cash read from Hyperliquid, together. Pass `cash`
|
|
@@ -1558,6 +1562,8 @@ export function createTotalis(options) {
|
|
|
1558
1562
|
deployment,
|
|
1559
1563
|
/** Spendable Totalis cash from a fresh balances read (`spendableCash`): `{ vault, wallet, total }`, each `null` while unknown, never 0. */
|
|
1560
1564
|
spendableCash: readSpendableCash,
|
|
1565
|
+
/** What the account holds at Totalis, every amount read at one block (`GET /v1/me/account-value`). */
|
|
1566
|
+
accountValue: readAccountValue,
|
|
1561
1567
|
readComboCash,
|
|
1562
1568
|
openPosition,
|
|
1563
1569
|
cashOut,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@totalis/hip4-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.98.0",
|
|
4
4
|
"description": "Totalis HIP-4 SDK: typed HTTP clients, signer-agnostic typed data, a retrying request layer, pagination, a realtime stream and taker/maker flows",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|