@meshsdk/core 1.6.0-alpha.9 → 1.6.2

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.
Files changed (97) hide show
  1. package/README.md +54 -26
  2. package/dist/index.cjs +1 -0
  3. package/dist/index.d.cts +141 -0
  4. package/dist/index.d.ts +141 -14
  5. package/dist/index.js +1 -0
  6. package/package.json +42 -68
  7. package/dist/common/constants.d.ts +0 -58
  8. package/dist/common/contracts/evaluator.d.ts +0 -4
  9. package/dist/common/contracts/fetcher.d.ts +0 -22
  10. package/dist/common/contracts/index.d.ts +0 -7
  11. package/dist/common/contracts/initiator.d.ts +0 -8
  12. package/dist/common/contracts/listener.d.ts +0 -3
  13. package/dist/common/contracts/signer.d.ts +0 -8
  14. package/dist/common/contracts/submitter.d.ts +0 -3
  15. package/dist/common/contracts/uploader.d.ts +0 -3
  16. package/dist/common/data/index.d.ts +0 -2
  17. package/dist/common/data/mesh.d.ts +0 -8
  18. package/dist/common/data/plutus.d.ts +0 -72
  19. package/dist/common/data/plutus.spec.d.ts +0 -1
  20. package/dist/common/decorators.d.ts +0 -19
  21. package/dist/common/helpers/generateNonce.d.ts +0 -1
  22. package/dist/common/helpers/index.d.ts +0 -2
  23. package/dist/common/helpers/readPlutusData.d.ts +0 -2
  24. package/dist/common/index.d.ts +0 -2
  25. package/dist/common/utils/builder.d.ts +0 -18
  26. package/dist/common/utils/converter.d.ts +0 -27
  27. package/dist/common/utils/deserializer.d.ts +0 -19
  28. package/dist/common/utils/index.d.ts +0 -5
  29. package/dist/common/utils/parser.d.ts +0 -5
  30. package/dist/common/utils/resolver.d.ts +0 -17
  31. package/dist/core/CIP14.d.ts +0 -2
  32. package/dist/core/CIP1852.d.ts +0 -4
  33. package/dist/core/CIP1853.d.ts +0 -1
  34. package/dist/core/CIP1855.d.ts +0 -1
  35. package/dist/core/CIP2.d.ts +0 -4
  36. package/dist/core/CIP25.d.ts +0 -19
  37. package/dist/core/CIP27.d.ts +0 -4
  38. package/dist/core/CIP8.d.ts +0 -15
  39. package/dist/core/CPS0009.d.ts +0 -2
  40. package/dist/core/CSL.d.ts +0 -147
  41. package/dist/core/index.d.ts +0 -10
  42. package/dist/core.cjs +0 -18
  43. package/dist/core.js +0 -22016
  44. package/dist/providers/blockfrost.provider.d.ts +0 -46
  45. package/dist/providers/index.d.ts +0 -6
  46. package/dist/providers/infura.provider.d.ts +0 -12
  47. package/dist/providers/koios.provider.d.ts +0 -27
  48. package/dist/providers/maestro.provider.d.ts +0 -35
  49. package/dist/providers/ogmios.provider.d.ts +0 -12
  50. package/dist/providers/tango.provider.d.ts +0 -25
  51. package/dist/providers/yaci.provider.d.ts +0 -32
  52. package/dist/scripts/forge.script.d.ts +0 -8
  53. package/dist/scripts/index.d.ts +0 -1
  54. package/dist/serializer/index.d.ts +0 -1
  55. package/dist/serializer/serializer.d.ts +0 -42
  56. package/dist/serializer/signatures.d.ts +0 -3
  57. package/dist/transaction/index.d.ts +0 -2
  58. package/dist/transaction/meshTxBuilder/index.d.ts +0 -2
  59. package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +0 -47
  60. package/dist/transaction/meshTxBuilder/meshTxBuilder.spec.d.ts +0 -1
  61. package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +0 -292
  62. package/dist/transaction/meshTxBuilder/type.d.ts +0 -128
  63. package/dist/transaction/transaction.service.d.ts +0 -150
  64. package/dist/transaction/transaction.service.spec.d.ts +0 -1
  65. package/dist/types/Account.d.ts +0 -5
  66. package/dist/types/AccountInfo.d.ts +0 -7
  67. package/dist/types/Action.d.ts +0 -12
  68. package/dist/types/Asset.d.ts +0 -7
  69. package/dist/types/AssetExtended.d.ts +0 -8
  70. package/dist/types/AssetMetadata.d.ts +0 -24
  71. package/dist/types/BlockInfo.d.ts +0 -17
  72. package/dist/types/Data.d.ts +0 -4
  73. package/dist/types/DataSignature.d.ts +0 -4
  74. package/dist/types/Era.d.ts +0 -1
  75. package/dist/types/Mint.d.ts +0 -10
  76. package/dist/types/NativeScript.d.ts +0 -14
  77. package/dist/types/Network.d.ts +0 -4
  78. package/dist/types/PlutusScript.d.ts +0 -5
  79. package/dist/types/PoolParams.d.ts +0 -16
  80. package/dist/types/Protocol.d.ts +0 -22
  81. package/dist/types/Recipient.d.ts +0 -11
  82. package/dist/types/Relay.d.ts +0 -13
  83. package/dist/types/Token.d.ts +0 -2
  84. package/dist/types/TransactionInfo.d.ts +0 -11
  85. package/dist/types/UTxO.d.ts +0 -15
  86. package/dist/types/Wallet.d.ts +0 -5
  87. package/dist/types/index.d.ts +0 -22
  88. package/dist/wallet/app.service.d.ts +0 -43
  89. package/dist/wallet/app.service.spec.d.ts +0 -1
  90. package/dist/wallet/browser.service.d.ts +0 -205
  91. package/dist/wallet/browser.service.spec.d.ts +0 -1
  92. package/dist/wallet/embedded.service.d.ts +0 -20
  93. package/dist/wallet/embedded.service.spec.d.ts +0 -1
  94. package/dist/wallet/index.d.ts +0 -4
  95. package/dist/wallet/mesh.service.d.ts +0 -188
  96. package/dist/wallet/mina.service.d.ts +0 -11
  97. 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/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,6 +0,0 @@
