@tari-project/tarijs 0.4.1 → 0.4.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.
Files changed (61) hide show
  1. package/.github/workflows/ci.yml +2 -1
  2. package/.github/workflows/documentation-deploy.yml +44 -0
  3. package/.github/workflows/documentation-test-deploy.yml +20 -0
  4. package/.moon/workspace.yml +1 -0
  5. package/README.md +19 -0
  6. package/docusaurus/tari-docs/README.md +41 -0
  7. package/docusaurus/tari-docs/docs/index.md +16 -0
  8. package/docusaurus/tari-docs/docs/installation.md +27 -0
  9. package/docusaurus/tari-docs/docs/providers/_category_.json +8 -0
  10. package/docusaurus/tari-docs/docs/providers/tari-universe.md +27 -0
  11. package/docusaurus/tari-docs/docs/providers/wallet-connect.md +52 -0
  12. package/docusaurus/tari-docs/docs/providers/wallet-daemon.md +37 -0
  13. package/docusaurus/tari-docs/docs/wallet/_category_.json +8 -0
  14. package/docusaurus/tari-docs/docs/wallet/default-account.md +51 -0
  15. package/docusaurus/tari-docs/docs/wallet/get-substate.md +110 -0
  16. package/docusaurus/tari-docs/docs/wallet/list-substates.md +69 -0
  17. package/docusaurus/tari-docs/docs/wallet/submit-transaction/_category_.json +8 -0
  18. package/docusaurus/tari-docs/docs/wallet/submit-transaction/build-execute-request.md +38 -0
  19. package/docusaurus/tari-docs/docs/wallet/submit-transaction/index.md +14 -0
  20. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/_category_.json +8 -0
  21. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-function.md +17 -0
  22. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-method.md +17 -0
  23. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/fee.md +28 -0
  24. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/index.md +426 -0
  25. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/inputs.md +24 -0
  26. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/instruction.md +108 -0
  27. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/min-max-epoch.md +19 -0
  28. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/raw-instructions.md +16 -0
  29. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/save-var.md +63 -0
  30. package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/transaction-internals.md +20 -0
  31. package/docusaurus/tari-docs/docs/wallet/template-definition.md +101 -0
  32. package/docusaurus/tari-docs/docusaurus.config.ts +108 -0
  33. package/docusaurus/tari-docs/moon.yml +41 -0
  34. package/docusaurus/tari-docs/package.json +49 -0
  35. package/docusaurus/tari-docs/sidebars.ts +7 -0
  36. package/docusaurus/tari-docs/src/components/HomepageFeatures/index.tsx +69 -0
  37. package/docusaurus/tari-docs/src/components/HomepageFeatures/styles.module.css +11 -0
  38. package/docusaurus/tari-docs/src/css/custom.css +30 -0
  39. package/docusaurus/tari-docs/src/pages/index.module.css +23 -0
  40. package/docusaurus/tari-docs/src/pages/index.tsx +44 -0
  41. package/docusaurus/tari-docs/static/.nojekyll +0 -0
  42. package/docusaurus/tari-docs/static/img/favicon.png +0 -0
  43. package/docusaurus/tari-docs/static/img/meta-image.png +0 -0
  44. package/docusaurus/tari-docs/static/img/tari/wallet-connect-1.png +0 -0
  45. package/docusaurus/tari-docs/static/img/tari/wallet-connect-2.png +0 -0
  46. package/docusaurus/tari-docs/static/img/tari/wallet-connect-3.png +0 -0
  47. package/docusaurus/tari-docs/static/img/tari-logo.svg +30 -0
  48. package/docusaurus/tari-docs/tsconfig.json +8 -0
  49. package/package.json +1 -1
  50. package/packages/tari_provider/package.json +1 -1
  51. package/packages/tari_provider/src/TariProvider.ts +1 -2
  52. package/packages/tari_provider/src/types.ts +2 -0
  53. package/packages/tari_universe/package.json +1 -1
  54. package/packages/tari_universe/src/provider.ts +2 -17
  55. package/packages/tarijs/moon.yml +8 -0
  56. package/packages/tarijs/package.json +1 -0
  57. package/packages/tarijs/src/cbor.spec.ts +259 -0
  58. package/packages/tarijs/src/cbor.ts +114 -0
  59. package/packages/tarijs/src/index.ts +3 -0
  60. package/pnpm-workspace.yaml +1 -0
  61. package/tsconfig.json +3 -0
