@tari-project/tari-provider 0.4.0 → 0.5.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.
- package/dist/TariProvider.d.ts +5 -8
- package/dist/types.d.ts +33 -21
- package/package.json +2 -2
package/dist/TariProvider.d.ts
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { ListTemplatesResponse } from "@tari-project/typescript-bindings";
|
|
2
|
+
import { TransactionResult, TemplateDefinition, Substate, ListSubstatesResponse, GetSubstateRequest, ListSubstatesRequest } from "./types";
|
|
3
3
|
export interface TariProvider {
|
|
4
4
|
providerName: string;
|
|
5
5
|
isConnected(): boolean;
|
|
6
|
-
|
|
7
|
-
getSubstate(substate_address: string): Promise<Substate>;
|
|
8
|
-
submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
|
|
6
|
+
getSubstate(req: GetSubstateRequest): Promise<Substate>;
|
|
9
7
|
getTransactionResult(transactionId: string): Promise<TransactionResult>;
|
|
10
8
|
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
|
|
9
|
+
listSubstates(req: ListSubstatesRequest): Promise<ListSubstatesResponse>;
|
|
10
|
+
listTemplates(limit?: number): Promise<ListTemplatesResponse>;
|
|
14
11
|
}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FinalizeResult } from "@tari-project/typescript-bindings";
|
|
1
|
+
import { FinalizeResult, SubstateType } from "@tari-project/typescript-bindings";
|
|
2
2
|
export type SubstateMetadata = {
|
|
3
3
|
substate_id: string;
|
|
4
4
|
module_name: string | null;
|
|
@@ -9,23 +9,6 @@ export type SubstateRequirement = {
|
|
|
9
9
|
substate_id: string;
|
|
10
10
|
version?: number | null;
|
|
11
11
|
};
|
|
12
|
-
export type SubmitTransactionRequest = {
|
|
13
|
-
network: number;
|
|
14
|
-
account_id: number;
|
|
15
|
-
instructions: object[];
|
|
16
|
-
fee_instructions: object[];
|
|
17
|
-
inputs: object[];
|
|
18
|
-
input_refs: object[];
|
|
19
|
-
required_substates: SubstateRequirement[];
|
|
20
|
-
is_dry_run: boolean;
|
|
21
|
-
min_epoch: number | null;
|
|
22
|
-
max_epoch: number | null;
|
|
23
|
-
is_seal_signer_authorized: boolean;
|
|
24
|
-
detect_inputs_use_unversioned: boolean;
|
|
25
|
-
};
|
|
26
|
-
export type SubmitTransactionResponse = {
|
|
27
|
-
transaction_id: string;
|
|
28
|
-
};
|
|
29
12
|
export type TransactionResult = {
|
|
30
13
|
transaction_id: string;
|
|
31
14
|
status: TransactionStatus;
|
|
@@ -50,6 +33,8 @@ export interface VaultData {
|
|
|
50
33
|
type: string;
|
|
51
34
|
balance: number;
|
|
52
35
|
resource_address: string;
|
|
36
|
+
token_symbol: string;
|
|
37
|
+
vault_id: string;
|
|
53
38
|
}
|
|
54
39
|
export interface VaultBalances {
|
|
55
40
|
balances: Map<string, number | null>;
|
|
@@ -57,6 +42,36 @@ export interface VaultBalances {
|
|
|
57
42
|
export interface TemplateDefinition {
|
|
58
43
|
[key: string]: any;
|
|
59
44
|
}
|
|
45
|
+
export type SubmitTransactionRequest = {
|
|
46
|
+
network: number;
|
|
47
|
+
account_id: number;
|
|
48
|
+
instructions: object[];
|
|
49
|
+
fee_instructions: object[];
|
|
50
|
+
inputs: object[];
|
|
51
|
+
input_refs: object[];
|
|
52
|
+
required_substates: SubstateRequirement[];
|
|
53
|
+
is_dry_run: boolean;
|
|
54
|
+
min_epoch: number | null;
|
|
55
|
+
max_epoch: number | null;
|
|
56
|
+
is_seal_signer_authorized: boolean;
|
|
57
|
+
detect_inputs_use_unversioned: boolean;
|
|
58
|
+
};
|
|
59
|
+
export type SubmitTransactionResponse = {
|
|
60
|
+
transaction_id: string;
|
|
61
|
+
};
|
|
62
|
+
export type ListSubstatesRequest = {
|
|
63
|
+
filter_by_template: string | null;
|
|
64
|
+
filter_by_type: SubstateType | null;
|
|
65
|
+
limit: number | null;
|
|
66
|
+
offset: number | null;
|
|
67
|
+
};
|
|
68
|
+
export type ListSubstatesResponse = {
|
|
69
|
+
substates: Array<SubstateMetadata>;
|
|
70
|
+
};
|
|
71
|
+
export type GetSubstateRequest = {
|
|
72
|
+
substate_address: string;
|
|
73
|
+
version: number | null;
|
|
74
|
+
};
|
|
60
75
|
export interface Substate {
|
|
61
76
|
value: any;
|
|
62
77
|
address: {
|
|
@@ -64,6 +79,3 @@ export interface Substate {
|
|
|
64
79
|
version: number;
|
|
65
80
|
};
|
|
66
81
|
}
|
|
67
|
-
export type ListSubstatesResponse = {
|
|
68
|
-
substates: Array<SubstateMetadata>;
|
|
69
|
-
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tari-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@tari-project/typescript-bindings": "^1.
|
|
13
|
+
"@tari-project/typescript-bindings": "^1.5.1"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@types/node": "^22.13.1",
|