import Axios from 'axios';
import { INTERNAL_SYMBOL } from '#utils';
import type * as kuma from '#index';
import type { AnyObj } from '#types/utils';
import type { AxiosInstance, AxiosRequestConfig, CreateAxiosDefaults } from 'axios';
/**
* Authenticated API client configuration options.
*
* @example
* ```typescript
* import { RestAuthenticatedClient } from '@kumabid/kuma-sdk';
*
* // Edit the values before for your environment
* const authenticatedClient = new RestAuthenticatedClient({
* sandbox: false,
* apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
* apiSecret: 'axuh3ywgg854aq7m73oy6gnnpj5ar9a67szuw5lclbz77zqu0j',
* walletPrivateKey: '0x...'
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/interfaces/RestAuthenticatedClientOptions.html)
* @see client {@link RestAuthenticatedClient}
*
* @category API Clients
*/
export interface RestAuthenticatedClientOptions {
/**
* - Used to authenticate the requesting user making requests to the API.
*/
apiKey: string;
/**
* - Used to compute HMAC signature for authenticated requests
*/
apiSecret: string;
/**
* The private key for the wallet making requests to the API.
*
* **Note:** This should always be provided except in advanced use case scenarios.
*
* - When **provided**, used to create ECDSA signatures for authenticated requests automatically.
* - When **not provided**, must provider your own {@link kuma.SignTypedData signer} to sign requests
* that require an ECDSA signature.
*/
walletPrivateKey?: string;
/**
* - If `true`, the client will point to [Kuma Sandbox API](https;//api-docs-v1.kuma.bid/#sandbox)
* - If not provided or `false`, will point to the Kuma Production API.
*
* @defaultValue false
*/
sandbox?: boolean;
/**
* - Optionally provide a custom baseURL to use instead of the automatically
* derived value based on the {@link sandbox} option.
*
* @internal
*/
baseURL?: string;
/**
* **Optionally** provide the `exchangeContractAddress` as returned by the public clients
* {@link RestPublicClient.getExchange getExchange} response's
* {@link kuma.KumaExchange.exchangeContractAddress exchangeContractAddress} property.
*
* - If not provided, this will be fetched and cached automatically from the public client before
* making the first request which requires it.
*
* @internal
*/
exchangeContractAddress?: string;
/**
* Optionally provide the `chainId` as returned by the public clients
* {@link RestPublicClient.getExchange getExchange} response's
* {@link kuma.KumaExchange.chainId chainId} property.
*
* - If not provided, this will be fetched and cached automatically from the public client before
* making the first request which requires it.
*
* @internal
*/
chainId?: number;
/**
* Optionally provide the `stargateBridgeAdapterContractAddress` as returned by the public clients
* {@link RestPublicClient.getExchange getExchange} response's
* {@link kuma.KumaExchange.stargateBridgeAdapterContractAddress stargateBridgeAdapterContractAddress}
* property.
*
* - If not provided, this will be fetched and cached automatically from the public client before
* making the first request which requires it.
*
* @internal
*/
stargateBridgeAdapterContractAddress?: string;
/**
* - Changing this value will likely result in a broken client, internal use only.
*
* @defaultValue true
* @internal
*/
autoCreateHmacHeader?: boolean;
/**
* - This is for internal use only and may not work as expected if used.
*
* @internal
*/
axiosConfig?: CreateAxiosDefaults;
}
/**
* The {@link RestAuthenticatedClient} is used to make authenticated requests to the Kuma API. It includes
* methods that make requests on behalf of a specific wallet such as creating and cancelling orders.
*
* - The client requires the following properties to automatically handle authentication
* of requests:
* - {@link RestAuthenticatedClientOptions.apiKey apiKey}
* - {@link RestAuthenticatedClientOptions.apiSecret apiSecret}
* - {@link RestAuthenticatedClientOptions.walletPrivateKey walletPrivateKey}
* - Optionally, a {@link RestAuthenticatedClientOptions.sandbox sandbox} option can
* be set to `true` in order to point to the Kuma Sandbox API.
*
* @example
* ```typescript
* import { RestAuthenticatedClient } from '@kumabid/kuma-sdk';
*
* // Edit the values before for your environment
* const authenticatedClient = new RestAuthenticatedClient({
* sandbox: false,
* apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
* apiSecret: 'axuh3ywgg854aq7m73oy6gnnpj5ar9a67szuw5lclbz77zqu0j',
* walletPrivateKey: '0x...'
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html)
* @see options {@link RestAuthenticatedClientOptions}
*
* @category API Clients
* @category Kuma - Get Market Maker Rewards Epochs
* @category Kuma - Get Wallets
* @category Kuma - Get Positions
* @category Kuma - Associate Wallet
* @category Kuma - Create Order
* @category Kuma - Cancel Order
* @category Kuma - Get Orders
* @category Kuma - Get Fills
* @category Kuma - Get Payouts
* @category Kuma - Authorize Payout
* @category Kuma - Get Deposits
* @category Kuma - Get Withdrawals
* @category Kuma - Withdraw Funds
* @category Kuma - Get Funding Payments
* @category Kuma - Get Historical PnL
* @category Kuma - Get WebSocket Token
*/
export declare class RestAuthenticatedClient {
#private;
/**
* When creating an authenticated client, a {@link kuma.RestPublicClient RestPublicClient} is automatically
* created and can be used based on the config given for this client.
*
* - Can be utilized to fetch public data instead of creating both clients.
* - Used when fetching the {@link kuma.KumaExchange.exchangeContractAddress exchangeContractAddress}
* and {@link kuma.KumaExchange.chainId chainId} properties from the public client's
* {@link RestPublicClient.getExchange getExchange} method.
*
* @example
* ```typescript
* import { RestAuthenticatedClient } from '@kumabid/kuma-sdk';
*
* // Edit the values before for your environment
* const client = new RestAuthenticatedClient({
* sandbox: true,
* apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
* apiSecret: 'axuh3ywgg854aq7m73oy6gnnpj5ar9a67szuw5lclbz77zqu0j',
* walletPrivateKey: '0x...'
* });
*
* const wallets = await client.getWallets();
* ```
*
*
*
* ---
*
* @see client {@link kuma.RestPublicClient RestPublicClient}
*
* @category Accessors
*/
readonly public: kuma.RestPublicClient;
readonly axios: AxiosInstance;
/**
* Gets the current configured options for the client.
*
* - The `baseURL` is automatically derived from the {@link sandbox} option during construction
* unless a custom `baseURL` is given.
* - The `sandbox` will either default to `false` unless provided in the client constructor.
* - Both `exchangeContractAddress` and `chainId` use the provided values during construction
* or are automatically fetched from the {@link public} client.
*
* @category Accessors
*
* @internal
*/
get config(): Readonly<{
baseURL: string;
sandbox: boolean;
autoCreateHmacHeader: boolean;
chainId?: number | undefined;
stargateBridgeAdapterContractAddress?: string | undefined;
exchangeContractAddress?: string | undefined;
}>;
/**
* The {@link RestAuthenticatedClient} is used to make authenticated requests to the Kuma API. It includes
* methods that make requests on behalf of a specific wallet such as creating and cancelling orders.
*
* - The client requires the following properties to automatically handle authentication
* of requests:
* - {@link RestAuthenticatedClientOptions.apiKey apiKey}
* - {@link RestAuthenticatedClientOptions.apiSecret apiSecret}
* - {@link RestAuthenticatedClientOptions.walletPrivateKey walletPrivateKey}
* - Optionally, a {@link RestAuthenticatedClientOptions.sandbox sandbox} option can
* be set to `true` in order to point to the Kuma Sandbox API.
*
* @example
* ```typescript
* import { RestAuthenticatedClient } from '@kumabid/kuma-sdk';
*
* // Edit the values before for your environment
* const client = new RestAuthenticatedClient({
* sandbox: true,
* apiKey: '1f7c4f52-4af7-4e1b-aa94-94fac8d931aa',
* apiSecret: 'axuh3ywgg854aq7m73oy6gnnpj5ar9a67szuw5lclbz77zqu0j',
* walletPrivateKey: '0x...'
* });
*
* const wallets = await client.getWallets();
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/WebSocketClient.html)
* @see options {@link RestAuthenticatedClientOptions}
*
* @category Constructor
*/
constructor(options: RestAuthenticatedClientOptions);
/**
*
*
* ---
* **Endpoint Parameters**
*
* > - HTTP Request: `GET /v1/marketMakerRewardsV1/epoch`
* > - Endpoint Security: [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - API Key Scope: [Read](https://api-docs-v1.kuma.bid/#api-keys)
* ---
*
*
*
*
* About Overloads
*
* This method has two overloads to provide type-safe responses:
*
* -
* Calling this method with a {@link kuma.RestRequestGetMarketMakerRewardsEpochWithWallet.wallet wallet}
* parameter returns {@link kuma.MarketMakerRewardsEpochDetailedWithWallet MarketMakerRewardsEpochDetailedWithWallet}
*
* -
* Calling this method without a {@link kuma.RestRequestGetMarketMakerRewardsEpochWithWallet.wallet wallet}
* parameter returns {@link kuma.MarketMakerRewardsEpochDetailedWithoutWallet MarketMakerRewardsEpochDetailedWithoutWallet}
*
*
*
*
*
*
*
*
* Overload 1: With Wallet
*
* The Get Epoch endpoint provides detailed information about
* epoch configuration as well as wallet epoch performance.
*
* > When **providing** a wallet address, the resulting response will
* > be {@link kuma.MarketMakerRewardsEpochDetailedWithWallet MarketMakerRewardsEpochDetailedWithWallet}
*/
getMarketMakerRewardsEpoch(params: kuma.RestRequestGetMarketMakerRewardsEpochWithWallet): Promise;
/**
* Overload 2: Without Wallet
*
* > When **not** providing a {@link kuma.RestRequestGetMarketMakerRewardsEpochWithWallet.wallet wallet},
* > the resulting response will be {@link kuma.MarketMakerRewardsEpochDetailedWithoutWallet MarketMakerRewardsEpochDetailedWithoutWallet}
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getMarketMakerRewardsEpoch)
* @see request {@link kuma.RestRequestGetMarketMakerRewardsEpoch RestRequestGetMarketMakerRewardsEpoch}
* @see response {@link kuma.RestResponseGetMarketMakerRewardsEpoch RestResponseGetMarketMakerRewardsEpoch}
* @see type {@link kuma.KumaMarketMakerRewardsEpoch KumaMarketMakerRewardsEpoch}
* @see related {@link getMarketMakerRewardsEpochs this.getMarketMakerRewardsEpochs}
*
* @category Rewards & Payouts
*/
getMarketMakerRewardsEpoch(params: kuma.RestRequestGetMarketMakerRewardsEpochWithoutWallet): Promise;
/**
* The Get Epochs endpoint provides a list of the defined
* market maker rewards epochs.
*
* ---
* **Endpoint Parameters**
*
* > - HTTP Request: `GET /v1/marketMakerRewardsV1/epochs`
* > - Endpoint Security: [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - API Key Scope: [Read](https://api-docs-v1.kuma.bid/#api-keys)
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getMarketMakerRewardsEpochs)
* @see request {@link kuma.RestRequestGetMarketMakerRewardsEpochs RestRequestGetMarketMakerRewardsEpochs}
* @see response {@link kuma.RestResponseGetMarketMakerRewardsEpochs RestResponseGetMarketMakerRewardsEpochs}
* @see type {@link kuma.KumaMarketMakerRewardsEpochSummary KumaMarketMakerRewardsEpochSummary}
* @see related {@link getMarketMakerRewardsEpoch client.getMarketMakerRewardsEpoch}
*
* @category Rewards & Payouts
*/
getMarketMakerRewardsEpochs(params?: kuma.RestRequestGetMarketMakerRewardsEpochs): Promise;
/**
* Associates a wallet with an API account, allowing access to private data such as fills.
* Associating a wallet with an API account is often the first step in interacting with private
* read endpoints.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `POST /v1/wallets`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns the {@link kuma.KumaWallet KumaWallet} which was associated by the request.
*
* ---
*
* @example
* ```typescript
* const wallet = await client.associateWallet({
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#associateWallet)
* @see request {@link kuma.RestRequestAssociateWallet RestRequestAssociateWallet}
* @see response {@link kuma.RestResponseAssociateWallet RestResponseAssociateWallet}
* @see type {@link kuma.KumaWallet KumaWallet}
*
* @category Wallets & Positions
*/
associateWallet(params: kuma.RestRequestAssociateWallet, signer?: undefined | kuma.SignTypedData): Promise;
/**
* Returns information about the wallets associated with the API account.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/wallets`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - An array of {@link kuma.KumaWallet KumaWallet} objects representing all associated wallets.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getWallets)
* @see request {@link kuma.RestRequestGetWallets RestRequestGetWallets}
* @see response {@link kuma.RestResponseGetWallets RestResponseGetWallets}
* @see type {@link kuma.KumaWallet KumaWallet}
*
* @category Wallets & Positions
*/
getWallets(params: kuma.RestRequestGetWallets): Promise;
/**
* Get Positions
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/positions`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - An array of {@link kuma.KumaPosition KumaPosition} objects representing all matching positions based
* on your requested params.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getPositions)
* @see request {@link kuma.RestRequestGetPositions RestRequestGetPositions}
* @see response {@link kuma.RestResponseGetPositions RestResponseGetPositions}
* @see type {@link kuma.KumaPosition KumaPosition}
*
* @category Wallets & Positions
*/
getPositions(params: kuma.RestRequestGetPositions): Promise;
/**
* Create and submit an order to the matching engine.
*
* - It is recommended to use the {@link kuma.OrderType OrderType} enum when creating
* your requests. This provides inline documentation and ensures accuracy of the values.
* - Check out the {@link kuma.RestRequestOrder RestRequestOrder} type for an overview
* of the various parameters needed for different order types.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `POST /v1/orders`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityTrade)
* > - **API Key Scope:** [Trade](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns the {@link kuma.KumaOrder KumaOrder} which was created by the request.
*
* ---
*
* @example
* ```typescript
* import { OrderType, OrderSide } from '@kumabid/kuma-sdk';
*
* try {
* const order = await client.createOrder({
* // always use the enum and define it first so that
* // the type of this params object change to the
* // appropriate interface with completion hints in IDE!
* type: OrderType.market,
* // this object is now narrowed to
* // interface: RestRequestOrderTypeMarket
* side: OrderSide.buy,
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* market: 'ETH-USD',
* quantity: '10.00000000'
* });
* } catch(e) {
* // order placement failed with an unexpected error
* // you may use isAxiosError(e) for stronger typing here if desired
* if (e.response?.data?.code === 'INSUFFICIENT_FUNDS') {
* // handle insufficient funds errors
* console.log('Insufficient funds to create order');
* }
* }
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#createOrder)
* @see request {@link kuma.RestRequestOrder RestRequestOrder}
* @see response {@link kuma.RestResponseGetOrder RestResponseGetOrder}
* @see type {@link kuma.KumaOrder KumaOrder}
*
* @category Orders
*/
createOrder(params: kuma.RestRequestOrder & {
type: T;
}, signer?: undefined | kuma.SignTypedData): Promise;
/**
* Cancel multiple matching orders using one of the following methods:
*
* - By {@link kuma.RestRequestCancelOrdersByWallet.wallet wallet} (params: {@link kuma.RestRequestCancelOrdersByWallet RestRequestCancelOrdersByWallet})
* - By {@link kuma.RestRequestCancelOrdersByMarket.wallet wallet} & {@link kuma.RestRequestCancelOrdersByMarket.market market} (params: {@link kuma.RestRequestCancelOrdersByMarket RestRequestCancelOrdersByMarket})
* - By {@link kuma.RestRequestCancelOrdersByMarket.wallet wallet} & {@link kuma.RestRequestCancelOrdersByOrderIds.orderIds orderIds} (params: {@link kuma.RestRequestCancelOrdersByOrderIds RestRequestCancelOrdersByOrderIds})
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `DELETE /v1/orders`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Trade](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns an array of cancelled orders matching {@link kuma.KumaCanceledOrder KumaCanceledOrder}
*
* ---
*
* @example
* ```typescript
* const allOrders = client.cancelOrders({
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* });
*
* const ordersForMarket = client.cancelOrders({
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* market: 'ETH-USD'
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#cancelOrders)
* @see request {@link kuma.RestRequestCancelOrders RestRequestCancelOrders}
* @see response {@link kuma.RestResponseCancelOrders RestResponseCancelOrders}
* @see type {@link kuma.KumaCanceledOrder KumaCanceledOrder}
* @see related {@link cancelOrder client.cancelOrder}
*
* @category Orders
*/
cancelOrders(params: kuma.RestRequestCancelOrders, signer?: kuma.SignTypedData | undefined): Promise;
private makeCancelOrdersRequest;
/**
* Returns an order matching your {@link kuma.RestRequestGetOrder.orderId orderId} request parameter.
*
* - Can be an order's {@link kuma.KumaOrder.orderId orderId}
* - To get an order by its {@link kuma.KumaOrder.clientOrderId clientOrderId},
* you should prefix the value with `client:`.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/orders`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getOrder)
* @see request {@link kuma.RestRequestGetOrder RestRequestGetOrder}
* @see response {@link kuma.RestResponseGetOrder RestResponseGetOrder}
* @see type {@link kuma.KumaOrder KumaOrder}
* @see related {@link getOrders client.getOrders}
*
* @category Orders
*/
getOrder(params: kuma.RestRequestGetOrder): Promise;
/**
* Returns information about open and past {@link kuma.KumaOrder orders}.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/orders`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit},
* > {@link kuma.RestRequestPaginationWithFromId.fromId fromId}
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getOrders)
* @see request {@link kuma.RestRequestGetOrders RestRequestGetOrders}
* @see response {@link kuma.RestResponseGetOrders RestResponseGetOrders}
* @see type {@link kuma.KumaOrder KumaOrder}
* @see related {@link getOrder client.getOrder}
*
* @category Orders
*/
getOrders(params: kuma.RestRequestGetOrders): Promise;
/**
* Get a single fill from the API by your requests {@link kuma.RestRequestGetFill.fillId fillId}
* parameter.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/fills`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getFill)
* @see request {@link kuma.RestRequestGetFill RestRequestGetFill}
* @see response {@link kuma.RestResponseGetFill RestResponseGetFill}
* @see type {@link kuma.KumaFill KumaFill}
* @see related {@link getFills client.getFills}
*
* @category Fills & Historical
*/
getFill(params: kuma.RestRequestGetFill): Promise;
/**
* Get an array of {@link KumaFill} objects matching your request parameters.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/fills`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit},
* > {@link kuma.RestRequestPaginationWithFromId.fromId fromId}
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getFills)
* @see request {@link kuma.RestRequestGetFills RestRequestGetFills}
* @see response {@link kuma.RestResponseGetFills RestResponseGetFills}
* @see type {@link kuma.KumaFill KumaFill}
* @see related {@link getFill client.getFill}
*
* @category Fills & Historical
*/
getFills(params: kuma.RestRequestGetFills): Promise;
/**
* Returns information about a payout program and the requested wallets earned/paid amounts for
* the program.
*
* - Includes the data required to authorize a payout using the `distribute`
* function of the escrow contract.
* - Throws an error if the {@link kuma.KumaPayoutProgram.quantityOwed quantityOwed}
* is `0`
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `POST /v1/payouts`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @example
* ```typescript
* import { PayoutProgram } from '@kumabid/kuma-sdk';
*
* // create client
*
* await client.authorizePayout({
* wallet: '0x...',
* nonce: uuidv1(),
* // use the PayoutProgram enum for inline auto completion
* program: PayoutProgram.tradingRewardsV2
* });
* ```
*
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#authorizePayout)
* @see request {@link kuma.RestRequestAuthorizePayout RestRequestAuthorizePayout}
* @see response {@link kuma.RestResponseAuthorizePayout RestResponseAuthorizePayout}
* @see type {@link kuma.KumaPayoutProgramAuthorization KumaPayoutProgramAuthorization}
*
* @category Rewards & Payouts
*/
authorizePayout(params: kuma.RestRequestAuthorizePayout): Promise;
/**
* Returns information about a payout program and the requested wallets
* earned/paid amounts for the program.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/payouts`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @example
* ```typescript
* import { PayoutProgram } from '@kumabid/kuma-sdk';
*
* // create client
*
* await client.getPayouts({
* wallet: '0x...',
* nonce: uuidv1(),
* // use the PayoutProgram enum for inline auto completion
* program: PayoutProgram.tradingRewardsV2
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getPayouts)
* @see request {@link kuma.RestRequestGetPayouts RestRequestGetPayouts}
* @see response {@link kuma.RestResponseGetPayouts RestResponseGetPayouts}
* @see type {@link kuma.KumaPayoutProgram KumaPayoutProgram}
*
* @category Rewards & Payouts
*/
getPayouts(params: kuma.RestRequestGetPayouts): Promise;
/**
* Returns information about deposits made by a wallet.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/deposits`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns a single {@link kuma.KumaDeposit KumaDeposit} object matching your parameters.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getDeposit)
* @see request {@link kuma.RestRequestGetDeposit RestRequestGetDeposit}
* @see response {@link kuma.RestResponseGetDeposit RestResponseGetDeposit}
* @see type {@link kuma.KumaDeposit KumaDeposit}
* @see related {@link getDeposits client.getDeposits}
*
* @category Deposits & Withdrawals
*/
getDeposit(params: kuma.RestRequestGetDeposit): Promise;
/**
* Returns information about deposits made by a wallet.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/deposits`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit},
* > {@link kuma.RestRequestPaginationWithFromId.fromId fromId}
* ---
*
* @returns
* - Returns an array of {@link kuma.KumaDeposit KumaDeposit} objects matching your parameters.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getDeposits)
* @see request {@link kuma.RestRequestGetDeposits RestRequestGetDeposits}
* @see response {@link kuma.RestResponseGetDeposits RestResponseGetDeposits}
* @see type {@link kuma.KumaDeposit KumaDeposit}
* @see related {@link getDeposit client.getDeposit}
*
* @category Deposits & Withdrawals
*/
getDeposits(params: kuma.RestRequestGetDeposits): Promise;
/**
* A convenience method that helps capture the appropriate value for the
* {@link withdraw} method's {@link kuma.RestRequestWithdrawFundsBase.maximumGasFee maximumGasFee}
* parameter.
*
* - Calls `publicClient.getGasFees` and adds the defined `maximumSlippagePercent` to it.
* - User should then confirm the value is acceptable before calling {@link withdraw} method.
* - If gas were `0.05000000` and `maximumSlippagePercent` is `0.10000000` (10%) then result would be `0.05500000`
* - The value is represented in USD.
*
* ---
*
* @returns
* - A value indicating the max gas fee that should be allowed (in USD) based on the
* core gas fee with your `maximumSlippagePercent` added. This value should always
* be validated by your application before calling {@link withdraw} method with this
* as your {@link kuma.RestRequestWithdrawFundsBase.maximumGasFee maximumGasFee}
* parameter.
*
* ---
*
* @example
* ```typescript
* // returns the max gas fee in USD you will accept for a withdrawal
* const maximumGasFee = await client.calculateWithdrawalMaximumGasFee({
* bridgeTarget: BridgeTarget.STARGATE_ETHEREUM,
* // 10% slippage alllowed (default)
* maximumSlippagePercent: '0.10000000'
* });
*
* // never pay more than $1 USD in gas fees to withdrawal
* if (Number(maximumGasFee) >= 1) {
* throw new Error('Too Much Gas cost to Withdraw! ${maximumGasFee} USD >= 1 USD!');
* }
*
* const withdrawal = await client.withdraw({
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* quantity: '100.00000000',
* maximumGasFee,
* bridgeTarget: BridgeTarget.STARGATE_ETHEREUM
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#calculateWithdrawalMaximumGasFee)
* @see related {@link withdraw client.withdraw}
*/
calculateWithdrawalMaximumGasFee({ bridgeTarget, maximumSlippagePercent, }: {
/**
* The bridge target for the withdrawal of funds.
*
* - Utilize the {@link BridgeTarget} enum for convenience and
* auto-completion.
* - Automatically calculates the {@link bridgeAdapterAddress} &
* {@link bridgeAdapterPayload} parameters for the targeted network.
*
* @see enum {@link BridgeTarget}
*/
bridgeTarget: kuma.BridgeTarget;
/**
* Maximum slippage percent in pips percent format (ex `0.10000000` for 10%)
*
* @example
* ```typescript
* // 10%
* '0.10000000'
* ```
*/
maximumSlippagePercent: string;
}): Promise;
/**
* Withdraw funds from the exchange.
*
* - Unlike deposits, withdrawals are initiated via this REST API endpoint.
* - Once the withdrawal is validated, Kuma automatically dispatches the
* resulting transaction to send funds to the wallet.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `POST /v1/withdrawals`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Withdraw](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns an {@link kuma.KumaWithdrawal KumaWithdrawal} object providing the details of the
* withdrawal.
*
* ---
*
* @example
* ```typescript
* // returns the max gas fee in USD you will accept for a withdrawal
* const maximumGasFee = await client.calculateWithdrawalMaximumGasFee({
* bridgeTarget: BridgeTarget.STARGATE_ETHEREUM,
* // 10% slippage alllowed (default)
* maximumSlippagePercent: '0.10000000'
* });
*
* // never pay more than $1 USD in gas fees to withdrawal
* if (Number(maximumGasFee) >= 1) {
* throw new Error('Too Much Gas cost to Withdraw! ${maximumGasFee} USD >= 1 USD!');
* }
*
* const withdrawal = await client.withdraw({
* nonce: uuidv1(),
* wallet: '0xA71C4aeeAabBBB8D2910F41C2ca3964b81F7310d',
* quantity: '100.00000000',
* maximumGasFee,
* bridgeTarget: BridgeTarget.STARGATE_ETHEREUM
* });
* ```
*
*
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#withdraw)
* @see request {@link kuma.RestRequestWithdrawFunds RestRequestWithdrawFunds}
* @see response {@link kuma.RestResponseWithdrawFunds RestResponseWithdrawFunds}
* @see type {@link kuma.KumaWithdrawal KumaWithdrawal}
* @see related {@link calculateWithdrawalMaximumGasFee}
*
* @category Deposits & Withdrawals
*/
withdraw($params: kuma.RestRequestWithdrawFundsSDK | kuma.RestRequestWithdrawFunds, signer?: undefined | kuma.SignTypedData): Promise;
/**
* Returns information about a single withdrawal matching the request.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/withdrawals`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns an {@link kuma.KumaWithdrawal KumaWithdrawal} object matching your request.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getWithdrawal)
* @see request {@link kuma.RestRequestGetWithdrawal RestRequestGetWithdrawal}
* @see response {@link kuma.RestResponseGetWithdrawal RestResponseGetWithdrawal}
* @see type {@link kuma.KumaWithdrawal KumaWithdrawal}
* @see related {@link getWithdrawals client.getWithdrawals}
*
* @category Deposits & Withdrawals
*/
getWithdrawal(params: kuma.RestRequestGetWithdrawal): Promise;
/**
* Returns information about withdrawals to a wallet.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/withdrawals`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit},
* > {@link kuma.RestRequestPaginationWithFromId.fromId fromId}
* ---
*
* @returns
* - Returns an array of {@link kuma.KumaWithdrawal KumaWithdrawal} objects matching your request.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getWithdrawals)
* @see request {@link kuma.RestRequestGetWithdrawals RestRequestGetWithdrawals}
* @see response {@link kuma.RestResponseGetWithdrawals RestResponseGetWithdrawals}
* @see type {@link kuma.KumaWithdrawal KumaWithdrawal}
* @see related {@link getWithdrawal client.getWithdrawal}
*
* @category Deposits & Withdrawals
*/
getWithdrawals(params: kuma.RestRequestGetWithdrawals): Promise;
/**
* Get Funding Payments for wallet matching {@link kuma.KumaFundingPayment KumaFundingPayment}
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/fundingPayments`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit}
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getFundingPayments)
* @see request {@link kuma.RestRequestGetFundingPayments RestRequestGetFundingPayments}
* @see response {@link kuma.RestResponseGetFundingPayments RestResponseGetFundingPayments}
* @see type {@link kuma.KumaFundingPayment KumaFundingPayment}
*
* @category Fills & Historical
*/
getFundingPayments(params: kuma.RestRequestGetFundingPayments): Promise;
/**
* Override minimum Initial Margin Fraction for wallet for a market
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `POST /v1/initialMarginFractionOverride`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityTrade)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* ---
*
* @returns
* - Returns an {@link kuma.KumaInitialMarginFractionOverride KumaInitialMarginFractionOverride}
* object providing the details of the new setting.
*
* @category Wallets & Positions
*/
setInitialMarginFractionOverride(params: kuma.RestRequestSetInitialMarginFractionOverride, signer?: kuma.SignTypedData | undefined): Promise;
/**
* Get Initial Margin Fraction overrides for wallet for a market or all markets
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/initialMarginFractionOverride`
* > - **Endpoint Security:** [Trade](https://api-docs-v1.kuma.bid/#endpointSecurityTrade)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* ---
*
* @returns
* - Returns an {@link kuma.KumaInitialMarginFractionOverride KumaInitialMarginFractionOverride}
* object providing the details of the setting.
*
* @category Wallets & Positions
*/
getInitialMarginFractionOverride(params: kuma.RestRequestGetInitialMarginFractionOverride): Promise;
/**
* Get Historical PnL for the wallet / market matching {@link kuma.KumaHistoricalProfitLoss KumaHistoricalProfitLoss}
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/historicalPnL`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:**
* > {@link kuma.RestRequestPaginationWithFromId.start start},
* > {@link kuma.RestRequestPaginationWithFromId.end end},
* > {@link kuma.RestRequestPaginationWithFromId.limit limit}
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getHistoricalPnL)
* @see request {@link kuma.RestRequestGetHistoricalPnL RestRequestGetHistoricalPnL}
* @see response {@link kuma.RestResponseGetHistoricalPnL RestResponseGetHistoricalPnL}
* @see type {@link kuma.KumaHistoricalProfitLoss KumaHistoricalProfitLoss}
*
* @category Fills & Historical
*/
getHistoricalPnL(params: kuma.RestRequestGetHistoricalPnL): Promise;
/**
* Returns a single-use authentication token as a string for access
* to {@link kuma.SubscriptionNameAuthenticated authenticated subscriptions}
* in the WebSocket API.
*
* ---
* **Endpoint Parameters**
*
* > - **HTTP Request:** `GET /v1/wsToken`
* > - **Endpoint Security:** [User Data](https://api-docs-v1.kuma.bid/#endpointSecurityUserData)
* > - **API Key Scope:** [Read](https://api-docs-v1.kuma.bid/#api-keys)
* > - **Pagination:** `None`
* ---
*
* @returns
* - Returns the {@link kuma.KumaWebSocketToken.token KumaWebSocketToken.token} string
* directly which you can use to authenticate with the WebSocket server.
*
* ---
*
* @see typedoc [Reference Documentation](https://sdk-js-docs-v1.kuma.bid/classes/RestAuthenticatedClient.html#getWsToken)
* @see request {@link kuma.RestRequestGetAuthenticationToken RestRequestGetAuthenticationToken}
* @see response {@link kuma.RestResponseGetAuthenticationToken RestResponseGetAuthenticationToken}
*
* @category WebSocket
*/
getWsToken(params: kuma.RestRequestGetAuthenticationToken): Promise;
/**
* - All requests within the internal symbol are undocumented internal methods which may change or be removed without notice.
* - API handling of the parameters used within these methods is likely to change without notice without changes to the SDK to match.
* - These methods or parameters may require additional permissions to use and result in errors or blocking of your request if used.
* - If you need to use these methods for your use case, please contact support to discuss your requirements before using them.
*
* @internal
*/
readonly [INTERNAL_SYMBOL]: Readonly<{
/**
* Requires the public IDs (`orderIds`) of the stop loss orders' parent
* orders. Do not provide the public IDs of the stop loss orders themselves.
*/
readonly cancelConditionalStopLossOrders: (params: kuma.RestRequestCancelOrders, signer?: kuma.SignTypedData | undefined) => Promise;
/**
* Requires the public IDs (`orderIds`) of the take profit orders' parent
* orders. Do not provide the public IDs of the take profit orders themselves.
*/
readonly cancelConditionalTakeProfitOrders: (params: kuma.RestRequestCancelOrders, signer?: kuma.SignTypedData | undefined) => Promise;
readonly getFundingPayments: (params: kuma.RestRequestGetFundingPayments) => Promise>;
readonly placeConditionalTpSlOrder: (takeProfitOrStopLossOrder: kuma.RestRequestOrder & {
type: T;
}, conditionalParentOrderId: string, signer?: undefined | kuma.SignTypedData) => Promise;
readonly placeOrderWithConditionalTpSlOrders: (params: {
order: kuma.RestRequestOrder & {
type: T_1;
};
conditionalTakeProfitOrder?: (kuma.RestRequestOrderTypeTakeProfitMarket & {
type: typeof kuma.OrderType.takeProfitMarket;
}) | undefined;
conditionalStopLossOrder?: (kuma.RestRequestOrderTypeStopLossMarket & {
type: typeof kuma.OrderType.stopLossMarket;
}) | undefined;
}, signer?: undefined | kuma.SignTypedData) => Promise<{
order: kuma.KumaOrder & {
conditionalTakeProfitOrder?: (kuma.KumaOrder & {
type: "takeProfitMarket";
}) | undefined;
conditionalStopLossOrder?: (kuma.KumaOrder & {
type: "stopLossMarket";
}) | undefined;
} & {
type: T_1;
};
conditionalTakeProfitOrder?: (kuma.KumaOrder & {
conditionalTakeProfitOrder?: (kuma.KumaOrder & {
type: "takeProfitMarket";
}) | undefined;
conditionalStopLossOrder?: (kuma.KumaOrder & {
type: "stopLossMarket";
}) | undefined;
} & {
type: typeof kuma.OrderType.takeProfitMarket;
}) | undefined;
conditionalStopLossOrder?: (kuma.KumaOrder & {
conditionalTakeProfitOrder?: (kuma.KumaOrder & {
type: "takeProfitMarket";
}) | undefined;
conditionalStopLossOrder?: (kuma.KumaOrder & {
type: "stopLossMarket";
}) | undefined;
} & {
type: typeof kuma.OrderType.stopLossMarket;
}) | undefined;
}>;
}>;
protected getContractAndChainId(): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected get(endpoint: string, params?: AnyObj | undefined, axiosConfig?: Omit, 'method' | 'url' | 'params'>): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected post(endpoint: string, data?: AnyObj, axiosConfig?: Omit, 'method' | 'url' | 'data'>): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected delete(endpoint: string, data?: AnyObj, axiosConfig?: Omit, 'method' | 'url' | 'data'>): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected put(endpoint: string, data?: AnyObj, axiosConfig?: Omit, 'method' | 'url' | 'data'>): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected patch(endpoint: string, data?: AnyObj, axiosConfig?: Omit, 'method' | 'url' | 'data'>): Promise;
/**
* - Internal Use and may change or break without notice
*
* @internal
* @hidden
*/
protected request(endpoint: string, config: Partial & ({
method: 'GET';
} | {
method: Exclude;
data: {
[key: string]: unknown;
};
}), createHmacSignatureHeader?: boolean): Promise>;
}
//# sourceMappingURL=authenticated.d.ts.map