@tari-project/tarijs 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/.prototools +2 -2
- package/docusaurus/tari-docs/package.json +1 -1
- package/examples/vite-typescript-react/src/App.tsx +2 -2
- package/package.json +3 -3
- package/packages/builders/package.json +1 -1
- package/packages/builders/src/transaction/TransactionBuilder.ts +6 -4
- package/packages/indexer_provider/package.json +1 -1
- package/packages/indexer_provider/src/transports/IndexerProviderClient.ts +0 -17
- package/packages/metamask_signer/package.json +1 -1
- package/packages/metamask_signer/src/index.ts +5 -7
- 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_signer/package.json +1 -1
- package/packages/tari_signer/src/TariSigner.ts +3 -3
- package/packages/tari_universe/package.json +1 -1
- package/packages/tari_universe/src/signer.ts +4 -4
- package/packages/tarijs/package.json +1 -1
- package/packages/tarijs_types/package.json +1 -1
- package/packages/tarijs_types/src/ConfidentialOutput.ts +2 -2
- package/packages/tarijs_types/src/helpers/simpleResult.ts +2 -2
- package/packages/tarijs_types/src/helpers/txResult.ts +0 -8
- package/packages/tarijs_types/src/index.ts +4 -2
- package/packages/tarijs_types/src/signer.ts +20 -3
- package/packages/wallet_daemon/package.json +1 -1
- package/packages/wallet_daemon/src/provider.ts +4 -4
- package/packages/wallet_daemon/src/signer.ts +16 -17
- package/packages/walletconnect/package.json +1 -1
- package/packages/walletconnect/src/index.ts +8 -10
- package/pnpm-workspace.yaml +1 -1
package/.prototools
CHANGED
|
@@ -31,8 +31,8 @@ function App() {
|
|
|
31
31
|
<div>
|
|
32
32
|
<h2>Connected Account</h2>
|
|
33
33
|
<p>Account ID: {account.account_id}</p>
|
|
34
|
-
<p>
|
|
35
|
-
<p>
|
|
34
|
+
<p>Component: {account.component_address}</p>
|
|
35
|
+
<p>Wallet Address: {account.wallet_address}</p>
|
|
36
36
|
<h3>Resources:</h3>
|
|
37
37
|
<ul>
|
|
38
38
|
{account.vaults.map((resource, index) => (
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/tarijs",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [],
|
|
7
7
|
"author": "The Tari Community",
|
|
8
8
|
"license": "ISC",
|
|
9
9
|
"engines": {
|
|
10
|
-
"node": "22.
|
|
10
|
+
"node": "22.19.0"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@eslint/js": "^9.30.0",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"typescript-eslint": "^8.35.0"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@tari-project/tarijs-types": "^0.
|
|
22
|
+
"@tari-project/tarijs-types": "^0.14.1"
|
|
23
23
|
},
|
|
24
24
|
"scripts": {
|
|
25
25
|
"docs": "typedoc",
|
|
@@ -5,7 +5,8 @@ import { TransactionRequest } from "./TransactionRequest";
|
|
|
5
5
|
import { Amount, Network, TransactionArg } from "@tari-project/tarijs-types";
|
|
6
6
|
import {
|
|
7
7
|
ComponentAddress,
|
|
8
|
-
|
|
8
|
+
MinotariBurnClaimProof,
|
|
9
|
+
ClaimBurnOutputData,
|
|
9
10
|
ConfidentialWithdrawProof,
|
|
10
11
|
Instruction,
|
|
11
12
|
ResourceAddress,
|
|
@@ -187,7 +188,7 @@ export interface Builder {
|
|
|
187
188
|
* - If `withdraw_proof` is required by the burn process, it must be included.
|
|
188
189
|
* - This method should be used only when recovering burned confidential resources.
|
|
189
190
|
*/
|
|
190
|
-
claimBurn(claim:
|
|
191
|
+
claimBurn(claim: MinotariBurnClaimProof, output_data: ClaimBurnOutputData): this;
|
|
191
192
|
|
|
192
193
|
addInput(inputObject: SubstateRequirement): this;
|
|
193
194
|
|
|
@@ -346,7 +347,7 @@ export class TransactionBuilder implements Builder {
|
|
|
346
347
|
|
|
347
348
|
return this.addInstruction({
|
|
348
349
|
CreateAccount: {
|
|
349
|
-
|
|
350
|
+
owner_public_key: ownerPublicKey,
|
|
350
351
|
owner_rule: null, // Custom owner rule is not set by default
|
|
351
352
|
access_rules: null, // Custom access rules are not set by default
|
|
352
353
|
workspace_id,
|
|
@@ -364,10 +365,11 @@ export class TransactionBuilder implements Builder {
|
|
|
364
365
|
});
|
|
365
366
|
}
|
|
366
367
|
|
|
367
|
-
|
|
368
|
+
public claimBurn(claim: MinotariBurnClaimProof, output_data: ClaimBurnOutputData): this {
|
|
368
369
|
return this.addInstruction({
|
|
369
370
|
ClaimBurn: {
|
|
370
371
|
claim,
|
|
372
|
+
output_data,
|
|
371
373
|
},
|
|
372
374
|
});
|
|
373
375
|
}
|
|
@@ -1,12 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
GetEpochManagerStatsResponse,
|
|
3
|
-
GetNonFungibleCollectionsResponse,
|
|
4
|
-
GetNonFungibleCountRequest,
|
|
5
|
-
GetNonFungibleCountResponse,
|
|
6
3
|
GetNonFungiblesRequest,
|
|
7
4
|
GetNonFungiblesResponse,
|
|
8
|
-
GetRelatedTransactionsRequest,
|
|
9
|
-
GetRelatedTransactionsResponse,
|
|
10
5
|
GetTemplateDefinitionRequest,
|
|
11
6
|
GetTemplateDefinitionResponse,
|
|
12
7
|
IndexerGetIdentityResponse,
|
|
@@ -92,22 +87,10 @@ export class IndexerProviderClient {
|
|
|
92
87
|
return this.__invokeRpc("get_transaction_result", params);
|
|
93
88
|
}
|
|
94
89
|
|
|
95
|
-
public getSubstateTransactions(params: GetRelatedTransactionsRequest): Promise<GetRelatedTransactionsResponse> {
|
|
96
|
-
return this.__invokeRpc("get_substate_transactions", params);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
90
|
public getNonFungibles(params: GetNonFungiblesRequest): Promise<GetNonFungiblesResponse> {
|
|
100
91
|
return this.__invokeRpc("get_non_fungibles", params);
|
|
101
92
|
}
|
|
102
93
|
|
|
103
|
-
public getNonFungibleCollections(): Promise<GetNonFungibleCollectionsResponse> {
|
|
104
|
-
return this.__invokeRpc("get_non_fungible_collections");
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
public getNonFungibleCount(params: GetNonFungibleCountRequest): Promise<GetNonFungibleCountResponse> {
|
|
108
|
-
return this.__invokeRpc("get_non_fungible_count", params);
|
|
109
|
-
}
|
|
110
|
-
|
|
111
94
|
public getEpochManagerStats(): Promise<GetEpochManagerStatsResponse> {
|
|
112
95
|
return this.__invokeRpc("get_epoch_manager_stats");
|
|
113
96
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
ListSubstatesResponse,
|
|
11
11
|
AccountData,
|
|
12
12
|
ListSubstatesRequest,
|
|
13
|
-
GetTransactionResultResponse,
|
|
13
|
+
GetTransactionResultResponse, ListNftsResponse, ListNftsRequest,
|
|
14
14
|
} from "@tari-project/tarijs-types";
|
|
15
15
|
import { MetaMaskInpageProvider } from "@metamask/providers";
|
|
16
16
|
import { connectSnap, getSnap, isFlask, Snap } from "./utils";
|
|
@@ -19,8 +19,6 @@ import {
|
|
|
19
19
|
AccountsListRequest,
|
|
20
20
|
AccountsListResponse,
|
|
21
21
|
ConfidentialViewVaultBalanceRequest,
|
|
22
|
-
ListAccountNftRequest,
|
|
23
|
-
ListAccountNftResponse,
|
|
24
22
|
WalletGetInfoResponse,
|
|
25
23
|
} from "@tari-project/typescript-bindings";
|
|
26
24
|
|
|
@@ -82,8 +80,8 @@ export class MetamaskTariSigner implements TariSigner {
|
|
|
82
80
|
})) as any;
|
|
83
81
|
return {
|
|
84
82
|
account_id,
|
|
85
|
-
|
|
86
|
-
|
|
83
|
+
component_address: res.address,
|
|
84
|
+
wallet_address: res.public_key,
|
|
87
85
|
vaults: [],
|
|
88
86
|
};
|
|
89
87
|
}
|
|
@@ -213,8 +211,8 @@ export class MetamaskTariSigner implements TariSigner {
|
|
|
213
211
|
return resp as T;
|
|
214
212
|
}
|
|
215
213
|
|
|
216
|
-
public async getNftsList(req:
|
|
217
|
-
const resp = (await this.metamaskRequest("getNftsList", req)) as
|
|
214
|
+
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
|
215
|
+
const resp = (await this.metamaskRequest("getNftsList", req)) as ListNftsResponse;
|
|
218
216
|
return resp;
|
|
219
217
|
}
|
|
220
218
|
|
|
@@ -3,8 +3,6 @@ import type {
|
|
|
3
3
|
AccountsListRequest,
|
|
4
4
|
AccountsListResponse,
|
|
5
5
|
ConfidentialViewVaultBalanceRequest,
|
|
6
|
-
ListAccountNftRequest,
|
|
7
|
-
ListAccountNftResponse,
|
|
8
6
|
WalletGetInfoResponse,
|
|
9
7
|
} from "@tari-project/typescript-bindings";
|
|
10
8
|
import {
|
|
@@ -17,6 +15,8 @@ import {
|
|
|
17
15
|
Substate,
|
|
18
16
|
ListSubstatesResponse,
|
|
19
17
|
ListSubstatesRequest,
|
|
18
|
+
ListNftsRequest,
|
|
19
|
+
ListNftsResponse,
|
|
20
20
|
} from "@tari-project/tarijs-types";
|
|
21
21
|
|
|
22
22
|
export interface TariSigner {
|
|
@@ -32,6 +32,6 @@ export interface TariSigner {
|
|
|
32
32
|
getPublicKey(branch: string, index: number): Promise<string>;
|
|
33
33
|
getConfidentialVaultBalances(req: ConfidentialViewVaultBalanceRequest): Promise<VaultBalances>;
|
|
34
34
|
listSubstates(req: ListSubstatesRequest): Promise<ListSubstatesResponse>;
|
|
35
|
-
getNftsList(req:
|
|
35
|
+
getNftsList(req: ListNftsRequest): Promise<ListNftsResponse>;
|
|
36
36
|
getWalletInfo(): Promise<WalletGetInfoResponse>;
|
|
37
37
|
}
|
|
@@ -9,6 +9,8 @@ import {
|
|
|
9
9
|
ListSubstatesRequest,
|
|
10
10
|
GetTransactionResultResponse,
|
|
11
11
|
ListAccountNftFromBalancesRequest,
|
|
12
|
+
ListNftsRequest,
|
|
13
|
+
ListNftsResponse,
|
|
12
14
|
} from "@tari-project/tarijs-types";
|
|
13
15
|
import { SignerRequest, SignerMethodNames, SignerReturnType, TariUniverseSignerParameters, WindowSize } from "./types";
|
|
14
16
|
import { sendSignerCall } from "./utils";
|
|
@@ -19,8 +21,6 @@ import {
|
|
|
19
21
|
AccountsListRequest,
|
|
20
22
|
AccountsListResponse,
|
|
21
23
|
ConfidentialViewVaultBalanceRequest,
|
|
22
|
-
ListAccountNftRequest,
|
|
23
|
-
ListAccountNftResponse,
|
|
24
24
|
WalletGetInfoResponse,
|
|
25
25
|
} from "@tari-project/typescript-bindings";
|
|
26
26
|
import { MessageType } from "./useIframeMessage";
|
|
@@ -133,11 +133,11 @@ export class TariUniverseSigner implements TariSigner {
|
|
|
133
133
|
return this.sendRequest({ methodName: "getTemplateDefinition", args: [template_address] });
|
|
134
134
|
}
|
|
135
135
|
|
|
136
|
-
public async getNftsList(req:
|
|
136
|
+
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
|
137
137
|
return this.sendRequest({ methodName: "getNftsList", args: [req] });
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
-
public async getNftsFromAccountBalances(req: ListAccountNftFromBalancesRequest): Promise<
|
|
140
|
+
public async getNftsFromAccountBalances(req: ListAccountNftFromBalancesRequest): Promise<ListNftsResponse> {
|
|
141
141
|
return this.sendRequest({ methodName: "getNftsFromAccountBalances", args: [req] });
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CompressedElgamalVerifiableBalance } 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?: CompressedElgamalVerifiableBalance;
|
|
9
9
|
}
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
SubstateDiff,
|
|
11
11
|
SubstateType,
|
|
12
12
|
TransactionReceipt,
|
|
13
|
-
|
|
13
|
+
ClaimedOutputTombstone,
|
|
14
14
|
ValidatorFeePool,
|
|
15
15
|
PublishedTemplate,
|
|
16
16
|
ValidatorFeeWithdrawal,
|
|
@@ -290,7 +290,7 @@ export type AnySubstate =
|
|
|
290
290
|
| ComponentHeader
|
|
291
291
|
| Resource
|
|
292
292
|
| Vault
|
|
293
|
-
|
|
|
293
|
+
| ClaimedOutputTombstone
|
|
294
294
|
| NonFungible
|
|
295
295
|
| TransactionReceipt
|
|
296
296
|
| ValidatorFeePool
|
|
@@ -12,19 +12,11 @@ import {
|
|
|
12
12
|
} from "@tari-project/typescript-bindings";
|
|
13
13
|
import { UpSubstates } from "../SubstateDiff";
|
|
14
14
|
|
|
15
|
-
function isOfType<T extends object>(obj: T, key: keyof T): boolean {
|
|
16
|
-
return obj !== null && typeof obj === "object" && key in obj;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
15
|
export const txResultCheck = {
|
|
20
16
|
isAccept: (result: FinalizeResult) => {
|
|
21
17
|
return "Accept" in result.result;
|
|
22
18
|
},
|
|
23
19
|
|
|
24
|
-
isVaultId: (substateId: SubstateId): substateId is { Vault: VaultId } => {
|
|
25
|
-
return isOfType(substateId, "Vault" as keyof SubstateId);
|
|
26
|
-
},
|
|
27
|
-
|
|
28
20
|
isVaultSubstate: (substate: SubstateValue): substate is { Vault: Vault } => {
|
|
29
21
|
return "Vault" in substate;
|
|
30
22
|
},
|
|
@@ -23,16 +23,18 @@ export { ListAccountNftFromBalancesRequest } from "./ListAccountNftFromBalancesR
|
|
|
23
23
|
export { Network } from "./network";
|
|
24
24
|
export {
|
|
25
25
|
AccountData,
|
|
26
|
+
GetSubstateRequest,
|
|
27
|
+
ListNftsRequest,
|
|
28
|
+
ListNftsResponse,
|
|
26
29
|
ListSubstatesRequest,
|
|
27
30
|
ListSubstatesResponse,
|
|
31
|
+
ReqSubstate,
|
|
28
32
|
SubmitTransactionRequest,
|
|
29
33
|
Substate,
|
|
30
34
|
SubstateMetadata,
|
|
31
|
-
ReqSubstate,
|
|
32
35
|
TemplateDefinition,
|
|
33
36
|
VaultBalances,
|
|
34
37
|
VaultData,
|
|
35
|
-
GetSubstateRequest,
|
|
36
38
|
} from "./signer";
|
|
37
39
|
|
|
38
40
|
export {
|
|
@@ -1,4 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
SubstateType,
|
|
3
|
+
TemplateDef,
|
|
4
|
+
UnsignedTransactionV1,
|
|
5
|
+
ComponentAddress,
|
|
6
|
+
NonFungibleToken,
|
|
7
|
+
OotleAddress,
|
|
8
|
+
} from "@tari-project/typescript-bindings";
|
|
2
9
|
|
|
3
10
|
export type SubstateMetadata = {
|
|
4
11
|
substate_id: string;
|
|
@@ -20,8 +27,8 @@ export type SubmitTransactionRequest = {
|
|
|
20
27
|
|
|
21
28
|
export interface AccountData {
|
|
22
29
|
account_id: number;
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
component_address: ComponentAddress;
|
|
31
|
+
wallet_address: OotleAddress;
|
|
25
32
|
vaults: VaultData[];
|
|
26
33
|
}
|
|
27
34
|
|
|
@@ -63,3 +70,13 @@ export type GetSubstateRequest = {
|
|
|
63
70
|
substate_address: string;
|
|
64
71
|
version: number | null;
|
|
65
72
|
};
|
|
73
|
+
|
|
74
|
+
export type ListNftsRequest = {
|
|
75
|
+
accountAddress: ComponentAddress;
|
|
76
|
+
limit: number | null;
|
|
77
|
+
offset: number | null;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type ListNftsResponse = {
|
|
81
|
+
nfts: Array<NonFungibleToken>
|
|
82
|
+
};
|
|
@@ -74,16 +74,16 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
74
74
|
|
|
75
75
|
async getSubstate(req: GetSubstateRequest): Promise<Substate> {
|
|
76
76
|
// TODO: Substate address cannot be converted to SubstateId directly - Perhaps we need to change the provider interface
|
|
77
|
-
const {
|
|
78
|
-
if (!
|
|
77
|
+
const { substate_from_remote } = await this.client.substatesGet({ substate_id: req.substate_address });
|
|
78
|
+
if (!substate_from_remote) {
|
|
79
79
|
throw new Error(`Substate not found for address: ${req.substate_address}`);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
return {
|
|
83
|
-
value:
|
|
83
|
+
value: substate_from_remote?.substate,
|
|
84
84
|
address: {
|
|
85
85
|
substate_id: req.substate_address,
|
|
86
|
-
version:
|
|
86
|
+
version: substate_from_remote?.version || 0,
|
|
87
87
|
},
|
|
88
88
|
};
|
|
89
89
|
}
|
|
@@ -14,6 +14,8 @@ import {
|
|
|
14
14
|
Substate,
|
|
15
15
|
ListSubstatesResponse,
|
|
16
16
|
ListSubstatesRequest,
|
|
17
|
+
ListNftsResponse,
|
|
18
|
+
ListNftsRequest,
|
|
17
19
|
} from "@tari-project/tarijs-types";
|
|
18
20
|
import {
|
|
19
21
|
AccountGetResponse,
|
|
@@ -21,8 +23,6 @@ import {
|
|
|
21
23
|
AccountsListResponse,
|
|
22
24
|
ConfidentialViewVaultBalanceRequest,
|
|
23
25
|
KeyBranch,
|
|
24
|
-
ListAccountNftRequest,
|
|
25
|
-
ListAccountNftResponse,
|
|
26
26
|
substateIdToString,
|
|
27
27
|
SubstatesListRequest,
|
|
28
28
|
WalletGetInfoResponse,
|
|
@@ -125,14 +125,14 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
125
125
|
public async createFreeTestCoins(): Promise<AccountData> {
|
|
126
126
|
const res = await this.client.createFreeTestCoins({
|
|
127
127
|
account: { Name: "template_web" },
|
|
128
|
-
amount:
|
|
128
|
+
amount: 1000_000_000,
|
|
129
129
|
max_fee: null,
|
|
130
|
-
key_id: 0,
|
|
131
130
|
});
|
|
132
131
|
return {
|
|
133
132
|
account_id: res.account.key_index,
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
component_address: res.account.component_address,
|
|
134
|
+
wallet_address: res.address,
|
|
135
|
+
// TODO: API for fetching vaults by account
|
|
136
136
|
vaults: [],
|
|
137
137
|
};
|
|
138
138
|
}
|
|
@@ -144,17 +144,16 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
144
144
|
|
|
145
145
|
public async getAccount(): Promise<AccountData> {
|
|
146
146
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
|
147
|
-
const { account,
|
|
148
|
-
const address = typeof account.address === "object" ? account.address.Component : account.address;
|
|
147
|
+
const { account, address } = await this.client.accountsGetDefault({});
|
|
149
148
|
const { balances } = await this.client.accountsGetBalances({
|
|
150
|
-
account: { ComponentAddress:
|
|
149
|
+
account: { ComponentAddress: account.component_address },
|
|
151
150
|
refresh: false,
|
|
152
151
|
});
|
|
153
152
|
|
|
154
153
|
return {
|
|
155
154
|
account_id: account.key_index,
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
component_address: account.component_address,
|
|
156
|
+
wallet_address: address,
|
|
158
157
|
// TODO: should be vaults not resources
|
|
159
158
|
vaults: balances.map((b: any) => ({
|
|
160
159
|
type: b.resource_type,
|
|
@@ -181,16 +180,16 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
181
180
|
}
|
|
182
181
|
|
|
183
182
|
public async getSubstate(substateId: string): Promise<Substate> {
|
|
184
|
-
const {
|
|
185
|
-
if (!
|
|
183
|
+
const { substate_from_remote } = await this.client.substatesGet({ substate_id: substateId });
|
|
184
|
+
if (!substate_from_remote) {
|
|
186
185
|
throw new Error(`Substate not found for address: ${substateId}`);
|
|
187
186
|
}
|
|
188
187
|
|
|
189
188
|
return {
|
|
190
|
-
value:
|
|
189
|
+
value: substate_from_remote?.substate,
|
|
191
190
|
address: {
|
|
192
191
|
substate_id: substateId,
|
|
193
|
-
version:
|
|
192
|
+
version: substate_from_remote?.version || 0,
|
|
194
193
|
},
|
|
195
194
|
};
|
|
196
195
|
}
|
|
@@ -261,7 +260,7 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
261
260
|
} as SubstatesListRequest);
|
|
262
261
|
|
|
263
262
|
const substates = resp.substates.map((s: any) => ({
|
|
264
|
-
substate_id:
|
|
263
|
+
substate_id: substateIdToString(s.substate_id),
|
|
265
264
|
module_name: s.module_name,
|
|
266
265
|
version: s.version,
|
|
267
266
|
template_address: s.template_address,
|
|
@@ -270,7 +269,7 @@ export class WalletDaemonTariSigner implements TariSigner {
|
|
|
270
269
|
return { substates };
|
|
271
270
|
}
|
|
272
271
|
|
|
273
|
-
public async getNftsList(req:
|
|
272
|
+
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
|
274
273
|
return await this.client.nftsList(req);
|
|
275
274
|
}
|
|
276
275
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
AccountData,
|
|
13
13
|
ListSubstatesResponse,
|
|
14
14
|
ListSubstatesRequest,
|
|
15
|
-
SubmitTransactionResponse,
|
|
15
|
+
SubmitTransactionResponse, ListNftsResponse, ListNftsRequest,
|
|
16
16
|
} from "@tari-project/tarijs-types";
|
|
17
17
|
import {
|
|
18
18
|
AccountGetResponse,
|
|
@@ -20,8 +20,6 @@ import {
|
|
|
20
20
|
AccountsListResponse,
|
|
21
21
|
ConfidentialViewVaultBalanceRequest,
|
|
22
22
|
KeyBranch,
|
|
23
|
-
ListAccountNftRequest,
|
|
24
|
-
ListAccountNftResponse,
|
|
25
23
|
substateIdToString,
|
|
26
24
|
TransactionSubmitRequest,
|
|
27
25
|
WalletGetInfoResponse,
|
|
@@ -173,8 +171,8 @@ export class WalletConnectTariSigner implements TariSigner {
|
|
|
173
171
|
|
|
174
172
|
return {
|
|
175
173
|
account_id: account.key_index,
|
|
176
|
-
|
|
177
|
-
public_key,
|
|
174
|
+
component_address: account.address,
|
|
175
|
+
wallet_address: public_key,
|
|
178
176
|
// TODO: should be vaults not resources
|
|
179
177
|
vaults: balances.map((b: any) => ({
|
|
180
178
|
type: b.resource_type,
|
|
@@ -244,8 +242,8 @@ export class WalletConnectTariSigner implements TariSigner {
|
|
|
244
242
|
const res = await this.sendRequest(method, params);
|
|
245
243
|
return {
|
|
246
244
|
account_id: res.account.key_index,
|
|
247
|
-
|
|
248
|
-
|
|
245
|
+
component_address: (res.account.address as { Component: string }).Component,
|
|
246
|
+
wallet_address: res.public_key,
|
|
249
247
|
vaults: [],
|
|
250
248
|
};
|
|
251
249
|
}
|
|
@@ -305,15 +303,15 @@ export class WalletConnectTariSigner implements TariSigner {
|
|
|
305
303
|
return { balances: res.balances as unknown as Map<string, number | null> };
|
|
306
304
|
}
|
|
307
305
|
|
|
308
|
-
public async getNftsList(req:
|
|
306
|
+
public async getNftsList(req: ListNftsRequest): Promise<ListNftsResponse> {
|
|
309
307
|
const method = "tari_getNftsList";
|
|
310
308
|
const params = {
|
|
311
|
-
account: req.
|
|
309
|
+
account: req.accountAddress,
|
|
312
310
|
limit: req.limit,
|
|
313
311
|
offset: req.offset,
|
|
314
312
|
};
|
|
315
313
|
const res = await this.sendRequest(method, params);
|
|
316
|
-
return res as
|
|
314
|
+
return res as ListNftsResponse;
|
|
317
315
|
}
|
|
318
316
|
|
|
319
317
|
public async getWalletInfo(): Promise<WalletGetInfoResponse> {
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -10,7 +10,7 @@ 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.
|
|
13
|
+
"@tari-project/typescript-bindings": ">=1.17.0"
|
|
14
14
|
"@tari-project/wallet_jrpc_client": ^1.7.2
|
|
15
15
|
"@metamask/providers": ^18.2.0
|
|
16
16
|
"@walletconnect/universal-provider": 2.21.3
|