libra-sdk-mol
Version:
Javascript SDK for Libra Network and Move Smart Contract powered by MoveOnLibra OpenAPI
135 lines (91 loc) • 3.01 kB
Markdown
Method | HTTP request | Description
------------- | ------------- | -------------
[**getAccountState**](address_api.md
[**getAccountResource**](address_api.md
[**getAccountBalance**](address_api.md
[**getAccountSequence**](address_api.md
<br/><hr/>
Get account state from address. also automatically decode account resource of this address. btw, an address can have many other resources.
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.AddressAPI.getAccountState(address);
console.log(data) //AccountState
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**address** | **string**|
| |
[**AccountState**](../AccountState.md)
<br/><hr/>
Get account resource from address.
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.AddressAPI.getAccountResource(address);
console.log(data) //AccountResource
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**address** | **string**|
| |
[**AccountResource**](../AccountResource.md)
<br/><hr/>
Get account balance from address
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.AddressAPI.getAccountBalance(address);
console.log(data) //Balance
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**address** | **string**|
| |
[**BalanceResult**](../BalanceResult.md)
<br/><hr/>
Get account sequence_number from address
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.AddressAPI.getAccountSequence(address);
console.log(data) //sequence_number
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**address** | **string**|
| |
[**SequenceNumberResult**](../SequenceNumberResult.md)