@hinkal/common 0.0.97 → 0.0.98

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -13,33 +13,36 @@ yarn add @hinkal/common
13
13
 
14
14
  1. Step: import hinkal from @hinkal/common package and initiate a Hinkal instance:
15
15
  ```sh
16
- import {Hinkal} from '@hinkal/common';
16
+ import {Hinkal} from '@hinkal/common';
17
17
 
18
- const hinkal = new Hinkal<Connector>();
18
+ const hinkal = new Hinkal<Connector>();
19
19
  ```
20
20
 
21
21
  2. Initiate ProviderAdapter object, where connector should be 'wagmi' Connector instance
22
- ```sh
23
- const providerAdapter = new ProviderAdapter(connector);
24
- await hinkal.initProviderAdapter(connector, providerAdapter);
22
+ ```typescript
23
+ const providerAdapter = new ProviderAdapter(connector);
24
+ await hinkal.initProviderAdapter(connector, providerAdapter);
25
25
  ```
26
+
26
27
  3. Ask user to generate his shielded address and fetch state from smart contract
27
- ```sh
28
- await hinkal.initUserKeys();
29
- await hinkal.resetMerkle();
28
+ ```typescript
29
+ await hinkal.initUserKeys();
30
+ await hinkal.resetMerkle();
30
31
  ```
32
+
31
33
  4. Once user generated shielded address, shielded balances are available that can be displayed in front-end:
32
- ```sh
33
- const balances = await hinkal.getBalances();
34
+ ```typescript
35
+ const balances = await hinkal.getBalances();
34
36
  ```
37
+
35
38
  5. A user can deposit to his shielded account using:
36
- ```sh
37
- hinkal.deposit(erc20addresses:string[], amountChanges:bigint[]);
39
+ ```typescript
40
+ hinkal.deposit(erc20addresses:string[],amountChanges:bigint[]);
38
41
  ```
39
42
  where erc20Addresses is array of token addresses and amountChanges - token amounts for the deposit.
43
+
40
44
  6. A user, once his balance is updated, can do any smart contract interaction:
41
- ```sh
42
- hinkal.actionPrivateWallet(erc20Addresses:string[], amountChanges:bigint[],
43
- onChainCreation:boolean[], ops:string[]);
45
+ ```typescript
46
+ hinkal.actionPrivateWallet( erc20Addresses:string[], amountChanges:bigint[], onChainCreation:boolean[], ops:string[]);
44
47
  ```
45
- Where onChainCreation indicates amounts of tokens which are uncertain before the transaction is executed onchain. And, ops array is encoded array of user ops.
48
+ where onChainCreation indicates amounts of tokens which are uncertain before the transaction is executed onchain. And, ops array is encoded array of user ops.