@meshsdk/core 1.5.25 → 1.5.28

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 (91) hide show
  1. package/README.md +3 -30
  2. package/dist/index.d.mts +129 -0
  3. package/dist/index.d.ts +129 -11
  4. package/dist/index.js +149 -0
  5. package/dist/index.mjs +91 -0
  6. package/package.json +30 -60
  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/decorators.d.ts +0 -16
  17. package/dist/common/helpers/generateNonce.d.ts +0 -1
  18. package/dist/common/helpers/index.d.ts +0 -4
  19. package/dist/common/helpers/mergeSignatures.d.ts +0 -3
  20. package/dist/common/helpers/readPlutusData.d.ts +0 -2
  21. package/dist/common/helpers/readTransaction.d.ts +0 -2
  22. package/dist/common/types/Account.d.ts +0 -5
  23. package/dist/common/types/AccountInfo.d.ts +0 -7
  24. package/dist/common/types/Action.d.ts +0 -12
  25. package/dist/common/types/Asset.d.ts +0 -7
  26. package/dist/common/types/AssetExtended.d.ts +0 -8
  27. package/dist/common/types/AssetMetadata.d.ts +0 -24
  28. package/dist/common/types/BlockInfo.d.ts +0 -17
  29. package/dist/common/types/Data.d.ts +0 -4
  30. package/dist/common/types/DataSignature.d.ts +0 -4
  31. package/dist/common/types/Era.d.ts +0 -1
  32. package/dist/common/types/Mint.d.ts +0 -10
  33. package/dist/common/types/NativeScript.d.ts +0 -14
  34. package/dist/common/types/Network.d.ts +0 -4
  35. package/dist/common/types/PlutusScript.d.ts +0 -6
  36. package/dist/common/types/PoolParams.d.ts +0 -16
  37. package/dist/common/types/Protocol.d.ts +0 -22
  38. package/dist/common/types/Recipient.d.ts +0 -11
  39. package/dist/common/types/Relay.d.ts +0 -13
  40. package/dist/common/types/Token.d.ts +0 -2
  41. package/dist/common/types/TransactionInfo.d.ts +0 -11
  42. package/dist/common/types/UTxO.d.ts +0 -15
  43. package/dist/common/types/Wallet.d.ts +0 -5
  44. package/dist/common/types/index.d.ts +0 -22
  45. package/dist/common/utils/builder.d.ts +0 -18
  46. package/dist/common/utils/converter.d.ts +0 -27
  47. package/dist/common/utils/deserializer.d.ts +0 -19
  48. package/dist/common/utils/index.d.ts +0 -5
  49. package/dist/common/utils/parser.d.ts +0 -5
  50. package/dist/common/utils/resolver.d.ts +0 -19
  51. package/dist/core/CIP14.d.ts +0 -2
  52. package/dist/core/CIP1852.d.ts +0 -4
  53. package/dist/core/CIP1853.d.ts +0 -1
  54. package/dist/core/CIP1855.d.ts +0 -1
  55. package/dist/core/CIP2.d.ts +0 -4
  56. package/dist/core/CIP25.d.ts +0 -19
  57. package/dist/core/CIP27.d.ts +0 -4
  58. package/dist/core/CIP8.d.ts +0 -15
  59. package/dist/core/CPS-009.d.ts +0 -2
  60. package/dist/core/CSL.d.ts +0 -147
  61. package/dist/core/index.d.ts +0 -9
  62. package/dist/core.cjs +0 -8
  63. package/dist/core.js +0 -5995
  64. package/dist/providers/blockfrost.provider.d.ts +0 -46
  65. package/dist/providers/index.d.ts +0 -6
  66. package/dist/providers/infura.provider.d.ts +0 -12
  67. package/dist/providers/koios.provider.d.ts +0 -27
  68. package/dist/providers/maestro.provider.d.ts +0 -35
  69. package/dist/providers/ogmios.provider.d.ts +0 -12
  70. package/dist/providers/tango.provider.d.ts +0 -25
  71. package/dist/providers/yaci.provider.d.ts +0 -32
  72. package/dist/scripts/forge.script.d.ts +0 -8
  73. package/dist/scripts/index.d.ts +0 -1
  74. package/dist/transaction/index.d.ts +0 -2
  75. package/dist/transaction/meshTxBuilder/index.d.ts +0 -2
  76. package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +0 -47
  77. package/dist/transaction/meshTxBuilder/meshTxBuilder.spec.d.ts +0 -1
  78. package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +0 -321
  79. package/dist/transaction/meshTxBuilder/type.d.ts +0 -146
  80. package/dist/transaction/transaction.service.d.ts +0 -157
  81. package/dist/transaction/transaction.service.spec.d.ts +0 -1
  82. package/dist/wallet/app.service.d.ts +0 -45
  83. package/dist/wallet/app.service.spec.d.ts +0 -1
  84. package/dist/wallet/browser.service.d.ts +0 -218
  85. package/dist/wallet/browser.service.spec.d.ts +0 -1
  86. package/dist/wallet/embedded.service.d.ts +0 -21
  87. package/dist/wallet/embedded.service.spec.d.ts +0 -1
  88. package/dist/wallet/index.d.ts +0 -4
  89. package/dist/wallet/mesh.service.d.ts +0 -193
  90. package/dist/wallet/mina.service.d.ts +0 -11
  91. package/dist/wallet/mina.service.spec.d.ts +0 -1
