@tari-project/tarijs 0.1.20 → 0.1.21
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/package.json +8 -11
- package/dist/index.js +0 -1063
- package/dist/index.js.map +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/index.d.ts +0 -111
- package/dist/node_modules/@tari-project/typescript-bindings/src/helpers/helpers.d.ts +0 -11
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/AccessRule.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Account.d.ts +0 -7
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Amount.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Arg.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ArgDef.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/AuthHook.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Block.d.ts +0 -31
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/BucketId.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Claims.d.ts +0 -7
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Command.d.ts +0 -13
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Committee.d.ts +0 -3
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/CommitteeInfo.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/CommitteeShardInfo.d.ts +0 -10
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ComponentAccessRules.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ComponentAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ComponentBody.d.ts +0 -3
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ComponentHeader.d.ts +0 -13
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ComponentKey.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialClaim.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialOutput.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialOutputStatement.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialStatement.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialTransferInputSelection.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ConfidentialWithdrawProof.d.ts +0 -7
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Decision.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ElgamalVerifiableBalance.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/EntityId.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Epoch.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Event.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Evidence.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ExecuteResult.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ExecutedTransaction.d.ts +0 -21
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeBreakdown.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeClaim.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeClaimAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeCostBreakdown.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeReceipt.d.ts +0 -7
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FeeSource.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FinalizeResult.d.ts +0 -13
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ForeignProposal.d.ts +0 -10
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ForeignProposalState.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/FunctionDef.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/IndexedValue.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/IndexedWellKnownTypes.d.ts +0 -18
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Instruction.d.ts +0 -40
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/InstructionResult.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/JrpcPermission.d.ts +0 -14
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/JrpcPermissions.d.ts +0 -2
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/LeaderFee.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/LockFlag.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/LogEntry.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/LogLevel.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Metadata.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NetworkCommitteeInfo.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NodeHeight.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungible.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleAddressContents.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleContainer.d.ts +0 -2
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleId.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleIndex.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleIndexAddress.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/NonFungibleToken.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Ordering.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/OwnerRule.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/PeerAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ProofId.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/QuorumCertificate.d.ts +0 -15
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/QuorumDecision.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/RejectReason.d.ts +0 -11
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/RequireRule.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Resource.d.ts +0 -16
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ResourceAccessRules.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ResourceAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ResourceContainer.d.ts +0 -25
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ResourceType.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/RestrictedAccessRule.d.ts +0 -8
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/RuleRequirement.d.ts +0 -12
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Shard.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ShardEvidence.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Substate.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateDestroyed.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateDiff.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateId.d.ts +0 -24
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateLockFlag.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateRecord.d.ts +0 -19
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateRequirement.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateType.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/SubstateValue.d.ts +0 -25
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TemplateDef.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TemplateDefV1.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Transaction.d.ts +0 -15
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionAtom.d.ts +0 -10
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionPoolRecord.d.ts +0 -16
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionPoolStage.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionReceipt.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionReceiptAddress.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionResult.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionSignature.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/TransactionStatus.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Type.d.ts +0 -9
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/UnclaimedConfidentialOutput.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/UnsignedTransaction.d.ts +0 -10
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ValidatorSignature.d.ts +0 -7
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/Vault.d.ts +0 -4
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/VaultId.d.ts +0 -1
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/VersionedSubstateId.d.ts +0 -5
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/VersionedSubstateIdLockIntent.d.ts +0 -6
- package/dist/node_modules/@tari-project/typescript-bindings/src/types/ViewableBalanceProof.d.ts +0 -10
- package/dist/src/index.d.ts +0 -9
- package/dist/src/providers/index.d.ts +0 -16
- package/dist/src/providers/metamask/index.d.ts +0 -30
- package/dist/src/providers/metamask/utils.d.ts +0 -38
- package/dist/src/providers/tari_universe/index.d.ts +0 -3
- package/dist/src/providers/tari_universe/provider.d.ts +0 -23
- package/dist/src/providers/tari_universe/types.d.ts +0 -30
- package/dist/src/providers/types.d.ts +0 -65
- package/dist/src/providers/wallet_daemon/index.d.ts +0 -3
- package/dist/src/providers/wallet_daemon/provider.d.ts +0 -35
- package/dist/src/providers/wallet_daemon/tari_permissions.d.ts +0 -216
- package/dist/src/providers/wallet_daemon/webrtc.d.ts +0 -20
- package/dist/src/providers/wallet_daemon/webrtc_transport.d.ts +0 -10
- package/dist/src/utils.d.ts +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type VaultId = string;
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { TariProvider } from "./providers";
|
|
2
|
-
import * as utils from "./utils";
|
|
3
|
-
import { Account, TransactionStatus, TransactionResult, SubmitTransactionResponse, SubmitTransactionRequest, VaultBalances, VaultData, TemplateDefinition, SubstateRequirement, Substate } from "./providers/types";
|
|
4
|
-
import { MetamaskTariProvider } from "./providers/metamask";
|
|
5
|
-
import { MetaMaskInpageProvider } from "@metamask/providers";
|
|
6
|
-
import { WalletDaemonTariProvider, WalletDaemonParameters, TariPermissions } from "./providers/wallet_daemon";
|
|
7
|
-
import { TariUniverseProvider, TariUniverseProviderParameters } from "./providers/tari_universe";
|
|
8
|
-
import * as permissions from "./providers/wallet_daemon";
|
|
9
|
-
export { utils, TariProvider, Account, TransactionStatus, TransactionResult, SubmitTransactionResponse, SubmitTransactionRequest, VaultBalances, VaultData, TemplateDefinition, SubstateRequirement, MetamaskTariProvider, WalletDaemonTariProvider, WalletDaemonParameters, TariUniverseProvider, TariUniverseProviderParameters, TariPermissions, MetaMaskInpageProvider, Substate, permissions, };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { SubstateType } from "@tari-project/typescript-bindings";
|
|
2
|
-
import { Account, SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse } from "./types";
|
|
3
|
-
import { ProviderMethods, ProviderMethodNames, ProviderReturnType } from "./tari_universe/types";
|
|
4
|
-
export type { Account, SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse, ProviderMethods, ProviderMethodNames, ProviderReturnType, };
|
|
5
|
-
export interface TariProvider {
|
|
6
|
-
providerName: string;
|
|
7
|
-
isConnected(): boolean;
|
|
8
|
-
getAccount(): Promise<Account>;
|
|
9
|
-
getSubstate(substate_address: string): Promise<Substate>;
|
|
10
|
-
submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
|
|
11
|
-
getTransactionResult(transactionId: string): Promise<TransactionResult>;
|
|
12
|
-
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
13
|
-
getPublicKey(branch: string, index: number): Promise<string>;
|
|
14
|
-
getConfidentialVaultBalances(viewKeyId: number, vaultId: string, min: number | null, max: number | null): Promise<VaultBalances>;
|
|
15
|
-
listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
|
|
16
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TariProvider } from "../index";
|
|
2
|
-
import { SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse } from "../types";
|
|
3
|
-
import { MetaMaskInpageProvider } from '@metamask/providers';
|
|
4
|
-
import { Snap } from "./utils";
|
|
5
|
-
import { Account } from "../types";
|
|
6
|
-
import { SubstateType } from "@tari-project/typescript-bindings";
|
|
7
|
-
export declare const MetamaskNotInstalled = "METAMASK_NOT_INSTALLED";
|
|
8
|
-
export declare const MetamaskIsNotFlask = "METAMASK_IS_NOT_FLASK";
|
|
9
|
-
export declare const TariSnapNotInstalled = "TARI_SNAP_NOT_INSTALLED";
|
|
10
|
-
export declare class MetamaskTariProvider implements TariProvider {
|
|
11
|
-
providerName: string;
|
|
12
|
-
snapId: string;
|
|
13
|
-
snapVersion: string | undefined;
|
|
14
|
-
metamask: MetaMaskInpageProvider;
|
|
15
|
-
snap?: Snap;
|
|
16
|
-
metamaskConnected: boolean;
|
|
17
|
-
constructor(snapId: string, metamask: MetaMaskInpageProvider);
|
|
18
|
-
connect(): Promise<void>;
|
|
19
|
-
isConnected(): boolean;
|
|
20
|
-
createFreeTestCoins(account_id: number): Promise<Account>;
|
|
21
|
-
getAccount(): Promise<Account>;
|
|
22
|
-
getSubstate(substate_address: string): Promise<Substate>;
|
|
23
|
-
listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
|
|
24
|
-
submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
|
|
25
|
-
getTransactionResult(transactionId: string): Promise<TransactionResult>;
|
|
26
|
-
getPublicKey(_branch: string, index: number): Promise<string>;
|
|
27
|
-
getConfidentialVaultBalances(viewKeyId: number, vaultId: string, min?: number | null, max?: number | null): Promise<VaultBalances>;
|
|
28
|
-
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
29
|
-
private metamaskRequest;
|
|
30
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { MetaMaskInpageProvider } from '@metamask/providers';
|
|
2
|
-
export type GetSnapsResponse = Record<string, Snap>;
|
|
3
|
-
export type Snap = {
|
|
4
|
-
permissionName: string;
|
|
5
|
-
id: string;
|
|
6
|
-
version: string;
|
|
7
|
-
initialPermissions: Record<string, unknown>;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Get the installed snaps in MetaMask.
|
|
11
|
-
*
|
|
12
|
-
* @param provider - The MetaMask inpage provider.
|
|
13
|
-
* @returns The snaps installed in MetaMask.
|
|
14
|
-
*/
|
|
15
|
-
export declare const getSnaps: (provider: MetaMaskInpageProvider) => Promise<GetSnapsResponse>;
|
|
16
|
-
/**
|
|
17
|
-
* Connect a snap to MetaMask.
|
|
18
|
-
*
|
|
19
|
-
* @param snapId - The ID of the snap.
|
|
20
|
-
* @param params - The params to pass with the snap to connect.
|
|
21
|
-
*/
|
|
22
|
-
export declare const connectSnap: (provider: MetaMaskInpageProvider, snaps: Record<string, {
|
|
23
|
-
version?: string;
|
|
24
|
-
}>) => Promise<void>;
|
|
25
|
-
/**
|
|
26
|
-
* Get the snap from MetaMask.
|
|
27
|
-
*
|
|
28
|
-
* @param version - The version of the snap to install (optional).
|
|
29
|
-
* @returns The snap object returned by the extension.
|
|
30
|
-
*/
|
|
31
|
-
export declare const getSnap: (provider: MetaMaskInpageProvider, snapId: string, version?: string) => Promise<Snap | undefined>;
|
|
32
|
-
export declare const isLocalSnap: (snapId: string) => boolean;
|
|
33
|
-
/**
|
|
34
|
-
* Detect if the wallet injecting the ethereum object is MetaMask Flask.
|
|
35
|
-
*
|
|
36
|
-
* @returns True if the MetaMask version is Flask, false otherwise.
|
|
37
|
-
*/
|
|
38
|
-
export declare const isFlask: (provider: MetaMaskInpageProvider) => Promise<boolean>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, Account, Substate, TemplateDefinition, VaultBalances, ListSubstatesResponse } from "../types";
|
|
2
|
-
import { TariUniverseProviderParameters, WindowSize } from "./types";
|
|
3
|
-
import { TariProvider } from "../index";
|
|
4
|
-
import { AccountsGetBalancesResponse, SubstateType } from "@tari-project/wallet_jrpc_client";
|
|
5
|
-
export declare class TariUniverseProvider implements TariProvider {
|
|
6
|
-
params: TariUniverseProviderParameters;
|
|
7
|
-
providerName: string;
|
|
8
|
-
private __id;
|
|
9
|
-
constructor(params: TariUniverseProviderParameters);
|
|
10
|
-
private sendRequest;
|
|
11
|
-
isConnected(): boolean;
|
|
12
|
-
getPublicKey(): Promise<string>;
|
|
13
|
-
listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
|
|
14
|
-
getConfidentialVaultBalances(viewKeyId: number, vaultId: string, min: number | null, max: number | null): Promise<VaultBalances>;
|
|
15
|
-
createFreeTestCoins(): Promise<void>;
|
|
16
|
-
requestParentSize(): Promise<WindowSize>;
|
|
17
|
-
getAccount(): Promise<Account>;
|
|
18
|
-
getAccountBalances(componentAddress: string): Promise<AccountsGetBalancesResponse>;
|
|
19
|
-
getSubstate(substate_id: string): Promise<Substate>;
|
|
20
|
-
submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
|
|
21
|
-
getTransactionResult(transactionId: string): Promise<TransactionResult>;
|
|
22
|
-
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
23
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { TariPermissions } from "../wallet_daemon";
|
|
2
|
-
import { TariUniverseProvider } from "./provider";
|
|
3
|
-
export type TariUniverseProviderParameters = {
|
|
4
|
-
permissions: TariPermissions;
|
|
5
|
-
optionalPermissions: TariPermissions;
|
|
6
|
-
name?: string;
|
|
7
|
-
onConnection?: () => void;
|
|
8
|
-
};
|
|
9
|
-
export type WindowSize = {
|
|
10
|
-
width: number;
|
|
11
|
-
height: number;
|
|
12
|
-
};
|
|
13
|
-
export type PickMatching<T, V> = {
|
|
14
|
-
[K in keyof T as T[K] extends V ? K : never]: T[K];
|
|
15
|
-
};
|
|
16
|
-
export type ExtractMethods<T> = PickMatching<T, Function>;
|
|
17
|
-
export type ProviderMethods = ExtractMethods<TariUniverseProvider>;
|
|
18
|
-
export type ProviderMethodNames = keyof ProviderMethods;
|
|
19
|
-
export type ProviderReturnType<T extends ProviderMethodNames> = Awaited<ReturnType<ProviderMethods[T]>>;
|
|
20
|
-
export type ProviderRequest<T extends ProviderMethodNames> = {
|
|
21
|
-
id: number;
|
|
22
|
-
methodName: T;
|
|
23
|
-
args: Parameters<ProviderMethods[T]>;
|
|
24
|
-
};
|
|
25
|
-
export type ProviderResponse<T extends ProviderMethodNames> = {
|
|
26
|
-
id: number;
|
|
27
|
-
type: "provider-call";
|
|
28
|
-
result: ProviderReturnType<T>;
|
|
29
|
-
resultError?: string;
|
|
30
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export type SubstateMetadata = {
|
|
2
|
-
substate_id: string;
|
|
3
|
-
module_name: string | null;
|
|
4
|
-
version: number;
|
|
5
|
-
template_address: string | null;
|
|
6
|
-
};
|
|
7
|
-
export type SubstateRequirement = {
|
|
8
|
-
substate_id: string;
|
|
9
|
-
version?: number | null;
|
|
10
|
-
};
|
|
11
|
-
export type SubmitTransactionRequest = {
|
|
12
|
-
account_id: number;
|
|
13
|
-
instructions: object[];
|
|
14
|
-
fee_instructions: object[];
|
|
15
|
-
inputs: object[];
|
|
16
|
-
input_refs: object[];
|
|
17
|
-
required_substates: SubstateRequirement[];
|
|
18
|
-
is_dry_run: boolean;
|
|
19
|
-
min_epoch: number | null;
|
|
20
|
-
max_epoch: number | null;
|
|
21
|
-
};
|
|
22
|
-
export type SubmitTransactionResponse = {
|
|
23
|
-
transaction_id: string;
|
|
24
|
-
};
|
|
25
|
-
export type TransactionResult = {
|
|
26
|
-
transaction_id: string;
|
|
27
|
-
status: TransactionStatus;
|
|
28
|
-
result: object | null;
|
|
29
|
-
};
|
|
30
|
-
export declare enum TransactionStatus {
|
|
31
|
-
New = 0,
|
|
32
|
-
DryRun = 1,
|
|
33
|
-
Pending = 2,
|
|
34
|
-
Accepted = 3,
|
|
35
|
-
Rejected = 4,
|
|
36
|
-
InvalidTransaction = 5,
|
|
37
|
-
OnlyFeeAccepted = 6
|
|
38
|
-
}
|
|
39
|
-
export interface Account {
|
|
40
|
-
account_id: number;
|
|
41
|
-
address: string;
|
|
42
|
-
public_key: string;
|
|
43
|
-
resources: VaultData[];
|
|
44
|
-
}
|
|
45
|
-
export interface VaultData {
|
|
46
|
-
type: string;
|
|
47
|
-
balance: number;
|
|
48
|
-
resource_address: string;
|
|
49
|
-
}
|
|
50
|
-
export interface VaultBalances {
|
|
51
|
-
balances: Map<string, number | null>;
|
|
52
|
-
}
|
|
53
|
-
export interface TemplateDefinition {
|
|
54
|
-
[key: string]: any;
|
|
55
|
-
}
|
|
56
|
-
export interface Substate {
|
|
57
|
-
value: any;
|
|
58
|
-
address: {
|
|
59
|
-
substate_id: string;
|
|
60
|
-
version: number;
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
export type ListSubstatesResponse = {
|
|
64
|
-
substates: Array<SubstateMetadata>;
|
|
65
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { TariPermissions } from "./tari_permissions";
|
|
2
|
-
import { TariProvider } from '../index';
|
|
3
|
-
import { SubmitTransactionRequest, TransactionResult, SubmitTransactionResponse, VaultBalances, TemplateDefinition, Substate, ListSubstatesResponse } from "../types";
|
|
4
|
-
import { Account } from "../types";
|
|
5
|
-
import { WalletDaemonClient, SubstateType } from "@tari-project/wallet_jrpc_client";
|
|
6
|
-
export declare const WalletDaemonNotConnected = "WALLET_DAEMON_NOT_CONNECTED";
|
|
7
|
-
export declare const Unsupported = "UNSUPPORTED";
|
|
8
|
-
export type WalletDaemonParameters = {
|
|
9
|
-
signalingServerUrl?: string;
|
|
10
|
-
permissions: TariPermissions;
|
|
11
|
-
optionalPermissions: TariPermissions;
|
|
12
|
-
webRtcConfig?: RTCConfiguration;
|
|
13
|
-
name?: string;
|
|
14
|
-
onConnection?: () => void;
|
|
15
|
-
};
|
|
16
|
-
export declare class WalletDaemonTariProvider implements TariProvider {
|
|
17
|
-
providerName: string;
|
|
18
|
-
params: WalletDaemonParameters;
|
|
19
|
-
client: WalletDaemonClient;
|
|
20
|
-
private constructor();
|
|
21
|
-
static build(params: WalletDaemonParameters): Promise<WalletDaemonTariProvider>;
|
|
22
|
-
get token(): string | undefined;
|
|
23
|
-
get tokenUrl(): string | undefined;
|
|
24
|
-
isConnected(): boolean;
|
|
25
|
-
createFreeTestCoins(): Promise<Account>;
|
|
26
|
-
getAccount(): Promise<Account>;
|
|
27
|
-
getAccountBalances(componentAddress: string): Promise<unknown>;
|
|
28
|
-
getSubstate(substate_id: string): Promise<Substate>;
|
|
29
|
-
submitTransaction(req: SubmitTransactionRequest): Promise<SubmitTransactionResponse>;
|
|
30
|
-
getTransactionResult(transactionId: string): Promise<TransactionResult>;
|
|
31
|
-
getPublicKey(branch: string, index: number): Promise<string>;
|
|
32
|
-
getTemplateDefinition(template_address: string): Promise<TemplateDefinition>;
|
|
33
|
-
getConfidentialVaultBalances(viewKeyId: number, vaultId: string, min?: number | null, max?: number | null): Promise<VaultBalances>;
|
|
34
|
-
listSubstates(filter_by_template: string | null, filter_by_type: SubstateType | null, limit: number | null, offset: number | null): Promise<ListSubstatesResponse>;
|
|
35
|
-
}
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
export declare class Hash {
|
|
2
|
-
private value;
|
|
3
|
-
constructor(value: number[]);
|
|
4
|
-
toJSON(): number[];
|
|
5
|
-
}
|
|
6
|
-
export declare enum TAG {
|
|
7
|
-
ComponentAddress = 128,
|
|
8
|
-
Metadata = 129,
|
|
9
|
-
NonFungibleAddress = 130,
|
|
10
|
-
ResourceAddress = 131,
|
|
11
|
-
VaultId = 132,
|
|
12
|
-
TransactionReceipt = 134,
|
|
13
|
-
FeeClaim = 135
|
|
14
|
-
}
|
|
15
|
-
export declare class Tagged {
|
|
16
|
-
private value;
|
|
17
|
-
private tag;
|
|
18
|
-
constructor(tag: number, value: any);
|
|
19
|
-
toJSON(): {
|
|
20
|
-
"@@TAGGED@@": any[];
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
export declare class ResourceAddress {
|
|
24
|
-
private tagged;
|
|
25
|
-
constructor(hash: Hash);
|
|
26
|
-
toJSON(): {
|
|
27
|
-
"@@TAGGED@@": any[];
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
export declare class UnclaimedConfidentialOutputAddress {
|
|
31
|
-
private hash;
|
|
32
|
-
constructor(hash: Hash);
|
|
33
|
-
toJSON(): number[];
|
|
34
|
-
}
|
|
35
|
-
export type u64 = number;
|
|
36
|
-
export type u32 = number;
|
|
37
|
-
export declare class U256 {
|
|
38
|
-
private value;
|
|
39
|
-
constructor(value: number[]);
|
|
40
|
-
toJSON(): number[];
|
|
41
|
-
}
|
|
42
|
-
export type NonFungibleIdType = u32 | u64 | string | U256;
|
|
43
|
-
export declare class NonFungibleId {
|
|
44
|
-
private value;
|
|
45
|
-
constructor(value: NonFungibleIdType);
|
|
46
|
-
toJSON(): {
|
|
47
|
-
string: string;
|
|
48
|
-
Uint64?: undefined;
|
|
49
|
-
U256?: undefined;
|
|
50
|
-
} | {
|
|
51
|
-
Uint64: number;
|
|
52
|
-
string?: undefined;
|
|
53
|
-
U256?: undefined;
|
|
54
|
-
} | {
|
|
55
|
-
U256: U256;
|
|
56
|
-
string?: undefined;
|
|
57
|
-
Uint64?: undefined;
|
|
58
|
-
};
|
|
59
|
-
}
|
|
60
|
-
export declare class NonFungibleAddressContents {
|
|
61
|
-
private resource_address;
|
|
62
|
-
private id;
|
|
63
|
-
constructor(resource_address: ResourceAddress, id: NonFungibleId);
|
|
64
|
-
toJSON(): {
|
|
65
|
-
resource_address: ResourceAddress;
|
|
66
|
-
id: NonFungibleId;
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export declare class NonFungibleAddress {
|
|
70
|
-
private tagged;
|
|
71
|
-
constructor(value: NonFungibleAddressContents);
|
|
72
|
-
toJSON(): {
|
|
73
|
-
"@@TAGGED@@": any[];
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
export declare class NonFungibleIndexAddress {
|
|
77
|
-
private resource_address;
|
|
78
|
-
private index;
|
|
79
|
-
constructor(resource_address: ResourceAddress, index: number);
|
|
80
|
-
toJSON(): {
|
|
81
|
-
resource_address: ResourceAddress;
|
|
82
|
-
index: number;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
export declare class ComponentAddress {
|
|
86
|
-
private tagged;
|
|
87
|
-
constructor(hash: Hash);
|
|
88
|
-
toJSON(): {
|
|
89
|
-
"@@TAGGED@@": any[];
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
export declare class VaultId {
|
|
93
|
-
private tagged;
|
|
94
|
-
constructor(hash: Hash);
|
|
95
|
-
toJSON(): {
|
|
96
|
-
"@@TAGGED@@": any[];
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
export type SubstateAddressType = ResourceAddress | ComponentAddress | VaultId | UnclaimedConfidentialOutputAddress | NonFungibleAddress | NonFungibleIndexAddress;
|
|
100
|
-
export declare class SubstateAddress {
|
|
101
|
-
private value;
|
|
102
|
-
constructor(value: SubstateAddressType);
|
|
103
|
-
toJSON(): {
|
|
104
|
-
Component: ComponentAddress;
|
|
105
|
-
Resource?: undefined;
|
|
106
|
-
Vault?: undefined;
|
|
107
|
-
UnclaimedConfidentialOutput?: undefined;
|
|
108
|
-
NonFungible?: undefined;
|
|
109
|
-
NonFungibleIndex?: undefined;
|
|
110
|
-
} | {
|
|
111
|
-
Resource: ResourceAddress;
|
|
112
|
-
Component?: undefined;
|
|
113
|
-
Vault?: undefined;
|
|
114
|
-
UnclaimedConfidentialOutput?: undefined;
|
|
115
|
-
NonFungible?: undefined;
|
|
116
|
-
NonFungibleIndex?: undefined;
|
|
117
|
-
} | {
|
|
118
|
-
Vault: VaultId;
|
|
119
|
-
Component?: undefined;
|
|
120
|
-
Resource?: undefined;
|
|
121
|
-
UnclaimedConfidentialOutput?: undefined;
|
|
122
|
-
NonFungible?: undefined;
|
|
123
|
-
NonFungibleIndex?: undefined;
|
|
124
|
-
} | {
|
|
125
|
-
UnclaimedConfidentialOutput: UnclaimedConfidentialOutputAddress;
|
|
126
|
-
Component?: undefined;
|
|
127
|
-
Resource?: undefined;
|
|
128
|
-
Vault?: undefined;
|
|
129
|
-
NonFungible?: undefined;
|
|
130
|
-
NonFungibleIndex?: undefined;
|
|
131
|
-
} | {
|
|
132
|
-
NonFungible: NonFungibleAddress;
|
|
133
|
-
Component?: undefined;
|
|
134
|
-
Resource?: undefined;
|
|
135
|
-
Vault?: undefined;
|
|
136
|
-
UnclaimedConfidentialOutput?: undefined;
|
|
137
|
-
NonFungibleIndex?: undefined;
|
|
138
|
-
} | {
|
|
139
|
-
NonFungibleIndex: NonFungibleIndexAddress;
|
|
140
|
-
Component?: undefined;
|
|
141
|
-
Resource?: undefined;
|
|
142
|
-
Vault?: undefined;
|
|
143
|
-
UnclaimedConfidentialOutput?: undefined;
|
|
144
|
-
NonFungible?: undefined;
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
export declare class TariPermissionAccountBalance {
|
|
148
|
-
private value;
|
|
149
|
-
constructor(value: SubstateAddress);
|
|
150
|
-
toJSON(): {
|
|
151
|
-
AccountBalance: SubstateAddress;
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
export declare class TariPermissionAccountInfo {
|
|
155
|
-
constructor();
|
|
156
|
-
toJSON(): string;
|
|
157
|
-
}
|
|
158
|
-
export declare class TariPermissionAccountList {
|
|
159
|
-
private value?;
|
|
160
|
-
constructor(value?: ComponentAddress);
|
|
161
|
-
toJSON(): {
|
|
162
|
-
AccountList: ComponentAddress | null;
|
|
163
|
-
};
|
|
164
|
-
}
|
|
165
|
-
export declare class TariPermissionKeyList {
|
|
166
|
-
constructor();
|
|
167
|
-
toJSON(): string;
|
|
168
|
-
}
|
|
169
|
-
export declare class TariPermissionTransactionGet {
|
|
170
|
-
constructor();
|
|
171
|
-
toJSON(): string;
|
|
172
|
-
}
|
|
173
|
-
export declare class TariPermissionTransactionSend {
|
|
174
|
-
private value?;
|
|
175
|
-
constructor(value?: SubstateAddress);
|
|
176
|
-
toJSON(): {
|
|
177
|
-
TransactionSend: null;
|
|
178
|
-
} | {
|
|
179
|
-
TransactionSend: SubstateAddress;
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
export declare class TariPermissionGetNft {
|
|
183
|
-
private value0?;
|
|
184
|
-
private value1?;
|
|
185
|
-
constructor(value0?: SubstateAddress, value1?: ResourceAddress);
|
|
186
|
-
toJSON(): {
|
|
187
|
-
GetNft: (ResourceAddress | SubstateAddress | undefined)[];
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
export declare class TariPermissionNftGetOwnershipProof {
|
|
191
|
-
private value?;
|
|
192
|
-
constructor(value?: ResourceAddress);
|
|
193
|
-
toJSON(): {
|
|
194
|
-
NftGetOwnershipProof: ResourceAddress | undefined;
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
export declare class TariPermissionTransactionsGet {
|
|
198
|
-
constructor();
|
|
199
|
-
toJSON(): string;
|
|
200
|
-
}
|
|
201
|
-
export declare class TariPermissionSubstatesRead {
|
|
202
|
-
constructor();
|
|
203
|
-
toJSON(): string;
|
|
204
|
-
}
|
|
205
|
-
export declare class TariPermissionTemplatesRead {
|
|
206
|
-
constructor();
|
|
207
|
-
toJSON(): string;
|
|
208
|
-
}
|
|
209
|
-
export type TariPermission = TariPermissionNftGetOwnershipProof | TariPermissionAccountBalance | TariPermissionAccountInfo | TariPermissionAccountList | TariPermissionKeyList | TariPermissionTransactionGet | TariPermissionTransactionSend | TariPermissionGetNft | TariPermissionTransactionsGet | TariPermissionSubstatesRead | TariPermissionTemplatesRead | string;
|
|
210
|
-
export declare class TariPermissions {
|
|
211
|
-
private permissions;
|
|
212
|
-
constructor();
|
|
213
|
-
addPermission(permission: TariPermission): this;
|
|
214
|
-
addPermissions(other: TariPermissions): this;
|
|
215
|
-
toJSON(): TariPermission[];
|
|
216
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { TariPermissions } from "./tari_permissions";
|
|
2
|
-
import { transports } from "@tari-project/wallet_jrpc_client";
|
|
3
|
-
export declare class TariConnection {
|
|
4
|
-
private _peerConnection;
|
|
5
|
-
private _dataChannel;
|
|
6
|
-
private _signalingServer;
|
|
7
|
-
private _callbacks;
|
|
8
|
-
private _offer?;
|
|
9
|
-
private _walletToken;
|
|
10
|
-
onopen: (() => void) | undefined;
|
|
11
|
-
onConnection: ((conn: TariConnection) => void) | undefined;
|
|
12
|
-
constructor(signalig_server_url?: string, config?: RTCConfiguration);
|
|
13
|
-
get token(): string | undefined;
|
|
14
|
-
init(permissions: TariPermissions, onConnection: ((conn: TariConnection) => void) | undefined): Promise<void>;
|
|
15
|
-
private setAnswer;
|
|
16
|
-
private signalingServerPolling;
|
|
17
|
-
isConnected(): boolean;
|
|
18
|
-
sendMessage<T>(request: transports.RpcRequest, token: string | undefined, timeout_secs?: number | null): Promise<T>;
|
|
19
|
-
private config;
|
|
20
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { transports } from "@tari-project/wallet_jrpc_client";
|
|
2
|
-
import { TariConnection } from "./webrtc";
|
|
3
|
-
export declare class WebRtcRpcTransport implements transports.RpcTransport {
|
|
4
|
-
connection: TariConnection;
|
|
5
|
-
constructor(connection: TariConnection);
|
|
6
|
-
static new(connection: TariConnection): WebRtcRpcTransport;
|
|
7
|
-
token(): string | undefined;
|
|
8
|
-
isConnected(): boolean;
|
|
9
|
-
sendRequest<T>(data: transports.RpcRequest, options: transports.RpcTransportOptions): Promise<T>;
|
|
10
|
-
}
|
package/dist/src/utils.d.ts
DELETED