PHP WebShell
Текущая директория: /opt/BitGoJS/node_modules/@aptos-labs/ts-sdk/dist/esm/client
Просмотр файла: post.d.mts
import { AptosConfig } from '../api/aptosConfig.mjs';
import { MimeType, AnyNumber, ClientConfig, AptosResponse } from '../types/types.mjs';
import { AptosApiType } from '../utils/const.mjs';
import '../utils/apiEndpoints.mjs';
import '../types/indexer.mjs';
import '../types/generated/operations.mjs';
import '../types/generated/types.mjs';
/**
* Options for making a POST request, including the API client configuration.
*/
type PostRequestOptions = {
/**
* The config for the API client
*/
aptosConfig: AptosConfig;
/**
* The type of API endpoint to call e.g. fullnode, indexer, etc
*/
type: AptosApiType;
/**
* The name of the API method
*/
originMethod: string;
/**
* The URL path to the API method
*/
path: string;
/**
* The content type of the request body
*/
contentType?: MimeType;
/**
* The accepted content type of the response of the API
*/
acceptType?: MimeType;
/**
* The query parameters for the request
*/
params?: Record<string, string | AnyNumber | boolean | undefined>;
/**
* The body of the request, should match the content type of the request
*/
body?: any;
/**
* Specific client overrides for this request to override aptosConfig
*/
overrides?: ClientConfig;
};
/**
* Options for posting a request to Aptos, excluding the type field.
*/
type PostAptosRequestOptions = Omit<PostRequestOptions, "type">;
/**
* Executes a POST request to the specified URL with the provided options.
*
* @param options - The options for the POST request.
* @param options.type - The type of the request.
* @param options.originMethod - The original method that initiated the request.
* @param options.path - The path for the request.
* @param options.body - The body content to be sent with the request.
* @param options.acceptType - The type of response expected from the server.
* @param options.contentType - The content type of the request body.
* @param options.params - Additional parameters to include in the request.
* @param options.aptosConfig - Configuration settings for the Aptos request.
* @param options.overrides - Any overrides for the default request behavior.
* @returns The response from the POST request.
*/
declare function post<Req extends {}, Res extends {}>(options: PostRequestOptions): Promise<AptosResponse<Req, Res>>;
/**
* Sends a request to the Aptos full node using the specified options.
* This function allows you to interact with the Aptos blockchain by sending requests to the full node.
*
* @param options - The options for the request.
* @param options.aptosConfig - Configuration settings for the Aptos client.
* @param options.aptosConfig.clientConfig - Client-specific configuration settings.
* @param options.aptosConfig.fullnodeConfig - Full node-specific configuration settings.
* @param options.overrides - Additional overrides for the request.
*/
declare function postAptosFullNode<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
/**
* Sends a request to the Aptos indexer with the specified options.
* This function allows you to interact with the Aptos indexer and customize the request using various configurations.
*
* @param options - The options for the request to the Aptos indexer.
* @param options.aptosConfig - Configuration settings specific to the Aptos client and indexer.
* @param options.aptosConfig.clientConfig - The client configuration settings.
* @param options.aptosConfig.indexerConfig - The indexer configuration settings.
* @param options.overrides - Additional overrides for the request.
* @param options.overrides.HEADERS - Custom headers to include in the request.
*/
declare function postAptosIndexer<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
/**
* Sends a request to the Aptos faucet to obtain test tokens.
* This function modifies the provided configuration to ensure that the API_KEY is not included in the request.
*
* @param options - The options for the request.
* @param options.aptosConfig - The configuration settings for the Aptos client.
* @param options.aptosConfig.clientConfig - The client-specific configuration settings.
* @param options.aptosConfig.clientConfig.HEADERS - Optional headers to include in the request.
* @param options.aptosConfig.faucetConfig - The configuration settings specific to the faucet.
* @param options.overrides - Additional overrides for the request configuration.
*/
declare function postAptosFaucet<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
/**
* Makes a post request to the pepper service.
*
* @param options - The options for the request.
* @param options.url - The URL to which the request is sent.
* @param options.headers - The headers to include in the request.
* @param options.body - The body of the request.
* @returns A promise that resolves to the response from the pepper service.
*/
declare function postAptosPepperService<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
/**
* Sends a request to the Aptos proving service with the specified options.
*
* @param options - The options for the request to the Aptos proving service.
* @param options.type - The type of the request, which should be set to AptosApiType.PROVER.
* @param options.data - The data to be included in the request.
*/
declare function postAptosProvingService<Req extends {}, Res extends {}>(options: PostAptosRequestOptions): Promise<AptosResponse<Req, Res>>;
export { type PostAptosRequestOptions, type PostRequestOptions, post, postAptosFaucet, postAptosFullNode, postAptosIndexer, postAptosPepperService, postAptosProvingService };
Выполнить команду
Для локальной разработки. Не используйте в интернете!