@@ -1,193 +0,0 @@
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
- networkId: number;
6
- fetcher?: IFetcher;
7
- submitter?: ISubmitter;
8
- key: {
9
- type: "root";
10
- bech32: string;
11
- } | {
12
- type: "cli";
13
- payment: string;
14
- stake?: string;
15
- } | {
16
- type: "mnemonic";
17
- words: string[];
18
- };
19
- };
20
- /**
21
- * Mesh Wallet provides a set of APIs to interact with the blockchain. This wallet is compatible with Mesh transaction builders.
22
- *
23
- * It is a single address wallet, a wrapper around the AppWallet class.
24
- *
25
- * ```javascript
26
- * import { MeshWallet, BlockfrostProvider } from '@meshsdk/core';
27
- *
28
- * const blockchainProvider = new BlockfrostProvider('<BLOCKFROST_API_KEY>');
29
- *
30
- * const wallet = new MeshWallet({
31
- * networkId: 0,
32
- * fetcher: blockchainProvider,
33
- * submitter: blockchainProvider,
34
- * key: {
35
- * type: 'mnemonic',
36
- * words: ["solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution","solution"],
37
- * },
38
- * });
39
- * ```
40
- */
41
- export declare class MeshWallet implements IInitiator, ISigner, ISubmitter {
42
- private readonly _wallet;
43
- private readonly _network;
44
- constructor(options: CreateMeshWalletOptions);
45
- /**
46
- * Returns a list of assets in the wallet. This API will return every assets in the wallet. Each asset is an object with the following properties:
47
- * - A unit is provided to display asset's name on the user interface.
48
- * - A quantity is provided to display asset's quantity on the user interface.
49
- *
50
- * @returns a list of assets and their quantities
51
- */
52
- getBalance(): Promise<Asset[]>;
53
- /**
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
- *
56
- * @param addressType - `enterprise` or `base` address
57
- * @returns an address
58
- */
59
- getChangeAddress(addressType?: "enterprise" | "base"): string;
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).
62
- *
63
- * If this cannot be attained, an error message with an explanation of the blocking problem shall be returned. NOTE: wallets are free to return UTXOs that add up to a greater total ADA value than requested in the amount parameter, but wallets must never return any result where UTXOs would sum up to a smaller total ADA value, instead in a case like that an error message must be returned.
64
- *
65
- * @returns a list of UTXOs
66
- */
67
- getCollateral(): Promise<UTxO[]>;
68
- /**
69
- * Returns the network ID of the currently connected account. 0 is testnet and 1 is mainnet but other networks can possibly be returned by wallets. Those other network ID values are not governed by CIP-30. This result will stay the same unless the connected account has changed.
70
- *
71
- * @returns network ID
72
- */
73
- getNetworkId(): number;
74
- /**
75
- * Returns a list of reward addresses owned by the wallet. A reward address is a stake address that is used to receive rewards from staking, generally starts from `stake` prefix.
76
- *
77
- * @returns a list of reward addresses
78
- */
79
- getRewardAddresses(): Promise<string[]>;
80
- /**
81
- * Returns a list of unused addresses controlled by the wallet.
82
- *
83
- * @param addressType - `enterprise` or `base` address
84
- * @returns a list of unused addresses
85
- */
86
- getUnusedAddresses(addressType?: "enterprise" | "base"): string[];
87
- /**
88
- * Returns a list of used addresses controlled by the wallet.
89
- *
90
- * @param addressType - `enterprise` or `base` address
91
- * @returns a list of used addresses
92
- */
93
- getUsedAddresses(addressType?: "enterprise" | "base"): Promise<string[]>;
94
- /**
95
- * Return a list of all UTXOs (unspent transaction outputs) controlled by the wallet.
96
- *
97
- * @param addressType - `enterprise` or `base` address
98
- * @returns a list of UTXOs
99
- */
100
- getUtxos(addressType?: "enterprise" | "base"): Promise<UTxO[]>;
101
- /**
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.
103
- *
104
- * Here, we get the first wallet's address with wallet.getUsedAddresses(), alternativelly you can use reward addresses (getRewardAddresses()) too. It's really up to you as the developer which address you want to use in your application.
105
- *
106
- * @param address
107
- * @param payload
108
- * @returns a signature
109
- */
110
- signData(payload: string): DataSignature;
111
- /**
112
- * Requests user to sign the provided transaction (tx). The wallet should ask the user for permission, and if given, try to sign the supplied body and return a signed transaction. partialSign should be true if the transaction provided requires multiple signatures.
113
- *
114
- * @param unsignedTx
115
- * @param partialSign
116
- * @returns a signed transaction in CBOR
117
- */
118
- signTx(unsignedTx: string, partialSign?: boolean): Promise<string>;
119
- /**
120
- * Experimental feature - sign multiple transactions at once.
121
- *
122
- * @param unsignedTxs - array of unsigned transactions in CborHex string
123
- * @param partialSign - if the transactions are signed partially
124
- * @returns array of signed transactions CborHex string
125
- */
126
- signTxs(unsignedTxs: string[], partialSign?: boolean): Promise<string[]>;
127
- /**
128
- * Submits the signed transaction to the blockchain network.
129
- *
130
- * As wallets should already have this ability to submit transaction, we allow dApps to request that a transaction be sent through it. If the wallet accepts the transaction and tries to send it, it shall return the transaction ID for the dApp to track. The wallet can return error messages or failure if there was an error in sending it.
131
- *
132
- * @param tx
133
- * @returns a transaction hash
134
- */
135
- submitTx(tx: string): Promise<string>;
136
- /**
137
- * Get a used address of type Address from the wallet.
138
- *
139
- * This is used in transaction building.
140
- *
141
- * @returns an Address object
142
- */
143
- getUsedAddress(): Address;
144
- /**
145
- * Get a list of UTXOs to be used as collateral inputs for transactions with plutus script inputs.
146
- *
147
- * This is used in transaction building.
148
- *
149
- * @returns a list of UTXOs
150
- */
151
- getUsedCollateral(): Promise<TransactionUnspentOutput[]>;
152
- /**
153
- * Get a list of UTXOs to be used for transaction building.
154
- *
155
- * This is used in transaction building.
156
- *
157
- * @param addressType - `enterprise` or `base` address
158
- * @returns a list of UTXOs
159
- */
160
- getUsedUTxOs(addressType?: "enterprise" | "base"): Promise<TransactionUnspentOutput[]>;
161
- /**
162
- * A helper function to get the assets in the wallet.
163
- *
164
- * @returns a list of assets
165
- */
166
- getAssets(): Promise<AssetExtended[]>;
167
- /**
168
- * A helper function to get the lovelace balance in the wallet.
169
- *
170
- * @returns lovelace balance
171
- */
172
- getLovelace(): Promise<string>;
173
- /**
174
- * A helper function to get the assets of a specific policy ID in the wallet.
175
- *
176
- * @param policyId
177
- * @returns a list of assets
178
- */
179
- getPolicyIdAssets(policyId: string): Promise<AssetExtended[]>;
180
- /**
181
- * A helper function to get the policy IDs of all the assets in the wallet.
182
- *
183
- * @returns a list of policy IDs
184
- */
185
- getPolicyIds(): Promise<string[]>;
186
- /**
187
- * A helper function to create a collateral input for a transaction.
188
- *
189
- * @returns a transaction hash
190
- */
191
- createCollateral(): Promise<string>;
192
- static brew(privateKey?: boolean, strength?: number): string[] | string;
193
- }
@@ -1,11 +0,0 @@
1
- import type { UTxO } from '@mesh/common/types';
2
- export declare class MinaWallet {
3
- static getAxiosInstance(): import("axios").AxiosInstance;
4
- static getAppId(): string;
5
- static openMinaFrontend(url: string): Promise<unknown>;
6
- static get(route: string, params?: {}): Promise<any>;
7
- static enable(): Promise<unknown>;
8
- static getChangeAddress(walletId?: undefined, accountIndex?: undefined): Promise<string | undefined>;
9
- static getUtxos(walletId?: undefined, accountIndex?: undefined): Promise<UTxO[]>;
10
- static signTx(unsignedTx: string, partialSign?: boolean): Promise<string | undefined>;
11
- }
@@ -1 +0,0 @@
1
- export {};