@tari-project/tarijs 0.4.1 → 0.5.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/.github/workflows/ci.yml +2 -1
- package/.github/workflows/documentation-deploy.yml +44 -0
- package/.github/workflows/documentation-test-deploy.yml +20 -0
- package/.moon/workspace.yml +1 -0
- package/README.md +19 -0
- package/TODO.md +2 -6
- package/docusaurus/tari-docs/README.md +41 -0
- package/docusaurus/tari-docs/docs/index.md +21 -0
- package/docusaurus/tari-docs/docs/installation.md +27 -0
- package/docusaurus/tari-docs/docs/providers/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/providers/indexer-provider.md +32 -0
- package/docusaurus/tari-docs/docs/signers/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/signers/tari-universe.md +27 -0
- package/docusaurus/tari-docs/docs/signers/wallet-connect.md +51 -0
- package/docusaurus/tari-docs/docs/signers/wallet-daemon.md +37 -0
- package/docusaurus/tari-docs/docs/wallet/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/default-account.md +51 -0
- package/docusaurus/tari-docs/docs/wallet/get-substate.md +110 -0
- package/docusaurus/tari-docs/docs/wallet/list-substates.md +68 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/build-execute-request.md +38 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/index.md +14 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/_category_.json +8 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-function.md +17 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/call-method.md +17 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/fee.md +28 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/index.md +426 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/inputs.md +24 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/instruction.md +108 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/min-max-epoch.md +19 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/raw-instructions.md +16 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/save-var.md +63 -0
- package/docusaurus/tari-docs/docs/wallet/submit-transaction/transaction-builder/transaction-internals.md +20 -0
- package/docusaurus/tari-docs/docs/wallet/template-definition.md +101 -0
- package/docusaurus/tari-docs/docusaurus.config.ts +108 -0
- package/docusaurus/tari-docs/moon.yml +41 -0
- package/docusaurus/tari-docs/package.json +49 -0
- package/docusaurus/tari-docs/sidebars.ts +7 -0
- package/docusaurus/tari-docs/src/components/HomepageFeatures/index.tsx +69 -0
- package/docusaurus/tari-docs/src/components/HomepageFeatures/styles.module.css +11 -0
- package/docusaurus/tari-docs/src/css/custom.css +30 -0
- package/docusaurus/tari-docs/src/pages/index.module.css +23 -0
- package/docusaurus/tari-docs/src/pages/index.tsx +44 -0
- package/docusaurus/tari-docs/static/.nojekyll +0 -0
- package/docusaurus/tari-docs/static/img/favicon.png +0 -0
- package/docusaurus/tari-docs/static/img/meta-image.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-1.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-2.png +0 -0
- package/docusaurus/tari-docs/static/img/tari/wallet-connect-3.png +0 -0
- package/docusaurus/tari-docs/static/img/tari-logo.svg +30 -0
- package/docusaurus/tari-docs/tsconfig.json +10 -0
- package/package.json +1 -1
- package/packages/builders/package.json +3 -3
- package/packages/builders/src/helpers/submitTransaction.ts +8 -8
- package/packages/builders/tsconfig.json +2 -4
- package/packages/indexer_provider/package.json +31 -0
- package/packages/indexer_provider/src/index.ts +2 -0
- package/packages/indexer_provider/src/provider.ts +105 -0
- package/packages/indexer_provider/src/transports/IndexerProviderClient.ts +144 -0
- package/packages/indexer_provider/src/transports/fetch.ts +46 -0
- package/packages/indexer_provider/src/transports/index.ts +3 -0
- package/packages/indexer_provider/src/transports/rpc.ts +19 -0
- package/packages/indexer_provider/tsconfig.json +22 -0
- package/packages/metamask_signer/moon.yml +55 -0
- package/packages/{metamask_provider → metamask_signer}/package.json +3 -3
- package/packages/{metamask_provider → metamask_signer}/src/index.ts +11 -6
- package/packages/metamask_signer/tsconfig.json +19 -0
- package/packages/tari_permissions/package.json +2 -3
- package/packages/tari_permissions/src/helpers.ts +33 -0
- package/packages/tari_permissions/src/index.ts +2 -1
- package/packages/tari_permissions/src/tari_permissions.ts +59 -42
- package/packages/tari_provider/package.json +1 -1
- package/packages/tari_provider/src/TariProvider.ts +7 -23
- package/packages/tari_provider/src/index.ts +1 -2
- package/packages/tari_provider/src/types.ts +38 -24
- package/packages/tari_signer/moon.yml +55 -0
- package/packages/tari_signer/package.json +28 -0
- package/packages/tari_signer/src/TariSigner.ts +35 -0
- package/packages/tari_signer/src/index.ts +2 -0
- package/packages/tari_signer/src/types.ts +84 -0
- package/packages/{metamask_provider → tari_signer}/tsconfig.json +0 -3
- package/packages/tari_universe/package.json +3 -3
- package/packages/tari_universe/src/index.ts +1 -1
- package/packages/tari_universe/src/{provider.ts → signer.ts} +32 -33
- package/packages/tari_universe/src/types.ts +15 -10
- package/packages/tari_universe/src/utils.ts +8 -8
- package/packages/tari_universe/tsconfig.json +2 -4
- package/packages/tarijs/integration-tests/wallet_daemon/json_rpc_provider.spec.ts +44 -44
- package/packages/tarijs/moon.yml +8 -0
- package/packages/tarijs/package.json +9 -6
- package/packages/tarijs/src/cbor.spec.ts +259 -0
- package/packages/tarijs/src/cbor.ts +114 -0
- package/packages/tarijs/src/index.ts +31 -15
- package/packages/tarijs/tsconfig.json +7 -1
- package/packages/tarijs_types/package.json +1 -1
- package/packages/tarijs_types/src/helpers/index.ts +62 -0
- package/packages/tarijs_types/src/index.ts +12 -1
- package/packages/wallet_daemon/package.json +4 -3
- package/packages/wallet_daemon/src/index.ts +1 -1
- package/packages/wallet_daemon/src/{provider.ts → signer.ts} +45 -47
- package/packages/wallet_daemon/tsconfig.json +4 -1
- package/packages/walletconnect/package.json +4 -3
- package/packages/walletconnect/src/index.ts +42 -43
- package/packages/walletconnect/tsconfig.json +4 -1
- package/pnpm-workspace.yaml +4 -3
- package/tsconfig.json +11 -2
- /package/packages/{metamask_provider → indexer_provider}/moon.yml +0 -0
- /package/packages/{metamask_provider → metamask_signer}/src/utils.ts +0 -0
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { TariPermissions } from "@tari-project/tari-permissions";
|
|
2
2
|
import { TariConnection } from "./webrtc";
|
|
3
|
-
import { TariProvider } from "@tari-project/tari-provider";
|
|
4
3
|
import {
|
|
5
4
|
SubmitTransactionRequest,
|
|
6
5
|
TransactionResult,
|
|
7
|
-
TransactionStatus,
|
|
8
6
|
SubmitTransactionResponse,
|
|
9
|
-
VaultBalances,
|
|
7
|
+
VaultBalances,
|
|
8
|
+
TemplateDefinition,
|
|
9
|
+
Substate,
|
|
10
10
|
ListSubstatesResponse,
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
TariSigner,
|
|
12
|
+
} from "@tari-project/tari-signer";
|
|
13
|
+
import { Account } from "@tari-project/tari-signer";
|
|
13
14
|
import {
|
|
14
15
|
WalletDaemonClient,
|
|
15
16
|
substateIdToString,
|
|
@@ -18,30 +19,33 @@ import {
|
|
|
18
19
|
SubstatesListRequest,
|
|
19
20
|
KeyBranch,
|
|
20
21
|
SubstateId,
|
|
22
|
+
ListAccountNftRequest,
|
|
23
|
+
ListAccountNftResponse,
|
|
21
24
|
} from "@tari-project/wallet_jrpc_client";
|
|
22
25
|
import { WebRtcRpcTransport } from "./webrtc_transport";
|
|
26
|
+
import { convertStringToTransactionStatus } from "@tari-project/tarijs-types";
|
|
23
27
|
|
|
24
28
|
export const WalletDaemonNotConnected = "WALLET_DAEMON_NOT_CONNECTED";
|
|
25
29
|
export const Unsupported = "UNSUPPORTED";
|
|
26
30
|
|
|
27
31
|
export interface WalletDaemonBaseParameters {
|
|
28
|
-
permissions: TariPermissions
|
|
29
|
-
optionalPermissions?: TariPermissions
|
|
30
|
-
onConnection?: () => void
|
|
32
|
+
permissions: TariPermissions;
|
|
33
|
+
optionalPermissions?: TariPermissions;
|
|
34
|
+
onConnection?: () => void;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
37
|
export interface WalletDaemonParameters extends WalletDaemonBaseParameters {
|
|
34
|
-
signalingServerUrl?: string
|
|
35
|
-
webRtcConfig?: RTCConfiguration
|
|
36
|
-
name?: string
|
|
37
|
-
}
|
|
38
|
+
signalingServerUrl?: string;
|
|
39
|
+
webRtcConfig?: RTCConfiguration;
|
|
40
|
+
name?: string;
|
|
41
|
+
}
|
|
38
42
|
|
|
39
43
|
export interface WalletDaemonFetchParameters extends WalletDaemonBaseParameters {
|
|
40
|
-
serverUrl: string
|
|
44
|
+
serverUrl: string;
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
export class
|
|
44
|
-
public
|
|
47
|
+
export class WalletDaemonTariSigner implements TariSigner {
|
|
48
|
+
public signerName = "WalletDaemon";
|
|
45
49
|
params: WalletDaemonParameters;
|
|
46
50
|
client: WalletDaemonClient;
|
|
47
51
|
|
|
@@ -50,8 +54,8 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
50
54
|
this.client = connection;
|
|
51
55
|
}
|
|
52
56
|
|
|
53
|
-
static async build(params: WalletDaemonParameters): Promise<
|
|
54
|
-
const allPermissions =
|
|
57
|
+
static async build(params: WalletDaemonParameters): Promise<WalletDaemonTariSigner> {
|
|
58
|
+
const allPermissions = WalletDaemonTariSigner.buildPermissions(params);
|
|
55
59
|
let connection = new TariConnection(params.signalingServerUrl, params.webRtcConfig);
|
|
56
60
|
const client = WalletDaemonClient.new(WebRtcRpcTransport.new(connection));
|
|
57
61
|
await connection.init(allPermissions, (conn) => {
|
|
@@ -60,19 +64,19 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
60
64
|
client.setToken(conn.token);
|
|
61
65
|
}
|
|
62
66
|
});
|
|
63
|
-
return new
|
|
67
|
+
return new WalletDaemonTariSigner(params, client);
|
|
64
68
|
}
|
|
65
69
|
|
|
66
|
-
static async
|
|
67
|
-
const allPermissions =
|
|
70
|
+
static async buildFetchSigner(params: WalletDaemonFetchParameters) {
|
|
71
|
+
const allPermissions = WalletDaemonTariSigner.buildPermissions(params);
|
|
68
72
|
const client = WalletDaemonClient.usingFetchTransport(params.serverUrl);
|
|
69
73
|
|
|
70
|
-
const plainPermissions = allPermissions.toJSON().flatMap((p) => typeof
|
|
74
|
+
const plainPermissions = allPermissions.toJSON().flatMap((p) => (typeof p === "string" ? [p] : []));
|
|
71
75
|
const authResponse = await client.authRequest(plainPermissions);
|
|
72
76
|
await client.authAccept(authResponse, "WalletDaemon");
|
|
73
77
|
|
|
74
78
|
params.onConnection?.();
|
|
75
|
-
return new
|
|
79
|
+
return new WalletDaemonTariSigner(params, client);
|
|
76
80
|
}
|
|
77
81
|
|
|
78
82
|
private static buildPermissions(params: WalletDaemonBaseParameters): TariPermissions {
|
|
@@ -98,7 +102,7 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
98
102
|
return undefined;
|
|
99
103
|
}
|
|
100
104
|
|
|
101
|
-
const name = this.params.name && encodeURIComponent(this.params.name) || "";
|
|
105
|
+
const name = (this.params.name && encodeURIComponent(this.params.name)) || "";
|
|
102
106
|
const token = this.token;
|
|
103
107
|
const permissions = JSON.stringify(this.params.permissions);
|
|
104
108
|
const optionalPermissions = JSON.stringify(this.params.optionalPermissions);
|
|
@@ -126,7 +130,7 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
126
130
|
}
|
|
127
131
|
|
|
128
132
|
public async getAccount(): Promise<Account> {
|
|
129
|
-
const { account, public_key } = await this.client.accountsGetDefault({}) as any;
|
|
133
|
+
const { account, public_key } = (await this.client.accountsGetDefault({})) as any;
|
|
130
134
|
const address = typeof account.address === "object" ? account.address.Component : account.address;
|
|
131
135
|
const { balances } = await this.client.accountsGetBalances({
|
|
132
136
|
account: { ComponentAddress: address },
|
|
@@ -142,7 +146,8 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
142
146
|
type: b.resource_type,
|
|
143
147
|
resource_address: b.resource_address,
|
|
144
148
|
balance: b.balance + b.confidential_balance,
|
|
145
|
-
vault_id:
|
|
149
|
+
vault_id:
|
|
150
|
+
typeof b.vault_address === "object" && "Vault" in b.vault_address ? b.vault_address.Vault : b.vault_address,
|
|
146
151
|
token_symbol: b.token_symbol,
|
|
147
152
|
})),
|
|
148
153
|
};
|
|
@@ -212,7 +217,12 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
212
217
|
return resp.template_definition as TemplateDefinition;
|
|
213
218
|
}
|
|
214
219
|
|
|
215
|
-
public async getConfidentialVaultBalances(
|
|
220
|
+
public async getConfidentialVaultBalances(
|
|
221
|
+
viewKeyId: number,
|
|
222
|
+
vaultId: string,
|
|
223
|
+
min: number | null = null,
|
|
224
|
+
max: number | null = null,
|
|
225
|
+
): Promise<VaultBalances> {
|
|
216
226
|
const res = await this.client.viewVaultBalance({
|
|
217
227
|
view_key_id: viewKeyId,
|
|
218
228
|
vault_id: vaultId,
|
|
@@ -222,7 +232,12 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
222
232
|
return { balances: res.balances as unknown as Map<string, number | null> };
|
|
223
233
|
}
|
|
224
234
|
|
|
225
|
-
public async listSubstates(
|
|
235
|
+
public async listSubstates(
|
|
236
|
+
filter_by_template: string | null,
|
|
237
|
+
filter_by_type: SubstateType | null,
|
|
238
|
+
limit: number | null,
|
|
239
|
+
offset: number | null,
|
|
240
|
+
): Promise<ListSubstatesResponse> {
|
|
226
241
|
const resp = await this.client.substatesList({
|
|
227
242
|
filter_by_template,
|
|
228
243
|
filter_by_type,
|
|
@@ -239,25 +254,8 @@ export class WalletDaemonTariProvider implements TariProvider {
|
|
|
239
254
|
|
|
240
255
|
return { substates };
|
|
241
256
|
}
|
|
242
|
-
}
|
|
243
257
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
case "New":
|
|
247
|
-
return TransactionStatus.New;
|
|
248
|
-
case "DryRun":
|
|
249
|
-
return TransactionStatus.DryRun;
|
|
250
|
-
case "Pending":
|
|
251
|
-
return TransactionStatus.Pending;
|
|
252
|
-
case "Accepted":
|
|
253
|
-
return TransactionStatus.Accepted;
|
|
254
|
-
case "Rejected":
|
|
255
|
-
return TransactionStatus.Rejected;
|
|
256
|
-
case "InvalidTransaction":
|
|
257
|
-
return TransactionStatus.InvalidTransaction;
|
|
258
|
-
case "OnlyFeeAccepted":
|
|
259
|
-
return TransactionStatus.OnlyFeeAccepted;
|
|
260
|
-
default:
|
|
261
|
-
throw new Error(`Unknown status: ${status}`);
|
|
258
|
+
public async getNftsList(req: ListAccountNftRequest): Promise<ListAccountNftResponse> {
|
|
259
|
+
return await this.client.nftsList(req);
|
|
262
260
|
}
|
|
263
|
-
}
|
|
261
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "@tari-project/wallet-connect-
|
|
3
|
-
"version": "0.
|
|
2
|
+
"name": "@tari-project/wallet-connect-signer",
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@tari-project/tari-
|
|
16
|
+
"@tari-project/tari-signer": "workspace:^",
|
|
17
17
|
"@tari-project/tarijs-builders": "workspace:^",
|
|
18
|
+
"@tari-project/tarijs-types": "workspace:^",
|
|
18
19
|
"@tari-project/typescript-bindings": "catalog:",
|
|
19
20
|
"@tari-project/wallet_jrpc_client": "catalog:",
|
|
20
21
|
"@walletconnect/modal": "catalog:",
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
TariSigner,
|
|
3
|
+
SubmitTransactionRequest,
|
|
3
4
|
TransactionResult,
|
|
4
5
|
SubmitTransactionResponse,
|
|
5
|
-
VaultBalances,
|
|
6
|
+
VaultBalances,
|
|
7
|
+
TemplateDefinition,
|
|
8
|
+
Substate,
|
|
6
9
|
Account,
|
|
7
10
|
ListSubstatesResponse,
|
|
8
|
-
} from "@tari-project/tari-
|
|
9
|
-
import {
|
|
10
|
-
TransactionStatus,
|
|
11
|
-
} from "@tari-project/tarijs-builders";
|
|
11
|
+
} from "@tari-project/tari-signer";
|
|
12
12
|
import UniversalProvider from "@walletconnect/universal-provider";
|
|
13
13
|
import { WalletConnectModal } from "@walletconnect/modal";
|
|
14
14
|
import {
|
|
15
15
|
Instruction,
|
|
16
16
|
KeyBranch,
|
|
17
|
+
ListAccountNftRequest,
|
|
18
|
+
ListAccountNftResponse,
|
|
17
19
|
stringToSubstateId,
|
|
18
20
|
substateIdToString,
|
|
19
21
|
SubstateType,
|
|
20
22
|
TransactionSubmitRequest,
|
|
21
23
|
} from "@tari-project/wallet_jrpc_client";
|
|
24
|
+
import { convertStringToTransactionStatus } from "@tari-project/tarijs-types";
|
|
22
25
|
|
|
23
26
|
const walletConnectParams = {
|
|
24
27
|
requiredNamespaces: {
|
|
@@ -34,17 +37,16 @@ const walletConnectParams = {
|
|
|
34
37
|
"tari_viewConfidentialVaultBalance",
|
|
35
38
|
"tari_createFreeTestCoins",
|
|
36
39
|
"tari_listSubstates",
|
|
40
|
+
"tari_getNftsList",
|
|
37
41
|
],
|
|
38
|
-
chains: [
|
|
39
|
-
|
|
40
|
-
],
|
|
41
|
-
events: ["chainChanged\", \"accountsChanged"],
|
|
42
|
+
chains: ["tari:devnet"],
|
|
43
|
+
events: ['chainChanged", "accountsChanged'],
|
|
42
44
|
},
|
|
43
45
|
},
|
|
44
46
|
};
|
|
45
47
|
|
|
46
|
-
export class
|
|
47
|
-
public
|
|
48
|
+
export class WalletConnectTariSigner implements TariSigner {
|
|
49
|
+
public signerName = "WalletConnect";
|
|
48
50
|
projectId: string;
|
|
49
51
|
wcProvider: UniversalProvider | null;
|
|
50
52
|
wcSession: any | null;
|
|
@@ -56,8 +58,7 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
56
58
|
}
|
|
57
59
|
|
|
58
60
|
async connect(): Promise<void> {
|
|
59
|
-
if (this.wcProvider && this.wcSession)
|
|
60
|
-
return;
|
|
61
|
+
if (this.wcProvider && this.wcSession) return;
|
|
61
62
|
|
|
62
63
|
// initialize WalletConnect
|
|
63
64
|
const projectId = this.projectId;
|
|
@@ -109,7 +110,6 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
109
110
|
return requestResult;
|
|
110
111
|
}
|
|
111
112
|
|
|
112
|
-
|
|
113
113
|
isConnected(): boolean {
|
|
114
114
|
// TODO: check status in the session
|
|
115
115
|
return this.wcSession !== null;
|
|
@@ -117,11 +117,10 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
117
117
|
|
|
118
118
|
async getAccount(): Promise<Account> {
|
|
119
119
|
const { account, public_key } = await this.sendRequest("tari_getDefaultAccount", {});
|
|
120
|
-
const { balances } = await this.sendRequest(
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
});
|
|
120
|
+
const { balances } = await this.sendRequest("tari_getAccountBalances", {
|
|
121
|
+
account: { ComponentAddress: account.address },
|
|
122
|
+
refresh: false,
|
|
123
|
+
});
|
|
125
124
|
|
|
126
125
|
return {
|
|
127
126
|
account_id: account.key_index,
|
|
@@ -132,7 +131,8 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
132
131
|
type: b.resource_type,
|
|
133
132
|
resource_address: b.resource_address,
|
|
134
133
|
balance: b.balance + b.confidential_balance,
|
|
135
|
-
vault_id:
|
|
134
|
+
vault_id:
|
|
135
|
+
typeof b.vault_address === "object" && "Vault" in b.vault_address ? b.vault_address.Vault : b.vault_address,
|
|
136
136
|
token_symbol: b.token_symbol,
|
|
137
137
|
})),
|
|
138
138
|
};
|
|
@@ -151,7 +151,12 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
151
151
|
};
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
public async listSubstates(
|
|
154
|
+
public async listSubstates(
|
|
155
|
+
filter_by_template: string | null,
|
|
156
|
+
filter_by_type: SubstateType | null,
|
|
157
|
+
limit: number | null,
|
|
158
|
+
offset: number | null,
|
|
159
|
+
): Promise<ListSubstatesResponse> {
|
|
155
160
|
const method = "tari_listSubstates";
|
|
156
161
|
const params = {
|
|
157
162
|
filter_by_template,
|
|
@@ -237,7 +242,12 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
237
242
|
return res.public_key;
|
|
238
243
|
}
|
|
239
244
|
|
|
240
|
-
async getConfidentialVaultBalances(
|
|
245
|
+
async getConfidentialVaultBalances(
|
|
246
|
+
viewKeyId: number,
|
|
247
|
+
vaultId: string,
|
|
248
|
+
min: number | null,
|
|
249
|
+
max: number | null,
|
|
250
|
+
): Promise<VaultBalances> {
|
|
241
251
|
const method = "tari_viewConfidentialVaultBalance";
|
|
242
252
|
const params = {
|
|
243
253
|
view_key_id: viewKeyId,
|
|
@@ -250,25 +260,14 @@ export class WalletConnectTariProvider implements TariProvider {
|
|
|
250
260
|
return { balances: res.balances as unknown as Map<string, number | null> };
|
|
251
261
|
}
|
|
252
262
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
return TransactionStatus.Pending;
|
|
263
|
-
case "Accepted":
|
|
264
|
-
return TransactionStatus.Accepted;
|
|
265
|
-
case "Rejected":
|
|
266
|
-
return TransactionStatus.Rejected;
|
|
267
|
-
case "InvalidTransaction":
|
|
268
|
-
return TransactionStatus.InvalidTransaction;
|
|
269
|
-
case "OnlyFeeAccepted":
|
|
270
|
-
return TransactionStatus.OnlyFeeAccepted;
|
|
271
|
-
default:
|
|
272
|
-
throw new Error(`Unknown status: ${status}`);
|
|
263
|
+
public async getNftsList(req: ListAccountNftRequest): Promise<ListAccountNftResponse> {
|
|
264
|
+
const method = "tari_getNftsList";
|
|
265
|
+
const params = {
|
|
266
|
+
account: req.account,
|
|
267
|
+
limit: req.limit,
|
|
268
|
+
offset: req.offset,
|
|
269
|
+
};
|
|
270
|
+
const res = await this.sendRequest(method, params);
|
|
271
|
+
return res as ListAccountNftResponse;
|
|
273
272
|
}
|
|
274
273
|
}
|
package/pnpm-workspace.yaml
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
packages:
|
|
2
2
|
- packages/*
|
|
3
3
|
- apps/*
|
|
4
|
+
- docusaurus/*
|
|
4
5
|
- "!**/test/**"
|
|
5
6
|
catalog:
|
|
6
7
|
typescript: ^5.0.4
|
|
7
8
|
vitest: ^3.0.4
|
|
8
9
|
vite: ^6.1.0
|
|
9
10
|
"@types/node": ^22.13.1
|
|
10
|
-
"@tari-project/typescript-bindings": ^1.
|
|
11
|
-
"@tari-project/wallet_jrpc_client": ^1.
|
|
11
|
+
"@tari-project/typescript-bindings": ^1.5.1
|
|
12
|
+
"@tari-project/wallet_jrpc_client": ^1.5.1
|
|
12
13
|
"@metamask/providers": ^18.2.0
|
|
13
14
|
"@walletconnect/universal-provider": ^2.13.3
|
|
14
|
-
"@walletconnect/modal": ^2.6.2
|
|
15
|
+
"@walletconnect/modal": ^2.6.2
|
package/tsconfig.json
CHANGED
|
@@ -8,11 +8,17 @@
|
|
|
8
8
|
"composite": true
|
|
9
9
|
},
|
|
10
10
|
"references": [
|
|
11
|
+
{
|
|
12
|
+
"path": "docusaurus/tari-docs"
|
|
13
|
+
},
|
|
11
14
|
{
|
|
12
15
|
"path": "packages/builders"
|
|
13
16
|
},
|
|
14
17
|
{
|
|
15
|
-
"path": "packages/
|
|
18
|
+
"path": "packages/indexer_provider"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "packages/metamask_signer"
|
|
16
22
|
},
|
|
17
23
|
{
|
|
18
24
|
"path": "packages/tari_permissions"
|
|
@@ -20,6 +26,9 @@
|
|
|
20
26
|
{
|
|
21
27
|
"path": "packages/tari_provider"
|
|
22
28
|
},
|
|
29
|
+
{
|
|
30
|
+
"path": "packages/tari_signer"
|
|
31
|
+
},
|
|
23
32
|
{
|
|
24
33
|
"path": "packages/tari_universe"
|
|
25
34
|
},
|
|
@@ -30,7 +39,7 @@
|
|
|
30
39
|
"path": "packages/tarijs_types"
|
|
31
40
|
},
|
|
32
41
|
{
|
|
33
|
-
"path": "packages/
|
|
42
|
+
"path": "packages/tarijs_types"
|
|
34
43
|
},
|
|
35
44
|
{
|
|
36
45
|
"path": "packages/wallet_daemon"
|
|
File without changes
|
|
File without changes
|