You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/network/flare-tx-sdk/1-getting-started.mdx
+20-6Lines changed: 20 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -49,6 +49,13 @@ Add the SDK to your project:
49
49
```
50
50
51
51
</TabItem>
52
+
<TabItemvalue="pnpm"label="pnpm">
53
+
54
+
```bash
55
+
pnpm add @flarenetwork/flare-tx-sdk
56
+
```
57
+
58
+
</TabItem>
52
59
53
60
</Tabs>
54
61
@@ -66,10 +73,10 @@ This ensures the same wallet can be used across multiple networks without code c
66
73
The `Network` object provides methods to query balances, transfer tokens, claim rewards, and interact with contracts.
67
74
It uses Flare's [public RPCs](/network/overview#configuration) by default.
68
75
69
-
-**`Wallet`**: Represents a user account. The SDK does not store private keys. Instead, it defines a `Wallet` interface which can be implemented by:
70
-
- MetaMask and other browser wallets (`EIP1193WalletController`)
71
-
- Ledger (`LedgerWalletController`)
72
-
- Trezor (`TrezorWalletController`)
76
+
-**`Wallet`**: Represents a user account. The SDK does not store private keys. Instead, it defines a [`Wallet`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/wallet/index.ts) interface which can be implemented by:
77
+
- MetaMask and other browser wallets - `EIP1193WalletController`
78
+
- Ledger - `LedgerWalletController`
79
+
- Trezor - `TrezorWalletController`
73
80
- Your own custom signer
74
81
75
82
## Example implementation
@@ -120,8 +127,15 @@ Example output:
120
127
121
128
:::info[Units]
122
129
123
-
The SDK uses nats (smallest unit of FLR, equivalent to wei).
124
-
Use helpers methods `Amount.nats(x)` for FLR and `Amount.wnats(x)` for WFLR.
130
+
The SDK uses wei, the smallest unit of FLR (1 FLR = $10^{18}$ wei).
where `proofs` is an array of objects [`FtsoRewardClaimWithProof`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/network/iotype.ts) with:
241
+
`proofs` is an array of [`FtsoRewardClaimWithProof`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/network/iotype.ts):
243
242
244
-
-`merkleProof` (array of string) - The Merkle proof in hexadecimal encoding.
245
-
-`body` ([`FtsoRewardClaim`](https://github.com/flare-foundation/flare-tx-sdk/blob/HEAD/src/network/iotype.ts) ) - Same structure as `FtsoRewardState` without the `initialised` parameter.
-For official Flare contracts, names are predefined and easier to use.
415
+
The ABI must match the contract interface.
416
+
For official Flare contracts, i.e. contracts defined in the [`FlareContractRegistry`](/network/solidity-reference/IFlareContractRegistry), names are predefined and easier to use.
0 commit comments