Skip to content

Commit d3ad5d8

Browse files
Merge branch 'master' into docs/fix-cp-commands
2 parents 937a58a + b45f52e commit d3ad5d8

File tree

2 files changed

+16
-66
lines changed

2 files changed

+16
-66
lines changed

README.md

Lines changed: 11 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,15 @@ Dock Mobile SDK supports devices that have Android 8.1 or higher and iOS 11 or h
1212
## Installation
1313
```js
1414
yarn add @docknetwork/wallet-sdk-core
15-
yarn add @docknetwork/wallet-sdk-transactions
1615
yarn add @docknetwork/wallet-sdk-react-native
1716

1817
```
1918
**There are some scripts and additional dependencies required.**
2019
Please check our [example repo](https://github.com/docknetwork/wallet-sdk-demo) for detailed steps.
2120

2221
## React Native Example
23-
The following example will create a wallet and allow the user to add accounts on it. Displaying the count of documents added to the wallet.
24-
25-
Notice that the account documents are accessible through the `documents` object, and for each account created multiple documents will be added to the wallet.
22+
The following example will create a wallet and allow the user to add credentials to it. Displaying the count of documents added to the wallet.
23+
Notice that the all documents are accessible through the `documents` object.
2624

2725
```js
2826
import {Box, Button, NativeBaseProvider, Text} from 'native-base';
@@ -39,8 +37,11 @@ const WalletDetails = function () {
3937
<Box>
4038
<Text>Wallet status: {status}</Text>
4139
<Text>Wallet docs: {documents.length}</Text>
42-
<Button onPress={() => wallet.accounts.create({name: 'test'})}>
43-
<Text>Add Account</Text>
40+
<Button onPress={() => wallet.addDocument({
41+
name: 'my credential',
42+
type: 'VerifiableCredential',
43+
})}>
44+
<Text>Add Credential</Text>
4445
</Button>
4546
</Box>
4647
);
@@ -52,7 +53,7 @@ const App = () => {
5253
<WalletSDKProvider>
5354
<Box p={8}>
5455
<Text>Dock Wallet SDK Demo</Text>
55-
<Text>Press on `add document` button to create a new account</Text>
56+
<Text>Press on `add credential` button to create a new credential</Text>
5657
</Box>
5758
<WalletDetails />
5859
</WalletSDKProvider>
@@ -64,67 +65,12 @@ export default App;
6465

6566
```
6667

67-
## Using the wallet module
68-
69-
```js
70-
import {Wallet} from '@docknetwork/wallet-sdk-core/lib/modules/wallet';
71-
import {Transactions} from '@docknetwork/wallet-sdk-transactions/lib/transactions';
72-
73-
const wallet = await Wallet.create();
74-
75-
const account1 = await wallet.accounts.create({
76-
name: 'test',
77-
});
78-
79-
console.log(`Account1 address ${account1.address}`);
80-
// result: Account1 address 3D1M9UnR684eBfVujjQr6ucPqvXERSxYxcVBFGAhRohhRXxq
81-
82-
// Create account using an existing mnemonic
83-
const mnemonic =
84-
'indicate mention thing discover clarify grief inherit vivid dish health market spoil';
85-
const account2 = await wallet.accounts.create({
86-
name: 'Test',
87-
mnemonic,
88-
});
89-
90-
console.log(`Account2 address ${account2.address}`);
91-
92-
// result: Account2 address 3FENesfZgFmBruv2H9Hc17GmobeTfxFAp8gHKXFmUtA38hcW
93-
94-
// Fetch accounts balance
95-
const balance = await account1.getBalance();
96-
97-
console.log('Account1 balance', balance);
68+
For more details you can check the [getting started guide](docs/getting-started.md).
9869

99-
// result: Account1 balance 0
100-
101-
// Handle transactions
102-
const transactions = Transactions.with(account1);
103-
104-
const txInput = {
105-
toAddress: account2.address,
106-
amount: 3
107-
};
108-
109-
// Get transaction fee in DOCK tokens
110-
const fee = await transactions.getFee(txInput);
111-
112-
console.log('Transaction fee', fee);
113-
114-
// result: Transaction fee 2.3
115-
116-
// Send transaction
117-
const hash = await transactions.send(txInput);
118-
119-
console.log('Transaction hash', fee);
120-
121-
// result: Transaction hash 0x1c1c5ca40acafb830460dccb492be4ac7181e9d700ab78853df052e478e8b2a9
122-
123-
```
12470

125-
## Running on nodejs
71+
## Running on other platforms
12672

127-
Check the following repository for nodejs project examples.
73+
Check the following repository for detailed examples for running the Dock Wallet SDK on NodeJS, Web, and Flutter.
12874

12975
https://github.com/docknetwork/wallet-sdk-examples
13076

packages/transactions/readme.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11

2-
# Transactions Manager
2+
# Deprecated Module
3+
4+
The transaction module is deprecated and will be removed in the future.
5+
6+
# Transactions Manager
37

48
Transactions are required to send and receive (DOCK Tokens)[[https://www.dock.io/token]. This module handles the transaction history and provides methods to send DOCK tokens to any address.
59

0 commit comments

Comments
 (0)