@hinkal/common 0.0.103 → 0.0.104
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 +18 -11
- package/{index-COLpGMpe.mjs → index-DbehuQxV.mjs} +7481 -7489
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/{utxoWorkerLogic-DyerYrK3.mjs → utxoWorkerLogic-D7NuHk_K.mjs} +1 -1
- package/{viteWorkerURL.constant-DnU4hEv_.mjs → viteWorkerURL.constant-Bc7ufzqC.mjs} +1 -1
- package/{zkProofWorkerLogic-DN4QUc_a.mjs → zkProofWorkerLogic-Bnalmuka.mjs} +1 -1
package/README.md
CHANGED
|
@@ -22,10 +22,10 @@ yarn add @hinkal/common
|
|
|
22
22
|
|
|
23
23
|
1. Import hinkal from @hinkal/common package and initiate a Hinkal instance:
|
|
24
24
|
|
|
25
|
-
```
|
|
26
|
-
|
|
25
|
+
```typescript
|
|
26
|
+
import { Hinkal } from '@hinkal/common';
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
const hinkal = new Hinkal<Connector>();
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
2. Initialize a ProviderAdapter object, where the connector should be an instance of the wagmi Connector.
|
|
@@ -51,16 +51,20 @@ const balances = await hinkal.getBalances();
|
|
|
51
51
|
5. A user can deposit to their shielded account using:
|
|
52
52
|
|
|
53
53
|
```typescript
|
|
54
|
-
|
|
54
|
+
function deposit(erc20addresses: string[], amountChanges: bigint[]): Promise<TransactionObject>;
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
where erc20Addresses is an array of token addresses, and amountChanges represents the token amounts for the deposit.
|
|
58
58
|
|
|
59
59
|
6. Once a user’s balance is updated, they can perform any smart contract interaction:
|
|
60
60
|
|
|
61
|
-
|
|
62
61
|
```typescript
|
|
63
|
-
|
|
62
|
+
function actionPrivateWallet(
|
|
63
|
+
erc20Addresses: string[],
|
|
64
|
+
amountChanges: bigint[],
|
|
65
|
+
onChainCreation: boolean[],
|
|
66
|
+
ops: string[],
|
|
67
|
+
): Promise<TransactionObject>;
|
|
64
68
|
```
|
|
65
69
|
|
|
66
70
|
where onChainCreation indicates the amounts of tokens that are uncertain before the transaction is executed on-chain. The ops array is an encoded array of user operations.
|
|
@@ -72,15 +76,18 @@ Before interacting with Hinkal smart contracts, a user needs to mint an access t
|
|
|
72
76
|
To check whether the user already has an access token, one can use the checkAccessToken function:
|
|
73
77
|
|
|
74
78
|
```typescript
|
|
75
|
-
|
|
79
|
+
function checkAccessToken(): Promise<boolean>;
|
|
76
80
|
```
|
|
81
|
+
|
|
77
82
|
If the user does not have an access token, one of the compliance providers should be used to pass the check. To view the available providers:
|
|
83
|
+
|
|
78
84
|
```typescript
|
|
79
|
-
|
|
85
|
+
function getSupportedPassportLinks(): string[];
|
|
80
86
|
```
|
|
81
87
|
|
|
82
88
|
Once the user has passed the check, they can mint an access token using:
|
|
89
|
+
|
|
83
90
|
```typescript
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
```
|
|
91
|
+
const { signatureData } = await hinkal.getAPI().getAccessTokenSignature(chainId, ethereumAddress, accessKey);
|
|
92
|
+
await mintAccessToken(this, signatureData);
|
|
93
|
+
```
|