@tari-project/wallet-daemon-signer 0.13.1 → 0.14.1

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
  }
@@ -87,16 +87,15 @@ export class WalletDaemonTariSigner {
87
87
  }
88
88
  async getAccount() {
89
89
  /* eslint-disable-next-line @typescript-eslint/no-explicit-any */
90
- const { account, public_key } = (await this.client.accountsGetDefault({}));
91
- const address = typeof account.address === "object" ? account.address.Component : account.address;
90
+ const { account, address } = await this.client.accountsGetDefault({});
92
91
  const { balances } = await this.client.accountsGetBalances({
93
- account: { ComponentAddress: address },
92
+ account: { ComponentAddress: account.component_address },
94
93
  refresh: false,
95
94
  });
96
95
  return {
97
96
  account_id: account.key_index,
98
- address,
99
- public_key,
97
+ component_address: account.component_address,
98
+ wallet_address: address,
100
99
  // TODO: should be vaults not resources
101
100
  vaults: balances.map((b) => ({
102
101
  type: b.resource_type,
@@ -119,15 +118,15 @@ export class WalletDaemonTariSigner {
119
118
  return await this.client.accountsGetBalances({ account: { ComponentAddress: componentAddress }, refresh: true });
120
119
  }
121
120
  async getSubstate(substateId) {
122
- const { substate } = await this.client.substatesGet({ substate_id: substateId });
123
- if (!substate) {
121
+ const { substate_from_remote } = await this.client.substatesGet({ substate_id: substateId });
122
+ if (!substate_from_remote) {
124
123
  throw new Error(`Substate not found for address: ${substateId}`);
125
124
  }
126
125
  return {
127
- value: substate?.substate,
126
+ value: substate_from_remote?.substate,
128
127
  address: {
129
128
  substate_id: substateId,
130
- version: substate?.version || 0,
129
+ version: substate_from_remote?.version || 0,
131
130
  },
132
131
  };
133
132
  }
@@ -179,7 +178,7 @@ export class WalletDaemonTariSigner {
179
178
  offset,
180
179
  });
181
180
  const substates = resp.substates.map((s) => ({
182
- substate_id: typeof s.substate_id === "string" ? s.substate_id : substateIdToString(s.substate_id),
181
+ substate_id: substateIdToString(s.substate_id),
183
182
  module_name: s.module_name,
184
183
  version: s.version,
185
184
  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.1",
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.1",
16
+ "@tari-project/tari-signer": "^0.14.1",
17
+ "@tari-project/tari-provider": "^0.14.1",
18
+ "@tari-project/tarijs-types": "^0.14.1"
19
19
  },
20
20
  "devDependencies": {
21
21
  "@types/node": "^22.13.1",