TupeloClient
Represents a connection to a specific Tupelo wallet managed by a remote Tupelo RPC server
Constructor Summary
Public Constructor | ||
public |
|
Member Summary
Public Members | ||
public |
rpc: WalletRPCService Back end Tupelo Wallet RPC service connection |
|
public |
The name and passphrase of the wallet to connect to |
|
public |
The URL ("host:port") of the RPC wallet server to connect to |
Method Summary
Public Methods | ||
public |
createChainTree(keyAddr: string, storageAdapter: StorageAdapterConfig): Promise<CreateChainResponse, RpcError> Create a new chain tree owned by the key at |
|
public |
establishToken(chainId: string, keyAddr: string, tokenName: string, maximum: number): Promise<EstablishTokenResponse, RpcError> Establish a new token type associated with a chain tree. |
|
public |
exportChainTree(chainId: string): Promise<ExportChainTreeResponse, RpcError> Get a Base58 serialized chain tree Export |
|
public |
Generate a new chain tree ownership key pair. |
|
public |
getTip(chainId: string): Promise<GetTipResponse, RpcError> Get the latest tip (as known by the Tupelo network signers) of the chain
tree with id |
|
public |
importChainTree(chainTree: SerializedChaintree, storageAdapter: StorageAdapterConfig): * Import a serialized chain tree and save it to the wallet. |
|
public |
List the IDs of the chain trees associated with the connected wallet. |
|
public |
List the addresses of the keys associated with the connected wallet. |
|
public |
mintToken(chainId: string, keyAddr: string, tokenName: string, amount: number): Promise<MintTokenResponse, RpcError> Mint new tokens of an already established token type associated with a chain tree. |
|
public |
playTransactions(chainId: string, keyAddr: string, transactions: Object[]): Promise<PlayTransactionsResponse, RpcError> Apply a sequence of transactions to a chain tree |
|
public |
receiveToken(chainId: string, keyAddr: string, tokenPayload: string): * Receive a send token payload from another chain tree. |
|
public |
Register a new wallet with the client credentials. |
|
public |
Resolve data from the root of the chain tree. |
|
public |
Resolve data from a tip of a chain tree given a certain path. |
|
public |
resolveData(chainId: string, path: string): Promise<ResolveResponse, RpcError> Resolve data from the user portion ("/tree/data") of the chain tree. |
|
public |
sendToken(chainId: string, keyAddr: string, tokenName: string, destinationChainId: string, amount: number): * Send an amount of minted tokens to another chain tree. |
|
public |
setData(chainId: string, keyAddr: string, path: string, value: string | number | boolean | Array | Object): Promise<SetDataResponse, RpcError> Store data on a chain tree with a transaction validated by the network's notary group. |
|
public |
setOwner(chainId: string, keyAddr: string, newOwnerKeys: string[]): Promise<SetOwnerResponse, RpcError> Define the set of owners of the chain tree with ID |
Public Constructors
public constructor() source
Public Members
Public Methods
public createChainTree(keyAddr: string, storageAdapter: StorageAdapterConfig): Promise<CreateChainResponse, RpcError> source
Create a new chain tree owned by the key at keyAddr
.
Params:
Name | Type | Attribute | Description |
keyAddr | string | Address of the key that owns the new chain tree. |
|
storageAdapter | StorageAdapterConfig |
|
Storage configuration for the chain tree |
public establishToken(chainId: string, keyAddr: string, tokenName: string, maximum: number): Promise<EstablishTokenResponse, RpcError> source
Establish a new token type associated with a chain tree.
public exportChainTree(chainId: string): Promise<ExportChainTreeResponse, RpcError> source
Get a Base58 serialized chain tree Export
Params:
Name | Type | Attribute | Description |
chainId | string | The ID of the chain tree to be exported |
public generateKey(): Promise<GenerateKeyResponse, RpcError> source
Generate a new chain tree ownership key pair.
public getTip(chainId: string): Promise<GetTipResponse, RpcError> source
Get the latest tip (as known by the Tupelo network signers) of the chain
tree with id chainId
Params:
Name | Type | Attribute | Description |
chainId | string | The ID of the chain tree. |
public importChainTree(chainTree: SerializedChaintree, storageAdapter: StorageAdapterConfig): * source
Import a serialized chain tree and save it to the wallet.
Params:
Name | Type | Attribute | Description |
chainTree | SerializedChaintree | Serialized chain tree to import |
|
storageAdapter | StorageAdapterConfig |
|
Storage configuration for the chain tree StorageAdapterConfig |
Return:
* |
public listChainIds(): Promise<ListChainIdsResponse, RpcError> source
List the IDs of the chain trees associated with the connected wallet.
public listKeys(): Promise<ListKeysResponse, RpcError> source
List the addresses of the keys associated with the connected wallet.
public mintToken(chainId: string, keyAddr: string, tokenName: string, amount: number): Promise<MintTokenResponse, RpcError> source
Mint new tokens of an already established token type associated with a chain tree.
public playTransactions(chainId: string, keyAddr: string, transactions: Object[]): Promise<PlayTransactionsResponse, RpcError> source
Apply a sequence of transactions to a chain tree
public receiveToken(chainId: string, keyAddr: string, tokenPayload: string): * source
Receive a send token payload from another chain tree.
Return:
* |
public register(): Promise<RegisterResponse, RpcError> source
Register a new wallet with the client credentials.
public resolve(chainId: string, path: string): Promise<ResolveResponse, RpcError> source
Resolve data from the root of the chain tree.
The data will be resolved in the tree according to the path until we reach the end
of the path or a leaf node. If we reach a leaf node before the end of the path,
the data at the leaf node is returned and the remaining unresolved part of the path is
set as the response's remainingPath
property.
public async resolveAt(chainId: string, path: string, tip: string): Promise<ResolveResponse, RpcError> source
Resolve data from a tip of a chain tree given a certain path.
public resolveData(chainId: string, path: string): Promise<ResolveResponse, RpcError> source
Resolve data from the user portion ("/tree/data") of the chain tree.
The data will be resolved in the tree according to the path until we reach the end
of the path or a leaf node. If we reach a leaf node before the end of the path,
the data at the leaf node is returned and the remaining unresolved part of the path is
set as the response's remainingPath
property.
public sendToken(chainId: string, keyAddr: string, tokenName: string, destinationChainId: string, amount: number): * source
Send an amount of minted tokens to another chain tree.
Return:
* |
public setData(chainId: string, keyAddr: string, path: string, value: string | number | boolean | Array | Object): Promise<SetDataResponse, RpcError> source
Store data on a chain tree with a transaction validated by the network's notary group.