@meshsdk/core 1.5.24 → 1.5.25
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/dist/common/contracts/initiator.d.ts +1 -1
- package/dist/common/contracts/signer.d.ts +1 -1
- package/dist/common/decorators.d.ts +0 -3
- package/dist/common/types/Account.d.ts +1 -1
- package/dist/common/types/AccountInfo.d.ts +1 -1
- package/dist/common/types/Action.d.ts +2 -2
- package/dist/common/types/Asset.d.ts +3 -3
- package/dist/common/types/AssetExtended.d.ts +1 -1
- package/dist/common/types/AssetMetadata.d.ts +7 -7
- package/dist/common/types/BlockInfo.d.ts +1 -1
- package/dist/common/types/Data.d.ts +1 -1
- package/dist/common/types/DataSignature.d.ts +1 -1
- package/dist/common/types/Era.d.ts +1 -1
- package/dist/common/types/Mint.d.ts +1 -1
- package/dist/common/types/NativeScript.d.ts +1 -1
- package/dist/common/types/Network.d.ts +1 -1
- package/dist/common/types/PlutusScript.d.ts +2 -2
- package/dist/common/types/PoolParams.d.ts +2 -2
- package/dist/common/types/Protocol.d.ts +1 -1
- package/dist/common/types/Recipient.d.ts +1 -1
- package/dist/common/types/Relay.d.ts +1 -1
- package/dist/common/types/Token.d.ts +1 -1
- package/dist/common/types/TransactionInfo.d.ts +1 -1
- package/dist/common/types/UTxO.d.ts +1 -1
- package/dist/common/types/Wallet.d.ts +1 -1
- package/dist/core/CIP25.d.ts +2 -2
- package/dist/core/CIP27.d.ts +1 -1
- package/dist/core/CIP8.d.ts +2 -2
- package/dist/core/CSL.d.ts +145 -145
- package/dist/core.cjs +6 -6
- package/dist/core.js +1216 -554
- package/dist/providers/infura.provider.d.ts +1 -1
- package/dist/providers/maestro.provider.d.ts +1 -1
- package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +1 -1
- package/dist/transaction/meshTxBuilder/type.d.ts +19 -19
- package/dist/transaction/transaction.service.d.ts +1 -1
- package/dist/wallet/app.service.d.ts +11 -11
- package/dist/wallet/browser.service.d.ts +4 -4
- package/dist/wallet/mesh.service.d.ts +17 -12
- package/package.json +15 -26
|
@@ -4,7 +4,7 @@ export declare class InfuraProvider implements IUploader {
|
|
|
4
4
|
constructor(projectId: string, projectSecret: string, options: Partial<CreateInfuraProviderOptions>);
|
|
5
5
|
uploadContent(content: FormData, recursive?: boolean): Promise<string>;
|
|
6
6
|
}
|
|
7
|
-
|
|
7
|
+
type CreateInfuraProviderOptions = {
|
|
8
8
|
host: string;
|
|
9
9
|
port: number;
|
|
10
10
|
version: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IEvaluator, IFetcher, ISubmitter } from '@mesh/common/contracts';
|
|
2
2
|
import type { AccountInfo, Action, Asset, AssetMetadata, BlockInfo, Protocol, TransactionInfo, UTxO } from '@mesh/common/types';
|
|
3
|
-
export
|
|
3
|
+
export type MaestroSupportedNetworks = 'Mainnet' | 'Preprod' | 'Preview';
|
|
4
4
|
export interface MaestroConfig {
|
|
5
5
|
network: MaestroSupportedNetworks;
|
|
6
6
|
apiKey: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IEvaluator, IFetcher, ISubmitter } from '@mesh/common/contracts';
|
|
2
2
|
import { MeshTxBuilderCore } from './meshTxBuilderCore';
|
|
3
3
|
import { MeshTxBuilderBody } from './type';
|
|
4
|
-
|
|
4
|
+
type MeshTxBuilderOptions = {
|
|
5
5
|
fetcher?: IFetcher;
|
|
6
6
|
submitter?: ISubmitter;
|
|
7
7
|
evaluator?: IEvaluator;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Asset, Budget, Data, LanguageVersion, PlutusScript, UTxO, PoolParams } from '@mesh/common/types';
|
|
2
|
-
export
|
|
2
|
+
export type MeshTxBuilderBody = {
|
|
3
3
|
inputs: TxIn[];
|
|
4
4
|
outputs: Output[];
|
|
5
5
|
extraInputs: UTxO[];
|
|
@@ -14,23 +14,23 @@ export declare type MeshTxBuilderBody = {
|
|
|
14
14
|
certificates: Certificate[];
|
|
15
15
|
signingKey: string[];
|
|
16
16
|
};
|
|
17
|
-
export
|
|
18
|
-
export
|
|
17
|
+
export type TxIn = PubKeyTxIn | SimpleScriptTxIn | ScriptTxIn;
|
|
18
|
+
export type PubKeyTxIn = {
|
|
19
19
|
type: 'PubKey';
|
|
20
20
|
txIn: TxInParameter;
|
|
21
21
|
};
|
|
22
|
-
export
|
|
22
|
+
export type TxInParameter = {
|
|
23
23
|
txHash: string;
|
|
24
24
|
txIndex: number;
|
|
25
25
|
amount?: Asset[];
|
|
26
26
|
address?: string;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type SimpleScriptTxIn = {
|
|
29
29
|
type: 'SimpleScript';
|
|
30
30
|
txIn: TxInParameter;
|
|
31
31
|
simpleScriptTxIn: SimpleScriptTxInParameter;
|
|
32
32
|
};
|
|
33
|
-
export
|
|
33
|
+
export type SimpleScriptTxInParameter = {
|
|
34
34
|
scriptSource?: {
|
|
35
35
|
type: 'Provided';
|
|
36
36
|
script: string;
|
|
@@ -39,16 +39,16 @@ export declare type SimpleScriptTxInParameter = {
|
|
|
39
39
|
txInInfo: SimpleScriptSourceInfo;
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
export
|
|
42
|
+
export type SimpleScriptSourceInfo = {
|
|
43
43
|
txHash: string;
|
|
44
44
|
txIndex: number;
|
|
45
45
|
};
|
|
46
|
-
export
|
|
46
|
+
export type ScriptTxIn = {
|
|
47
47
|
type: 'Script';
|
|
48
48
|
txIn: TxInParameter;
|
|
49
49
|
scriptTxIn: ScriptTxInParameter;
|
|
50
50
|
};
|
|
51
|
-
export
|
|
51
|
+
export type ScriptTxInParameter = {
|
|
52
52
|
scriptSource?: {
|
|
53
53
|
type: 'Provided';
|
|
54
54
|
script: PlutusScript;
|
|
@@ -66,17 +66,17 @@ export declare type ScriptTxInParameter = {
|
|
|
66
66
|
};
|
|
67
67
|
redeemer?: Redeemer;
|
|
68
68
|
};
|
|
69
|
-
export
|
|
69
|
+
export type ScriptSourceInfo = {
|
|
70
70
|
txHash: string;
|
|
71
71
|
txIndex: number;
|
|
72
72
|
spendingScriptHash?: string;
|
|
73
73
|
version: LanguageVersion;
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type RefTxIn = {
|
|
76
76
|
txHash: string;
|
|
77
77
|
txIndex: number;
|
|
78
78
|
};
|
|
79
|
-
export
|
|
79
|
+
export type Output = {
|
|
80
80
|
address: string;
|
|
81
81
|
amount: Asset[];
|
|
82
82
|
datum?: {
|
|
@@ -85,7 +85,7 @@ export declare type Output = {
|
|
|
85
85
|
};
|
|
86
86
|
referenceScript?: PlutusScript;
|
|
87
87
|
};
|
|
88
|
-
export
|
|
88
|
+
export type MintItem = {
|
|
89
89
|
type: 'Plutus' | 'Native';
|
|
90
90
|
policyId: string;
|
|
91
91
|
assetName: string;
|
|
@@ -101,11 +101,11 @@ export declare type MintItem = {
|
|
|
101
101
|
version: LanguageVersion;
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
-
export
|
|
104
|
+
export type ValidityRange = {
|
|
105
105
|
invalidBefore?: number;
|
|
106
106
|
invalidHereafter?: number;
|
|
107
107
|
};
|
|
108
|
-
export
|
|
108
|
+
export type BuilderData = {
|
|
109
109
|
type: 'Mesh';
|
|
110
110
|
content: Data;
|
|
111
111
|
} | {
|
|
@@ -115,15 +115,15 @@ export declare type BuilderData = {
|
|
|
115
115
|
type: 'CBOR';
|
|
116
116
|
content: string;
|
|
117
117
|
};
|
|
118
|
-
export
|
|
118
|
+
export type Redeemer = {
|
|
119
119
|
data: BuilderData;
|
|
120
120
|
exUnits: Budget;
|
|
121
121
|
};
|
|
122
|
-
export
|
|
122
|
+
export type Metadata = {
|
|
123
123
|
tag: string;
|
|
124
124
|
metadata: object;
|
|
125
125
|
};
|
|
126
|
-
export
|
|
126
|
+
export type Certificate = {
|
|
127
127
|
type: 'RegisterPool';
|
|
128
128
|
poolParams: PoolParams;
|
|
129
129
|
} | {
|
|
@@ -141,6 +141,6 @@ export declare type Certificate = {
|
|
|
141
141
|
poolId: string;
|
|
142
142
|
epoch: number;
|
|
143
143
|
};
|
|
144
|
-
export
|
|
144
|
+
export type RequiredWith<T, K extends keyof T> = Required<T> & {
|
|
145
145
|
[P in K]: Required<T[P]>;
|
|
146
146
|
};
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { csl } from
|
|
2
|
-
import { IFetcher, IInitiator, ISigner, ISubmitter } from
|
|
3
|
-
import type { Address, TransactionUnspentOutput } from
|
|
4
|
-
import type { DataSignature } from
|
|
5
|
-
export
|
|
6
|
-
type:
|
|
1
|
+
import { csl } from "@mesh/core";
|
|
2
|
+
import { IFetcher, IInitiator, ISigner, ISubmitter } from "@mesh/common/contracts";
|
|
3
|
+
import type { Address, TransactionUnspentOutput } from "@mesh/core";
|
|
4
|
+
import type { DataSignature } from "@mesh/common/types";
|
|
5
|
+
export type AppWalletKeyType = {
|
|
6
|
+
type: "root";
|
|
7
7
|
bech32: string;
|
|
8
8
|
} | {
|
|
9
|
-
type:
|
|
9
|
+
type: "cli";
|
|
10
10
|
payment: string;
|
|
11
11
|
stake?: string;
|
|
12
12
|
} | {
|
|
13
|
-
type:
|
|
13
|
+
type: "mnemonic";
|
|
14
14
|
words: string[];
|
|
15
15
|
};
|
|
16
|
-
export
|
|
16
|
+
export type CreateAppWalletOptions = {
|
|
17
17
|
networkId: number;
|
|
18
18
|
fetcher?: IFetcher;
|
|
19
19
|
submitter?: ISubmitter;
|
|
@@ -29,9 +29,9 @@ export declare class AppWallet implements IInitiator, ISigner, ISubmitter {
|
|
|
29
29
|
getRewardAddress(accountIndex?: number, keyIndex?: number): string;
|
|
30
30
|
getUsedAddress(accountIndex?: number, keyIndex?: number): Address;
|
|
31
31
|
getUsedCollateral(_limit?: number): Promise<TransactionUnspentOutput[]>;
|
|
32
|
-
getUsedUTxOs(accountIndex?: number): Promise<TransactionUnspentOutput[]>;
|
|
32
|
+
getUsedUTxOs(accountIndex?: number, addressType?: "enterprise" | "base"): Promise<TransactionUnspentOutput[]>;
|
|
33
33
|
signData(address: string, payload: string, accountIndex?: number, keyIndex?: number): DataSignature;
|
|
34
|
-
signTx(unsignedTx: string, partialSign?: boolean, accountIndex?: number, keyIndex?: number): Promise<string>;
|
|
34
|
+
signTx(unsignedTx: string, partialSign?: boolean, accountIndex?: number, keyIndex?: number, addressType?: "enterprise" | "base"): Promise<string>;
|
|
35
35
|
signTxSync(unsignedTx: string, partialSign?: boolean, accountIndex?: number, keyIndex?: number): string;
|
|
36
36
|
signTxs(unsignedTxs: string[], partialSign: boolean): Promise<string[]>;
|
|
37
37
|
submitTx(tx: string): Promise<string>;
|
|
@@ -183,7 +183,7 @@ declare global {
|
|
|
183
183
|
cardano: Cardano;
|
|
184
184
|
}
|
|
185
185
|
}
|
|
186
|
-
|
|
186
|
+
type Cardano = {
|
|
187
187
|
[key: string]: {
|
|
188
188
|
name: string;
|
|
189
189
|
icon: string;
|
|
@@ -191,11 +191,11 @@ declare type Cardano = {
|
|
|
191
191
|
enable: () => Promise<WalletInstance>;
|
|
192
192
|
};
|
|
193
193
|
};
|
|
194
|
-
|
|
194
|
+
type TransactionSignatureRequest = {
|
|
195
195
|
cbor: string;
|
|
196
196
|
partialSign: boolean;
|
|
197
197
|
};
|
|
198
|
-
|
|
198
|
+
type WalletInstance = {
|
|
199
199
|
experimental: ExperimentalFeatures;
|
|
200
200
|
getBalance(): Promise<string>;
|
|
201
201
|
getChangeAddress(): Promise<string>;
|
|
@@ -210,7 +210,7 @@ declare type WalletInstance = {
|
|
|
210
210
|
signTxs?(txs: string[], partialSign: boolean): Promise<string[]>;
|
|
211
211
|
submitTx(tx: string): Promise<string>;
|
|
212
212
|
};
|
|
213
|
-
|
|
213
|
+
type ExperimentalFeatures = {
|
|
214
214
|
getCollateral(): Promise<string[] | undefined>;
|
|
215
215
|
signTxs?(txs: TransactionSignatureRequest[]): Promise<string[]>;
|
|
216
216
|
signTxs?(txs: string[], partialSign: boolean): Promise<string[]>;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { IFetcher, IInitiator, ISigner, ISubmitter } from
|
|
2
|
-
import type { Address, TransactionUnspentOutput } from
|
|
3
|
-
import type { Asset, AssetExtended, DataSignature, UTxO } from
|
|
4
|
-
export
|
|
1
|
+
import { IFetcher, IInitiator, ISigner, ISubmitter } from "@mesh/common/contracts";
|
|
2
|
+
import type { Address, TransactionUnspentOutput } from "@mesh/core";
|
|
3
|
+
import type { Asset, AssetExtended, DataSignature, UTxO } from "@mesh/common/types";
|
|
4
|
+
export type CreateMeshWalletOptions = {
|
|
5
5
|
networkId: number;
|
|
6
6
|
fetcher?: IFetcher;
|
|
7
7
|
submitter?: ISubmitter;
|
|
8
8
|
key: {
|
|
9
|
-
type:
|
|
9
|
+
type: "root";
|
|
10
10
|
bech32: string;
|
|
11
11
|
} | {
|
|
12
|
-
type:
|
|
12
|
+
type: "cli";
|
|
13
13
|
payment: string;
|
|
14
14
|
stake?: string;
|
|
15
15
|
} | {
|
|
16
|
-
type:
|
|
16
|
+
type: "mnemonic";
|
|
17
17
|
words: string[];
|
|
18
18
|
};
|
|
19
19
|
};
|
|
@@ -53,9 +53,10 @@ export declare class MeshWallet implements IInitiator, ISigner, ISubmitter {
|
|
|
53
53
|
/**
|
|
54
54
|
* Returns an address owned by the wallet that should be used as a change address to return leftover assets during transaction creation back to the connected wallet.
|
|
55
55
|
*
|
|
56
|
+
* @param addressType - `enterprise` or `base` address
|
|
56
57
|
* @returns an address
|
|
57
58
|
*/
|
|
58
|
-
getChangeAddress(): string;
|
|
59
|
+
getChangeAddress(addressType?: "enterprise" | "base"): string;
|
|
59
60
|
/**
|
|
60
61
|
* This function shall return a list of one or more UTXOs (unspent transaction outputs) controlled by the wallet that are required to reach AT LEAST the combined ADA value target specified in amount AND the best suitable to be used as collateral inputs for transactions with plutus script inputs (pure ADA-only UTXOs).
|
|
61
62
|
*
|
|
@@ -79,21 +80,24 @@ export declare class MeshWallet implements IInitiator, ISigner, ISubmitter {
|
|
|
79
80
|
/**
|
|
80
81
|
* Returns a list of unused addresses controlled by the wallet.
|
|
81
82
|
*
|
|
83
|
+
* @param addressType - `enterprise` or `base` address
|
|
82
84
|
* @returns a list of unused addresses
|
|
83
85
|
*/
|
|
84
|
-
getUnusedAddresses(): string[];
|
|
86
|
+
getUnusedAddresses(addressType?: "enterprise" | "base"): string[];
|
|
85
87
|
/**
|
|
86
88
|
* Returns a list of used addresses controlled by the wallet.
|
|
87
89
|
*
|
|
90
|
+
* @param addressType - `enterprise` or `base` address
|
|
88
91
|
* @returns a list of used addresses
|
|
89
92
|
*/
|
|
90
|
-
getUsedAddresses(): Promise<string[]>;
|
|
93
|
+
getUsedAddresses(addressType?: "enterprise" | "base"): Promise<string[]>;
|
|
91
94
|
/**
|
|
92
95
|
* Return a list of all UTXOs (unspent transaction outputs) controlled by the wallet.
|
|
93
96
|
*
|
|
97
|
+
* @param addressType - `enterprise` or `base` address
|
|
94
98
|
* @returns a list of UTXOs
|
|
95
99
|
*/
|
|
96
|
-
getUtxos(): Promise<UTxO[]>;
|
|
100
|
+
getUtxos(addressType?: "enterprise" | "base"): Promise<UTxO[]>;
|
|
97
101
|
/**
|
|
98
102
|
* This endpoint utilizes the [CIP-8 - Message Signing](https://github.com/cardano-foundation/CIPs/tree/master/CIP-0030) to sign arbitrary data, to verify the data was signed by the owner of the private key.
|
|
99
103
|
*
|
|
@@ -150,9 +154,10 @@ export declare class MeshWallet implements IInitiator, ISigner, ISubmitter {
|
|
|
150
154
|
*
|
|
151
155
|
* This is used in transaction building.
|
|
152
156
|
*
|
|
157
|
+
* @param addressType - `enterprise` or `base` address
|
|
153
158
|
* @returns a list of UTXOs
|
|
154
159
|
*/
|
|
155
|
-
getUsedUTxOs(): Promise<TransactionUnspentOutput[]>;
|
|
160
|
+
getUsedUTxOs(addressType?: "enterprise" | "base"): Promise<TransactionUnspentOutput[]>;
|
|
156
161
|
/**
|
|
157
162
|
* A helper function to get the assets in the wallet.
|
|
158
163
|
*
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "Rapidly build Web3 apps on the Cardano Blockchain.",
|
|
4
4
|
"homepage": "https://meshjs.dev",
|
|
5
5
|
"author": "MeshJS",
|
|
6
|
-
"version": "1.5.
|
|
6
|
+
"version": "1.5.25",
|
|
7
7
|
"license": "Apache-2.0",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"repository": {
|
|
@@ -28,21 +28,14 @@
|
|
|
28
28
|
"node": ">=16"
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
|
-
"lint": "eslint --ext .ts .",
|
|
32
31
|
"test": "vitest --run",
|
|
33
32
|
"test:watch": "vitest",
|
|
34
33
|
"test:coverage": "vitest run --coverage",
|
|
35
|
-
"build": "vite build &&
|
|
36
|
-
"prepare": "yarn lint && yarn test && yarn build",
|
|
34
|
+
"build": "vite build && pnpm run docs",
|
|
37
35
|
"dev": "vite build --watch",
|
|
38
|
-
"docs": "typedoc src/index.ts --json
|
|
36
|
+
"docs": "typedoc src/index.ts --json ../../mesh-docs/src/data/api.json",
|
|
39
37
|
"docs2": "typedoc src/index.ts --out ../docs/tmp"
|
|
40
38
|
},
|
|
41
|
-
"husky": {
|
|
42
|
-
"hooks": {
|
|
43
|
-
"pre-commit": "yarn lint"
|
|
44
|
-
}
|
|
45
|
-
},
|
|
46
39
|
"browser": {
|
|
47
40
|
"@emurgo/cardano-message-signing-nodejs": "@emurgo/cardano-message-signing-browser",
|
|
48
41
|
"@emurgo/cardano-serialization-lib-nodejs": "@emurgo/cardano-serialization-lib-browser"
|
|
@@ -55,17 +48,13 @@
|
|
|
55
48
|
}
|
|
56
49
|
},
|
|
57
50
|
"devDependencies": {
|
|
58
|
-
"@rollup/plugin-typescript": "
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"vite": "3.1.4",
|
|
66
|
-
"vite-plugin-eslint": "1.8.1",
|
|
67
|
-
"vite-plugin-wasm": "2.1.0",
|
|
68
|
-
"vitest": "0.22.1"
|
|
51
|
+
"@rollup/plugin-typescript": "11.1.6",
|
|
52
|
+
"rollup": "4.18.0",
|
|
53
|
+
"tslib": "2.6.3",
|
|
54
|
+
"typedoc": "0.25.13",
|
|
55
|
+
"vite": "5.2.13",
|
|
56
|
+
"vite-plugin-wasm": "3.3.0",
|
|
57
|
+
"vitest": "1.6.0"
|
|
69
58
|
},
|
|
70
59
|
"dependencies": {
|
|
71
60
|
"@emurgo/cardano-message-signing-browser": "1.0.1",
|
|
@@ -73,10 +62,10 @@
|
|
|
73
62
|
"@emurgo/cardano-serialization-lib-browser": "11.5.0",
|
|
74
63
|
"@emurgo/cardano-serialization-lib-nodejs": "11.5.0",
|
|
75
64
|
"@emurgo/cip14-js": "3.0.1",
|
|
76
|
-
"axios": "1.
|
|
77
|
-
"bip39": "3.0
|
|
78
|
-
"json-bigint": "
|
|
79
|
-
"nanoid": "
|
|
80
|
-
"zod": "3.
|
|
65
|
+
"axios": "1.7.2",
|
|
66
|
+
"bip39": "3.1.0",
|
|
67
|
+
"json-bigint": "1.0.0",
|
|
68
|
+
"nanoid": "5.0.7",
|
|
69
|
+
"zod": "3.23.8"
|
|
81
70
|
}
|
|
82
71
|
}
|