@aptos-labs/js-pro 0.0.1

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 ADDED
@@ -0,0 +1,50 @@
1
+ # Aptos JS Pro
2
+
3
+ Aptos JS Pro is a framework agnostic library of queries and mutations related to the Aptos ecosystem.
4
+
5
+ # Getting Started
6
+
7
+ 1. Install the package
8
+
9
+ ```bash
10
+ pnpm add @aptos-labs/js-pro
11
+ ```
12
+
13
+ 2. Initialize the AptosJSPro client
14
+
15
+ ```ts
16
+ const core = new AptosJSProClient({ account, network, signer });
17
+ ```
18
+
19
+ 3. You now have access to all of the queries and mutations in the library!
20
+
21
+ ```ts
22
+ const address = await core.fetchAddressFromName({ name: 'kent.apt' })
23
+
24
+ const signedTxn = await core.signTransaction({ rawTxn })
25
+ ```
26
+
27
+ # Maintainers
28
+
29
+ In order to see changes reflected in apps locally, the package needs to be built and bundled. To do this, run the following command from the project:
30
+
31
+ ```bash
32
+ pnpm build
33
+ ```
34
+
35
+ This will build the package and place it in the `dist` folder. The package builds to CommonJS and ESM.
36
+
37
+ ## Utilities
38
+
39
+ Aptos core provides the client alongside the signer, network, and account. If you need access to clients such as the indexer client, FaucetClient, TokenClient, or AptosClient, you can use the `getClients()` utility.
40
+
41
+ ```ts
42
+ // Access AptosClient via `provider.aptosClient`
43
+ const { provider, indexerClient, faucetClient, tokenClient } = core.getClients();
44
+
45
+ // Access to: core.account, core.network, core.signer
46
+ core.account
47
+ ```
48
+
49
+ > The AptosClient can be found in the provider client as `provider.aptosClient` in `getClients()`
50
+