@meshsdk/core 1.5.25 → 1.5.29
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/README.md +3 -30
- package/dist/index.d.mts +129 -0
- package/dist/index.d.ts +129 -11
- package/dist/index.js +149 -0
- package/dist/index.mjs +91 -0
- package/package.json +32 -59
- package/dist/common/constants.d.ts +0 -58
- package/dist/common/contracts/evaluator.d.ts +0 -4
- package/dist/common/contracts/fetcher.d.ts +0 -22
- package/dist/common/contracts/index.d.ts +0 -7
- package/dist/common/contracts/initiator.d.ts +0 -8
- package/dist/common/contracts/listener.d.ts +0 -3
- package/dist/common/contracts/signer.d.ts +0 -8
- package/dist/common/contracts/submitter.d.ts +0 -3
- package/dist/common/contracts/uploader.d.ts +0 -3
- package/dist/common/decorators.d.ts +0 -16
- package/dist/common/helpers/generateNonce.d.ts +0 -1
- package/dist/common/helpers/index.d.ts +0 -4
- package/dist/common/helpers/mergeSignatures.d.ts +0 -3
- package/dist/common/helpers/readPlutusData.d.ts +0 -2
- package/dist/common/helpers/readTransaction.d.ts +0 -2
- package/dist/common/types/Account.d.ts +0 -5
- package/dist/common/types/AccountInfo.d.ts +0 -7
- package/dist/common/types/Action.d.ts +0 -12
- package/dist/common/types/Asset.d.ts +0 -7
- package/dist/common/types/AssetExtended.d.ts +0 -8
- package/dist/common/types/AssetMetadata.d.ts +0 -24
- package/dist/common/types/BlockInfo.d.ts +0 -17
- package/dist/common/types/Data.d.ts +0 -4
- package/dist/common/types/DataSignature.d.ts +0 -4
- package/dist/common/types/Era.d.ts +0 -1
- package/dist/common/types/Mint.d.ts +0 -10
- package/dist/common/types/NativeScript.d.ts +0 -14
- package/dist/common/types/Network.d.ts +0 -4
- package/dist/common/types/PlutusScript.d.ts +0 -6
- package/dist/common/types/PoolParams.d.ts +0 -16
- package/dist/common/types/Protocol.d.ts +0 -22
- package/dist/common/types/Recipient.d.ts +0 -11
- package/dist/common/types/Relay.d.ts +0 -13
- package/dist/common/types/Token.d.ts +0 -2
- package/dist/common/types/TransactionInfo.d.ts +0 -11
- package/dist/common/types/UTxO.d.ts +0 -15
- package/dist/common/types/Wallet.d.ts +0 -5
- package/dist/common/types/index.d.ts +0 -22
- package/dist/common/utils/builder.d.ts +0 -18
- package/dist/common/utils/converter.d.ts +0 -27
- package/dist/common/utils/deserializer.d.ts +0 -19
- package/dist/common/utils/index.d.ts +0 -5
- package/dist/common/utils/parser.d.ts +0 -5
- package/dist/common/utils/resolver.d.ts +0 -19
- package/dist/core/CIP14.d.ts +0 -2
- package/dist/core/CIP1852.d.ts +0 -4
- package/dist/core/CIP1853.d.ts +0 -1
- package/dist/core/CIP1855.d.ts +0 -1
- package/dist/core/CIP2.d.ts +0 -4
- package/dist/core/CIP25.d.ts +0 -19
- package/dist/core/CIP27.d.ts +0 -4
- package/dist/core/CIP8.d.ts +0 -15
- package/dist/core/CPS-009.d.ts +0 -2
- package/dist/core/CSL.d.ts +0 -147
- package/dist/core/index.d.ts +0 -9
- package/dist/core.cjs +0 -8
- package/dist/core.js +0 -5995
- package/dist/providers/blockfrost.provider.d.ts +0 -46
- package/dist/providers/index.d.ts +0 -6
- package/dist/providers/infura.provider.d.ts +0 -12
- package/dist/providers/koios.provider.d.ts +0 -27
- package/dist/providers/maestro.provider.d.ts +0 -35
- package/dist/providers/ogmios.provider.d.ts +0 -12
- package/dist/providers/tango.provider.d.ts +0 -25
- package/dist/providers/yaci.provider.d.ts +0 -32
- package/dist/scripts/forge.script.d.ts +0 -8
- package/dist/scripts/index.d.ts +0 -1
- package/dist/transaction/index.d.ts +0 -2
- package/dist/transaction/meshTxBuilder/index.d.ts +0 -2
- package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +0 -47
- package/dist/transaction/meshTxBuilder/meshTxBuilder.spec.d.ts +0 -1
- package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +0 -321
- package/dist/transaction/meshTxBuilder/type.d.ts +0 -146
- package/dist/transaction/transaction.service.d.ts +0 -157
- package/dist/transaction/transaction.service.spec.d.ts +0 -1
- package/dist/wallet/app.service.d.ts +0 -45
- package/dist/wallet/app.service.spec.d.ts +0 -1
- package/dist/wallet/browser.service.d.ts +0 -218
- package/dist/wallet/browser.service.spec.d.ts +0 -1
- package/dist/wallet/embedded.service.d.ts +0 -21
- package/dist/wallet/embedded.service.spec.d.ts +0 -1
- package/dist/wallet/index.d.ts +0 -4
- package/dist/wallet/mesh.service.d.ts +0 -193
- package/dist/wallet/mina.service.d.ts +0 -11
- package/dist/wallet/mina.service.spec.d.ts +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { IFetcher, IListener, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import type { AccountInfo, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
/**
|
|
4
|
-
* [Blockfrost](https://blockfrost.io/) provides restful APIs which allows your app to access information stored on the blockchain.
|
|
5
|
-
*
|
|
6
|
-
* Get started:
|
|
7
|
-
* ```ts
|
|
8
|
-
* const blockfrostProvider = new BlockfrostProvider('<BLOCKFROST_API_KEY>');
|
|
9
|
-
* ```
|
|
10
|
-
*/
|
|
11
|
-
export declare class BlockfrostProvider implements IFetcher, IListener, ISubmitter {
|
|
12
|
-
private readonly _axiosInstance;
|
|
13
|
-
/**
|
|
14
|
-
* If you are using a privately hosted Blockfrost instance, you can set the URL in the parameter.
|
|
15
|
-
* @param baseUrl The base URL of the instance.
|
|
16
|
-
*/
|
|
17
|
-
constructor(baseUrl: string);
|
|
18
|
-
/**
|
|
19
|
-
* If you are using [Blockfrost](https://blockfrost.io/) hosted instance, you can set the project ID in the parameter.
|
|
20
|
-
* @param projectId The project ID of the instance.
|
|
21
|
-
* @param version The version of the API. Default is 0.
|
|
22
|
-
*/
|
|
23
|
-
constructor(projectId: string, version?: number);
|
|
24
|
-
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
25
|
-
private resolveScriptRef;
|
|
26
|
-
private toUTxO;
|
|
27
|
-
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
28
|
-
fetchAssetAddresses(asset: string): Promise<{
|
|
29
|
-
address: string;
|
|
30
|
-
quantity: string;
|
|
31
|
-
}[]>;
|
|
32
|
-
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
33
|
-
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
34
|
-
fetchCollectionAssets(policyId: string, cursor?: number): Promise<{
|
|
35
|
-
assets: Asset[];
|
|
36
|
-
next: string | number | null;
|
|
37
|
-
}>;
|
|
38
|
-
fetchHandleAddress(handle: string): Promise<string>;
|
|
39
|
-
fetchProtocolParameters(epoch?: number): Promise<Protocol>;
|
|
40
|
-
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
41
|
-
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
42
|
-
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
43
|
-
submitTx(tx: string): Promise<string>;
|
|
44
|
-
private fetchPlutusScriptCBOR;
|
|
45
|
-
private fetchNativeScriptJSON;
|
|
46
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IUploader } from '@mesh/common/contracts';
|
|
2
|
-
export declare class InfuraProvider implements IUploader {
|
|
3
|
-
private _axiosInstance;
|
|
4
|
-
constructor(projectId: string, projectSecret: string, options: Partial<CreateInfuraProviderOptions>);
|
|
5
|
-
uploadContent(content: FormData, recursive?: boolean): Promise<string>;
|
|
6
|
-
}
|
|
7
|
-
type CreateInfuraProviderOptions = {
|
|
8
|
-
host: string;
|
|
9
|
-
port: number;
|
|
10
|
-
version: number;
|
|
11
|
-
};
|
|
12
|
-
export {};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IFetcher, IListener, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import type { AccountInfo, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
export declare class KoiosProvider implements IFetcher, IListener, ISubmitter {
|
|
4
|
-
private readonly _axiosInstance;
|
|
5
|
-
constructor(baseUrl: string);
|
|
6
|
-
constructor(network: 'api' | 'preview' | 'preprod' | 'guild', token: string, version?: number);
|
|
7
|
-
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
8
|
-
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
9
|
-
fetchAssetAddresses(asset: string): Promise<{
|
|
10
|
-
address: string;
|
|
11
|
-
quantity: string;
|
|
12
|
-
}[]>;
|
|
13
|
-
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
14
|
-
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
15
|
-
fetchCollectionAssets(policyId: string, cursor?: number): Promise<{
|
|
16
|
-
assets: Asset[];
|
|
17
|
-
next: string | number | null;
|
|
18
|
-
}>;
|
|
19
|
-
fetchHandleAddress(handle: string): Promise<string>;
|
|
20
|
-
fetchProtocolParameters(epoch: number): Promise<Protocol>;
|
|
21
|
-
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
22
|
-
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
23
|
-
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
24
|
-
submitTx(tx: string): Promise<string>;
|
|
25
|
-
private toUTxO;
|
|
26
|
-
private resolveScriptRef;
|
|
27
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { IEvaluator, IFetcher, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import type { AccountInfo, Action, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
export type MaestroSupportedNetworks = 'Mainnet' | 'Preprod' | 'Preview';
|
|
4
|
-
export interface MaestroConfig {
|
|
5
|
-
network: MaestroSupportedNetworks;
|
|
6
|
-
apiKey: string;
|
|
7
|
-
turboSubmit?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare class MaestroProvider implements IFetcher, ISubmitter, IEvaluator {
|
|
10
|
-
private readonly _axiosInstance;
|
|
11
|
-
private readonly _amountsAsStrings;
|
|
12
|
-
submitUrl: string;
|
|
13
|
-
constructor({ network, apiKey, turboSubmit }: MaestroConfig);
|
|
14
|
-
evaluateTx(cbor: string): Promise<Omit<Action, 'data'>[]>;
|
|
15
|
-
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
16
|
-
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
17
|
-
fetchAssetAddresses(asset: string): Promise<{
|
|
18
|
-
address: string;
|
|
19
|
-
quantity: string;
|
|
20
|
-
}[]>;
|
|
21
|
-
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
22
|
-
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
23
|
-
fetchCollectionAssets(policyId: string, cursor?: string): Promise<{
|
|
24
|
-
assets: Asset[];
|
|
25
|
-
next: string | number | null;
|
|
26
|
-
}>;
|
|
27
|
-
fetchHandleAddress(handle: string): Promise<string>;
|
|
28
|
-
fetchProtocolParameters(epoch?: number): Promise<Protocol>;
|
|
29
|
-
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
30
|
-
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
31
|
-
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
32
|
-
submitTx(tx: string): Promise<string>;
|
|
33
|
-
private toUTxO;
|
|
34
|
-
private resolveScript;
|
|
35
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IEvaluator, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import { Action, Network } from '@mesh/common/types';
|
|
3
|
-
export declare class OgmiosProvider implements IEvaluator, ISubmitter {
|
|
4
|
-
private readonly _baseUrl;
|
|
5
|
-
constructor(baseUrl: string);
|
|
6
|
-
constructor(network: Network);
|
|
7
|
-
evaluateTx(tx: string): Promise<Omit<Action, 'data'>[]>;
|
|
8
|
-
onNextTx(callback: (tx: unknown) => void): Promise<() => void>;
|
|
9
|
-
submitTx(tx: string): Promise<string>;
|
|
10
|
-
private open;
|
|
11
|
-
private send;
|
|
12
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { IEvaluator, IFetcher, IListener, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import type { AccountInfo, Action, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
export declare class TangoProvider implements IEvaluator, IFetcher, IListener, ISubmitter {
|
|
4
|
-
private readonly _axiosInstance;
|
|
5
|
-
constructor(network: 'mainnet' | 'testnet', appId: string, appKey: string, version?: number);
|
|
6
|
-
evaluateTx(tx: string): Promise<Omit<Action, 'data'>[]>;
|
|
7
|
-
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
8
|
-
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
9
|
-
fetchAssetAddresses(asset: string): Promise<{
|
|
10
|
-
address: string;
|
|
11
|
-
quantity: string;
|
|
12
|
-
}[]>;
|
|
13
|
-
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
14
|
-
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
15
|
-
fetchCollectionAssets(policyId: string, cursor?: string): Promise<{
|
|
16
|
-
assets: Asset[];
|
|
17
|
-
next: string | number | null;
|
|
18
|
-
}>;
|
|
19
|
-
fetchHandleAddress(handle: string): Promise<string>;
|
|
20
|
-
fetchProtocolParameters(epoch: number): Promise<Protocol>;
|
|
21
|
-
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
22
|
-
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
23
|
-
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
24
|
-
submitTx(tx: string): Promise<string>;
|
|
25
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { IFetcher, IListener, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import type { AccountInfo, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
export declare class YaciProvider implements IFetcher, IListener, ISubmitter {
|
|
4
|
-
private readonly _axiosInstance;
|
|
5
|
-
/**
|
|
6
|
-
* Set the URL of the instance.
|
|
7
|
-
* @param baseUrl The base URL of the instance.
|
|
8
|
-
*/
|
|
9
|
-
constructor(baseUrl?: string);
|
|
10
|
-
fetchAccountInfo(address: string): Promise<AccountInfo>;
|
|
11
|
-
private resolveScriptRef;
|
|
12
|
-
private toUTxO;
|
|
13
|
-
fetchAddressUTxOs(address: string, asset?: string): Promise<UTxO[]>;
|
|
14
|
-
fetchAssetAddresses(asset: string): Promise<{
|
|
15
|
-
address: string;
|
|
16
|
-
quantity: string;
|
|
17
|
-
}[]>;
|
|
18
|
-
fetchAssetMetadata(asset: string): Promise<AssetMetadata>;
|
|
19
|
-
fetchBlockInfo(hash: string): Promise<BlockInfo>;
|
|
20
|
-
fetchCollectionAssets(policyId: string, cursor?: number): Promise<{
|
|
21
|
-
assets: Asset[];
|
|
22
|
-
next: string | number | null;
|
|
23
|
-
}>;
|
|
24
|
-
fetchHandleAddress(handle: string): Promise<string>;
|
|
25
|
-
fetchProtocolParameters(epoch?: number): Promise<Protocol>;
|
|
26
|
-
fetchTxInfo(hash: string): Promise<TransactionInfo>;
|
|
27
|
-
fetchUTxOs(hash: string): Promise<UTxO[]>;
|
|
28
|
-
onTxConfirmed(txHash: string, callback: () => void, limit?: number): void;
|
|
29
|
-
submitTx(txHex: string): Promise<string>;
|
|
30
|
-
private fetchPlutusScriptCBOR;
|
|
31
|
-
private fetchNativeScriptJSON;
|
|
32
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { NativeScript } from '@mesh/common/types';
|
|
2
|
-
export declare class ForgeScript {
|
|
3
|
-
static withOneSignature(address: string): string;
|
|
4
|
-
static withAtLeastNSignatures(addresses: string[], minimumRequired: number): string;
|
|
5
|
-
static withAnySignature(addresses: string[]): string;
|
|
6
|
-
static withAllSignatures(addresses: string[]): string;
|
|
7
|
-
static fromNativeScript(script: NativeScript): string;
|
|
8
|
-
}
|
package/dist/scripts/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './forge.script';
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { IEvaluator, IFetcher, ISubmitter } from '@mesh/common/contracts';
|
|
2
|
-
import { MeshTxBuilderCore } from './meshTxBuilderCore';
|
|
3
|
-
import { MeshTxBuilderBody } from './type';
|
|
4
|
-
type MeshTxBuilderOptions = {
|
|
5
|
-
fetcher?: IFetcher;
|
|
6
|
-
submitter?: ISubmitter;
|
|
7
|
-
evaluator?: IEvaluator;
|
|
8
|
-
isHydra?: boolean;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* MeshTxBuilder is a lower level api for building transaction
|
|
12
|
-
* @param {IFetcher} [fetcher] an optional parameter for fetching utxo
|
|
13
|
-
* @param {ISubmitter} [submitter] an optional parameter for submitting transaction
|
|
14
|
-
* @param {IEvaluator} [evaluator] an optional parameter for evaluating transaction
|
|
15
|
-
* @param {boolean} [isHydra] an optional parameter for using hydra transaction building for configuring 0 fee in protocol parameters
|
|
16
|
-
*/
|
|
17
|
-
export declare class MeshTxBuilder extends MeshTxBuilderCore {
|
|
18
|
-
private _fetcher?;
|
|
19
|
-
private _submitter?;
|
|
20
|
-
private _evaluator?;
|
|
21
|
-
private queriedTxHashes;
|
|
22
|
-
private queriedUTxOs;
|
|
23
|
-
constructor({ fetcher, submitter, evaluator, isHydra, }: MeshTxBuilderOptions);
|
|
24
|
-
/**
|
|
25
|
-
* It builds the transaction and query the blockchain for missing information
|
|
26
|
-
* @param customizedTx The optional customized transaction body
|
|
27
|
-
* @returns The signed transaction in hex ready to submit / signed by client
|
|
28
|
-
*/
|
|
29
|
-
complete: (customizedTx?: MeshTxBuilderBody) => Promise<this>;
|
|
30
|
-
/**
|
|
31
|
-
* Submit transactions to the blockchain using the fetcher instance
|
|
32
|
-
* @param txHex The signed transaction in hex
|
|
33
|
-
* @returns
|
|
34
|
-
*/
|
|
35
|
-
submitTx: (txHex: string) => Promise<string | undefined>;
|
|
36
|
-
/**
|
|
37
|
-
* Get the UTxO information from the blockchain
|
|
38
|
-
* @param TxHash The TxIn object that contains the txHash and txIndex, while missing amount and address information
|
|
39
|
-
*/
|
|
40
|
-
private getUTxOInfo;
|
|
41
|
-
private queryAllTxInfo;
|
|
42
|
-
private completeTxInformation;
|
|
43
|
-
private isInputComplete;
|
|
44
|
-
private isInputInfoComplete;
|
|
45
|
-
private isRefScriptInfoComplete;
|
|
46
|
-
}
|
|
47
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,321 +0,0 @@
|
|
|
1
|
-
import { Action, Asset, LanguageVersion, Protocol, UTxO, PoolParams } from '@mesh/common/types';
|
|
2
|
-
import { csl } from '@mesh/core';
|
|
3
|
-
import { MintItem, TxIn, PubKeyTxIn, MeshTxBuilderBody, RefTxIn, BuilderData, Certificate } from './type';
|
|
4
|
-
export declare class MeshTxBuilderCore {
|
|
5
|
-
txHex: string;
|
|
6
|
-
txBuilder: csl.TransactionBuilder;
|
|
7
|
-
txEvaluationMultiplier: number;
|
|
8
|
-
private _protocolParams;
|
|
9
|
-
private txOutput?;
|
|
10
|
-
private addingScriptInput;
|
|
11
|
-
private addingPlutusMint;
|
|
12
|
-
protected isHydra: boolean;
|
|
13
|
-
meshTxBuilderBody: MeshTxBuilderBody;
|
|
14
|
-
protected mintItem?: MintItem;
|
|
15
|
-
protected txInQueueItem?: TxIn;
|
|
16
|
-
protected collateralQueueItem?: PubKeyTxIn;
|
|
17
|
-
protected refScriptTxInQueueItem?: RefTxIn;
|
|
18
|
-
/**
|
|
19
|
-
* Reset everything in the MeshTxBuilder instance
|
|
20
|
-
* @returns The MeshTxBuilder instance
|
|
21
|
-
*/
|
|
22
|
-
reset: () => this;
|
|
23
|
-
/**
|
|
24
|
-
* Make an empty transaction body for building transaction in object
|
|
25
|
-
* @returns An empty transaction body
|
|
26
|
-
*/
|
|
27
|
-
emptyTxBuilderBody: () => MeshTxBuilderBody;
|
|
28
|
-
constructor();
|
|
29
|
-
/**
|
|
30
|
-
* Synchronous functions here
|
|
31
|
-
*/
|
|
32
|
-
/**
|
|
33
|
-
* It builds the transaction without dependencies
|
|
34
|
-
* @param customizedTx The optional customized transaction body
|
|
35
|
-
* @returns The signed transaction in hex ready to submit / signed by client
|
|
36
|
-
*/
|
|
37
|
-
completeSync: (customizedTx?: MeshTxBuilderBody) => this;
|
|
38
|
-
/**
|
|
39
|
-
* Complete the signing process
|
|
40
|
-
* @returns The signed transaction in hex
|
|
41
|
-
*/
|
|
42
|
-
completeSigning: () => string;
|
|
43
|
-
private serializeTxBody;
|
|
44
|
-
/**
|
|
45
|
-
* Set the input for transaction
|
|
46
|
-
* @param txHash The transaction hash of the input UTxO
|
|
47
|
-
* @param txIndex The transaction index of the input UTxO
|
|
48
|
-
* @param amount The asset amount of index of the input UTxO
|
|
49
|
-
* @param address The address of the input UTxO
|
|
50
|
-
* @returns The MeshTxBuilder instance
|
|
51
|
-
*/
|
|
52
|
-
txIn: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
|
|
53
|
-
/**
|
|
54
|
-
* Set the script for transaction input
|
|
55
|
-
* @param {string} scriptCbor The CborHex of the script
|
|
56
|
-
* @param version Optional - The Plutus script version
|
|
57
|
-
* @returns The MeshTxBuilder instance
|
|
58
|
-
*/
|
|
59
|
-
txInScript: (scriptCbor: string, version?: LanguageVersion) => this;
|
|
60
|
-
/**
|
|
61
|
-
* Set the input datum for transaction input
|
|
62
|
-
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
63
|
-
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
64
|
-
* @returns The MeshTxBuilder instance
|
|
65
|
-
*/
|
|
66
|
-
txInDatumValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
|
|
67
|
-
/**
|
|
68
|
-
* Tell the transaction builder that the input UTxO has inlined datum
|
|
69
|
-
* @returns The MeshTxBuilder instance
|
|
70
|
-
*/
|
|
71
|
-
txInInlineDatumPresent: () => this;
|
|
72
|
-
/**
|
|
73
|
-
* Set the redeemer for the reference input to be spent in same transaction
|
|
74
|
-
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
75
|
-
* @param exUnits The execution units budget for the redeemer
|
|
76
|
-
* @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
77
|
-
* @returns The MeshTxBuilder instance
|
|
78
|
-
*/
|
|
79
|
-
txInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
|
|
80
|
-
mem: number;
|
|
81
|
-
steps: number;
|
|
82
|
-
}, type?: BuilderData['type']) => this;
|
|
83
|
-
/**
|
|
84
|
-
* Set the output for transaction
|
|
85
|
-
* @param {string} address The recipient of the output
|
|
86
|
-
* @param {Asset[]} amount The amount of other native assets attached with UTxO
|
|
87
|
-
* @returns The MeshTxBuilder instance
|
|
88
|
-
*/
|
|
89
|
-
txOut: (address: string, amount: Asset[]) => this;
|
|
90
|
-
/**
|
|
91
|
-
* Set the output datum hash for transaction
|
|
92
|
-
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
93
|
-
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
94
|
-
* @returns The MeshTxBuilder instance
|
|
95
|
-
*/
|
|
96
|
-
txOutDatumHashValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
|
|
97
|
-
/**
|
|
98
|
-
* Set the output inline datum for transaction
|
|
99
|
-
* @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
100
|
-
* @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
101
|
-
* @returns The MeshTxBuilder instance
|
|
102
|
-
*/
|
|
103
|
-
txOutInlineDatumValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
|
|
104
|
-
/**
|
|
105
|
-
* Set the reference script to be attached with the output
|
|
106
|
-
* @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
|
|
107
|
-
* @param version Optional - The Plutus script version
|
|
108
|
-
* @returns The MeshTxBuilder instance
|
|
109
|
-
*/
|
|
110
|
-
txOutReferenceScript: (scriptCbor: string, version?: LanguageVersion) => this;
|
|
111
|
-
/**
|
|
112
|
-
* Set the instruction that it is currently using V2 Plutus spending scripts
|
|
113
|
-
* @returns The MeshTxBuilder instance
|
|
114
|
-
*/
|
|
115
|
-
spendingPlutusScriptV2: () => this;
|
|
116
|
-
/**
|
|
117
|
-
* Set the reference input where it would also be spent in the transaction
|
|
118
|
-
* @param txHash The transaction hash of the reference UTxO
|
|
119
|
-
* @param txIndex The transaction index of the reference UTxO
|
|
120
|
-
* @param spendingScriptHash The script hash of the spending script
|
|
121
|
-
* @returns The MeshTxBuilder instance
|
|
122
|
-
*/
|
|
123
|
-
spendingTxInReference: (txHash: string, txIndex: number, spendingScriptHash?: string, version?: LanguageVersion) => this;
|
|
124
|
-
/**
|
|
125
|
-
* [Alias of txInInlineDatumPresent] Set the instruction that the reference input has inline datum
|
|
126
|
-
* @returns The MeshTxBuilder instance
|
|
127
|
-
*/
|
|
128
|
-
spendingReferenceTxInInlineDatumPresent: () => this;
|
|
129
|
-
/**
|
|
130
|
-
* [Alias of txInRedeemerValue] Set the redeemer for the reference input to be spent in same transaction
|
|
131
|
-
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
132
|
-
* @param exUnits The execution units budget for the redeemer
|
|
133
|
-
* @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
134
|
-
* @returns The MeshTxBuilder instance
|
|
135
|
-
*/
|
|
136
|
-
spendingReferenceTxInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
|
|
137
|
-
mem: number;
|
|
138
|
-
steps: number;
|
|
139
|
-
}, type?: BuilderData['type']) => this;
|
|
140
|
-
/**
|
|
141
|
-
* Specify a read only reference input. This reference input is not witnessing anything it is simply provided in the plutus script context.
|
|
142
|
-
* @param txHash The transaction hash of the reference UTxO
|
|
143
|
-
* @param txIndex The transaction index of the reference UTxO
|
|
144
|
-
* @returns The MeshTxBuilder instance
|
|
145
|
-
*/
|
|
146
|
-
readOnlyTxInReference: (txHash: string, txIndex: number) => this;
|
|
147
|
-
/**
|
|
148
|
-
* Set the instruction that it is currently using V2 Plutus minting scripts
|
|
149
|
-
* @returns The MeshTxBuilder instance
|
|
150
|
-
*/
|
|
151
|
-
mintPlutusScriptV2: () => this;
|
|
152
|
-
/**
|
|
153
|
-
* Set the minting value of transaction
|
|
154
|
-
* @param quantity The quantity of asset to be minted
|
|
155
|
-
* @param policy The policy id of the asset to be minted
|
|
156
|
-
* @param name The hex of token name of the asset to be minted
|
|
157
|
-
* @returns The MeshTxBuilder instance
|
|
158
|
-
*/
|
|
159
|
-
mint: (quantity: string, policy: string, name: string) => this;
|
|
160
|
-
/**
|
|
161
|
-
* Set the minting script of current mint
|
|
162
|
-
* @param scriptCBOR The CBOR hex of the minting policy script
|
|
163
|
-
* @param version Optional - The Plutus script version
|
|
164
|
-
* @returns The MeshTxBuilder instance
|
|
165
|
-
*/
|
|
166
|
-
mintingScript: (scriptCBOR: string, version?: LanguageVersion) => this;
|
|
167
|
-
/**
|
|
168
|
-
* Use reference script for minting
|
|
169
|
-
* @param txHash The transaction hash of the UTxO
|
|
170
|
-
* @param txIndex The transaction index of the UTxO
|
|
171
|
-
* @returns The MeshTxBuilder instance
|
|
172
|
-
*/
|
|
173
|
-
mintTxInReference: (txHash: string, txIndex: number, version?: LanguageVersion) => this;
|
|
174
|
-
/**
|
|
175
|
-
* Set the redeemer for minting
|
|
176
|
-
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
177
|
-
* @param exUnits The execution units budget for the redeemer
|
|
178
|
-
* @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
179
|
-
* @returns The MeshTxBuilder instance
|
|
180
|
-
*/
|
|
181
|
-
mintReferenceTxInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
|
|
182
|
-
mem: number;
|
|
183
|
-
steps: number;
|
|
184
|
-
}, type?: BuilderData['type']) => this;
|
|
185
|
-
/**
|
|
186
|
-
* Set the redeemer for the reference input to be spent in same transaction
|
|
187
|
-
* @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
188
|
-
* @param exUnits The execution units budget for the redeemer
|
|
189
|
-
* @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
|
|
190
|
-
* @returns The MeshTxBuilder instance
|
|
191
|
-
*/
|
|
192
|
-
mintRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
|
|
193
|
-
mem: number;
|
|
194
|
-
steps: number;
|
|
195
|
-
}, type?: BuilderData['type']) => this;
|
|
196
|
-
/**
|
|
197
|
-
* Set the required signer of the transaction
|
|
198
|
-
* @param pubKeyHash The PubKeyHash of the required signer
|
|
199
|
-
* @returns The MeshTxBuilder instance
|
|
200
|
-
*/
|
|
201
|
-
requiredSignerHash: (pubKeyHash: string) => this;
|
|
202
|
-
/**
|
|
203
|
-
* Set the collateral UTxO for the transaction
|
|
204
|
-
* @param txHash The transaction hash of the collateral UTxO
|
|
205
|
-
* @param txIndex The transaction index of the collateral UTxO
|
|
206
|
-
* @param amount The asset amount of index of the collateral UTxO
|
|
207
|
-
* @param address The address of the collateral UTxO
|
|
208
|
-
* @returns The MeshTxBuilder instance
|
|
209
|
-
*/
|
|
210
|
-
txInCollateral: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
|
|
211
|
-
/**
|
|
212
|
-
* Creates a pool registration certificate, and adds it to the transaction
|
|
213
|
-
* @param poolParams Parameters for pool registration
|
|
214
|
-
* @returns The MeshTxBuilder instance
|
|
215
|
-
*/
|
|
216
|
-
registerPoolCertificate: (poolParams: PoolParams) => this;
|
|
217
|
-
/**
|
|
218
|
-
* Creates a stake registration certificate, and adds it to the transaction
|
|
219
|
-
* @param stakeKeyHash The keyHash of the stake key
|
|
220
|
-
* @returns The MeshTxBuilder instance
|
|
221
|
-
*/
|
|
222
|
-
registerStakeCertificate: (stakeKeyHash: string) => this;
|
|
223
|
-
/**
|
|
224
|
-
* Creates a stake delegation certificate, and adds it to the transaction
|
|
225
|
-
* This will delegate stake from the corresponding stake address to the pool
|
|
226
|
-
* @param stakeKeyHash The keyHash of the stake key
|
|
227
|
-
* @param poolId poolId can be in either bech32 or hex form
|
|
228
|
-
* @returns The MeshTxBuilder instance
|
|
229
|
-
*/
|
|
230
|
-
delegateStakeCertificate: (stakeKeyHash: string, poolId: string) => this;
|
|
231
|
-
/**
|
|
232
|
-
* Creates a stake deregister certificate, and adds it to the transaction
|
|
233
|
-
* @param stakeKeyHash The keyHash of the stake key
|
|
234
|
-
* @returns The MeshTxBuilder instance
|
|
235
|
-
*/
|
|
236
|
-
deregisterStakeCertificate: (stakeKeyHash: string) => this;
|
|
237
|
-
/**
|
|
238
|
-
* Creates a pool retire certificate, and adds it to the transaction
|
|
239
|
-
* @param poolId poolId can be in either bech32 or hex form
|
|
240
|
-
* @param epoch The intended epoch to retire the pool
|
|
241
|
-
* @returns The MeshTxBuilder instance
|
|
242
|
-
*/
|
|
243
|
-
retirePoolCertificate: (poolId: string, epoch: number) => this;
|
|
244
|
-
/**
|
|
245
|
-
* Configure the address to accept change UTxO
|
|
246
|
-
* @param addr The address to accept change UTxO
|
|
247
|
-
* @returns The MeshTxBuilder instance
|
|
248
|
-
*/
|
|
249
|
-
changeAddress: (addr: string) => this;
|
|
250
|
-
/**
|
|
251
|
-
* Set the transaction valid interval to be valid only after the slot
|
|
252
|
-
* @param slot The transaction is valid only after this slot
|
|
253
|
-
* @returns The MeshTxBuilder instance
|
|
254
|
-
*/
|
|
255
|
-
invalidBefore: (slot: number) => this;
|
|
256
|
-
/**
|
|
257
|
-
* Set the transaction valid interval to be valid only before the slot
|
|
258
|
-
* @param slot The transaction is valid only before this slot
|
|
259
|
-
* @returns The MeshTxBuilder instance
|
|
260
|
-
*/
|
|
261
|
-
invalidHereafter: (slot: number) => this;
|
|
262
|
-
/**
|
|
263
|
-
* Add metadata to the transaction
|
|
264
|
-
* @param tag The tag of the metadata
|
|
265
|
-
* @param metadata The metadata in object format
|
|
266
|
-
* @returns The MeshTxBuilder instance
|
|
267
|
-
*/
|
|
268
|
-
metadataValue: <T extends object>(tag: string, metadata: T) => this;
|
|
269
|
-
/**
|
|
270
|
-
* Set the protocol parameters to be used for the transaction other than the default one
|
|
271
|
-
* @param params (Part of) the protocol parameters to be used for the transaction
|
|
272
|
-
* @returns The MeshTxBuilder instance
|
|
273
|
-
*/
|
|
274
|
-
protocolParams: (params: Partial<Protocol>) => this;
|
|
275
|
-
/**
|
|
276
|
-
* Sign the transaction with the private key
|
|
277
|
-
* @param skeyHex The private key in cborHex (with or without 5820 prefix, i.e. the format when generated from cardano-cli)
|
|
278
|
-
* @returns
|
|
279
|
-
*/
|
|
280
|
-
signingKey: (skeyHex: string) => this;
|
|
281
|
-
/**
|
|
282
|
-
* EXPERIMENTAL - Selects utxos to fill output value and puts them into inputs
|
|
283
|
-
* @param extraInputs The inputs already placed into the object will remain, these extra inputs will be used to fill the remaining value needed
|
|
284
|
-
* @param threshold Extra value needed to be selected for, usually for paying fees and min UTxO value of change output
|
|
285
|
-
*/
|
|
286
|
-
selectUtxosFrom: (extraInputs: UTxO[], threshold?: number) => this;
|
|
287
|
-
private addUtxosFrom;
|
|
288
|
-
private addAllSigningKeys;
|
|
289
|
-
private buildTx;
|
|
290
|
-
private queueInput;
|
|
291
|
-
private queueMint;
|
|
292
|
-
private makePlutusScriptSource;
|
|
293
|
-
protected removeDuplicateInputs: () => void;
|
|
294
|
-
private addAllInputs;
|
|
295
|
-
private addTxIn;
|
|
296
|
-
private addNativeScriptTxIn;
|
|
297
|
-
private addScriptTxIn;
|
|
298
|
-
private addAllOutputs;
|
|
299
|
-
private addOutput;
|
|
300
|
-
private addAllCollaterals;
|
|
301
|
-
private addCollateral;
|
|
302
|
-
private addCollateralReturn;
|
|
303
|
-
private addAllReferenceInputs;
|
|
304
|
-
private addReferenceInput;
|
|
305
|
-
protected addAllMints: (mints: MintItem[]) => void;
|
|
306
|
-
private addPlutusMint;
|
|
307
|
-
private addNativeMint;
|
|
308
|
-
private decimalToFraction;
|
|
309
|
-
private toPoolParams;
|
|
310
|
-
private addCertificate;
|
|
311
|
-
protected queueAllLastItem: () => void;
|
|
312
|
-
protected addAllCertificates: (allCertificates: Certificate[]) => void;
|
|
313
|
-
protected addCostModels: () => void;
|
|
314
|
-
private addChange;
|
|
315
|
-
private addValidityRange;
|
|
316
|
-
private addAllRequiredSignatures;
|
|
317
|
-
private addAllMetadata;
|
|
318
|
-
protected updateRedeemer: (meshTxBuilderBody: MeshTxBuilderBody, txEvaluation: Omit<Action, 'data'>[]) => void;
|
|
319
|
-
protected castRawDataToJsonString: (rawData: object | string) => any;
|
|
320
|
-
protected castDataToPlutusData: ({ type, content }: BuilderData) => csl.PlutusData;
|
|
321
|
-
}
|