Skip to content

Commit 7461328

Browse files
MantisClonegitbook-bot
authored andcommitted
GITBOOK-115: refactor: Hinkal Private Payments Code Snippet Formatting
1 parent 6c73de9 commit 7461328

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

docs/sdk-guides/payment/hinkal-private-payments.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,32 +20,36 @@ Paying a request where the payment recipient address is a Hinkal shielded addres
2020

2121
## Installation
2222

23-
To use the Hinkal Private Payments feature, install the necessary package:
23+
To use Hinkal Private Payments, install the necessary package:
2424

2525
```bash
2626
npm install @requestnetwork/payment-processor
27-
npm install @requestnetwork/request-client.js
2827
```
2928

3029
## Usage
3130

3231
### **Pay a request from a Hinkal shielded address**
3332

34-
To pay a request from a Hinkal shielded address to a public address, where only the payment sender's address is obfuscated, use the \``` payErc20FeeProxyRequestFromHinkalShieldedAddress()` `` function. Ensure the payment sender's Hinkal shielded address has a positive balance.
33+
To pay a request from a Hinkal shielded address to a public address, where only the payment sender's address is obfuscated, use the \``` payErc20FeeProxyRequestFromHinkalShieldedAddress()` `` function. Ensure the payment sender's Hinkal shielded address has a positive balance using[#deposit-to-a-hinkal-shielded-address](hinkal-private-payments.md#deposit-to-a-hinkal-shielded-address "mention")
3534

3635
{% hint style="warning" %}
37-
Strongly consider using [encryption-and-decryption](../encryption-and-decryption/ "mention")to keep the request contents private, including the payer and payee identity addresses, when paying requests from a Hinkal shielded address!
36+
Strongly consider using [encryption-and-decryption](../encryption-and-decryption/ "mention") to keep the request contents private, including the payer and payee identity addresses, when paying requests from a Hinkal shielded address. Revealing the payer and payee identity addresses increases the likelihood of un-shielding the payment sender's address via on-chain analysis.
3837
{% endhint %}
3938

4039
```typescript
41-
import { payErc20FeeProxyRequestFromHinkalShieldedAddress } from '@requestnetwork/payment-processor';
40+
import {
41+
payErc20FeeProxyRequestFromHinkalShieldedAddress,
42+
} from '@requestnetwork/payment-processor';
4243

4344
// Instantiation of `RequestNetwork` and `Signer` omitted for brevity
4445

4546
const request = await requestClient.fromRequestId('insert request id');
4647
const requestData = request.getData();
4748

48-
const paymentResult = await payErc20FeeProxyRequestFromHinkalShieldedAddress(requestData, signer);
49+
const relayerTx = await payErc20FeeProxyRequestFromHinkalShieldedAddress(
50+
requestData,
51+
signer,
52+
);
4953
```
5054

5155
{% hint style="info" %}
@@ -56,7 +60,7 @@ See [quickstart-browser.md](../../get-started/quickstart-browser.md "mention") f
5660

5761
To deposit funds to a Hinkal shielded address from a public address, where only the payment recipient's address is obfuscated, use the `sendToHinkalShieldedAddressFromPublic()` function.  
5862

59-
* Deposit to own Hinkal shielded address: omit the `recipientInfo`argument
63+
* Deposit to own Hinkal shielded address: omit the `recipientInfo` argument
6064
* Deposit to someone else's Hinkal shielded address: set `recipientInfo` to the shielded address of the payment recipient.
6165

6266
{% hint style="info" %}
@@ -65,12 +69,14 @@ Hinkal shielded addresses must be shared out-of-band. This SDK doesn't offer fun
6569

6670
{% code overflow="wrap" %}
6771
```typescript
68-
import { sendToHinkalShieldedAddressFromPublic } from '@requestnetwork/payment-processor';
72+
import {
73+
sendToHinkalShieldedAddressFromPublic,
74+
} from '@requestnetwork/payment-processor';
6975

7076
// Instantiation of `Signer` omitted for brevity
7177

7278
const recipientShieldedAddress = '142590100039484718476239190022599206250779986428210948946438848754146776167,0x096d6d5d8b2292aa52e57123a58fc4d5f3d66171acd895f22ce1a5b16ac51b9e,0xc025ccc6ef46399da52763a866a3a10d2eade509af27eb8411c5d251eb8cd34d'
73-
await sendToHinkalShieldedAddressFromPublic({
79+
const tx = await sendToHinkalShieldedAddressFromPublic({
7480
signerOrProvider: paymentSender,
7581
tokenAddress: '0x833589fcd6edb6e08f4c7c32d4f71b54bda02913', // USDC on Base
7682
amount: '1000000', // 1 USDC

0 commit comments

Comments
 (0)