Skip to content

Commit 197534d

Browse files
authored
Dev (#11)
* Remove wallet component * v1.0.1
1 parent 7308f96 commit 197534d

31 files changed

+651
-1468
lines changed

README.md

Lines changed: 21 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -5,36 +5,46 @@ An ironfish provider implementation and utilities in TypeScript.
55

66
**Features:**
77

8-
- Ironfish rpc over socket, both Tcp and Tls are supported
8+
- Ironfish rpc over http
99
- Fully **TypeScript** ready, with definition files and full TypeScript source
1010

1111
**Methods:**
1212

1313
- getBalance
14-
- getTransaction
14+
- getBalances
15+
- mintAsset
16+
- burnAsset
17+
- createTransaction
18+
- sendTransaction
19+
- getAccountTransaction
20+
- getAccountTransactions
21+
- getAsset
22+
- broadcastTransaction
1523
- getBlock
1624
- getChainInfo
17-
- getStatus
18-
- sendTransaction
25+
- getTransaction
1926

20-
**Basic Rpc Usage:**
27+
**Rpc Usage:**
2128

2229
```typescript
23-
import { RpcService, RpcTcpClient, RpcTlsClient } from 'oreos';
30+
import { RpcService } from 'oreos';
2431

25-
// communication with rpc server over tcp
26-
const tcpProvider = new RpcService(ip, port, rpcAuthToken, 'TCP');
27-
// communication with rpc server over tls
28-
const tlsProvider = new RpcService(ip, port, rpcAuthToken, 'TLS');
32+
const provider = new RpcService(ip, port);
2933

3034
type GetBalanceRequest = {
3135
account?: string;
3236
assetId?: string;
3337
confirmations?: number;
3438
};
39+
40+
type AssetVerification = {
41+
status: 'verified' | 'unverified' | 'unknown';
42+
};
43+
3544
type GetBalanceResponse = {
3645
account: string;
3746
assetId: string;
47+
assetVerification: AssetVerification;
3848
confirmed: string;
3949
unconfirmed: string;
4050
unconfirmedCount: number;
@@ -51,44 +61,5 @@ const getBalanceRequest: GetBalanceRequest = {
5161
confirmations: 2,
5262
};
5363

54-
// get balance with tcp/tls provider
55-
const response: GetBalanceResponse = await tcpProvider.getBalance(getBalanceRequest);
56-
```
57-
58-
**Advanced:**
59-
60-
As shown above, only part of rpc methods are supported by Oreos rpc service component. Therefore, Oreos provides another
61-
way to perform rpc request.
62-
63-
```typescript
64-
import { RpcTcpClient, RpcTlsClient } from 'oreos';
65-
66-
const tcpClient = new RpcTcpClient(ip, port, rpcAuthToken);
67-
const tlsClient = new RpcTlsClient(ip, port, rpcAuthToken);
68-
69-
// to perform getBalance
70-
const getBalanceRequest: GetBalanceRequest = {
71-
account: 'default',
72-
confirmations: 2,
73-
};
74-
const response = await tlsClient.send("wallet/getBalance", getBalanceRequest);
75-
```
76-
77-
Please refer to [HowToRpc.md](/docs/HowToRpc.md) for more details about rpc.
78-
79-
**Account & Transaction:**
80-
81-
`CreateAccount`, `ImportAccount` and `Transaction` based components are supported.
82-
83-
```typescript
84-
import {
85-
Account,
86-
createAccount,
87-
importAccount,
88-
} from 'oreos';
89-
90-
const newAccount: Account = createAccount(accountName);
91-
const importedAccount: Account = importAccount(newAccount.name, newAccount.spendingKey);
64+
const response: GetBalanceResponse = await provider.getBalance(getBalanceRequest);
9265
```
93-
94-
Please refer to [HowToWallet.md](/docs/HowToWallet.md) for more details about wallet.

docs/HowToRpc.md

Lines changed: 0 additions & 104 deletions
This file was deleted.

docs/HowToWallet.md

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)