@aeternity/aepp-sdk
Version:
SDK for the æternity blockchain
1,292 lines (1,250 loc) • 31 kB
JavaScript
import { createSerializer } from "../../utils/autorest.js";
import * as coreClient from "@azure/core-client";
import * as Parameters from "./models/parameters.js";
import * as Mappers from "./models/mappers.js";
export class Node extends coreClient.ServiceClient {
/**
* Initializes a new instance of the Node class.
* @param $host server parameter
* @param options The parameter options
*/
constructor($host, options) {
var _ref, _options$endpoint;
if ($host === undefined) {
throw new Error("'$host' cannot be null");
}
// Initializing default values for options
if (!options) {
options = {};
}
const defaults = {
requestContentType: "application/json; charset=utf-8"
};
const packageDetails = `azsdk-js-node/1.0.0-beta.1`;
const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` : `${packageDetails}`;
const optionsWithDefaults = {
...defaults,
...options,
userAgentOptions: {
userAgentPrefix
},
endpoint: (_ref = (_options$endpoint = options.endpoint) !== null && _options$endpoint !== void 0 ? _options$endpoint : options.baseUri) !== null && _ref !== void 0 ? _ref : "{$host}"
};
super(optionsWithDefaults);
// Parameter assignments
this.$host = $host;
}
/**
* Get an account by public key
* @param pubkey The public key of the account
* @param options The options parameters.
*/
getAccountByPubkey(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getAccountByPubkeyOperationSpec);
}
/**
* Get an account by public key after the block indicated by hash. Can be either a micro block or a
* keyblock hash
* @param pubkey The public key of the account
* @param hash The hash of the block - either a keyblock or a microblock
* @param options The options parameters.
*/
getAccountByPubkeyAndHash(pubkey, hash, options) {
return this.sendOperationRequest({
pubkey,
hash,
options
}, getAccountByPubkeyAndHashOperationSpec);
}
/**
* Get an account by public key after the opening key block of the generation at height
* @param pubkey The public key of the account
* @param height The height
* @param options The options parameters.
*/
getAccountByPubkeyAndHeight(pubkey, height, options) {
return this.sendOperationRequest({
pubkey,
height,
options
}, getAccountByPubkeyAndHeightOperationSpec);
}
/**
* Get an account's next nonce; This is computed according to whatever is the current account nonce and
* what transactions are currently present in the transaction pool
* @param pubkey The public key of the account
* @param options The options parameters.
*/
getAccountNextNonce(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getAccountNextNonceOperationSpec);
}
/**
* Get pending account transactions by public key
* @param pubkey The public key of the account
* @param options The options parameters.
*/
getPendingAccountTransactionsByPubkey(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getPendingAccountTransactionsByPubkeyOperationSpec);
}
/**
* Get auction entry from naming system
* @param name The name key of the name entry
* @param options The options parameters.
*/
getAuctionEntryByName(name, options) {
return this.sendOperationRequest({
name,
options
}, getAuctionEntryByNameOperationSpec);
}
/**
* Get channel by public key
* @param pubkey The pubkey of the channel
* @param options The options parameters.
*/
getChannelByPubkey(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getChannelByPubkeyOperationSpec);
}
/**
* Get a contract by pubkey
* @param pubkey Contract pubkey to get proof for
* @param options The options parameters.
*/
getContract(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getContractOperationSpec);
}
/**
* Get contract code by pubkey
* @param pubkey Contract pubkey to get proof for
* @param options The options parameters.
*/
getContractCode(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getContractCodeOperationSpec);
}
/**
* Get a proof of inclusion for a contract
* @param pubkey Contract pubkey to get proof for
* @param options The options parameters.
*/
getContractPoI(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getContractPoIOperationSpec);
}
/**
* Get the currency metadata of a node
* @param options The options parameters.
*/
getCurrency(options) {
return this.sendOperationRequest({
options
}, getCurrencyOperationSpec);
}
/**
* Dry-run unsigned transactions on top of a given block. Supports all TXs except GAMetaTx, PayingForTx
* and OffchainTx. The maximum gas limit of all calls is capped. The maximum gas limit per request is a
* global node setting. Since DryRunCallReq object do not have a mandatory gas field, if not set a
* default value of 1000000 is being used instead.
* @param body transactions
* @param options The options parameters.
*/
protectedDryRunTxs(body, options) {
return this.sendOperationRequest({
body,
options
}, protectedDryRunTxsOperationSpec);
}
/**
* Get the current generation
* @param options The options parameters.
*/
getCurrentGeneration(options) {
return this.sendOperationRequest({
options
}, getCurrentGenerationOperationSpec);
}
/**
* Get a generation by hash
* @param hash The hash of the key block
* @param options The options parameters.
*/
getGenerationByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getGenerationByHashOperationSpec);
}
/**
* Get a generation by height
* @param height The height
* @param options The options parameters.
*/
getGenerationByHeight(height, options) {
return this.sendOperationRequest({
height,
options
}, getGenerationByHeightOperationSpec);
}
/**
* Get the top header (either key or micro block)
* @param options The options parameters.
*/
getTopHeader(options) {
return this.sendOperationRequest({
options
}, getTopHeaderOperationSpec);
}
/**
* Get the pinning transaction for the current epoch. Returns both the individual parameters as well as
* the parent chain type (aeternity, btc etc.), network id and a packaged 80 byte readymade payload for
* that chain type.
* @param options The options parameters.
*/
getPinningTx(options) {
return this.sendOperationRequest({
options
}, getPinningTxOperationSpec);
}
/**
* Get the pubkeys for the configured hyperchain contracts for staking, election and rewards
* @param options The options parameters.
*/
getHyperchainContractPubkeys(options) {
return this.sendOperationRequest({
options
}, getHyperchainContractPubkeysOperationSpec);
}
/**
* Get the current key block
* @param options The options parameters.
*/
getCurrentKeyBlock(options) {
return this.sendOperationRequest({
options
}, getCurrentKeyBlockOperationSpec);
}
/**
* Get the hash of the current key block
* @param options The options parameters.
*/
getCurrentKeyBlockHash(options) {
return this.sendOperationRequest({
options
}, getCurrentKeyBlockHashOperationSpec);
}
/**
* Get the height of the current key block
* @param options The options parameters.
*/
getCurrentKeyBlockHeight(options) {
return this.sendOperationRequest({
options
}, getCurrentKeyBlockHeightOperationSpec);
}
/**
* Get a key block by hash
* @param hash The hash of the block - either a keyblock or a microblock
* @param options The options parameters.
*/
getKeyBlockByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getKeyBlockByHashOperationSpec);
}
/**
* Get a key block by height
* @param height The height
* @param options The options parameters.
*/
getKeyBlockByHeight(height, options) {
return this.sendOperationRequest({
height,
options
}, getKeyBlockByHeightOperationSpec);
}
/**
* Get the pending key block
* @param options The options parameters.
*/
getPendingKeyBlock(options) {
return this.sendOperationRequest({
options
}, getPendingKeyBlockOperationSpec);
}
/**
* Get a micro block header by hash
* @param hash The hash of the block - either a keyblock or a microblock
* @param options The options parameters.
*/
getMicroBlockHeaderByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getMicroBlockHeaderByHashOperationSpec);
}
/**
* Get micro block transactions by hash
* @param hash The hash of the micro block
* @param options The options parameters.
*/
getMicroBlockTransactionsByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getMicroBlockTransactionsByHashOperationSpec);
}
/**
* Get micro block transaction count by hash
* @param hash The hash of the micro block
* @param options The options parameters.
*/
getMicroBlockTransactionsCountByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getMicroBlockTransactionsCountByHashOperationSpec);
}
/**
* Get a micro block transaction by hash and index
* @param hash The hash of the micro block
* @param index The index of the transaction in a block
* @param options The options parameters.
*/
getMicroBlockTransactionByHashAndIndex(hash, index, options) {
return this.sendOperationRequest({
hash,
index,
options
}, getMicroBlockTransactionByHashAndIndexOperationSpec);
}
/**
* Get name entry from naming system
* @param name The name key of the name entry
* @param options The options parameters.
*/
getNameEntryByName(name, options) {
return this.sendOperationRequest({
name,
options
}, getNameEntryByNameOperationSpec);
}
/**
* Get name entry from naming system
* @param nameHash The name hash of the name entry
* @param options The options parameters.
*/
getNameEntryByNameHash(nameHash, options) {
return this.sendOperationRequest({
nameHash,
options
}, getNameEntryByNameHashOperationSpec);
}
/**
* Get an oracle by public key
* @param pubkey The public key of the oracle
* @param options The options parameters.
*/
getOracleByPubkey(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getOracleByPubkeyOperationSpec);
}
/**
* Get oracle queries by public key
* @param pubkey The public key of the oracle
* @param options The options parameters.
*/
getOracleQueriesByPubkey(pubkey, options) {
return this.sendOperationRequest({
pubkey,
options
}, getOracleQueriesByPubkeyOperationSpec);
}
/**
* Get an oracle query by public key and query ID
* @param pubkey The public key of the oracle
* @param queryId The ID of the query
* @param options The options parameters.
*/
getOracleQueryByPubkeyAndQueryId(pubkey, queryId, options) {
return this.sendOperationRequest({
pubkey,
queryId,
options
}, getOracleQueryByPubkeyAndQueryIdOperationSpec);
}
/**
* Get peer public key
* @param options The options parameters.
*/
getPeerPubkey(options) {
return this.sendOperationRequest({
options
}, getPeerPubkeyOperationSpec);
}
/**
* Get minimum gas prices in recent blocks
* @param options The options parameters.
*/
getRecentGasPrices(options) {
return this.sendOperationRequest({
options
}, getRecentGasPricesOperationSpec);
}
/**
* Get the status of a node
* @param options The options parameters.
*/
getStatus(options) {
return this.sendOperationRequest({
options
}, getStatusOperationSpec);
}
/**
* Get oldest keyblock hashes counting from genesis including orphans
* @param options The options parameters.
*/
getChainEnds(options) {
return this.sendOperationRequest({
options
}, getChainEndsOperationSpec);
}
/**
* Get the sync status of a node
* @param options The options parameters.
*/
getSyncStatus(options) {
return this.sendOperationRequest({
options
}, getSyncStatusOperationSpec);
}
/**
* Post a new transaction
* @param body The new transaction
* @param options The options parameters.
*/
postTransaction(body, options) {
return this.sendOperationRequest({
body,
options
}, postTransactionOperationSpec);
}
/**
* Get a transaction by hash
* @param hash The hash of the transaction
* @param options The options parameters.
*/
getTransactionByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getTransactionByHashOperationSpec);
}
/**
* @param hash The hash of the transaction
* @param options The options parameters.
*/
getTransactionInfoByHash(hash, options) {
return this.sendOperationRequest({
hash,
options
}, getTransactionInfoByHashOperationSpec);
}
}
// Operation Specifications
const serializer = createSerializer(Mappers, /* isXml */false);
const getAccountByPubkeyOperationSpec = {
path: "/v3/accounts/{pubkey}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Account
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getAccountByPubkeyAndHashOperationSpec = {
path: "/v3/accounts/{pubkey}/hash/{hash}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Account
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getAccountByPubkeyAndHeightOperationSpec = {
path: "/v3/accounts/{pubkey}/height/{height}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Account
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
410: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.height],
headerParameters: [Parameters.accept],
serializer
};
const getAccountNextNonceOperationSpec = {
path: "/v3/accounts/{pubkey}/next-nonce",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.NextNonceResponse
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
queryParameters: [Parameters.strategy],
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getPendingAccountTransactionsByPubkeyOperationSpec = {
path: "/v3/accounts/{pubkey}/transactions/pending",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SignedTxs
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getAuctionEntryByNameOperationSpec = {
path: "/v3/auctions/{name}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.AuctionEntry
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.name],
headerParameters: [Parameters.accept],
serializer
};
const getChannelByPubkeyOperationSpec = {
path: "/v3/channels/{pubkey}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Channel
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getContractOperationSpec = {
path: "/v3/contracts/{pubkey}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ContractObject
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getContractCodeOperationSpec = {
path: "/v3/contracts/{pubkey}/code",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.ByteCode
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getContractPoIOperationSpec = {
path: "/v3/contracts/{pubkey}/poi",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PoI
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getCurrencyOperationSpec = {
path: "/v3/currency",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Currency
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const protectedDryRunTxsOperationSpec = {
path: "/v3/dry-run",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.DryRunResults
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
403: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
requestBody: Parameters.body,
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getCurrentGenerationOperationSpec = {
path: "/v3/generations/current",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Generation
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getGenerationByHashOperationSpec = {
path: "/v3/generations/hash/{hash}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Generation
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getGenerationByHeightOperationSpec = {
path: "/v3/generations/height/{height}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Generation
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.height],
headerParameters: [Parameters.accept],
serializer
};
const getTopHeaderOperationSpec = {
path: "/v3/headers/top",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Header
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getPinningTxOperationSpec = {
path: "/v3/hyperchain/pin-tx",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PinningTx
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getHyperchainContractPubkeysOperationSpec = {
path: "/v3/hyperchain/contracts",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HCContractPubkeys
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getCurrentKeyBlockOperationSpec = {
path: "/v3/key-blocks/current",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.KeyBlock
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getCurrentKeyBlockHashOperationSpec = {
path: "/v3/key-blocks/current/hash",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HashResponse
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getCurrentKeyBlockHeightOperationSpec = {
path: "/v3/key-blocks/current/height",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.HeightResponse
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getKeyBlockByHashOperationSpec = {
path: "/v3/key-blocks/hash/{hash}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.KeyBlock
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getKeyBlockByHeightOperationSpec = {
path: "/v3/key-blocks/height/{height}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.KeyBlock
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.height],
headerParameters: [Parameters.accept],
serializer
};
const getPendingKeyBlockOperationSpec = {
path: "/v3/key-blocks/pending",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.KeyBlock
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getMicroBlockHeaderByHashOperationSpec = {
path: "/v3/micro-blocks/hash/{hash}/header",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.MicroBlockHeader
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getMicroBlockTransactionsByHashOperationSpec = {
path: "/v3/micro-blocks/hash/{hash}/transactions",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SignedTxs
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getMicroBlockTransactionsCountByHashOperationSpec = {
path: "/v3/micro-blocks/hash/{hash}/transactions/count",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.CountResponse
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getMicroBlockTransactionByHashAndIndexOperationSpec = {
path: "/v3/micro-blocks/hash/{hash}/transactions/index/{index}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SignedTx
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash, Parameters.index],
headerParameters: [Parameters.accept],
serializer
};
const getNameEntryByNameOperationSpec = {
path: "/v3/names/{name}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.NameEntry
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.name],
headerParameters: [Parameters.accept],
serializer
};
const getNameEntryByNameHashOperationSpec = {
path: "/v3/names/hash/{name_hash}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.NameEntry
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.nameHash],
headerParameters: [Parameters.accept],
serializer
};
const getOracleByPubkeyOperationSpec = {
path: "/v3/oracles/{pubkey}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.RegisteredOracle
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getOracleQueriesByPubkeyOperationSpec = {
path: "/v3/oracles/{pubkey}/queries",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OracleQueries
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
queryParameters: [Parameters.fromParam, Parameters.limit, Parameters.typeParam],
urlParameters: [Parameters.$host, Parameters.pubkey],
headerParameters: [Parameters.accept],
serializer
};
const getOracleQueryByPubkeyAndQueryIdOperationSpec = {
path: "/v3/oracles/{pubkey}/queries/{query-id}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.OracleQuery
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.pubkey, Parameters.queryId],
headerParameters: [Parameters.accept],
serializer
};
const getPeerPubkeyOperationSpec = {
path: "/v3/peers/pubkey",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.PeerPubKey
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getRecentGasPricesOperationSpec = {
path: "/v3/recent-gas-prices",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: {
name: "Sequence",
element: {
type: {
name: "Composite",
className: "GasPricesItem"
}
}
}
}
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getStatusOperationSpec = {
path: "/v3/status",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.Status
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getChainEndsOperationSpec = {
path: "/v3/status/chain-ends",
httpMethod: "GET",
responses: {
200: {
bodyMapper: {
type: {
name: "Sequence",
element: {
type: {
name: "String"
}
}
}
}
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const getSyncStatusOperationSpec = {
path: "/v3/sync-status",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SyncStatus
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept],
serializer
};
const postTransactionOperationSpec = {
path: "/v3/transactions",
httpMethod: "POST",
responses: {
200: {
bodyMapper: Mappers.PostTxResponse
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
requestBody: Parameters.body1,
urlParameters: [Parameters.$host],
headerParameters: [Parameters.accept, Parameters.contentType],
mediaType: "json",
serializer
};
const getTransactionByHashOperationSpec = {
path: "/v3/transactions/{hash}",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.SignedTx
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
const getTransactionInfoByHashOperationSpec = {
path: "/v3/transactions/{hash}/info",
httpMethod: "GET",
responses: {
200: {
bodyMapper: Mappers.TxInfoObject
},
400: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
404: {
bodyMapper: Mappers.ErrorModel,
isError: true
},
410: {
bodyMapper: Mappers.ErrorModel,
isError: true
}
},
urlParameters: [Parameters.$host, Parameters.hash],
headerParameters: [Parameters.accept],
serializer
};
//# sourceMappingURL=node.js.map