id | title |
---|---|
api-documentation |
API Documentation |
public connect(host: string, name = "main")
Connect to the given connection.
Type | Name | Required | Description |
---|---|---|---|
string | host | Yes | Node URL |
string | name | No | Network name |
Connection
public disconnect(name?: string)
Disconnect from the given connection.
Type | Name | Required | Description |
---|---|---|---|
string | name | No | Network Name |
void
public connection(name?: string)
Get a connection instance.
Type | Name | Required | Description |
---|---|---|---|
string | name | No | Network Name |
Connection
public getDefaultConnection()
Get the default connection name.
string
public setDefaultConnection(name: string)
Set the default connection name.
Type | Name | Required | Description |
---|---|---|---|
string | name | No | Network Name |
void
public getConnections()
Return all of the created connections.
Record<string, Connection>
public constructor(private readonly host: string)
Create a new Connection class instance.
Type | Name | Required | Description |
---|---|---|---|
string | host | Yes | Node URL |
public api<T = any>(name: string)
Instantiate new Api.
Type | Name | Required | Description |
---|---|---|---|
string | name | Yes | Network name |
T
Type | Name | Required | Description |
---|---|---|---|
string | host | Yes | Node URL |
public withOptions(opts: Record<string, any>)
Apply options to future connection requests.
Type | Name | Required | Description |
---|---|---|---|
string | opts | Yes | Connection options |
this
public async get<T = any>(url: string, opts?: Record<string, any>)
Send a GET request with query parameters.
Type | Name | Required | Description |
---|---|---|---|
string | url | Yes | Endpoint |
Record | opts? | No | Query parameters |
Promise<IResponse<T>>
public async post<T = any>(url: string, opts?: Record<string, any>): Promise<IResponse<T>>
Send a POST request with JSON-encoded parameters.
Type | Name | Required | Description |
---|---|---|---|
string | url | Yes | Endpoint |
Record | opts? | No | Query parameters |
Promise<IResponse<T>>
public constructor(error)
Create a new RequestError class instance.
Type | Name | Required | Description |
---|---|---|---|
string | error | Yes | Error |
public async all<T = any>(query?: Record<string, any>)
Get all blocks.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a block by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Block ID |
Promise<IResponse<T>>
public async transactions<T = any>(id: string, query?: Record<string, any>)
Get all transactions by the given block.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Block ID |
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async search<T = any>(payload?: Record<string, any>)
Filter all blocks by the given parameters.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all bridgechains.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a bridgechain by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Bridgechain identifier |
Promise<IResponse<T>>
public async search<T = any>(payload?: Record<string, any>)
Search for a bridgechain with the given payload.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all businesses.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a business by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Bridgechain identifier |
Promise<IResponse<T>>
public async bridgechains<T = any>(id: string, query?: Record<string, any>)
Get all bridgechains for a business.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Business identifier |
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async search<T = any>(payload?: Record<string, any>)
Search for a business with the given payload.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all locks.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a lock by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Bridgechain identifier |
Promise<IResponse<T>>
public async search<T = any>(payload?: Record<string, any>)
Search for locks with given payload.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async unlocked<T = any>(payload?: Record<string, any>)
Search for unlocked locks.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | No | Search parameters |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all accounts.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a delegate by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Delegate identifier |
Promise<IResponse<T>>
public async blocks<T = any>(id: string, query?: Record<string, any>)
Get all blocks for the given delegate.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Delegate identifier |
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async voters<T = any>(id: string, query?: Record<string, any>)
Get all voters for the given delegate.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Delegate identifier |
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async configuration<T = any>()
Get the node configuration.
Promise<IResponse<T>>
public async status<T = any>()
Get the node status.
Promise<IResponse<T>>
public async syncing<T = any>()
Get the node syncing status.
Promise<IResponse<T>>
public async crypto<T = any>()
Get the node crypto configuration.
Promise<IResponse<T>>
public async fees<T = any>(days: number)
Get the node fee statistics.
Type | Name | Required | Description |
---|---|---|---|
number | days | Yes | Days |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all peers.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(ip: string)
Get a peer by the given IP address.
Type | Name | Required | Description |
---|---|---|---|
string | ip | Yes | IP address |
Promise<IResponse<T>>
public async delegates<T = any>(id: number)
Get delegates for a round.
Type | Name | Required | Description |
---|---|---|---|
number | id | yes | Round number |
Promise<IResponse<T>>
public async create<T = any>(payload: object[])
Create a new transaction.
Type | Name | Required | Description |
---|---|---|---|
object[] | payload | Yes | Transaction(s) to broadcast |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a transaction by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Transaction ID |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all transactions.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async allUnconfirmed<T = any>(query?: Record<string, any>)
Get all unconfirmed transactions.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async getUnconfirmed<T = any>(id: string)
Get an unconfirmed transaction by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Transaction ID |
Promise<IResponse<T>>
public async search<T = any>(payload: Record<string, any>)
Filter all transactions by the given parameters.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | Yes | Search parameters |
Promise<IResponse<T>>
public async types<T = any>()
Get a list of valid transaction types.
Promise<IResponse<T>>
public async fees<T = any>(): Promise<IResponse<T>>
Get the node fee statistics.
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all votes.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a vote by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Vote ID |
Promise<IResponse<T>>
public async all<T = any>(query?: Record<string, any>)
Get all wallets.
Type | Name | Required | Description |
---|---|---|---|
Record | query | No | Query parameters |
Promise<IResponse<T>>
public async get<T = any>(id: string)
Get a wallet by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Promise<IResponse<T>>
public async locks<T = any>(id: string, query?: Record<string, any>)
Get a wallet by the given id.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Record | query | No | Search parameters |
Promise<IResponse<T>>
public async transactions<T = any>(id: string, query?: Record<string, any>)
Get all transactions for the given wallet.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Record | query | Yes | Query parameters |
Promise<IResponse<T>>
public async transactionsReceived<T = any>(id: string, query?: Record<string, any>)
Get all transactions received by the given wallet.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Record | query | Yes | Query parameters |
Promise<IResponse<T>>
public async transactionsSent<T = any>(id: string, query?: Record<string, any>)
Get all transactions sent by the given wallet.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Record | query | Yes | Query parameters |
Promise<IResponse<T>>
public async votes<T = any>(id: string)
Get all votes by the given wallet.
Type | Name | Required | Description |
---|---|---|---|
string | id | Yes | Wallet identifier |
Promise<IResponse<T>>
public async top<T = any>(query?: Record<string, any>)
Get all wallets sorted by balance in descending order.
Type | Name | Required | Description |
---|---|---|---|
Record | query | Yes | Query parameters |
Promise<IResponse<T>>
public async search<T = any>(payload: Record<string, any>)
Filter all wallets by the given parameters.
Type | Name | Required | Description |
---|---|---|---|
Record | payload | Yes | Search parameters |
Promise<IResponse<T>>