@tari-project/tarijs 0.14.0 → 0.14.2

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
@@ -12,17 +12,117 @@
12
12
  - **📱 Developer Friendly** — Full TypeScript support, intuitive APIs, comprehensive docs
13
13
  - **⚡ Production Ready** — Battle-tested, optimized, and actively maintained
14
14
 
15
+ ## Installing Tari.js
16
+
17
+ Tari.js provides the following packages:
18
+
19
+ | Package Name | Description |
20
+ |----------------------------------------|------------------------------------------------------------|
21
+ | @tari-project/tarijs-all | Everything: core, signers, providers, builders, permissions|
22
+ | @tari-project/tarijs | Core Tari.js types and helpers |
23
+ | @tari-project/tarijs-builders | Transaction builder (fluent API) |
24
+ | @tari-project/indexer-provider | Read-only blockchain provider |
25
+ | @tari-project/wallet-daemon-signer | Wallet Daemon signer & provider |
26
+ | @tari-project/metamask-signer | MetaMask signer |
27
+ | @tari-project/tari-universe-signer | Tari Universe wallet signer |
28
+ | @tari-project/wallet-connect-signer | WalletConnect signer |
29
+ | @tari-project/tari-permissions | Permissions utility |
30
+ | @tari-project/typescript-bindings | TypeScript type definitions and low-level structures |
31
+ | @tari-project/tarijs-types | Re-exports typescript-bindings while adding tari.js specific types |
32
+
33
+ ### Recommended: Use the Main Package
34
+
35
+ This installs everything (providers, signers, core modules, builders, types and permissions) with one package:
36
+
37
+ ```sh
38
+ npm install @tari-project/tarijs
39
+ ```
40
+
41
+ You can then import any of the required packages in your application:
42
+
43
+ ```typescript
44
+ import {
45
+ IndexerProvider,
46
+ WalletDaemonTariSigner,
47
+ TariUniverseSigner,
48
+ WalletConnectTariSigner,
49
+ TransactionBuilder,
50
+ TariPermissions,
51
+ } from "@tari-project/tarijs";
52
+ ```
53
+
54
+ If you are interested in development on the bleeding edge, you can install the following:
55
+
56
+ ```sh
57
+ npm install @tari-project/tarijs-all
58
+ ```
59
+
60
+ This will install ALL tari.js modules. Some of these may be under active development, experimental or not properly documented.
61
+
62
+ ### Optional: Install only the modules you require
63
+
64
+ If you require a minimal or custom setup, you can install the packages individually. This is not recommended unless you have a firm understanding of the purpose and function of the different packages.
65
+
66
+ Example of dependencies if you just wish to query Ootle states on the chain:
67
+
68
+ ```sh
69
+ npm install @tari-project/indexer-provider
70
+ npm install @tari-project/wallet-daemon-signer # Only if you need wallet data models/types
71
+ ```
72
+
73
+ #### Core Packages
74
+
75
+ - **@tari-project/tarijs-builders**
76
+ ```sh
77
+ npm install @tari-project/tarijs-builders
78
+ ```
79
+
80
+ #### Providers
81
+ - **@tari-project/indexer-provider**
82
+ ```sh
83
+ npm install @tari-project/indexer-provider
84
+ ```
85
+
86
+ - **@tari-project/wallet-daemon-signer**
87
+ ```sh
88
+ npm install @tari-project/wallet-daemon-signer
89
+ ```
90
+
91
+ #### Signers
92
+ - **@tari-project/metamask-signer**
93
+ ```sh
94
+ npm install @tari-project/metamask-signer
95
+ ```
96
+
97
+ - **@tari-project/tari-universe-signer**
98
+ ```sh
99
+ npm install @tari-project/tari-universe-signer
100
+ ```
101
+
102
+ - **@tari-project/wallet-connect-signer**
103
+ ```sh
104
+ npm install @tari-project/wallet-connect-signer
105
+ ```
106
+
107
+ ### Helpers
108
+
109
+ - **@tari-project/tari-permissions**
110
+ ```sh
111
+ npm install @tari-project/tari-permissions
112
+ ```
113
+
114
+
15
115
  ## 🎯 Quick Start (5 minutes)
16
116
 
17
117
  Get your first Tari app running in minutes:
18
118
 