@@ -0,0 +1,20 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ # Internals of a Transaction Request
6
+
7
+ A Transaction Request has the following parts:
8
+
9
+ - `network`: The ID of the network (e.g., LocalNet, NextNet, Igor) on which this request is expected to be executed.
10
+ - `accountId`: The ID of the account in which the transaction will be executed.
11
+ - `feeInstructions`: Instructions describing where to obtain funds to cover transaction costs.
12
+ - `instructions`: The core of the Transaction Request—the instructions to be executed.
13
+ - `inputs`: Substates involved in the transaction. Supplying these helps assign transactions to the correct shards in consensus.
14
+ - `minEpoch` and `maxEpoch`: Required epoch bounds for execution. These are optional.
15
+ - `is_dry_run`: If `true`, the transaction will be validated but not submitted.
16
+ - `is_seal_signer_authorized`: If `true`, the wallet's public key will be used; otherwise, the first signature of the transaction is used as the "default" owner.
17
+ - `detect_inputs_use_unversioned`: If `true`, dependent substates will skip the version check.
18
+
19
+ Most of these parts are covered by the *Transaction Builder*; the rest are filled by `buildTransactionRequest`.
20
+
@@ -0,0 +1,101 @@
1
+ ---
2
+ sidebar_position: 2
3
+ ---
4
+
5
+ # Template definition
6
+
7
+ A Tari contract template provides a standardized structure and pre-written code for creating smart contracts on the Tari blockchain. It simplifies development by offering a foundation with common functionalities and best practices, allowing developers to focus on the specific logic of their contract.
8
+
9
+
10
+ Let's take a look at the template definition of the `XtrFaucet` template.
11
+ The template address varies by installation. You can easily examine them using the `Tari Validation Node` UI.
12
+
13
+ ```js
14
+ const templateAddress = "0102030000000000000000000000000000000000000000000000000000000000";
15
+ const template = await provider.getTemplateDefinition(templateAddress);
16
+ ```
17
+
18
+ The result should look similar to:
19
+
20
+ ```json
21
+ {
22
+ "V1": {
23
+ "functions": [
24
+ {
25
+ "arguments": [
26
+ {
27
+ "arg_type": {
28
+ "Other": {
29
+ "name": "&self"
30
+ }
31
+ },
32
+ "name": "self"
33
+ },
34
+ {
35
+ "arg_type": {
36
+ "Other": {
37
+ "name": "Amount"
38
+ }
39
+ },
40
+ "name": "amount"
41
+ }
42
+ ],
43
+ "is_mut": false,
44
+ "name": "take",
45
+ "output": {
46
+ "Other": {
47
+ "name": "Bucket"
48
+ }
49
+ }
50
+ },
51
+ {
52
+ "arguments": [
53
+ {
54
+ "arg_type": {
55
+ "Other": {
56
+ "name": "&self"
57
+ }
58
+ },
59
+ "name": "self"
60
+ },
61
+ {
62
+ "arg_type": {
63
+ "Other": {
64
+ "name": "Amount"
65
+ }
66
+ },
67
+ "name": "amount"
68
+ },
69
+ {
70
+ "arg_type": {
71
+ "Other": {
72
+ "name": "ConfidentialOutputStatement"
73
+ }
74
+ },
75
+ "name": "output"
76
+ },
77
+ {
78
+ "arg_type": {
79
+ "Other": {
80
+ "name": "BalanceProofSignature"
81
+ }
82
+ },
83
+ "name": "balance_proof"
84
+ }
85
+ ],
86
+ "is_mut": false,
87
+ "name": "take_confidential",
88
+ "output": {
89
+ "Other": {
90
+ "name": "Bucket"
91
+ }
92
+ }
93
+ }
94
+ ],
95
+ "tari_version": "0.8.0",
96
+ "template_name": "XtrFaucet"
97
+ }
98
+ }
99
+ ```
100
+
101
+ This template has two methods - `take` and `take_confidential`. First one takes `amount` only, second requires additional confidential output statement along with balance proof signature. Both methods return a bucket.
@@ -0,0 +1,108 @@
1
+ import {themes as prismThemes} from 'prism-react-renderer';
2
+ import type {Config} from '@docusaurus/types';
3
+ import type * as Preset from '@docusaurus/preset-classic';
4
+
5
+ const config: Config = {
6
+ title: "tari.js",
7
+ tagline: "Your gateway to Tari L2",
8
+ favicon: "img/favicon.png",
9
+
10
+ organizationName: "tari-project",
11
+ projectName: "tari.js",
12
+ deploymentBranch: "documentation",
13
+ trailingSlash: false,
14
+
15
+ url: "https://tari-project.github.io/",
16
+ baseUrl: "/tari.js",
17
+
18
+ onBrokenLinks: "throw",
19
+ onBrokenMarkdownLinks: "warn",
20
+
21
+ i18n: {
22
+ defaultLocale: "en",
23
+ locales: ["en"],
24
+ },
25
+
26
+ presets: [
27
+ [
28
+ "classic",
29
+ {
30
+ docs: {
31
+ sidebarPath: "./sidebars.ts",
32
+ remarkPlugins: [[require("@docusaurus/remark-plugin-npm2yarn"), { sync: true }]],
33
+ },
34
+ blog: false,
35
+ theme: {
36
+ customCss: "./src/css/custom.css",
37
+ },
38
+ } satisfies Preset.Options,
39
+ ],
40
+ ],
41
+
42
+ themeConfig: {
43
+ image: "img/meta-image.png",
44
+ navbar: {
45
+ title: "tari.js",
46
+ logo: {
47
+ alt: "Tari Logo",
48
+ src: "img/tari-logo.svg",
49
+ },
50
+ items: [
51
+ {
52
+ type: "docSidebar",
53
+ sidebarId: "docsSidebar",
54
+ position: "left",
55
+ label: "Documentation",
56
+ },
57
+ {
58
+ href: "https://github.com/tari-project/tari.js",
59
+ label: "GitHub",
60
+ position: "right",
61
+ },
62
+ ],
63
+ },
64
+ footer: {
65
+ style: "dark",
66
+ links: [
67
+ {
68
+ title: "tari.js",
69
+ items: [
70
+ {
71
+ label: "Documentation",
72
+ to: "/docs/",
73
+ },
74
+ {
75
+ label: "Github",
76
+ to: "https://github.com/tari-project/tari.js",
77
+ },
78
+ ],
79
+ },
80
+ {
81
+ title: "Community",
82
+ items: [
83
+ {
84
+ label: "Discord",
85
+ href: "https://discord.com/invite/tari",
86
+ },
87
+ {
88
+ label: "Telegram",
89
+ href: "https://t.me/tariproject",
90
+ },
91
+ {
92
+ label: "X",
93
+ href: "https://x.com/tari",
94
+ }
95
+ ],
96
+ },
97
+ ],
98
+ copyright: `Copyright © ${new Date().getFullYear()} Tari Labs.`,
99
+ },
100
+ prism: {
101
+ theme: prismThemes.github,
102
+ darkTheme: prismThemes.dracula,
103
+ additionalLanguages: ["typescript", "javascript"],
104
+ },
105
+ } satisfies Preset.ThemeConfig,
106
+ };
107
+
108
+ export default config;
@@ -0,0 +1,41 @@
1
+ language: "typescript"
2
+ platform: 'node'
3
+ type: 'application'
4
+
5
+ fileGroups:
6
+ configs:
7
+ - "docusaurus.config.ts"
8
+ - "package.json"
9
+ - "tsconfig.json"
10
+ sources:
11
+ - "sidebars.ts"
12
+ - "src/**/*"
13
+ docs:
14
+ - "docs/**/*"
15
+ - "static/**/*"
16
+
17
+ tasks:
18
+ build:
19
+ script: "pnpm run build"
20
+ inputs:
21
+ - "@files(configs)"
22
+ - "@files(sources)"
23
+ - "@files(docs)"
24
+ outputs:
25
+ - "build"
26
+
27
+ start:
28
+ script: "pnpm run start"
29
+ inputs:
30
+ - "@files(configs)"
31
+ - "@files(sources)"
32
+ - "@files(docs)"
33
+
34
+ serve:
35
+ script: "pnpm run start"
36
+ inputs:
37
+ - "@files(configs)"
38
+ - "@files(sources)"
39
+ - "@files(docs)"
40
+ deps:
41
+ - 'build'
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "tari-docs",
3
+ "version": "0.0.1",
4
+ "private": true,
5
+ "scripts": {
6
+ "docusaurus": "docusaurus",
7
+ "start": "docusaurus start",
8
+ "build": "docusaurus build",
9
+ "swizzle": "docusaurus swizzle",
10
+ "deploy": "docusaurus deploy",
11
+ "clear": "docusaurus clear",
12
+ "serve": "docusaurus serve",
13
+ "write-translations": "docusaurus write-translations",
14
+ "write-heading-ids": "docusaurus write-heading-ids",
15
+ "typecheck": "tsc"
16
+ },
17
+ "dependencies": {
18
+ "@docusaurus/core": "3.7.0",
19
+ "@docusaurus/preset-classic": "3.7.0",
20
+ "@docusaurus/remark-plugin-npm2yarn": "^3.7.0",
21
+ "@mdx-js/react": "^3.0.0",
22
+ "clsx": "^2.0.0",
23
+ "prism-react-renderer": "^2.3.0",
24
+ "react": "^19.0.0",
25
+ "react-dom": "^19.0.0",
26
+ "react-feather": "^2.0.10"
27
+ },
28
+ "devDependencies": {
29
+ "@docusaurus/module-type-aliases": "3.7.0",
30
+ "@docusaurus/tsconfig": "3.7.0",
31
+ "@docusaurus/types": "3.7.0",
32
+ "typescript": "~5.6.2"
33
+ },
34
+ "browserslist": {
35
+ "production": [
36
+ ">0.5%",
37
+ "not dead",
38
+ "not op_mini all"
39
+ ],
40
+ "development": [
41
+ "last 3 chrome version",
42
+ "last 3 firefox version",
43
+ "last 5 safari version"
44
+ ]
45
+ },
46
+ "engines": {
47
+ "node": ">=18.0"
48
+ }
49
+ }
@@ -0,0 +1,7 @@
1
+ import type {SidebarsConfig} from '@docusaurus/plugin-content-docs';
2
+
3
+ const sidebars: SidebarsConfig = {
4
+ docsSidebar: [{type: 'autogenerated', dirName: '.'}],
5
+ };
6
+
7
+ export default sidebars;
@@ -0,0 +1,69 @@
1
+ import type {ReactNode} from 'react';
2
+ import clsx from 'clsx';
3
+ import Heading from '@theme/Heading';
4
+ import { Zap, Cpu, Code } from 'react-feather';
5
+ import styles from './styles.module.css';
6
+
7
+ type FeatureItem = {
8
+ title: string;
9
+ Svg: React.ComponentType<React.ComponentProps<'svg'>>;
10
+ description: ReactNode;
11
+ };
12
+
13
+ const FeatureList: FeatureItem[] = [
14
+ {
15
+ title: 'Simple Integration with Tari L2',
16
+ Svg: Zap,
17
+ description: (
18
+ <>
19
+ Easily integrate with Tari's Layer 2 wallet and blockchain functionality using our simple and intuitive JavaScript/TypeScript libraries.
20
+ </>
21
+ ),
22
+ },
23
+ {
24
+ title: 'Build Secure and Scalable dApps',
25
+ Svg: Cpu,
26
+ description: (
27
+ <>
28
+ Use Tari's advanced protocol to create decentralized applications with enhanced security and scalability for real-world use cases.
29
+ </>
30
+ ),
31
+ },
32
+ {
33
+ title: 'Developer-Friendly Smart Contracts',
34
+ Svg: Code,
35
+ description: (
36
+ <>
37
+ Quickly deploy and manage Tari-based smart contracts with pre-built templates, a seamless transaction builder, and a robust API.
38
+ </>
39
+ ),
40
+ },
41
+ ];
42
+
43
+ function Feature({ title, Svg, description }: FeatureItem) {
44
+ return (
45
+ <div className={clsx('col col--4')}>
46
+ <div className="text--center">
47
+ <Svg className={styles.featureSvg} role="img" />
48
+ </div>
49
+ <div className="text--center padding-horiz--md">
50
+ <Heading as="h3">{title}</Heading>
51
+ <p>{description}</p>
52
+ </div>
53
+ </div>
54
+ );
55
+ }
56
+
57
+ export default function HomepageFeatures(): ReactNode {
58
+ return (
59
+ <section className={styles.features}>
60
+ <div className="container">
61
+ <div className="row">
62
+ {FeatureList.map((props, idx) => (
63
+ <Feature key={idx} {...props} />
64
+ ))}
65
+ </div>
66
+ </div>
67
+ </section>
68
+ );
69
+ }
@@ -0,0 +1,11 @@
1
+ .features {
2
+ display: flex;
3
+ align-items: center;
4
+ padding: 2rem 0;
5
+ width: 100%;
6
+ }
7
+
8
+ .featureSvg {
9
+ height: 200px;
10
+ width: 200px;
11
+ }
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Any CSS included here will be global. The classic template
3
+ * bundles Infima by default. Infima is a CSS framework designed to
4
+ * work well for content-centric websites.
5
+ */
6
+
7
+ /* You can override the default Infima variables here. */
8
+ :root {
9
+ --ifm-color-primary: #2e8555;
10
+ --ifm-color-primary-dark: #29784c;
11
+ --ifm-color-primary-darker: #277148;
12
+ --ifm-color-primary-darkest: #205d3b;
13
+ --ifm-color-primary-light: #33925d;
14
+ --ifm-color-primary-lighter: #359962;
15
+ --ifm-color-primary-lightest: #3cad6e;
16
+ --ifm-code-font-size: 95%;
17
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
18
+ }
19
+
20
+ /* For readability concerns, you should choose a lighter palette in dark mode. */
21
+ [data-theme='dark'] {
22
+ --ifm-color-primary: #25c2a0;
23
+ --ifm-color-primary-dark: #21af90;
24
+ --ifm-color-primary-darker: #1fa588;
25
+ --ifm-color-primary-darkest: #1a8870;
26
+ --ifm-color-primary-light: #29d5b0;
27
+ --ifm-color-primary-lighter: #32d8b4;
28
+ --ifm-color-primary-lightest: #4fddbf;
29
+ --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3);
30
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * CSS files with the .module.css suffix will be treated as CSS modules
3
+ * and scoped locally.
4
+ */
5
+
6
+ .heroBanner {
7
+ padding: 4rem 0;
8
+ text-align: center;
9
+ position: relative;
10
+ overflow: hidden;
11
+ }
12
+
13
+ @media screen and (max-width: 996px) {
14
+ .heroBanner {
15
+ padding: 2rem;
16
+ }
17
+ }
18
+
19
+ .buttons {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: center;
23
+ }
@@ -0,0 +1,44 @@
1
+ import type {ReactNode} from 'react';
2
+ import clsx from 'clsx';
3
+ import Link from '@docusaurus/Link';
4
+ import useDocusaurusContext from '@docusaurus/useDocusaurusContext';
5
+ import Layout from '@theme/Layout';
6
+ import HomepageFeatures from '@site/src/components/HomepageFeatures';
7
+ import Heading from '@theme/Heading';
8
+
9
+ import styles from './index.module.css';
10
+
11
+ function HomepageHeader() {
12
+ const {siteConfig} = useDocusaurusContext();
13
+ return (
14
+ <header className={clsx('hero hero--primary', styles.heroBanner)}>
15
+ <div className="container">
16
+ <Heading as="h1" className="hero__title">
17
+ {siteConfig.title}
18
+ </Heading>
19
+ <p className="hero__subtitle">{siteConfig.tagline}</p>
20
+ <div className={styles.buttons}>
21
+ <Link
22
+ className="button button--secondary button--lg"
23
+ to="/docs/">
24
+ tari.js Documentation
25
+ </Link>
26
+ </div>
27
+ </div>
28
+ </header>
29
+ );
30
+ }
31
+
32
+ export default function Home(): ReactNode {
33
+ const {siteConfig} = useDocusaurusContext();
34
+ return (
35
+ <Layout
36
+ title={`${siteConfig.title}`}
37
+ description="tari.js - TypeScript and JavaScript library to interact with Tari L2">
38
+ <HomepageHeader />
39
+ <main>
40
+ <HomepageFeatures />
41
+ </main>
42
+ </Layout>
43
+ );
44
+ }
File without changes
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="161px" height="51px" viewBox="0 0 161 51" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 64 (93537) - https://sketch.com -->
4
+ <title>Tari Logo</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <defs>
7
+ <polygon id="path-1" points="0.393621297 0.862457335 29.0083004 0.862457335 29.0083004 33.4853883 0.393621297 33.4853883"></polygon>
8
+ </defs>
9
+ <g id="Final-Designs" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
10
+ <g id="Tari-Home---Large-Display" transform="translate(-50.000000, -112.000000)">
11
+ <g id="Group">
12
+ <g id="Tari-Logo" transform="translate(50.000000, 112.000000)">
13
+ <path d="M102.594401,9.47880149 L91.5497291,42.1014905 L98.6148729,42.1014905 L100.946448,34.5589002 L110.633313,34.5589002 L112.964645,42.1014905 L120.029547,42.1014905 L108.985118,9.47880149 L102.594401,9.47880149 Z M105.78988,18.7257282 L108.750629,28.4486495 L102.828647,28.4486495 L105.78988,18.7257282 Z" id="Fill-1" fill="#000000"></path>
14
+ <polygon id="Fill-2" fill="#000000" points="154.348369 42.1015147 160.914771 42.1015147 160.914771 9.47882569 154.348369 9.47882569"></polygon>
15
+ <g id="Group-10" transform="translate(0.000000, 0.176120)">
16
+ <path d="M130.331357,23.2899286 L130.331357,15.412908 L135.915763,15.412908 C138.462951,15.412908 139.808901,16.7748284 139.808901,19.3517813 C139.808901,21.9282501 138.462951,23.2899286 135.915763,23.2899286 L130.331357,23.2899286 Z M136.976648,29.3699305 C143.007768,29.0536494 146.467259,25.4022604 146.467259,19.3517813 C146.467259,13.059312 142.607758,9.30265727 136.144202,9.30265727 L123.764471,9.30265727 L123.764471,41.9253463 L130.331357,41.9253463 L130.331357,31.7305442 L139.324678,41.9253463 L147.781991,41.9253463 L136.621165,29.3885638 L136.976648,29.3699305 Z" id="Fill-3" fill="#000000"></path>
17
+ <g id="Group-7" transform="translate(64.000000, 8.440006)">
18
+ <mask id="mask-2" fill="white">
19
+ <use xlink:href="#path-1"></use>
20
+ </mask>
21
+ <g id="Clip-6"></g>
22
+ <polygon id="Fill-5" fill="#000000" mask="url(#mask-2)" points="11.4177961 33.4853883 17.9844402 33.4853883 17.9844402 6.97295003 29.0083004 6.97295003 29.0083004 0.862457335 0.393451904 0.862457335 0.393451904 6.97295003 11.4177961 6.97295003"></polygon>
23
+ </g>
24
+ <path d="M44.338157,17.1463649 L44.338157,23.1828086 L8.93838931,14.0762361 L20.8764882,6.30520718 L44.338157,17.1463649 Z M22.868551,42.4464326 L22.868551,22.7585999 L41.7674959,27.6201815 L22.868551,42.4464326 Z M17.9307424,40.5439062 L4.93805053,26.0356302 L4.93805053,18.1460261 L17.9307424,21.4883937 L17.9307424,40.5439062 Z M0,14.0024291 L0,27.9236371 L20.3772626,50.6774848 L49.2762075,28.0056718 L49.2762075,13.9883937 L20.4697028,0.677484788 L0,14.0024291 Z" id="Fill-8" fill="#000000"></path>
25
+ </g>
26
+ </g>
27
+ </g>
28
+ </g>
29
+ </g>
30
+ </svg>
@@ -0,0 +1,8 @@
1
+ {
2
+ // This file is not used in compilation. It is here just for a nice editor experience.
3
+ "extends": "@docusaurus/tsconfig",
4
+ "compilerOptions": {
5
+ "baseUrl": "."
6
+ },
7
+ "exclude": [".docusaurus", "build"]
8
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tarijs",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "keywords": [],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-provider",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -10,7 +10,6 @@ import {
10
10
  ListSubstatesResponse,
11
11
  } from "./types";
12
12
 
13
-
14
13
  export interface TariProvider {
15
14
  providerName: string;
16
15
  isConnected(): boolean;
@@ -32,4 +31,4 @@ export interface TariProvider {
32
31
  limit: number | null,
33
32
  offset: number | null,
34
33
  ): Promise<ListSubstatesResponse>;
35
- }
34
+ }
@@ -58,6 +58,8 @@ export interface VaultData {
58
58
  type: string;
59
59
  balance: number;
60
60
  resource_address: string;
61
+ token_symbol: string;
62
+ vault_id: string;
61
63
  }
