@tari-project/wallet-daemon-signer 0.10.1 → 0.12.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 +7 -4
- package/dist/signer.d.ts +1 -0
- package/dist/signer.js +13 -7
- package/package.json +8 -8
package/dist/provider.js
CHANGED
|
@@ -50,12 +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 {
|
|
53
|
+
const { substate, } = await this.client.substatesGet({ substate_id: req.substate_address });
|
|
54
|
+
if (!substate) {
|
|
55
|
+
throw new Error(`Substate not found for address: ${req.substate_address}`);
|
|
56
|
+
}
|
|
54
57
|
return {
|
|
55
|
-
value,
|
|
58
|
+
value: substate?.substate,
|
|
56
59
|
address: {
|
|
57
|
-
substate_id:
|
|
58
|
-
version:
|
|
60
|
+
substate_id: req.substate_address,
|
|
61
|
+
version: substate?.version || 0,
|
|
59
62
|
},
|
|
60
63
|
};
|
|
61
64
|
}
|
package/dist/signer.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export declare class WalletDaemonTariSigner implements TariSigner {
|
|
|
27
27
|
static buildFetchSigner(params: WalletDaemonFetchParameters): Promise<WalletDaemonTariSigner>;
|
|
28
28
|
private static buildPermissions;
|
|
29
29
|
private getWebRtcTransport;
|
|
30
|
+
newTransactionKey(index?: number): Promise<string>;
|
|
30
31
|
get token(): string | undefined;
|
|
31
32
|
get tokenUrl(): string | undefined;
|
|
32
33
|
isConnected(): boolean;
|
package/dist/signer.js
CHANGED
|
@@ -47,6 +47,10 @@ export class WalletDaemonTariSigner {
|
|
|
47
47
|
const transport = this.client.getTransport();
|
|
48
48
|
return transport instanceof WebRtcRpcTransport ? transport : undefined;
|
|
49
49
|
}
|
|
50
|
+
async newTransactionKey(index) {
|
|
51
|
+
const resp = await this.client.createKey({ branch: "transaction", specific_index: index || null });
|
|
52
|
+
return resp.public_key;
|
|
53
|
+
}
|
|
50
54
|
get token() {
|
|
51
55
|
return this.getWebRtcTransport()?.token();
|
|
52
56
|
}
|
|
@@ -74,7 +78,7 @@ export class WalletDaemonTariSigner {
|
|
|
74
78
|
account_id: res.account.key_index,
|
|
75
79
|
address: res.account.address.Component,
|
|
76
80
|
public_key: res.public_key,
|
|
77
|
-
|
|
81
|
+
vaults: [],
|
|
78
82
|
};
|
|
79
83
|
}
|
|
80
84
|
async getAccount() {
|
|
@@ -89,7 +93,7 @@ export class WalletDaemonTariSigner {
|
|
|
89
93
|
address,
|
|
90
94
|
public_key,
|
|
91
95
|
// TODO: should be vaults not resources
|
|
92
|
-
|
|
96
|
+
vaults: balances.map((b) => ({
|
|
93
97
|
type: b.resource_type,
|
|
94
98
|
resource_address: b.resource_address,
|
|
95
99
|
balance: b.balance + b.confidential_balance,
|
|
@@ -102,13 +106,15 @@ export class WalletDaemonTariSigner {
|
|
|
102
106
|
return await this.client.accountsGetBalances({ account: { ComponentAddress: componentAddress }, refresh: true });
|
|
103
107
|
}
|
|
104
108
|
async getSubstate(substateId) {
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
const { substate, } = await this.client.substatesGet({ substate_id: substateId });
|
|
110
|
+
if (!substate) {
|
|
111
|
+
throw new Error(`Substate not found for address: ${substateId}`);
|
|
112
|
+
}
|
|
107
113
|
return {
|
|
108
|
-
value,
|
|
114
|
+
value: substate?.substate,
|
|
109
115
|
address: {
|
|
110
|
-
substate_id:
|
|
111
|
-
version:
|
|
116
|
+
substate_id: substateId,
|
|
117
|
+
version: substate?.version || 0,
|
|
112
118
|
},
|
|
113
119
|
};
|
|
114
120
|
}
|
package/package.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/wallet-daemon-signer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
8
8
|
},
|
|
9
9
|
"keywords": [],
|
|
10
|
-
"author": "",
|
|
10
|
+
"author": "The Tari Community",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@tari-project/typescript-bindings": ">=1.
|
|
14
|
-
"@tari-project/wallet_jrpc_client": "^1.
|
|
15
|
-
"@tari-project/tari-permissions": "^0.
|
|
16
|
-
"@tari-project/tari-signer": "^0.
|
|
17
|
-
"@tari-project/tari-provider": "^0.
|
|
18
|
-
"@tari-project/tarijs-types": "^0.
|
|
13
|
+
"@tari-project/typescript-bindings": ">=1.14.0",
|
|
14
|
+
"@tari-project/wallet_jrpc_client": "^1.7.2",
|
|
15
|
+
"@tari-project/tari-permissions": "^0.12.0",
|
|
16
|
+
"@tari-project/tari-signer": "^0.12.0",
|
|
17
|
+
"@tari-project/tari-provider": "^0.12.0",
|
|
18
|
+
"@tari-project/tarijs-types": "^0.12.0"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
21
|
"@types/node": "^22.13.1",
|