@tari-project/tari-provider 0.5.0 → 0.5.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.
@@ -1,11 +1,11 @@
1
- import type { ListTemplatesResponse } from "@tari-project/typescript-bindings";
2
- import { TransactionResult, TemplateDefinition, Substate, ListSubstatesResponse, GetSubstateRequest, ListSubstatesRequest } from "./types";
1
+ import type { GetTemplateDefinitionResponse, ListTemplatesResponse } from "@tari-project/typescript-bindings";
2
+ import { GetTransactionResultResponse, Substate, ListSubstatesResponse, GetSubstateRequest, ListSubstatesRequest } from "@tari-project/tarijs-types";
3
3
  export interface TariProvider {
4
4
  providerName: string;
5
5
  isConnected(): boolean;
6
6
  getSubstate(req: GetSubstateRequest): Promise<Substate>;
7
- getTransactionResult(transactionId: string): Promise<TransactionResult>;
8
- getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
7
+ getTransactionResult(transactionId: string): Promise<GetTransactionResultResponse>;
8
+ getTemplateDefinition(template_address: string): Promise<GetTemplateDefinitionResponse>;
9
9
  listSubstates(req: ListSubstatesRequest): Promise<ListSubstatesResponse>;
10
10
  listTemplates(limit?: number): Promise<ListTemplatesResponse>;
11
11
  }
package/dist/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export * from "./types";
2
1
  export { TariProvider } from "./TariProvider";
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export * from "./types";
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/tari-provider",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -10,7 +10,8 @@
10
10
  "author": "",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@tari-project/typescript-bindings": "^1.5.1"
13
+ "@tari-project/typescript-bindings": "^1.5.1",
14
+ "@tari-project/tarijs-types": "^0.5.2"
14
15
  },
15
16
  "devDependencies": {
16
17
  "@types/node": "^22.13.1",
package/dist/types.d.ts DELETED
@@ -1,81 +0,0 @@
1
- import { FinalizeResult, SubstateType } from "@tari-project/typescript-bindings";
2
- export type SubstateMetadata = {
3
- substate_id: string;
4
- module_name: string | null;
5
- version: number;
6
- template_address: string | null;
7
- };
8
- export type SubstateRequirement = {
9
- substate_id: string;
10
- version?: number | null;
11
- };
12
- export type TransactionResult = {
13
- transaction_id: string;
14
- status: TransactionStatus;
15
- result: FinalizeResult | null;
16
- };
17
- export declare enum TransactionStatus {
18
- New = 0,
19
- DryRun = 1,
20
- Pending = 2,
21
- Accepted = 3,
22
- Rejected = 4,
23
- InvalidTransaction = 5,
24
- OnlyFeeAccepted = 6
25
- }
26
- export interface Account {
27
- account_id: number;
28
- address: string;
29
- public_key: string;
30
- resources: VaultData[];
31
- }
32
- export interface VaultData {
33
- type: string;
34
- balance: number;
35
- resource_address: string;
36
- token_symbol: string;
37
- vault_id: string;
38
- }
39
- export interface VaultBalances {
40
- balances: Map<string, number | null>;
41
- }
42
- export interface TemplateDefinition {
43
- [key: string]: any;
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
- };
75
- export interface Substate {
76
- value: any;
77
- address: {
78
- substate_id: string;
79
- version: number;
80
- };
81
- }
package/dist/types.js DELETED
@@ -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 = {}));