62
64
 
63
65
  export interface VaultBalances {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-universe-provider",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -7,7 +7,7 @@ import {
7
7
  ListSubstatesResponse,
8
8
  SubmitTransactionRequest,
9
9
  TariProvider,
10
- TransactionResult
10
+ TransactionResult,
11
11
  } from "@tari-project/tari-provider";
12
12
  import {
13
13
  ProviderRequest,
@@ -16,7 +16,6 @@ import {
16
16
  TariUniverseProviderParameters,
17
17
  WindowSize,
18
18
  } from "./types";
19
- import { } from "@tari-project/tari-provider";
20
19
  import { AccountsGetBalancesResponse, SubstateType } from "@tari-project/wallet_jrpc_client";
21
20
  import { sendProviderCall } from "./utils";
22
21
 
@@ -84,21 +83,7 @@ export class TariUniverseProvider implements TariProvider {
84
83
  }
85
84
 
86
85
  public async getAccount(): Promise<Account> {
87
- const { account_id, address, public_key } = await this.sendRequest({ methodName: "getAccount", args: [] });
88
- const { balances } = await this.getAccountBalances(address);
89
-
90
- return {
91
- account_id,
92
- address,
93
- public_key,
94
- resources: balances.map((b: any) => ({
95
- type: b.resource_type,
96
- resource_address: b.resource_address,
97
- balance: b.balance + b.confidential_balance,
98
- vault_id: "Vault" in b.vault_address ? b.vault_address.Vault : b.vault_address,
99
- token_symbol: b.token_symbol,
100
- })),
101
- };
86
+ return this.sendRequest({ methodName: "getAccount", args: [] });
102
87
  }
103
88
 
104
89
  public async getAccountBalances(componentAddress: string): Promise<AccountsGetBalancesResponse> {
@@ -54,6 +54,14 @@ tasks:
54
54
  - "@files(configs)"
55
55
  - "@files(tests)"
56
56
  test:
57
+ command: "pnpm run test"
58
+ inputs:
59
+ - "@files(sources)"
60
+ - "@files(tests)"
61
+ - "@files(configs)"
62
+ deps:
63
+ - "build"
64
+ integration-test:
57
65
  command: "pnpm run integration-tests"
58
66
  inputs:
59
67
  - "@files(sources)"