@tari-project/wallet-daemon-signer 0.13.1 → 0.14.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/provider.js CHANGED
@@ -50,15 +50,15 @@ export class WalletDaemonTariProvider {
50
50
  }
51
51
  async getSubstate(req) {
52
52
  // TODO: Substate address cannot be converted to SubstateId directly - Perhaps we need to change the provider interface
53
- const { substate } = await this.client.substatesGet({ substate_id: req.substate_address });
54
- if (!substate) {
53
+ const { substate_from_remote } = await this.client.substatesGet({ substate_id: req.substate_address });
54
+ if (!substate_from_remote) {
55
55
  throw new Error(`Substate not found for address: ${req.substate_address}`);
56
56
  }
57
57
  return {
58
- value: substate?.substate,
58
+ value: substate_from_remote?.substate,
59
59
  address: {
60
60
  substate_id: req.substate_address,
61
- version: substate?.version || 0,
61
+ version: substate_from_remote?.version || 0,
62
62
  },
63
63
  };
64
64
  }
package/dist/signer.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { TariPermissions } from "@tari-project/tari-permissions";
2
2
  import { TariSigner } from "@tari-project/tari-signer";
3
3
  import { WalletDaemonClient } from "@tari-project/wallet_jrpc_client";
4
- import { AccountData, GetTransactionResultResponse, SubmitTransactionRequest, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse, ListSubstatesRequest } from "@tari-project/tarijs-types";
5
- import { AccountGetResponse, AccountsListRequest, AccountsListResponse, ConfidentialViewVaultBalanceRequest, ListAccountNftRequest, ListAccountNftResponse, WalletGetInfoResponse } from "@tari-project/typescript-bindings";
4
+ import { AccountData, GetTransactionResultResponse, SubmitTransactionRequest, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse, ListSubstatesRequest, ListNftsResponse, ListNftsRequest } from "@tari-project/tarijs-types";
5
+ import { AccountGetResponse, AccountsListRequest, AccountsListResponse, ConfidentialViewVaultBalanceRequest, WalletGetInfoResponse } from "@tari-project/typescript-bindings";
6
6
  export declare const WalletDaemonNotConnected = "WALLET_DAEMON_NOT_CONNECTED";
7
7
  export declare const Unsupported = "UNSUPPORTED";
8
8
  export interface WalletDaemonBaseParameters {
@@ -43,6 +43,6 @@ export declare class WalletDaemonTariSigner implements TariSigner {
43
43
  getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
44
44
  getConfidentialVaultBalances({ vault_id, view_key_id, maximum_expected_value, minimum_expected_value, }: ConfidentialViewVaultBalanceRequest): Promise<VaultBalances>;
45
45
  listSubstates({ filter_by_template, filter_by_type, limit, offset, }: ListSubstatesRequest): Promise<ListSubstatesResponse>;
46
- getNftsList(req: ListAccountNftRequest): Promise<ListAccountNftResponse>;
46
+ getNftsList(req: ListNftsRequest): Promise<ListNftsResponse>;
47
47
  getWalletInfo(): Promise<WalletGetInfoResponse>;
48
48
  }
package/dist/signer.js CHANGED
@@ -70,14 +70,14 @@ export class WalletDaemonTariSigner {
70
70
  async createFreeTestCoins() {
71
71
  const res = await this.client.createFreeTestCoins({
72
72
  account: { Name: "template_web" },
73
- amount: 1000000,
73
+ amount: 1000_000_000,
74
74
  max_fee: null,
75
- key_id: 0,
76
75
  });
77
76
  return {
78
77
  account_id: res.account.key_index,
79
- address: res.account.address.Component,
80
- public_key: res.public_key,
78
+ component_address: res.account.component_address,
79
+ wallet_address: res.address,
80
+ // TODO: API for fetching vaults by account
81
81
  vaults: [],
82
82
  };
83
83
  }
@@ -95,8 +95,8 @@ export class WalletDaemonTariSigner {
95
95
  });
96
96
  return {
97
97
  account_id: account.key_index,
98
- address,
99
- public_key,
98
+ component_address: address,
99
+ wallet_address: public_key,
100
100
  // TODO: should be vaults not resources
101
101
  vaults: balances.map((b) => ({
102
102
  type: b.resource_type,
@@ -119,15 +119,15 @@ export class WalletDaemonTariSigner {
119
119
  return await this.client.accountsGetBalances({ account: { ComponentAddress: componentAddress }, refresh: true });
120
120
  }
121
121
  async getSubstate(substateId) {
122
- const { substate } = await this.client.substatesGet({ substate_id: substateId });
123
- if (!substate) {
122
+ const { substate_from_remote } = await this.client.substatesGet({ substate_id: substateId });
123
+ if (!substate_from_remote) {
124
124
  throw new Error(`Substate not found for address: ${substateId}`);
125
125
  }
126
126
  return {
127
- value: substate?.substate,
127
+ value: substate_from_remote?.substate,
128
128
  address: {
129
129
  substate_id: substateId,
130
- version: substate?.version || 0,
130
+ version: substate_from_remote?.version || 0,
131
131
  },
132
132
  };
133
133
  }
@@ -179,7 +179,7 @@ export class WalletDaemonTariSigner {
179
179
  offset,
180
180
  });
181
181
  const substates = resp.substates.map((s) => ({
182
- substate_id: typeof s.substate_id === "string" ? s.substate_id : substateIdToString(s.substate_id),
182
+ substate_id: substateIdToString(s.substate_id),
183
183
  module_name: s.module_name,
184
184
  version: s.version,
185
185
  template_address: s.template_address,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tari-project/wallet-daemon-signer",
3
- "version": "0.13.1",
3
+ "version": "0.14.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -10,12 +10,12 @@
10
10
  "author": "The Tari Community",
11
11
  "license": "ISC",
12
12
  "dependencies": {
13
- "@tari-project/typescript-bindings": ">=1.15.0",
13
+ "@tari-project/typescript-bindings": ">=1.17.0",
14
14
  "@tari-project/wallet_jrpc_client": "^1.7.2",
15
- "@tari-project/tari-permissions": "^0.13.1",
16
- "@tari-project/tari-signer": "^0.13.1",
17
- "@tari-project/tari-provider": "^0.13.1",
18
- "@tari-project/tarijs-types": "^0.13.1"
15
+ "@tari-project/tari-permissions": "^0.14.0",
16
+ "@tari-project/tari-provider": "^0.14.0",
17
+ "@tari-project/tari-signer": "^0.14.0",
18
+ "@tari-project/tarijs-types": "^0.14.0"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^22.13.1",