Constructor Summary
Public Constructor | ||
public |
constructor(endpoint: string, wallet: Wallet) libsimba API Interaction for Simbachain.com |
Member Summary
Public Members | ||
public |
metadata: * |
Method Summary
Public Methods | ||
public |
|
|
public |
async callMethod(method: string, parameters: Object): Promise |
|
public |
async callMethodWithFile(method: string, parameters-: Object, files: Array<Blob|File>): Promise<Object> |
|
public |
async getBalance(): Promise<Object> |
|
public |
async getBundleForTransaction(transactionIdOrHash: string): Promise<ReadableStream|Blob> |
|
public |
async getBundleMetadataForTransaction(transactionIdOrHash: string): Promise<Object> |
|
public |
async getFileFromBundleByNameForTransaction(transactionIdOrHash: string, fileName: string, stream: boolean): Promise<ReadableStream|Blob> |
|
public |
async getFileFromBundleForTransaction(transactionIdOrHash: string, fileIdx: number, stream: boolean): Promise<ReadableStream|Blob> |
|
public |
async getMethodTransactions(method: string, parameters: Object): Promise<PagedResponse> |
|
public |
async getTransaction(transactionIdOrHash: string): Promise<Object> |
|
public |
getTransactionStatus(txnId: string): Promise<Object> |
|
public |
async getTransactions(parameters: Object): Promise<PagedResponse> |
Protected Methods | ||
protected |
async sendTransactionRequest(url: URL): Promise<PagedResponse> |
Private Methods | ||
private |
checkTransactionDone(txn: Object): boolean |
|
private |
checkTransactionStatus(txnId: string): Object |
|
private |
|
|
private |
async initialize() |
|
private |
async sendMethodRequest(url: string, formdata: object): Promise<Response> |
|
private |
|
Inherited Summary
From class SimbaBase | ||
public |
apiKey: * |
|
public |
|
|
public |
|
|
public |
metadata: {} |
|
public |
wallet: * |
|
public abstract |
|
|
public abstract |
callMethod(method: string, parameters: Object): Promise |
|
public abstract |
|
|
public abstract |
checkTransactionStatus(txnId: string): Object |
|
public abstract |
getBalance(): Promise<Object> |
|
public abstract |
getBundleForTransaction(transactionIdOrHash: string, stream: boolean): Promise<ReadableStream|Blob> |
|
public abstract |
getBundleMetadataForTransaction(transactionIdOrHash: string): Promise<Object> |
|
public abstract |
getFileFromBundleByNameForTransaction(transactionIdOrHash: string, fileName: string, stream: boolean): Promise<ReadableStream|Blob> |
|
public abstract |
getFileFromBundleForTransaction(transactionIdOrHash: string, fileIdx: number, stream: boolean): Promise<ReadableStream|Blob> |
|
public abstract |
getMethodTransactions(method: string, parameters: Object) |
|
public abstract |
getTransaction(transactionIdOrHash: string): Promise<Object> |
|
public abstract |
getTransactionStatus(txnId: string): Promise<Object> |
|
public abstract |
getTransactions(parameters: Object): Promise<PagedResponse> |
|
public abstract |
|
|
public abstract |
async sendTransactionRequest(url: URL): Promise<PagedResponse> |
|
public |
Set the API Key to authenticate calls |
|
public |
setManagementKey(managementKey: string) Set the API Key to authenticate management calls |
|
public |
Set the wallet |
|
public |
waitForSuccessOrError(txnId: string, pollInterval: number): * Returns an object with 'future' and 'cancel' keys. |
|
private |
apiAuthHeaders(): {APIKEY: *, "Content-Type": string} |
|
private abstract |
checkTransactionDone(txn: Object): boolean |
|
private abstract |
|
|
private |
managementAuthHeaders(): {APIKEY: *, "Content-Type": string} |
|
private |
|
|
private |
validateCall(methodName: string, parameters: Object, files: Array): boolean |
|
private |
validateGetCall(methodName: string, parameters: Object): boolean |
Public Constructors
Public Members
Public Methods
public async callMethod(method: string, parameters: Object): Promise source
Override:
SimbaBase#callMethodpublic async callMethodWithFile(method: string, parameters-: Object, files: Array<Blob|File>): Promise<Object> source
Override:
SimbaBase#callMethodWithFilepublic async getBundleForTransaction(transactionIdOrHash: string): Promise<ReadableStream|Blob> source
Override:
SimbaBase#getBundleForTransactionParams:
Name | Type | Attribute | Description |
transactionIdOrHash | string | Either a transaction ID or a transaction hash |
public async getBundleMetadataForTransaction(transactionIdOrHash: string): Promise<Object> source
Params:
Name | Type | Attribute | Description |
transactionIdOrHash | string | Either a transaction ID or a transaction hash |
public async getFileFromBundleByNameForTransaction(transactionIdOrHash: string, fileName: string, stream: boolean): Promise<ReadableStream|Blob> source
public async getFileFromBundleForTransaction(transactionIdOrHash: string, fileIdx: number, stream: boolean): Promise<ReadableStream|Blob> source
public async getMethodTransactions(method: string, parameters: Object): Promise<PagedResponse> source
Override:
SimbaBase#getMethodTransactionspublic async getTransaction(transactionIdOrHash: string): Promise<Object> source
Override:
SimbaBase#getTransactionParams:
Name | Type | Attribute | Description |
transactionIdOrHash | string | Either a transaction ID or a transaction hash |
public getTransactionStatus(txnId: string): Promise<Object> source
Override:
SimbaBase#getTransactionStatusParams:
Name | Type | Attribute | Description |
txnId | string | the transaction ID |
public async getTransactions(parameters: Object): Promise<PagedResponse> source
Override:
SimbaBase#getTransactionsParams:
Name | Type | Attribute | Description |
parameters | Object | The query parameters |
Protected Methods
protected async sendTransactionRequest(url: URL): Promise<PagedResponse> source
Override:
SimbaBase#sendTransactionRequestParams:
Name | Type | Attribute | Description |
url | URL | The URL |
Private Methods
private checkTransactionDone(txn: Object): boolean source
Override:
SimbaBase#checkTransactionDoneParams:
Name | Type | Attribute | Description |
txn | Object | the transaction object |
private checkTransactionStatus(txnId: string): Object source
Override:
SimbaBase#checkTransactionStatusParams:
Name | Type | Attribute | Description |
txnId | string | a transaction ID |
private checkTransactionStatusFromObject(txn: Object): Object source
Params:
Name | Type | Attribute | Description |
txn | Object | a transaction object |