@tari-project/tarijs 0.14.2 → 0.14.4
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/.github/workflows/check-package-versions.yml +1 -1
- package/.github/workflows/ci.yml +1 -1
- package/.github/workflows/documentation-deploy.yml +1 -1
- package/.github/workflows/documentation-test-deploy.yml +1 -1
- package/.github/workflows/lint.yml +1 -1
- package/.github/workflows/npm_publish.yml +1 -1
- package/.prototools +2 -2
- package/docusaurus/tari-docs/package.json +1 -1
- package/package.json +2 -2
- package/packages/builders/package.json +1 -1
- package/packages/indexer_provider/package.json +1 -1
- package/packages/metamask_signer/package.json +1 -1
- package/packages/metamask_signer/src/index.ts +0 -18
- package/packages/permissions/package.json +1 -1
- package/packages/react-mui-connect-button/package.json +1 -1
- package/packages/tari_provider/package.json +1 -1
- package/packages/tari_provider/src/TariProvider.ts +4 -1
- package/packages/tari_signer/package.json +1 -1
- package/packages/tari_signer/src/TariSigner.ts +1 -3
- package/packages/tari_universe/package.json +1 -1
- package/packages/tari_universe/src/signer.ts +2 -2
- package/packages/tarijs/package.json +1 -1
- package/packages/tarijs/src/index.ts +1 -1
- package/packages/tarijs_types/package.json +1 -1
- package/packages/tarijs_types/src/ConfidentialOutput.ts +2 -2
- package/packages/tarijs_types/src/index.ts +1 -1
- package/packages/tarijs_types/src/signer.ts +3 -2
- package/packages/wallet_daemon/package.json +1 -1
- package/packages/wallet_daemon/src/signer.ts +25 -7
- package/packages/walletconnect/package.json +1 -1
- package/packages/walletconnect/src/index.ts +3 -3
- package/pnpm-workspace.yaml +2 -2
package/.github/workflows/ci.yml
CHANGED
package/.prototools
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tarijs",
|
|
3
|
-
"version": "0.14.
|
|
3
|
+
"version": "0.14.4",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"typescript-eslint": "^8.35.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tari-project/tarijs-types": "^0.14.
|
|
22
|
+
"@tari-project/tarijs-types": "^0.14.4"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"docs": "typedoc",
|
|
@@ -4,7 +4,6 @@ import {
|
|
|
4
4
|
SubmitTransactionRequest,
|
|
5
5
|
TransactionStatus,
|
|
6
6
|
SubmitTransactionResponse,
|
|
7
|
-
VaultBalances,
|
|
8
7
|
TemplateDefinition,
|
|
9
8
|
Substate,
|
|
10
9
|
ListSubstatesResponse,
|
|
@@ -18,7 +17,6 @@ import {
|
|
|
18
17
|
AccountGetResponse,
|
|
19
18
|
AccountsListRequest,
|
|
20
19
|
AccountsListResponse,
|
|
21
|
-
ConfidentialViewVaultBalanceRequest,
|
|
22
20
|
WalletGetInfoResponse,
|
|
23
21
|
} from "@tari-project/typescript-bindings";
|
|
24
22
|
|
|
@@ -163,22 +161,6 @@ export class MetamaskTariSigner implements TariSigner {
|
|
|
163
161
|
return resp.public_key;
|
|
164
162
|
}
|
|
165
163
|
|
|
166
|
-
public async getConfidentialVaultBalances({
|
|
167
|
-
vault_id,
|
|
168
|
-
maximum_expected_value,
|
|
169
|
-
minimum_expected_value,
|
|
170
|
-
view_key_id,
|
|
171
|
-
}: ConfidentialViewVaultBalanceRequest): Promise<VaultBalances> {
|
|
172
|
-
const resp = await this.metamaskRequest("getConfidentialVaultBalances", {
|
|
173
|
-
view_key_id,
|
|
174
|
-
vault_id,
|
|
175
|
-
minimum_expected_value,
|
|
176
|
-
maximum_expected_value,
|
|
177
|
-
});
|
|
178
|
-
|
|
179
|
-
return { balances: resp as Map<string, number | null> };
|
|
180
|
-
}
|
|
181
|
-
|
|
182
164
|
getTemplateDefinition(template_address: string): Promise<TemplateDefinition> {
|
|
183
165
|
return this.metamaskRequest("getTemplateDefinition", { template_address }).then((resp) => {
|
|
184
166
|
if (!resp) {
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GetTemplateDefinitionResponse,
|
|
3
|
+
ListTemplatesResponse,
|
|
4
|
+
} from "@tari-project/typescript-bindings";
|
|
2
5
|
import {
|
|
3
6
|
GetTransactionResultResponse,
|
|
4
7
|
Substate,
|
|
@@ -2,7 +2,6 @@ import type {
|
|
|
2
2
|
AccountGetResponse,
|
|
3
3
|
AccountsListRequest,
|
|
4
4
|
AccountsListResponse,
|
|
5
|
-
ConfidentialViewVaultBalanceRequest,
|
|
6
5
|
WalletGetInfoResponse,
|
|
7
6
|
} from "@tari-project/typescript-bindings";
|
|
8
7
|
import {
|
|
@@ -10,7 +9,6 @@ import {
|
|
|
10
9
|
AccountData,
|
|
11
10
|
SubmitTransactionRequest,
|
|
12
11
|
SubmitTransactionResponse,
|
|
13
|
-
VaultBalances,
|
|
14
12
|
TemplateDefinition,
|
|
15
13
|
Substate,
|
|
16
14
|
ListSubstatesResponse,
|
|
@@ -22,6 +20,7 @@ import {
|
|
|
22
20
|
export interface TariSigner {
|
|
23
21
|
signerName: string;
|
|
24
22
|
isConnected(): boolean;
|
|
23
|
+
// TODO: this should have signTransaction(UnsignedTransaction, keyId) and remove the rest of these
|
|
25
24
|
accountsList(req: AccountsListRequest): Promise<AccountsListResponse>;
|
|
26
25
|
getAccount(): Promise<AccountData>;
|
|
27
26
|
getAccountByAddress(address: string): Promise<AccountGetResponse>;
|
|
@@ -30,7 +29,6 @@ export interface TariSigner {
|
|
|
30
29
|
getTransactionResult(transactionId: string): Promise<GetTransactionResultResponse>;
|
|
31
30
|
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
32
31
|
getPublicKey(branch: string, index: number): Promise<string>;
|
|
33
|
-
getConfidentialVaultBalances(req: ConfidentialViewVaultBalanceRequest): Promise<VaultBalances>;
|
|
34
32
|
listSubstates(req: ListSubstatesRequest): Promise<ListSubstatesResponse>;
|
|
35
33
|
getNftsList(req: ListNftsRequest): Promise<ListNftsResponse>;
|
|
36
34
|
getWalletInfo(): Promise<WalletGetInfoResponse>;
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AccountData,
|
|
4
4
|
Substate,
|
|
5
5
|
TemplateDefinition,
|
|
6
|
-
|
|
6
|
+
RevealedBalances,
|
|
7
7
|
ListSubstatesResponse,
|
|
8
8
|
SubmitTransactionRequest,
|
|
9
9
|
ListSubstatesRequest,
|
|
@@ -73,7 +73,7 @@ export class TariUniverseSigner implements TariSigner {
|
|
|
73
73
|
maximum_expected_value,
|
|
74
74
|
minimum_expected_value,
|
|
75
75
|
view_key_id,
|
|
76
|
-
}: ConfidentialViewVaultBalanceRequest): Promise<
|
|
76
|
+
}: ConfidentialViewVaultBalanceRequest): Promise<RevealedBalances> {
|
|
77
77
|
return this.sendRequest({
|
|
78
78
|
methodName: "getConfidentialVaultBalances",
|
|
79
79
|
args: [{ view_key_id, vault_id, minimum_expected_value, maximum_expected_value }],
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ElgamalVerifiableBalanceBytes } from "@tari-project/typescript-bindings";
|
|
2
2
|
|
|
3
3
|
export interface ConfidentialOutput {
|
|
4
4
|
commitment: string;
|
|
5
5
|
stealthPublicNonce: string;
|
|
6
6
|
encrypted_data: Array<number>;
|
|
7
7
|
minimumValuePromise: number;
|
|
8
|
-
viewableBalance?:
|
|
8
|
+
viewableBalance?: ElgamalVerifiableBalanceBytes;
|
|
9
9
|
}
|
|
@@ -41,10 +41,11 @@ export interface VaultData {
|
|
|
41
41
|
vault_id: string;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export interface
|
|
45
|
-
balances: Map<string,
|
|
44
|
+
export interface RevealedBalances {
|
|
45
|
+
balances: Map<string, bigint | null>;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
+
|
|
48
49
|
export type TemplateDefinition = TemplateDef;
|
|
49
50
|
|
|
50
51
|
export interface Substate {
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
GetTransactionResultResponse,
|
|
10
10
|
SubmitTransactionRequest,
|
|
11
11
|
SubmitTransactionResponse,
|
|
12
|
-
|
|
12
|
+
RevealedBalances,
|
|
13
13
|
TemplateDefinition,
|
|
14
14
|
Substate,
|
|
15
15
|
ListSubstatesResponse,
|
|
@@ -24,12 +24,10 @@ import {
|
|
|
24
24
|
ConfidentialViewVaultBalanceRequest,
|
|
25
25
|
KeyBranch,
|
|
26
26
|
substateIdToString,
|
|
27
|
-
SubstatesListRequest,
|
|
27
|
+
SubstatesListRequest, UtxoAddress, UtxoId,
|
|
28
28
|
WalletGetInfoResponse,
|
|
29
29
|
} from "@tari-project/typescript-bindings";
|
|
30
30
|
|
|
31
|
-
export const WalletDaemonNotConnected = "WALLET_DAEMON_NOT_CONNECTED";
|
|
32
|
-
export const Unsupported = "UNSUPPORTED";
|
|
33
31
|
|
|
34
32
|
export interface WalletDaemonBaseParameters {
|
|
35
33
|
permissions: TariPermissions;
|
|
@@ -235,14 +233,30 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
235
233
|
view_key_id,
|
|
236
234
|
maximum_expected_value = null,
|
|
237
235
|
minimum_expected_value = null,
|
|
238
|
-
}: ConfidentialViewVaultBalanceRequest): Promise<
|
|
236
|
+
}: ConfidentialViewVaultBalanceRequest): Promise<RevealedBalances> {
|
|
239
237
|
const res = await this.client.viewVaultBalance({
|
|
240
238
|
view_key_id,
|
|
241
239
|
vault_id,
|
|
242
240
|
minimum_expected_value,
|
|
243
241
|
maximum_expected_value,
|
|
244
242
|
});
|
|
245
|
-
return { balances: res.balances as unknown as Map<string,
|
|
243
|
+
return { balances: res.balances as unknown as Map<string, bigint | null> };
|
|
244
|
+
}
|
|
245
|
+
public async decryptUtxoValue(
|
|
246
|
+
utxoAddress: UtxoAddress,
|
|
247
|
+
viewKeyId: number,
|
|
248
|
+
maximum_expected_value = null,
|
|
249
|
+
minimum_expected_value = null,
|
|
250
|
+
): Promise<RevealedBalances> {
|
|
251
|
+
const res = await this.client.stealthUtxosDecryptValue({
|
|
252
|
+
resource_address: utxoAddress.resource_address,
|
|
253
|
+
utxo_id: utxoAddress.id,
|
|
254
|
+
view_key_id: viewKeyId,
|
|
255
|
+
minimum_expected_value,
|
|
256
|
+
maximum_expected_value,
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
return { balances: res.balances as unknown as Map<string, bigint | null> };
|
|
246
260
|
}
|
|
247
261
|
|
|
248
262
|
public async listSubstates({
|
|
@@ -269,7 +283,11 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
269
283
|
}
|
|
270
284
|
|
|
271
285
|
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
|
272
|
-
return await this.client.nftsList(
|
|
286
|
+
return await this.client.nftsList({
|
|
287
|
+
account: {ComponentAddress: req.accountAddress},
|
|
288
|
+
limit: req.limit || 100,
|
|
289
|
+
offset: req.offset || 0,
|
|
290
|
+
});
|
|
273
291
|
}
|
|
274
292
|
|
|
275
293
|
public async getWalletInfo(): Promise<WalletGetInfoResponse> {
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
convertStringToTransactionStatus,
|
|
7
7
|
GetTransactionResultResponse,
|
|
8
8
|
SubmitTransactionRequest,
|
|
9
|
-
|
|
9
|
+
RevealedBalances,
|
|
10
10
|
TemplateDefinition,
|
|
11
11
|
Substate,
|
|
12
12
|
AccountData,
|
|
@@ -290,7 +290,7 @@ export class WalletConnectTariSigner implements TariSigner {
|
|
|
290
290
|
view_key_id,
|
|
291
291
|
maximum_expected_value = null,
|
|
292
292
|
minimum_expected_value = null,
|
|
293
|
-
}: ConfidentialViewVaultBalanceRequest): Promise<
|
|
293
|
+
}: ConfidentialViewVaultBalanceRequest): Promise<RevealedBalances> {
|
|
294
294
|
const method = "tari_viewConfidentialVaultBalance";
|
|
295
295
|
const params = {
|
|
296
296
|
view_key_id,
|
|
@@ -300,7 +300,7 @@ export class WalletConnectTariSigner implements TariSigner {
|
|
|
300
300
|
};
|
|
301
301
|
|
|
302
302
|
const res = await this.sendRequest(method, params);
|
|
303
|
-
return { balances: res.balances as unknown as Map<string,
|
|
303
|
+
return { balances: res.balances as unknown as Map<string, bigint | null> };
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -10,8 +10,8 @@ catalog:
|
|
|
10
10
|
vitest: ^3.0.4
|
|
11
11
|
vite: ^6.1.0
|
|
12
12
|
"@types/node": ^22.13.1
|
|
13
|
-
"@tari-project/typescript-bindings": ">=1.17.
|
|
14
|
-
"@tari-project/wallet_jrpc_client": ^1.
|
|
13
|
+
"@tari-project/typescript-bindings": ">=1.17.2"
|
|
14
|
+
"@tari-project/wallet_jrpc_client": ^1.9.2
|
|
15
15
|
"@metamask/providers": ^18.2.0
|
|
16
16
|
"@walletconnect/universal-provider": 2.21.3
|
|
17
17
|
"@reown/appkit": "1.7.15"
|