19
119
  ```bash
20
120
  # Install tari.js
21
- npm install @tari-project/tarijs @tari-project/wallet-daemon-signer
121
+ npm install @tari-project/tarijs-all
22
122
 
23
123
  # Run your first connection test
24
124
  node -e "
25
- import { WalletDaemonTariSigner, TariPermissions } from '@tari-project/tarijs';
125
+ import { WalletDaemonTariSigner, TariPermissions } from '@tari-project/tarijs-all';
26
126
  const wallet = await WalletDaemonTariSigner.buildFetchSigner({
27
127
  serverUrl: 'http://localhost:18103',
28
128
  permissions: new TariPermissions()
@@ -31,7 +131,7 @@ console.log('Connected to Tari!');
31
131
  "
32
132
  ```
33
133
 
34
- **👉 [Complete Installation Guide](https://tari-project.github.io/tari.js/installation) | [5-Minute Tutorial](https://tari-project.github.io/tari.js/guides/getting-started-tutorial)**
134
+ **👉 [Complete Installation Guide](https://tari-project.github.io/tari.js/docs/installation) | [5-Minute Tutorial](https://tari-project.github.io/tari.js/docs/guides/getting-started-tutorial)**
35
135
 
36
136
  ## 🏗️ What You Can Build
37
137
 
@@ -73,26 +173,26 @@ const transaction = new TransactionBuilder()
73
173
 
74
174
  | Wallet | Best For | Status |
75
175
  |--------|----------|--------|
76
- | **🖥️ [Tari Wallet Daemon](https://tari-project.github.io/tari.js/signers/wallet-daemon)** | Servers, advanced features | ✅ Production |
77
- | **🦊 [MetaMask](https://tari-project.github.io/tari.js/signers/metamask)** | Browser apps, familiar UX | ✅ Production |
78
- | **🌌 [Tari Universe](https://tari-project.github.io/tari.js/signers/tari-universe)** | Mobile, native experience | ✅ Production |
79
- | **📱 [WalletConnect](https://tari-project.github.io/tari.js/signers/wallet-connect)** | Cross-platform, mobile-first | ✅ Production |
176
+ | **🖥️ [Tari Wallet Daemon](https://tari-project.github.io/tari.js/docs/signers/wallet-daemon)** | Servers, advanced features | ✅ Production |
177
+ | **🦊 [MetaMask](https://tari-project.github.io/tari.js/docs/signers/metamask)** | Browser apps, familiar UX | ✅ Production |
178
+ | **🌌 [Tari Universe](https://tari-project.github.io/tari.js/docs/signers/tari-universe)** | Mobile, native experience | ✅ Production |
179
+ | **📱 [WalletConnect](https://tari-project.github.io/tari.js/docs/signers/wallet-connect)** | Cross-platform, mobile-first | ✅ Production |
80
180
 
81
181
  ## 📚 Documentation Hub
82
182
 
83
183
  ### 🚀 **Get Started**
84
- - **[Installation Guide](https://tari-project.github.io/tari.js/installation)** — Set up your development environment
85
- - **[First App Tutorial](https://tari-project.github.io/tari.js/guides/getting-started-tutorial)** — Build a working wallet app
86
- - **[Provider vs Signer](https://tari-project.github.io/tari.js/provider-vs-signer)** — Understand the core concepts
184
+ - **[Installation Guide](https://tari-project.github.io/tari.js/docs/installation)** — Set up your development environment
185
+ - **[First App Tutorial](https://tari-project.github.io/tari.js/docs/guides/getting-started-tutorial)** — Build a working wallet app
186
+ - **[Provider vs Signer](https://tari-project.github.io/tari.js/docs/provider-vs-signer)** — Understand the core concepts
87
187
 
88
188
  ### 📖 **Guides & Examples**
89
189
  - **[Wallet Integration](https://tari-project.github.io/tari.js/category/signers)** — Connect different wallet types
90
- - **[Transaction Building](https://tari-project.github.io/tari.js/wallet/submit-transaction/transaction-builder/)** — Create complex transactions
91
- - **[Production Deployment](https://tari-project.github.io/tari.js/guides/production-deployment)** — Go live with confidence
190
+ - **[Transaction Building](https://tari-project.github.io/tari.js/docs/wallet/submit-transaction/transaction-builder/)** — Create complex transactions
191
+ - **[Production Deployment](https://tari-project.github.io/tari.js/docs/guides/production-deployment)** — Go live with confidence
92
192
 
93
193
  ### 🔧 **Reference**
94
- - **[Complete API Reference](https://tari-project.github.io/tari.js/api-reference)** — Every method documented
95
- - **[Troubleshooting](https://tari-project.github.io/tari.js/troubleshooting)** — Common issues & solutions
194
+ - **[Complete API Reference](https://tari-project.github.io/tari.js/docs/api-reference)** — Every method documented
195
+ - **[Troubleshooting](https://tari-project.github.io/tari.js/docs/troubleshooting)** — Common issues & solutions
96
196
  - **[Templates & Examples](https://github.com/tari-project/tari.js/tree/main/examples)** — Copy-paste code snippets
97
197
 
98
198
  ---
@@ -139,7 +239,7 @@ docker cp tarijs-build:/app/combined_dist/ ./dist
139
239
  moon tari-docs:start # http://localhost:3000/tari.js/
140
240
  ```
141
241
 
142
- **Need help getting started?** Check our **[Contributing Guide](https://tari-project.github.io/tari.js/contributing)** or ask in [GitHub Discussions](https://github.com/tari-project/tari.js/discussions).
242
+ **Need help getting started?** Check our **[Contributing Guide](https://tari-project.github.io/tari.js/docs/contributing)** or ask in [GitHub Discussions](https://github.com/tari-project/tari.js/discussions).
143
243
 
144
244
  ## 🤝 Community & Support
145
245
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tari-docs",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "private": true,
5
5
  "scripts": {
6
6
  "docusaurus": "docusaurus",
@@ -31,8 +31,8 @@ function App() {
31
31
  <div>
32
32
  <h2>Connected Account</h2>
33
33
  <p>Account ID: {account.account_id}</p>
34
- <p>Address: {account.address}</p>
35
- <p>Public Key: {account.public_key}</p>
34
+ <p>Component: {account.component_address}</p>
35
+ <p>Wallet Address: {account.wallet_address}</p>
36
36
  <h3>Resources:</h3>
37
37
  <ul>
38
38
  {account.vaults.map((resource, index) => (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tarijs",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -19,7 +19,7 @@
19
19
  "typescript-eslint": "^8.35.0"
20
20
  },
21
21
  "dependencies": {
22
- "@tari-project/tarijs-types": "^0.14.0"
22
+ "@tari-project/tarijs-types": "^0.14.2"
23
23
  },
24
24
  "scripts": {
25
25
  "docs": "typedoc",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tarijs-builders",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/indexer-provider",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/metamask-signer",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-permissions",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/react-mui-connect-button",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "React component to connect your website to the Tari Ootle Wallet",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-provider",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-signer",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-universe-signer",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tarijs-all",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tarijs-types",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -35,6 +35,7 @@ export interface AccountData {
35
35
  export interface VaultData {
36
36
  type: string;
37
37
  balance: number;
38
+ confidential_balance: number;
38
39
  resource_address: string;
39
40
  token_symbol: string;
40
41
  vault_id: string;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/wallet-daemon-signer",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -144,24 +144,22 @@ export class WalletDaemonTariSigner implements TariSigner {
144
144
 
145
145
  public async getAccount(): Promise<AccountData> {
146
146
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
147
- const { account, public_key } = (await this.client.accountsGetDefault({})) as any;
148
- const address = typeof account.address === "object" ? account.address.Component : account.address;
147
+ const { account, address } = await this.client.accountsGetDefault({});
149
148
  const { balances } = await this.client.accountsGetBalances({
150
- account: { ComponentAddress: address },
149
+ account: { ComponentAddress: account.component_address },
151
150
  refresh: false,
152
151
  });
153
152
 
154
153
  return {
155
154
  account_id: account.key_index,
156
- component_address: address,
157
- wallet_address: public_key,
158
- // TODO: should be vaults not resources
155
+ component_address: account.component_address,
156
+ wallet_address: address,
159
157
  vaults: balances.map((b: any) => ({
160
158
  type: b.resource_type,
161
159
  resource_address: b.resource_address,
162
- balance: b.balance + b.confidential_balance,
163
- vault_id:
164
- typeof b.vault_address === "object" && "Vault" in b.vault_address ? b.vault_address.Vault : b.vault_address,
160
+ balance: b.balance,
161
+ confidential_balance: b.confidential_balance,
162
+ vault_id: b.vault_address,
165
163
  token_symbol: b.token_symbol,
166
164
  })),
167
165
  };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/wallet-connect-signer",
3
- "version": "0.14.0",
3
+ "version": "0.14.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {