@tari-project/tarijs 0.3.0 → 0.4.0

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 (105) hide show
  1. package/dist/index.d.ts +11 -10
  2. package/dist/index.js +10 -9
  3. package/dist/network.d.ts +8 -0
  4. package/dist/network.js +9 -0
  5. package/dist/templates/Account.d.ts +2 -2
  6. package/dist/templates/Pool.d.ts +1 -2
  7. package/dist/templates/Tariswap.d.ts +1 -2
  8. package/dist/templates/TemplateFactory.d.ts +1 -1
  9. package/dist/templates/TestFaucet.d.ts +1 -1
  10. package/package.json +20 -12
  11. package/README.md +0 -46
  12. package/dist/builders/helpers/index.d.ts +0 -2
  13. package/dist/builders/helpers/index.js +0 -2
  14. package/dist/builders/helpers/submitTransaction.d.ts +0 -13
  15. package/dist/builders/helpers/submitTransaction.js +0 -59
  16. package/dist/builders/helpers/workspace.d.ts +0 -23
  17. package/dist/builders/helpers/workspace.js +0 -29
  18. package/dist/builders/index.d.ts +0 -3
  19. package/dist/builders/index.js +0 -3
  20. package/dist/builders/transaction/TransactionBuilder.d.ts +0 -44
  21. package/dist/builders/transaction/TransactionBuilder.js +0 -164
  22. package/dist/builders/transaction/TransactionRequest.d.ts +0 -27
  23. package/dist/builders/transaction/TransactionRequest.js +0 -67
  24. package/dist/builders/transaction/index.d.ts +0 -2
  25. package/dist/builders/transaction/index.js +0 -2
  26. package/dist/builders/types/Amount.d.ts +0 -23
  27. package/dist/builders/types/Amount.js +0 -93
  28. package/dist/builders/types/Arg.d.ts +0 -1
  29. package/dist/builders/types/Arg.js +0 -1
  30. package/dist/builders/types/Builder.d.ts +0 -47
  31. package/dist/builders/types/Builder.js +0 -1
  32. package/dist/builders/types/ComponentAddress.d.ts +0 -1
  33. package/dist/builders/types/ComponentAddress.js +0 -1
  34. package/dist/builders/types/ConfidentialClaim.d.ts +0 -8
  35. package/dist/builders/types/ConfidentialClaim.js +0 -1
  36. package/dist/builders/types/ConfidentialOutput.d.ts +0 -8
  37. package/dist/builders/types/ConfidentialOutput.js +0 -1
  38. package/dist/builders/types/ConfidentialOutputStatement.d.ts +0 -9
  39. package/dist/builders/types/ConfidentialOutputStatement.js +0 -1
  40. package/dist/builders/types/ConfidentialStatement.d.ts +0 -8
  41. package/dist/builders/types/ConfidentialStatement.js +0 -1
  42. package/dist/builders/types/ConfidentialWithdrawProof.d.ts +0 -7
  43. package/dist/builders/types/ConfidentialWithdrawProof.js +0 -1
  44. package/dist/builders/types/ElgamalVerifiableBalance.d.ts +0 -4
  45. package/dist/builders/types/ElgamalVerifiableBalance.js +0 -1
  46. package/dist/builders/types/Epoch.d.ts +0 -1
  47. package/dist/builders/types/Epoch.js +0 -1
  48. package/dist/builders/types/FinalizeResult.d.ts +0 -20
  49. package/dist/builders/types/FinalizeResult.js +0 -1
  50. package/dist/builders/types/Instruction.d.ts +0 -56
  51. package/dist/builders/types/Instruction.js +0 -1
  52. package/dist/builders/types/ResourceAddress.d.ts +0 -1
  53. package/dist/builders/types/ResourceAddress.js +0 -2
  54. package/dist/builders/types/SubstateDiff.d.ts +0 -7
  55. package/dist/builders/types/SubstateDiff.js +0 -1
  56. package/dist/builders/types/SubstateRequirement.d.ts +0 -5
  57. package/dist/builders/types/SubstateRequirement.js +0 -1
  58. package/dist/builders/types/TemplateAddress.d.ts +0 -1
  59. package/dist/builders/types/TemplateAddress.js +0 -2
  60. package/dist/builders/types/Transaction.d.ts +0 -15
  61. package/dist/builders/types/Transaction.js +0 -1
  62. package/dist/builders/types/TransactionId.d.ts +0 -1
  63. package/dist/builders/types/TransactionId.js +0 -1
  64. package/dist/builders/types/TransactionResult.d.ts +0 -22
  65. package/dist/builders/types/TransactionResult.js +0 -10
  66. package/dist/builders/types/TransactionSignature.d.ts +0 -4
  67. package/dist/builders/types/TransactionSignature.js +0 -1
  68. package/dist/builders/types/UnsignedTransaction.d.ts +0 -12
  69. package/dist/builders/types/UnsignedTransaction.js +0 -1
  70. package/dist/builders/types/VersionedSubstateId.d.ts +0 -5
  71. package/dist/builders/types/VersionedSubstateId.js +0 -1
  72. package/dist/builders/types/ViewableBalanceProof.d.ts +0 -10
  73. package/dist/builders/types/ViewableBalanceProof.js +0 -2
  74. package/dist/builders/types/Workspace.d.ts +0 -3
  75. package/dist/builders/types/Workspace.js +0 -1
  76. package/dist/builders/types/index.d.ts +0 -24
  77. package/dist/builders/types/index.js +0 -2
  78. package/dist/providers/index.d.ts +0 -16
  79. package/dist/providers/index.js +0 -1
  80. package/dist/providers/metamask/index.d.ts +0 -30
  81. package/dist/providers/metamask/index.js +0 -168
  82. package/dist/providers/metamask/utils.d.ts +0 -38
  83. package/dist/providers/metamask/utils.js +0 -55
  84. package/dist/providers/tari_universe/index.d.ts +0 -3
  85. package/dist/providers/tari_universe/index.js +0 -3
  86. package/dist/providers/tari_universe/provider.d.ts +0 -23
  87. package/dist/providers/tari_universe/provider.js +0 -89
  88. package/dist/providers/tari_universe/types.d.ts +0 -30
  89. package/dist/providers/tari_universe/types.js +0 -1
  90. package/dist/providers/tari_universe/utils.d.ts +0 -2
  91. package/dist/providers/tari_universe/utils.js +0 -16
  92. package/dist/providers/types.d.ts +0 -66
  93. package/dist/providers/types.js +0 -10
  94. package/dist/providers/wallet_daemon/index.d.ts +0 -3
  95. package/dist/providers/wallet_daemon/index.js +0 -3
  96. package/dist/providers/wallet_daemon/provider.d.ts +0 -35
  97. package/dist/providers/wallet_daemon/provider.js +0 -173
  98. package/dist/providers/wallet_daemon/tari_permissions.d.ts +0 -216
  99. package/dist/providers/wallet_daemon/tari_permissions.js +0 -282
  100. package/dist/providers/wallet_daemon/webrtc.d.ts +0 -20
  101. package/dist/providers/wallet_daemon/webrtc.js +0 -201
  102. package/dist/providers/wallet_daemon/webrtc_transport.d.ts +0 -10
  103. package/dist/providers/wallet_daemon/webrtc_transport.js +0 -18
  104. package/dist/providers/walletconnect/index.d.ts +0 -23
  105. package/dist/providers/walletconnect/index.js +0 -217
@@ -1,67 +0,0 @@
1
- ///TODO this implementation is not fully done, see:
2
- /// https://github.com/tari-project/tari-dan/blob/development/dan_layer/transaction/src/transaction.rs
3
- export class TransactionRequest {
4
- id;
5
- feeInstructions;
6
- instructions;
7
- inputs;
8
- signatures;
9
- unsignedTransaction;
10
- minEpoch;
11
- maxEpoch;
12
- filledInputs;
13
- constructor(unsignedTransaction, signatures) {
14
- this.id = this.calculateHash();
15
- this.feeInstructions = unsignedTransaction.feeInstructions;
16
- this.instructions = unsignedTransaction.instructions;
17
- this.inputs = unsignedTransaction.inputs;
18
- this.signatures = signatures;
19
- this.minEpoch = unsignedTransaction.minEpoch;
20
- this.maxEpoch = unsignedTransaction.maxEpoch;
21
- // Inputs filled by some authority. These are not part of the transaction hash nor the signature
22
- this.filledInputs = [];
23
- }
24
- calculateHash() {
25
- return "";
26
- }
27
- withFilledInputs(filled_inputs) {
28
- return { ...this, filled_inputs };
29
- }
30
- getId() {
31
- return this.id;
32
- }
33
- checkId() {
34
- const id = this.calculateHash();
35
- return id === this.id;
36
- }
37
- getUnsignedTransaction() {
38
- return this.unsignedTransaction;
39
- }
40
- getFeeInstructions() {
41
- return this.feeInstructions;
42
- }
43
- getInstructions() {
44
- return this.instructions;
45
- }
46
- getSignatures() {
47
- return this.signatures;
48
- }
49
- getHash() {
50
- return this.id;
51
- }
52
- getInputs() {
53
- return this.inputs;
54
- }
55
- getFilledInputs() {
56
- return this.filledInputs;
57
- }
58
- getFilledInputsMut() {
59
- return this.filledInputs;
60
- }
61
- getMinEpoch() {
62
- return this.minEpoch;
63
- }
64
- getMaxEpoch() {
65
- return this.maxEpoch;
66
- }
67
- }
@@ -1,2 +0,0 @@
1
- export { TransactionBuilder } from "./TransactionBuilder";
2
- export { TransactionRequest } from "./TransactionRequest";
@@ -1,2 +0,0 @@
1
- export { TransactionBuilder } from "./TransactionBuilder";
2
- export { TransactionRequest } from "./TransactionRequest";
@@ -1,23 +0,0 @@
1
- export declare class Amount {
2
- private value;
3
- constructor(value: number);
4
- static readonly MAX: Amount;
5
- static newAmount(amount: number): Amount;
6
- static zero(): Amount;
7
- isZero(): boolean;
8
- isPositive(): boolean;
9
- isNegative(): boolean;
10
- getValue(): number;
11
- getStringValue(): string;
12
- checkedAdd(other: Amount): Amount | null;
13
- saturatingAdd(other: Amount): Amount;
14
- checkedSub(other: Amount): Amount | null;
15
- saturatingSub(other: Amount): Amount;
16
- saturatingSubPositive(other: Amount): Amount;
17
- checkedSubPositive(other: Amount): Amount | null;
18
- checkedMul(other: Amount): Amount | null;
19
- saturatingMul(other: Amount): Amount;
20
- checkedDiv(other: Amount): Amount | null;
21
- saturatingDiv(other: Amount): Amount;
22
- asU64Checked(): number | null;
23
- }
@@ -1,93 +0,0 @@
1
- export class Amount {
2
- value;
3
- constructor(value) {
4
- this.value = value;
5
- }
6
- static MAX = new Amount(Number.MAX_SAFE_INTEGER);
7
- static newAmount(amount) {
8
- return new Amount(amount);
9
- }
10
- static zero() {
11
- return new Amount(0);
12
- }
13
- isZero() {
14
- return this.value === 0;
15
- }
16
- isPositive() {
17
- return this.value >= 0;
18
- }
19
- isNegative() {
20
- return !this.isPositive();
21
- }
22
- getValue() {
23
- return this.value;
24
- }
25
- getStringValue() {
26
- return this.value.toString();
27
- }
28
- checkedAdd(other) {
29
- const result = this.value + other.value;
30
- if (result < Number.MIN_SAFE_INTEGER || result > Number.MAX_SAFE_INTEGER) {
31
- return null;
32
- }
33
- return new Amount(result);
34
- }
35
- saturatingAdd(other) {
36
- return new Amount(Math.min(Number.MAX_SAFE_INTEGER, Math.max(Number.MIN_SAFE_INTEGER, this.value + other.value)));
37
- }
38
- checkedSub(other) {
39
- const result = this.value - other.value;
40
- if (result < Number.MIN_SAFE_INTEGER || result > Number.MAX_SAFE_INTEGER) {
41
- return null;
42
- }
43
- return new Amount(result);
44
- }
45
- saturatingSub(other) {
46
- return new Amount(Math.min(Number.MAX_SAFE_INTEGER, Math.max(Number.MIN_SAFE_INTEGER, this.value - other.value)));
47
- }
48
- saturatingSubPositive(other) {
49
- const result = this.value - other.value;
50
- return result < 0 ? new Amount(0) : new Amount(result);
51
- }
52
- checkedSubPositive(other) {
53
- if (this.isNegative() || other.isNegative()) {
54
- return null;
55
- }
56
- if (this.value < other.value) {
57
- return null;
58
- }
59
- return new Amount(this.value - other.value);
60
- }
61
- checkedMul(other) {
62
- const result = this.value * other.value;
63
- if (result < Number.MIN_SAFE_INTEGER || result > Number.MAX_SAFE_INTEGER) {
64
- return null;
65
- }
66
- return new Amount(result);
67
- }
68
- saturatingMul(other) {
69
- return new Amount(Math.min(Number.MAX_SAFE_INTEGER, Math.max(Number.MIN_SAFE_INTEGER, this.value * other.value)));
70
- }
71
- checkedDiv(other) {
72
- if (other.value === 0) {
73
- throw new Error("Division by zero");
74
- }
75
- const result = this.value / other.value;
76
- if (result < Number.MIN_SAFE_INTEGER || result > Number.MAX_SAFE_INTEGER) {
77
- return null;
78
- }
79
- return new Amount(result);
80
- }
81
- saturatingDiv(other) {
82
- if (other.value === 0) {
83
- throw new Error("Division by zero");
84
- }
85
- return new Amount(Math.min(Number.MAX_SAFE_INTEGER, Math.max(Number.MIN_SAFE_INTEGER, this.value / other.value)));
86
- }
87
- asU64Checked() {
88
- if (this.value < 0) {
89
- return null;
90
- }
91
- return this.value;
92
- }
93
- }
@@ -1 +0,0 @@
1
- export type Arg = any;
@@ -1 +0,0 @@
1
- export {};
@@ -1,47 +0,0 @@
1
- import { TemplateAddress } from "./TemplateAddress";
2
- import { Arg } from "./Arg";
3
- import { ComponentAddress, ConfidentialClaim, ConfidentialWithdrawProof, Instruction, ResourceAddress, SubstateRequirement, Transaction, TransactionSignature, UnsignedTransaction } from ".";
4
- import { TransactionBuilder } from "../transaction";
5
- export interface TransactionConstructor {
6
- new (unsignedTransaction: UnsignedTransaction, signatures: TransactionSignature[]): Transaction;
7
- }
8
- export interface TariFunctionDefinition {
9
- functionName: string;
10
- args?: Arg[];
11
- templateAddress: TemplateAddress;
12
- }
13
- export interface TariMethodDefinition {
14
- methodName: string;
15
- args?: Arg[];
16
- componentAddress: ComponentAddress;
17
- }
18
- export interface TariCreateAccountDefinition {
19
- methodName: string;
20
- args?: {
21
- ownerPublicKey: string;
22
- workspaceBucket?: string;
23
- };
24
- }
25
- export interface Builder {
26
- callFunction<T extends TariFunctionDefinition>(func: T, args: Exclude<T["args"], undefined>): this;
27
- callMethod<T extends TariMethodDefinition>(method: T, args: Exclude<T["args"], undefined>): this;
28
- createAccount(ownerPublicKey: string, workspaceBucket?: string): this;
29
- createProof(account: ComponentAddress, resourceAddress: ResourceAddress): this;
30
- saveVar(key: string): this;
31
- dropAllProofsInWorkspace(): this;
32
- claimBurn(claim: ConfidentialClaim): this;
33
- addInput(inputObject: SubstateRequirement): this;
34
- addInstruction(instruction: Instruction): this;
35
- addFeeInstruction(instruction: Instruction): this;
36
- withMinEpoch(minEpoch: number): this;
37
- withMaxEpoch(maxEpoch: number): this;
38
- withInputs(inputs: SubstateRequirement[]): this;
39
- withInstructions(instructions: Instruction[]): this;
40
- withFeeInstructions(instructions: Instruction[]): this;
41
- withFeeInstructionsBuilder(builder: (builder: TransactionBuilder) => this): this;
42
- withUnsignedTransaction(unsignedTransaction: UnsignedTransaction): this;
43
- feeTransactionPayFromComponent(componentAddress: ComponentAddress, maxFee: string): this;
44
- feeTransactionPayFromComponentConfidential(componentAddress: ComponentAddress, proof: ConfidentialWithdrawProof): this;
45
- buildUnsignedTransaction(): UnsignedTransaction;
46
- build(): Transaction;
47
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type ComponentAddress = string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { ConfidentialWithdrawProof } from "./ConfidentialWithdrawProof";
2
- export interface ConfidentialClaim {
3
- publicKey: string;
4
- outputAddress: string;
5
- rangeProof: Array<number>;
6
- proofOfKnowledge: string;
7
- withdrawProof?: ConfidentialWithdrawProof;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { ElgamalVerifiableBalance } from "./ElgamalVerifiableBalance";
2
- export interface ConfidentialOutput {
3
- commitment: string;
4
- stealthPublicNonce: string;
5
- encrypted_data: Array<number>;
6
- minimumValuePromise: number;
7
- viewableBalance?: ElgamalVerifiableBalance;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,9 +0,0 @@
1
- import type { Amount } from "./Amount";
2
- import type { ConfidentialStatement } from "./ConfidentialStatement";
3
- export interface ConfidentialOutputStatement {
4
- outputStatement?: ConfidentialStatement;
5
- changeStatement?: ConfidentialStatement;
6
- rangeProof: Array<number>;
7
- outputRevealedAmount: Amount;
8
- changeRevealedAmount: Amount;
9
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,8 +0,0 @@
1
- import type { ViewableBalanceProof } from "./ViewableBalanceProof";
2
- export interface ConfidentialStatement {
3
- commitment: Array<number>;
4
- senderPublicNonce: Array<number>;
5
- encryptedData: Array<number>;
6
- minimumValuePromise: number;
7
- viewableBalanceProof?: ViewableBalanceProof;
8
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- import type { ConfidentialOutputStatement } from "./ConfidentialOutputStatement";
2
- export interface ConfidentialWithdrawProof {
3
- inputs: Array<Uint8Array>;
4
- inputRevealedAmount: number;
5
- outputProof: ConfidentialOutputStatement;
6
- balanceProof: Array<number>;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,4 +0,0 @@
1
- export interface ElgamalVerifiableBalance {
2
- encrypted: string;
3
- public_nonce: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type Epoch = number;
@@ -1 +0,0 @@
1
- export {};
@@ -1,20 +0,0 @@
1
- import { FeeReceipt, InstructionResult, LogEntry, RejectReason } from "@tari-project/typescript-bindings";
2
- import { SubstateDiff } from "./SubstateDiff";
3
- export type TxResultAccept = {
4
- Accept: SubstateDiff;
5
- };
6
- export type TxResultAcceptFeeRejectRest = {
7
- AcceptFeeRejectRest: [SubstateDiff, RejectReason];
8
- };
9
- export type TxResultReject = {
10
- Reject: RejectReason;
11
- };
12
- export type FinalizeResultStatus = TxResultAccept | TxResultAcceptFeeRejectRest | TxResultReject;
13
- export interface FinalizeResult {
14
- transaction_hash: Uint8Array;
15
- events: Array<Event>;
16
- logs: Array<LogEntry>;
17
- execution_results: Array<InstructionResult>;
18
- result: FinalizeResultStatus;
19
- fee_receipt: FeeReceipt;
20
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,56 +0,0 @@
1
- import { ComponentAddress, LogLevel } from "@tari-project/typescript-bindings";
2
- import { Arg } from "./Arg";
3
- import { ConfidentialClaim } from "./ConfidentialClaim";
4
- import { Amount } from "./Amount";
5
- import { ConfidentialOutput } from "./ConfidentialOutput";
6
- import { TemplateAddress } from "./TemplateAddress";
7
- export type Instruction = CreateAccount | CallFunction | CallMethod | PutLastInstructionOutputOnWorkspace | EmitLog | ClaimBurn | ClaimValidatorFees | DropAllProofsInWorkspace | CreateFreeTestCoins;
8
- export type CreateAccount = {
9
- CreateAccount: {
10
- owner_public_key: string;
11
- workspace_bucket: string | null;
12
- };
13
- };
14
- export type CallFunction = {
15
- CallFunction: {
16
- template_address: TemplateAddress;
17
- function: string;
18
- args: Array<Arg>;
19
- };
20
- };
21
- export type CallMethod = {
22
- CallMethod: {
23
- component_address: ComponentAddress;
24
- method: string;
25
- args: Array<Arg>;
26
- };
27
- };
28
- export type PutLastInstructionOutputOnWorkspace = {
29
- PutLastInstructionOutputOnWorkspace: {
30
- key: number[];
31
- };
32
- };
33
- export type EmitLog = {
34
- EmitLog: {
35
- level: LogLevel;
36
- message: string;
37
- };
38
- };
39
- export type ClaimBurn = {
40
- ClaimBurn: {
41
- claim: ConfidentialClaim;
42
- };
43
- };
44
- export type ClaimValidatorFees = {
45
- ClaimValidatorFees: {
46
- epoch: number;
47
- validator_public_key: string;
48
- };
49
- };
50
- export type DropAllProofsInWorkspace = "DropAllProofsInWorkspace";
51
- export type CreateFreeTestCoins = {
52
- CreateFreeTestCoins: {
53
- revealed_amount: Amount;
54
- output: ConfidentialOutput | null;
55
- };
56
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type ResourceAddress = string;
@@ -1,2 +0,0 @@
1
- //TODO refactor type (https://github.com/tari-project/tari.js/issues/29)
2
- export {};
@@ -1,7 +0,0 @@
1
- import { Substate, SubstateId } from "@tari-project/typescript-bindings";
2
- export type UpSubstates = Array<[SubstateId, Substate]>;
3
- export type DownSubstates = Array<[SubstateId, number]>;
4
- export interface SubstateDiff {
5
- up_substates: UpSubstates;
6
- down_substates: DownSubstates;
7
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { SubstateId } from "@tari-project/typescript-bindings";
2
- export interface SubstateRequirement {
3
- substateId: SubstateId;
4
- version?: number;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type TemplateAddress = string;
@@ -1,2 +0,0 @@
1
- //TODO refactor type (https://github.com/tari-project/tari.js/issues/29)
2
- export {};
@@ -1,15 +0,0 @@
1
- import { TransactionSignature } from "@tari-project/typescript-bindings";
2
- import { Instruction } from "./Instruction";
3
- import { SubstateRequirement } from "./SubstateRequirement";
4
- import { Epoch } from "./Epoch";
5
- import { VersionedSubstateId } from "./VersionedSubstateId";
6
- export interface Transaction {
7
- id: string;
8
- feeInstructions: Array<Instruction>;
9
- instructions: Array<Instruction>;
10
- inputs: Array<SubstateRequirement>;
11
- minEpoch?: Epoch;
12
- maxEpoch?: Epoch;
13
- signatures: Array<TransactionSignature>;
14
- filledInputs: Array<VersionedSubstateId>;
15
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1 +0,0 @@
1
- export type TransactionId = string;
@@ -1 +0,0 @@
1
- export {};
@@ -1,22 +0,0 @@
1
- import { FinalizeResult } from "./FinalizeResult";
2
- export type SubmitTransactionResponse = {
3
- transaction_id: string;
4
- };
5
- export interface SubmitTxResult {
6
- response: SubmitTransactionResponse;
7
- result: TransactionResult;
8
- }
9
- export declare enum TransactionStatus {
10
- New = 0,
11
- DryRun = 1,
12
- Pending = 2,
13
- Accepted = 3,
14
- Rejected = 4,
15
- InvalidTransaction = 5,
16
- OnlyFeeAccepted = 6
17
- }
18
- export type TransactionResult = {
19
- transaction_id: string;
20
- status: TransactionStatus;
21
- result: FinalizeResult | null;
22
- };
@@ -1,10 +0,0 @@
1
- export var TransactionStatus;
2
- (function (TransactionStatus) {
3
- TransactionStatus[TransactionStatus["New"] = 0] = "New";
4
- TransactionStatus[TransactionStatus["DryRun"] = 1] = "DryRun";
5
- TransactionStatus[TransactionStatus["Pending"] = 2] = "Pending";
6
- TransactionStatus[TransactionStatus["Accepted"] = 3] = "Accepted";
7
- TransactionStatus[TransactionStatus["Rejected"] = 4] = "Rejected";
8
- TransactionStatus[TransactionStatus["InvalidTransaction"] = 5] = "InvalidTransaction";
9
- TransactionStatus[TransactionStatus["OnlyFeeAccepted"] = 6] = "OnlyFeeAccepted";
10
- })(TransactionStatus || (TransactionStatus = {}));
@@ -1,4 +0,0 @@
1
- export interface TransactionSignature {
2
- public_key: string;
3
- signature: string;
4
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,12 +0,0 @@
1
- import { Instruction } from "./Instruction";
2
- import { Epoch } from "./Epoch";
3
- import { SubstateRequirement } from "./SubstateRequirement";
4
- import { VersionedSubstateId } from "./VersionedSubstateId";
5
- export interface UnsignedTransaction {
6
- feeInstructions: Instruction[];
7
- instructions: Instruction[];
8
- inputs: SubstateRequirement[];
9
- filledInputs: VersionedSubstateId[];
10
- minEpoch?: Epoch;
11
- maxEpoch?: Epoch;
12
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,5 +0,0 @@
1
- import { SubstateId } from "@tari-project/typescript-bindings";
2
- export interface VersionedSubstateId {
3
- substateId: SubstateId;
4
- version: number;
5
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export interface ViewableBalanceProof {
2
- elgamal_encrypted: Uint8Array;
3
- elgamal_public_nonce: Uint8Array;
4
- c_prime: Uint8Array;
5
- e_prime: Uint8Array;
6
- r_prime: Uint8Array;
7
- s_v: Uint8Array;
8
- s_m: Uint8Array;
9
- s_r: Uint8Array;
10
- }
@@ -1,2 +0,0 @@
1
- //TODO refactor type (https://github.com/tari-project/tari.js/issues/29)
2
- export {};
@@ -1,3 +0,0 @@
1
- export interface WorkspaceArg {
2
- Workspace: number[];
3
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,24 +0,0 @@
1
- export { Builder, TariCreateAccountDefinition, TariFunctionDefinition, TariMethodDefinition, TransactionConstructor, } from "./Builder";
2
- export { TemplateAddress } from "./TemplateAddress";
3
- export { Amount } from "./Amount";
4
- export { Arg } from "./Arg";
5
- export { ComponentAddress } from "./ComponentAddress";
6
- export { ConfidentialClaim } from "./ConfidentialClaim";
7
- export { ConfidentialOutput } from "./ConfidentialOutput";
8
- export { ConfidentialOutputStatement } from "./ConfidentialOutputStatement";
9
- export { ConfidentialStatement } from "./ConfidentialStatement";
10
- export { ConfidentialWithdrawProof } from "./ConfidentialWithdrawProof";
11
- export { Epoch } from "./Epoch";
12
- export { FinalizeResult, FinalizeResultStatus } from "./FinalizeResult";
13
- export { ResourceAddress } from "./ResourceAddress";
14
- export { Instruction } from "./Instruction";
15
- export { Transaction } from "./Transaction";
16
- export { SubstateDiff, DownSubstates, UpSubstates } from "./SubstateDiff";
17
- export { SubstateRequirement } from "./SubstateRequirement";
18
- export { TransactionId } from "./TransactionId";
19
- export { TransactionResult, TransactionStatus } from "./TransactionResult";
20
- export { TransactionSignature } from "./TransactionSignature";
21
- export { UnsignedTransaction } from "./UnsignedTransaction";
22
- export { VersionedSubstateId } from "./VersionedSubstateId";
23
- export { ViewableBalanceProof } from "./ViewableBalanceProof";
24
- export { WorkspaceArg } from "./Workspace";
@@ -1,2 +0,0 @@
1
- export { Amount } from "./Amount";
2
- export { TransactionStatus } from "./TransactionResult";
@@ -1,16 +0,0 @@
1
- import type { SubstateType } from "@tari-project/typescript-bindings";
2
- import { Account, SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse } from "./types";
3
- import { ProviderMethods, ProviderMethodNames, ProviderReturnType } from "./tari_universe/types";
4
- export type { Account, SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse, ProviderMethods, ProviderMethodNames, ProviderReturnType, };
5
- export interface TariProvider {
6
- providerName: string;
7
- isConnected(): boolean;
8
- getAccount(): Promise<Account>;
9
- getSubstate(substate_address: string): Promise<Substate>;
10
- submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
11
- getTransactionResult(transactionId: string): Promise<TransactionResult>;
12
- getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
13
- getPublicKey(branch: string, index: number): Promise<string>;
14
- getConfidentialVaultBalances(viewKeyId: number, vaultId: string, min: number | null, max: number | null): Promise<VaultBalances>;
15
- listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
16
- }
@@ -1 +0,0 @@
1
- export {};