SimbaBase
Direct Subclass:
Constructor Summary
Public Constructor | ||
public |
constructor(endpoint: string, wallet: Wallet) Base class for libsimba API Interaction implementations |
Method Summary
Public Methods | ||
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 Methods | ||
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 apiKey: * source
public managementKey: * source
public metadata: {} source
public wallet: * source
Public Methods
public abstract callMethodWithFile(method: string, parameters: Object, files: Array<Blob|File>): Promise<Object> source
public abstract checkTransactionStatus(txnId: string): Object source
Params:
Name | Type | Attribute | Description |
txnId | string | a transaction ID |
public abstract getBundleForTransaction(transactionIdOrHash: string, stream: boolean): Promise<ReadableStream|Blob> source
public abstract getBundleMetadataForTransaction(transactionIdOrHash: string): Promise<Object> source
Params:
Name | Type | Attribute | Description |
transactionIdOrHash | string | Either a transaction ID or a transaction hash |
public abstract getFileFromBundleByNameForTransaction(transactionIdOrHash: string, fileName: string, stream: boolean): Promise<ReadableStream|Blob> source
public abstract getFileFromBundleForTransaction(transactionIdOrHash: string, fileIdx: number, stream: boolean): Promise<ReadableStream|Blob> source
public abstract getTransaction(transactionIdOrHash: string): Promise<Object> source
Params:
Name | Type | Attribute | Description |
transactionIdOrHash | string | Either a transaction ID or a transaction hash |
public abstract getTransactionStatus(txnId: string): Promise<Object> source
Params:
Name | Type | Attribute | Description |
txnId | string | the transaction ID |
public abstract getTransactions(parameters: Object): Promise<PagedResponse> source
Params:
Name | Type | Attribute | Description |
parameters | Object | The query parameters |
public abstract initialize() source
public abstract async sendTransactionRequest(url: URL): Promise<PagedResponse> source
Params:
Name | Type | Attribute | Description |
url | URL | The URL |
public setApiKey(apiKey: string) source
Set the API Key to authenticate calls
Params:
Name | Type | Attribute | Description |
apiKey | string | the API Key |
public setManagementKey(managementKey: string) source
Set the API Key to authenticate management calls
Params:
Name | Type | Attribute | Description |
managementKey | string | the management API Key |
public setWallet(wallet: Wallet) source
Set the wallet
Params:
Name | Type | Attribute | Description |
wallet | Wallet | the wallet |
public waitForSuccessOrError(txnId: string, pollInterval: number): * source
Returns an object with 'future' and 'cancel' keys. future is the promise to listen on for the response or an error. cancel is a function - call it to cancel the polling.
Return:
* |
Private Methods
private abstract checkTransactionDone(txn: Object): boolean source
Params:
Name | Type | Attribute | Description |
txn | Object | the transaction object |
private abstract checkTransactionStatusFromObject(txn: Object): Object source
Params:
Name | Type | Attribute | Description |
txn | Object | a transaction object |
private validateAnyGetCall(): boolean source
Throw:
App Metadata not yet retrieved |
|
App Metadata doesn't have methods |
private validateCall(methodName: string, parameters: Object, files: Array): boolean source
Throw:
App Metadata not yet retrieved |
|
App Metadata doesn't have methods |
|
Method call fails validation |