1
- export * from './blockfrost.provider';
2
- export * from './infura.provider';
3
- export * from './koios.provider';
4
- export * from './ogmios.provider';
5
- export * from './maestro.provider';
6
- export * from './yaci.provider';
@@ -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
- declare 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/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/types';
3
- export declare 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/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/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/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/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
- }
@@ -1 +0,0 @@
1
- export * from './forge.script';
@@ -1 +0,0 @@
1
- export * from './signatures';
@@ -1,42 +0,0 @@
1
- import { BuilderData, Certificate, MeshTxBuilderBody, MintItem, Protocol } from '..';
2
- import { TransactionBuilder, csl } from '@mesh/core';
3
- export declare const emptyTxBuilderBody: () => MeshTxBuilderBody;
4
- export interface IMeshSerializer {
5
- serializeTxBody(txBody: MeshTxBuilderBody, protocolParams: Protocol): string;
6
- addSigningKeys(txHex: string, signingKeys: string[]): string;
7
- }
8
- export declare class CSLSerializer implements IMeshSerializer {
9
- txBuilder: TransactionBuilder;
10
- protocolParams: Protocol;
11
- meshTxBuilderBody: MeshTxBuilderBody;
12
- constructor(protocolParams?: Protocol);
13
- serializeTxBody(txBody: MeshTxBuilderBody, protocolParams?: Protocol): string;
14
- addSigningKeys(txHex: string, signingKeys: string[]): string;
15
- private addUtxosFrom;
16
- private makePlutusScriptSource;
17
- protected removeDuplicateInputs: () => void;
18
- private addAllInputs;
19
- private addTxIn;
20
- private addScriptTxIn;
21
- private addAllOutputs;
22
- private addOutput;
23
- private addAllCollaterals;
24
- private addCollateral;
25
- private addCollateralReturn;
26
- private addAllReferenceInputs;
27
- private addReferenceInput;
28
- protected addAllMints: (mints: MintItem[]) => void;
29
- private addPlutusMint;
30
- private addNativeMint;
31
- private decimalToFraction;
32
- private toPoolParams;
33
- private addCertificate;
34
- protected addAllCertificates: (allCertificates: Certificate[]) => void;
35
- protected addCostModels: () => void;
36
- private addChange;
37
- private addValidityRange;
38
- private addAllRequiredSignatures;
39
- private addAllMetadata;
40
- protected castRawDataToJsonString: (rawData: object | string) => any;
41
- protected castDataToPlutusData: ({ type, content }: BuilderData) => csl.PlutusData;
42
- }
@@ -1,3 +0,0 @@
1
- import { csl } from '@mesh/core';
2
- import type { TransactionWitnessSet, Vkeywitnesses } from '@mesh/core';
3
- export declare const mergeSignatures: (txWitnessSet: TransactionWitnessSet, newSignatures: Vkeywitnesses) => csl.Vkeywitnesses;
@@ -1,2 +0,0 @@
1
- export * from './transaction.service';
2
- export * from './meshTxBuilder';
@@ -1,2 +0,0 @@
1
- export * from './meshTxBuilder.service';
2
- export * from './type';
@@ -1,47 +0,0 @@
1
- import { IEvaluator, IFetcher, ISubmitter } from '@mesh/common/contracts';
2
- import { MeshTxBuilderCore } from './meshTxBuilderCore';
3
- import { MeshTxBuilderBody } from './type';
4
- declare 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,292 +0,0 @@
1
- import { Action, Asset, LanguageVersion, Protocol, UTxO, PoolParams } from '@mesh/types';
2
- import { MintItem, TxIn, PubKeyTxIn, MeshTxBuilderBody, RefTxIn, BuilderData } from './type';
3
- import { IMeshSerializer } from '@mesh/serializer/serializer';
4
- export declare class MeshTxBuilderCore {
5
- txHex: string;
6
- txEvaluationMultiplier: number;
7
- private _protocolParams;
8
- serializer: IMeshSerializer;
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(serializer?: IMeshSerializer);
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) => string;
38
- /**
39
- * Complete the signing process
40
- * @returns The signed transaction in hex
41
- */
42
- completeSigning: () => string;
43
- /**
44
- * Set the input for transaction
45
- * @param txHash The transaction hash of the input UTxO
46
- * @param txIndex The transaction index of the input UTxO
47
- * @param amount The asset amount of index of the input UTxO
48
- * @param address The address of the input UTxO
49
- * @returns The MeshTxBuilder instance
50
- */
51
- txIn: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
52
- /**
53
- * Set the script for transaction input
54
- * @param {string} scriptCbor The CborHex of the script
55
- * @param version Optional - The Plutus script version
56
- * @returns The MeshTxBuilder instance
57
- */
58
- txInScript: (scriptCbor: string, version?: LanguageVersion) => this;
59
- /**
60
- * Set the input datum for transaction input
61
- * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
62
- * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
63
- * @returns The MeshTxBuilder instance
64
- */
65
- txInDatumValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
66
- /**
67
- * Tell the transaction builder that the input UTxO has inlined datum
68
- * @returns The MeshTxBuilder instance
69
- */
70
- txInInlineDatumPresent: () => this;
71
- /**
72
- * Set the redeemer for the reference input to be spent in same transaction
73
- * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
74
- * @param exUnits The execution units budget for the redeemer
75
- * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
76
- * @returns The MeshTxBuilder instance
77
- */
78
- txInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
79
- mem: number;
80
- steps: number;
81
- }, type?: BuilderData['type']) => this;
82
- /**
83
- * Set the output for transaction
84
- * @param {string} address The recipient of the output
85
- * @param {Asset[]} amount The amount of other native assets attached with UTxO
86
- * @returns The MeshTxBuilder instance
87
- */
88
- txOut: (address: string, amount: Asset[]) => this;
89
- /**
90
- * Set the output datum hash for transaction
91
- * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
92
- * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
93
- * @returns The MeshTxBuilder instance
94
- */
95
- txOutDatumHashValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
96
- /**
97
- * Set the output inline datum for transaction
98
- * @param datum The datum in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
99
- * @param type The datum type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
100
- * @returns The MeshTxBuilder instance
101
- */
102
- txOutInlineDatumValue: (datum: BuilderData['content'], type?: BuilderData['type']) => this;
103
- /**
104
- * Set the reference script to be attached with the output
105
- * @param scriptCbor The CBOR hex of the script to be attached to UTxO as reference script
106
- * @param version Optional - The Plutus script version
107
- * @returns The MeshTxBuilder instance
108
- */
109
- txOutReferenceScript: (scriptCbor: string, version?: LanguageVersion) => this;
110
- /**
111
- * Set the instruction that it is currently using V2 Plutus spending scripts
112
- * @returns The MeshTxBuilder instance
113
- */
114
- spendingPlutusScriptV2: () => this;
115
- /**
116
- * Set the reference input where it would also be spent in the transaction
117
- * @param txHash The transaction hash of the reference UTxO
118
- * @param txIndex The transaction index of the reference UTxO
119
- * @param spendingScriptHash The script hash of the spending script
120
- * @returns The MeshTxBuilder instance
121
- */
122
- spendingTxInReference: (txHash: string, txIndex: number, spendingScriptHash?: string, version?: LanguageVersion) => this;
123
- /**
124
- * [Alias of txInInlineDatumPresent] Set the instruction that the reference input has inline datum
125
- * @returns The MeshTxBuilder instance
126
- */
127
- spendingReferenceTxInInlineDatumPresent: () => this;
128
- /**
129
- * [Alias of txInRedeemerValue] Set the redeemer for the reference input to be spent in same transaction
130
- * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
131
- * @param exUnits The execution units budget for the redeemer
132
- * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
133
- * @returns The MeshTxBuilder instance
134
- */
135
- spendingReferenceTxInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
136
- mem: number;
137
- steps: number;
138
- }, type?: BuilderData['type']) => this;
139
- /**
140
- * Specify a read only reference input. This reference input is not witnessing anything it is simply provided in the plutus script context.
141
- * @param txHash The transaction hash of the reference UTxO
142
- * @param txIndex The transaction index of the reference UTxO
143
- * @returns The MeshTxBuilder instance
144
- */
145
- readOnlyTxInReference: (txHash: string, txIndex: number) => this;
146
- /**
147
- * Set the instruction that it is currently using V2 Plutus minting scripts
148
- * @returns The MeshTxBuilder instance
149
- */
150
- mintPlutusScriptV2: () => this;
151
- /**
152
- * Set the minting value of transaction
153
- * @param quantity The quantity of asset to be minted
154
- * @param policy The policy id of the asset to be minted
155
- * @param name The hex of token name of the asset to be minted
156
- * @returns The MeshTxBuilder instance
157
- */
158
- mint: (quantity: string, policy: string, name: string) => this;
159
- /**
160
- * Set the minting script of current mint
161
- * @param scriptCBOR The CBOR hex of the minting policy script
162
- * @param version Optional - The Plutus script version
163
- * @returns The MeshTxBuilder instance
164
- */
165
- mintingScript: (scriptCBOR: string, version?: LanguageVersion) => this;
166
- /**
167
- * Use reference script for minting
168
- * @param txHash The transaction hash of the UTxO
169
- * @param txIndex The transaction index of the UTxO
170
- * @returns The MeshTxBuilder instance
171
- */
172
- mintTxInReference: (txHash: string, txIndex: number, version?: LanguageVersion) => this;
173
- /**
174
- * Set the redeemer for minting
175
- * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
176
- * @param exUnits The execution units budget for the redeemer
177
- * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
178
- * @returns The MeshTxBuilder instance
179
- */
180
- mintReferenceTxInRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
181
- mem: number;
182
- steps: number;
183
- }, type?: BuilderData['type']) => this;
184
- /**
185
- * Set the redeemer for the reference input to be spent in same transaction
186
- * @param redeemer The redeemer in Mesh Data type, JSON in raw constructor like format, or CBOR hex string
187
- * @param exUnits The execution units budget for the redeemer
188
- * @param type The redeemer data type, either Mesh Data type, JSON in raw constructor like format, or CBOR hex string
189
- * @returns The MeshTxBuilder instance
190
- */
191
- mintRedeemerValue: (redeemer: BuilderData['content'], exUnits?: {
192
- mem: number;
193
- steps: number;
194
- }, type?: BuilderData['type']) => this;
195
- /**
196
- * Set the required signer of the transaction
197
- * @param pubKeyHash The PubKeyHash of the required signer
198
- * @returns The MeshTxBuilder instance
199
- */
200
- requiredSignerHash: (pubKeyHash: string) => this;
201
- /**
202
- * Set the collateral UTxO for the transaction
203
- * @param txHash The transaction hash of the collateral UTxO
204
- * @param txIndex The transaction index of the collateral UTxO
205
- * @param amount The asset amount of index of the collateral UTxO
206
- * @param address The address of the collateral UTxO
207
- * @returns The MeshTxBuilder instance
208
- */
209
- txInCollateral: (txHash: string, txIndex: number, amount?: Asset[], address?: string) => this;
210
- /**
211
- * Creates a pool registration certificate, and adds it to the transaction
212
- * @param poolParams Parameters for pool registration
213
- * @returns The MeshTxBuilder instance
214
- */
215
- registerPoolCertificate: (poolParams: PoolParams) => this;
216
- /**
217
- * Creates a stake registration certificate, and adds it to the transaction
218
- * @param stakeKeyHash The keyHash of the stake key
219
- * @returns The MeshTxBuilder instance
220
- */
221
- registerStakeCertificate: (stakeKeyHash: string) => this;
222
- /**
223
- * Creates a stake delegation certificate, and adds it to the transaction
224
- * This will delegate stake from the corresponding stake address to the pool
225
- * @param stakeKeyHash The keyHash of the stake key
226
- * @param poolId poolId can be in either bech32 or hex form
227
- * @returns The MeshTxBuilder instance
228
- */
229
- delegateStakeCertificate: (stakeKeyHash: string, poolId: string) => this;
230
- /**
231
- * Creates a stake deregister certificate, and adds it to the transaction
232
- * @param stakeKeyHash The keyHash of the stake key
233
- * @returns The MeshTxBuilder instance
234
- */
235
- deregisterStakeCertificate: (stakeKeyHash: string) => this;
236
- /**
237
- * Creates a pool retire certificate, and adds it to the transaction
238
- * @param poolId poolId can be in either bech32 or hex form
239
- * @param epoch The intended epoch to retire the pool
240
- * @returns The MeshTxBuilder instance
241
- */
242
- retirePoolCertificate: (poolId: string, epoch: number) => this;
243
- /**
244
- * Configure the address to accept change UTxO
245
- * @param addr The address to accept change UTxO
246
- * @returns The MeshTxBuilder instance
247
- */
248
- changeAddress: (addr: string) => this;
249
- /**
250
- * Set the transaction valid interval to be valid only after the slot
251
- * @param slot The transaction is valid only after this slot
252
- * @returns The MeshTxBuilder instance
253
- */
254
- invalidBefore: (slot: number) => this;
255
- /**
256
- * Set the transaction valid interval to be valid only before the slot
257
- * @param slot The transaction is valid only before this slot
258
- * @returns The MeshTxBuilder instance
259
- */
260
- invalidHereafter: (slot: number) => this;
261
- /**
262
- * Add metadata to the transaction
263
- * @param tag The tag of the metadata
264
- * @param metadata The metadata in object format
265
- * @returns The MeshTxBuilder instance
266
- */
267
- metadataValue: <T extends object>(tag: string, metadata: T) => this;
268
- /**
269
- * Set the protocol parameters to be used for the transaction other than the default one
270
- * @param params (Part of) the protocol parameters to be used for the transaction
271
- * @returns The MeshTxBuilder instance
272
- */
273
- protocolParams: (params: Partial<Protocol>) => this;
274
- /**
275
- * Sign the transaction with the private key
276
- * @param skeyHex The private key in cborHex (with or without 5820 prefix, i.e. the format when generated from cardano-cli)
277
- * @returns
278
- */
279
- signingKey: (skeyHex: string) => this;
280
- /**
281
- * EXPERIMENTAL - Selects utxos to fill output value and puts them into inputs
282
- * @param extraInputs The inputs already placed into the object will remain, these extra inputs will be used to fill the remaining value needed
283
- * @param threshold Extra value needed to be selected for, usually for paying fees and min UTxO value of change output
284
- */
285
- selectUtxosFrom: (extraInputs: UTxO[], threshold?: number) => this;
286
- private queueInput;
287
- private queueMint;
288
- protected removeDuplicateInputs: () => void;
289
- protected queueAllLastItem: () => void;
290
- protected updateRedeemer: (meshTxBuilderBody: MeshTxBuilderBody, txEvaluation: Omit<Action, 'data'>[]) => void;
291
- protected castRawDataToJsonString: (rawData: object | string) => any;
292
- }