libra-sdk-mol
Version:
Javascript SDK for Libra Network and Move Smart Contract powered by MoveOnLibra OpenAPI
198 lines (134 loc) • 4.01 kB
Markdown
Method | HTTP request | Description
------------- | ------------- | -------------
[**createWallet**](wallet_api.md
[**getWallets**](wallet_api.md
[**getWallet**](wallet_api.md
[**backupWallet**](wallet_api.md
[**createWalletAccount**](wallet_api.md
[**getWalletAccounts**](wallet_api.md
<br/><hr/>
Create a wallet belongs to the app authorized by auth key
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.createWallet(name);
console.log(data) //Wallet
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**name** | **string**|
| |
[**Wallet**](../Wallet.md)
<br/><hr/>
Get all wallets managed by the app authorized by auth key
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.getWallets();
console.log(data) //List of Wallets
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
| |
[**Wallet**](../Wallet.md)
<br/><hr/>
Get a wallet by id which should belongs to authorized app
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.getWallet(wallet_id);
console.log(data) //Wallet
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**wallet_id** | **number**|
| |
[**Wallet**](../Wallet.md)
<br/><hr/>
Backup a wallet by id which should belongs to authorized app
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.backupWallet(wallet_id);
console.log(data) //Wallet
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**wallet_id** | **number**|
| |
[**Wallet**](../Wallet.md)
<br/><hr/>
Create an account in wallet
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.createWalletAccount(wallet_id);
console.log(data) //List of Account
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**wallet_id** | **number**|
| |
[**Account**](../Account.md)
<br/><hr/>
Get all accounts of a wallet
```javascript
const appkey = "*****" // your app key
var client = new LibraClient("testnet", appkey);
try{
data = await client.WalletAPI.getWalletAccounts(wallet_id);
console.log(data) //Account
} catch (error) {
console.log(error);
}
```
Name | Type | Description
------------- | ------------- | -------------
**wallet_id** | **number**|
| |
[**Account**](../Account.md)