@tari-project/tarijs 0.4.0 → 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.
- package/.github/ISSUE_TEMPLATE/bug_report.md +36 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +27 -0
- package/.github/dependabot.yml +8 -0
- package/.github/workflows/ci.yml +26 -0
- package/.github/workflows/documentation-deploy.yml +44 -0
- package/.github/workflows/documentation-test-deploy.yml +20 -0
- package/.github/workflows/npm_publish.yml +26 -0
- package/.github/workflows/pr_signed_commits_check.yml +19 -0
- package/.github/workflows/pr_title.yml +30 -0
- package/.moon/toolchain.yml +6 -0
- package/.moon/workspace.yml +33 -0
- package/.prettierrc +12 -0
- package/.prototools +9 -0
- package/CODEOWNERS +3 -0
- package/README.md +66 -0
- package/TODO.md +12 -0
- package/docusaurus/tari-docs/README.md +41 -0
- package/docusaurus/tari-docs/docs/index.md +16 -0
- package/docusaurus/tari-docs/docs/installation.md +27 -0
- package/docusaurus/tari-docs/docs/providers/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/providers/tari-universe.md +27 -0
- package/docusaurus/tari-docs/docs/providers/wallet-connect.md +52 -0
- package/docusaurus/tari-docs/docs/providers/wallet-daemon.md +37 -0
- package/docusaurus/tari-docs/docs/wallet/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/default-account.md +51 -0
- package/docusaurus/tari-docs/docs/wallet/get-substate.md +110 -0
- package/docusaurus/tari-docs/docs/wallet/list-substates.md +69 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/build-execute-request.md +38 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/index.md +14 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-function.md +17 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-method.md +17 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/fee.md +28 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/index.md +426 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/inputs.md +24 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/instruction.md +108 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/min-max-epoch.md +19 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/raw-instructions.md +16 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/save-var.md +63 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/transaction-internals.md +20 -0
- package/docusaurus/tari-docs/docs/wallet/template-definition.md +101 -0
- package/docusaurus/tari-docs/docusaurus.config.ts +108 -0
- package/docusaurus/tari-docs/moon.yml +41 -0
- package/docusaurus/tari-docs/package.json +49 -0
- package/docusaurus/tari-docs/sidebars.ts +7 -0
- package/docusaurus/tari-docs/src/components/HomepageFeatures/index.tsx +69 -0
- package/docusaurus/tari-docs/src/components/HomepageFeatures/styles.module.css +11 -0
- package/docusaurus/tari-docs/src/css/custom.css +30 -0
- package/docusaurus/tari-docs/src/pages/index.module.css +23 -0
- package/docusaurus/tari-docs/src/pages/index.tsx +44 -0
- package/docusaurus/tari-docs/static/.nojekyll +0 -0
- package/docusaurus/tari-docs/static/img/favicon.png +0 -0
- package/docusaurus/tari-docs/static/img/meta-image.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-1.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-2.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-3.png +0 -0
- package/docusaurus/tari-docs/static/img/tari-logo.svg +30 -0
- package/docusaurus/tari-docs/tsconfig.json +8 -0
- package/package.json +4 -28
- package/packages/builders/moon.yml +55 -0
- package/packages/builders/package.json +30 -0
- package/packages/builders/src/helpers/index.ts +2 -0
- package/packages/builders/src/helpers/submitTransaction.ts +97 -0
- package/packages/builders/src/helpers/workspace.ts +32 -0
- package/packages/builders/src/index.ts +9 -0
- package/packages/builders/src/transaction/TransactionBuilder.ts +276 -0
- package/packages/builders/src/transaction/TransactionRequest.ts +93 -0
- package/packages/builders/src/transaction/index.ts +2 -0
- package/packages/builders/tsconfig.json +24 -0
- package/packages/metamask_provider/moon.yml +55 -0
- package/packages/metamask_provider/package.json +30 -0
- package/packages/metamask_provider/src/index.ts +232 -0
- package/packages/metamask_provider/src/utils.ts +86 -0
- package/packages/metamask_provider/tsconfig.json +21 -0
- package/packages/tari_permissions/moon.yml +55 -0
- package/packages/tari_permissions/package.json +26 -0
- package/packages/tari_permissions/src/index.ts +1 -0
- package/packages/tari_permissions/src/tari_permissions.ts +312 -0
- package/packages/tari_permissions/tsconfig.json +15 -0
- package/packages/tari_provider/moon.yml +55 -0
- package/packages/tari_provider/package.json +27 -0
- package/packages/tari_provider/src/TariProvider.ts +34 -0
- package/packages/tari_provider/src/index.ts +3 -0
- package/packages/tari_provider/src/types.ts +84 -0
- package/packages/tari_provider/tsconfig.json +11 -0
- package/packages/tari_universe/moon.yml +55 -0
- package/packages/tari_universe/package.json +31 -0
- package/packages/tari_universe/src/index.ts +3 -0
- package/packages/tari_universe/src/provider.ts +120 -0
- package/packages/tari_universe/src/types.ts +33 -0
- package/packages/tari_universe/src/utils.ts +23 -0
- package/packages/tari_universe/tsconfig.json +24 -0
- package/packages/tarijs/integration-tests/.env +1 -0
- package/packages/tarijs/integration-tests/wallet_daemon/json_rpc_provider.spec.ts +191 -0
- package/packages/tarijs/moon.yml +71 -0
- package/packages/tarijs/package.json +40 -0
- package/packages/tarijs/src/cbor.spec.ts +259 -0
- package/packages/tarijs/src/cbor.ts +114 -0
- package/packages/tarijs/src/index.ts +72 -0
- package/packages/tarijs/src/network.ts +8 -0
- package/packages/tarijs/src/templates/Account.ts +98 -0
- package/packages/tarijs/src/templates/Pool.ts +42 -0
- package/packages/tarijs/src/templates/Tariswap.ts +101 -0
- package/packages/tarijs/src/templates/TemplateFactory.ts +22 -0
- package/packages/tarijs/src/templates/TestFaucet.ts +72 -0
- package/{dist/utils.js → packages/tarijs/src/utils.ts} +4 -3
- package/packages/tarijs/tsconfig.json +39 -0
- package/packages/tarijs/vitest.config.ts +9 -0
- package/packages/tarijs_types/moon.yml +55 -0
- package/packages/tarijs_types/package.json +27 -0
- package/packages/tarijs_types/src/Amount.ts +113 -0
- package/packages/tarijs_types/src/Arg.ts +3 -0
- package/packages/tarijs_types/src/ComponentAddress.ts +3 -0
- package/packages/tarijs_types/src/ConfidentialClaim.ts +9 -0
- package/packages/tarijs_types/src/ConfidentialOutput.ts +9 -0
- package/packages/tarijs_types/src/ConfidentialOutputStatement.ts +10 -0
- package/packages/tarijs_types/src/ConfidentialStatement.ts +9 -0
- package/packages/tarijs_types/src/ConfidentialWithdrawProof.ts +8 -0
- package/packages/tarijs_types/src/ElgamalVerifiableBalance.ts +4 -0
- package/packages/tarijs_types/src/Epoch.ts +3 -0
- package/packages/tarijs_types/src/FinalizeResult.ts +17 -0
- package/packages/tarijs_types/src/Instruction.ts +29 -0
- package/packages/tarijs_types/src/ResourceAddress.ts +3 -0
- package/packages/tarijs_types/src/SubstateDiff.ts +9 -0
- package/packages/tarijs_types/src/SubstateRequirement.ts +6 -0
- package/packages/tarijs_types/src/TemplateAddress.ts +3 -0
- package/packages/tarijs_types/src/Transaction.ts +16 -0
- package/packages/tarijs_types/src/TransactionId.ts +4 -0
- package/packages/tarijs_types/src/TransactionResult.ts +26 -0
- package/packages/tarijs_types/src/TransactionSignature.ts +4 -0
- package/packages/tarijs_types/src/UnsignedTransaction.ts +15 -0
- package/packages/tarijs_types/src/VersionedSubstateId.ts +6 -0
- package/packages/tarijs_types/src/ViewableBalanceProof.ts +12 -0
- package/packages/tarijs_types/src/Workspace.ts +3 -0
- package/packages/tarijs_types/src/index.ts +25 -0
- package/packages/tarijs_types/tsconfig.json +15 -0
- package/packages/wallet_daemon/moon.yml +55 -0
- package/packages/wallet_daemon/package.json +29 -0
- package/packages/wallet_daemon/src/index.ts +5 -0
- package/packages/wallet_daemon/src/provider.ts +263 -0
- package/packages/wallet_daemon/src/webrtc.ts +229 -0
- package/packages/wallet_daemon/src/webrtc_transport.ts +27 -0
- package/packages/wallet_daemon/tsconfig.json +21 -0
- package/packages/walletconnect/moon.yml +55 -0
- package/packages/walletconnect/package.json +32 -0
- package/packages/walletconnect/src/index.ts +274 -0
- package/packages/walletconnect/tsconfig.json +21 -0
- package/pnpm-workspace.yaml +15 -0
- package/tsconfig.json +45 -0
- package/dist/index.d.ts +0 -14
- package/dist/index.js +0 -13
- package/dist/network.d.ts +0 -8
- package/dist/network.js +0 -9
- package/dist/templates/Account.d.ts +0 -65
- package/dist/templates/Account.js +0 -31
- package/dist/templates/Pool.d.ts +0 -29
- package/dist/templates/Pool.js +0 -20
- package/dist/templates/Tariswap.d.ts +0 -64
- package/dist/templates/Tariswap.js +0 -36
- package/dist/templates/TemplateFactory.d.ts +0 -9
- package/dist/templates/TemplateFactory.js +0 -18
- package/dist/templates/TestFaucet.d.ts +0 -49
- package/dist/templates/TestFaucet.js +0 -31
- package/dist/templates/index.js +0 -5
- package/dist/utils.d.ts +0 -2
- /package/{dist/templates/index.d.ts → packages/tarijs/src/templates/index.ts} +0 -0
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { TemplateFactory } from "./TemplateFactory";
|
|
2
|
-
export class TariswapTemplate extends TemplateFactory {
|
|
3
|
-
templateAddress;
|
|
4
|
-
newPool;
|
|
5
|
-
mint;
|
|
6
|
-
mintWithSymbol;
|
|
7
|
-
totalSupply;
|
|
8
|
-
payFee;
|
|
9
|
-
payFeeConfidential;
|
|
10
|
-
withdraw;
|
|
11
|
-
addLiquidity;
|
|
12
|
-
removeLiquidity;
|
|
13
|
-
deposit;
|
|
14
|
-
swap;
|
|
15
|
-
constructor(templateAddress) {
|
|
16
|
-
super(templateAddress);
|
|
17
|
-
this.templateAddress = templateAddress;
|
|
18
|
-
this._initFunctions();
|
|
19
|
-
this._initMethods();
|
|
20
|
-
}
|
|
21
|
-
_initFunctions() {
|
|
22
|
-
this.newPool = this._defineFunction("new");
|
|
23
|
-
this.mint = this._defineFunction("mint");
|
|
24
|
-
this.mintWithSymbol = this._defineFunction("mint_with_symbol");
|
|
25
|
-
}
|
|
26
|
-
_initMethods() {
|
|
27
|
-
this.totalSupply = this._defineMethod("total_supply");
|
|
28
|
-
this.payFee = this._defineMethod("pay_fee");
|
|
29
|
-
this.payFeeConfidential = this._defineMethod("pay_fee_confidential");
|
|
30
|
-
this.withdraw = this._defineMethod("withdraw");
|
|
31
|
-
this.addLiquidity = this._defineMethod("add_liquidity");
|
|
32
|
-
this.removeLiquidity = this._defineMethod("remove_liquidity");
|
|
33
|
-
this.deposit = this._defineMethod("deposit");
|
|
34
|
-
this.swap = this._defineMethod("swap");
|
|
35
|
-
}
|
|
36
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TariFunctionDefinition, TariMethodDefinition } from "@tari-project/tarijs-builders";
|
|
2
|
-
export declare abstract class TemplateFactory {
|
|
3
|
-
templateAddress: string;
|
|
4
|
-
constructor(templateAddress: string);
|
|
5
|
-
_defineFunction<T extends TariFunctionDefinition>(name: T["functionName"]): T;
|
|
6
|
-
_defineMethod<T extends TariMethodDefinition>(name: T["methodName"]): T;
|
|
7
|
-
protected abstract _initFunctions(): void;
|
|
8
|
-
protected abstract _initMethods(): void;
|
|
9
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export class TemplateFactory {
|
|
2
|
-
templateAddress;
|
|
3
|
-
constructor(templateAddress) {
|
|
4
|
-
this.templateAddress = templateAddress;
|
|
5
|
-
}
|
|
6
|
-
_defineFunction(name) {
|
|
7
|
-
return {
|
|
8
|
-
templateAddress: this.templateAddress,
|
|
9
|
-
functionName: name,
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
_defineMethod(name) {
|
|
13
|
-
return {
|
|
14
|
-
componentAddress: this.templateAddress,
|
|
15
|
-
methodName: name,
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { Amount, ConfidentialWithdrawProof, TariFunctionDefinition, TariMethodDefinition } from "@tari-project/tarijs-builders";
|
|
2
|
-
import { TemplateFactory } from "./TemplateFactory";
|
|
3
|
-
interface MintFunction extends TariFunctionDefinition {
|
|
4
|
-
functionName: "mint";
|
|
5
|
-
args?: [string];
|
|
6
|
-
}
|
|
7
|
-
interface MintWithSymbolFunction extends TariFunctionDefinition {
|
|
8
|
-
functionName: "mint_with_symbol";
|
|
9
|
-
args?: [amount: string, symbol: string];
|
|
10
|
-
}
|
|
11
|
-
interface PayFeeMethod extends TariMethodDefinition {
|
|
12
|
-
methodName: "pay_fee";
|
|
13
|
-
args?: [Amount];
|
|
14
|
-
}
|
|
15
|
-
interface PayFeeConfidentialMethod extends TariMethodDefinition {
|
|
16
|
-
methodName: "pay_fee_confidential";
|
|
17
|
-
args?: [ConfidentialWithdrawProof];
|
|
18
|
-
}
|
|
19
|
-
interface TakeFreeCoinsMethod extends TariMethodDefinition {
|
|
20
|
-
methodName: "take_free_coins";
|
|
21
|
-
args?: [];
|
|
22
|
-
}
|
|
23
|
-
interface TakeFreeCoinsConfidentialMethod extends TariMethodDefinition {
|
|
24
|
-
methodName: "take_free_coins_confidential";
|
|
25
|
-
args?: [ConfidentialWithdrawProof];
|
|
26
|
-
}
|
|
27
|
-
interface BurnCoinsMethod extends TariMethodDefinition {
|
|
28
|
-
methodName: "burn_coins";
|
|
29
|
-
args?: [BigInt];
|
|
30
|
-
}
|
|
31
|
-
interface TotalSupplyMethod extends TariMethodDefinition {
|
|
32
|
-
methodName: "total_supply";
|
|
33
|
-
args?: [];
|
|
34
|
-
}
|
|
35
|
-
export declare class TestFaucet extends TemplateFactory {
|
|
36
|
-
templateAddress: string;
|
|
37
|
-
mint: MintFunction;
|
|
38
|
-
mintWithSymbol: MintWithSymbolFunction;
|
|
39
|
-
takeFreeCoins: TakeFreeCoinsMethod;
|
|
40
|
-
takeFreeCoinsConfidential: TakeFreeCoinsConfidentialMethod;
|
|
41
|
-
burnCoins: BurnCoinsMethod;
|
|
42
|
-
totalSupply: TotalSupplyMethod;
|
|
43
|
-
payFee: PayFeeMethod;
|
|
44
|
-
payFeeConfidential: PayFeeConfidentialMethod;
|
|
45
|
-
constructor(templateAddress: string);
|
|
46
|
-
protected _initFunctions(): void;
|
|
47
|
-
protected _initMethods(): void;
|
|
48
|
-
}
|
|
49
|
-
export {};
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { TemplateFactory } from "./TemplateFactory";
|
|
2
|
-
export class TestFaucet extends TemplateFactory {
|
|
3
|
-
templateAddress;
|
|
4
|
-
mint;
|
|
5
|
-
mintWithSymbol;
|
|
6
|
-
takeFreeCoins;
|
|
7
|
-
takeFreeCoinsConfidential;
|
|
8
|
-
burnCoins;
|
|
9
|
-
totalSupply;
|
|
10
|
-
payFee;
|
|
11
|
-
payFeeConfidential;
|
|
12
|
-
constructor(templateAddress) {
|
|
13
|
-
super(templateAddress);
|
|
14
|
-
this.templateAddress = templateAddress;
|
|
15
|
-
this._initFunctions();
|
|
16
|
-
this._initMethods();
|
|
17
|
-
}
|
|
18
|
-
_initFunctions() {
|
|
19
|
-
this.mint = this._defineFunction("mint");
|
|
20
|
-
this.mintWithSymbol = this._defineFunction("mint_with_symbol");
|
|
21
|
-
}
|
|
22
|
-
_initMethods() {
|
|
23
|
-
this.takeFreeCoins = this._defineMethod("take_free_coins");
|
|
24
|
-
this.takeFreeCoinsConfidential =
|
|
25
|
-
this._defineMethod("take_free_coins_confidential");
|
|
26
|
-
this.burnCoins = this._defineMethod("burn_coins");
|
|
27
|
-
this.totalSupply = this._defineMethod("total_supply");
|
|
28
|
-
this.payFee = this._defineMethod("pay_fee");
|
|
29
|
-
this.payFeeConfidential = this._defineMethod("pay_fee_confidential");
|
|
30
|
-
}
|
|
31
|
-
}
|
package/dist/templates/index.js
DELETED
package/dist/utils.d.ts
DELETED
|
File without changes
|