@meshsdk/core 1.6.0-alpha.16 → 1.6.0-alpha.18

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 (71) hide show
  1. package/dist/core/CIP1852.d.ts +3 -2
  2. package/dist/core/CIP1853.d.ts +2 -1
  3. package/dist/core/CIP1855.d.ts +2 -1
  4. package/dist/core.cjs +19 -18
  5. package/dist/core.js +29393 -13198
  6. package/package.json +2 -2
  7. package/dist/common/contracts/evaluator.d.ts +0 -4
  8. package/dist/common/contracts/fetcher.d.ts +0 -22
  9. package/dist/common/contracts/index.d.ts +0 -7
  10. package/dist/common/contracts/initiator.d.ts +0 -8
  11. package/dist/common/contracts/listener.d.ts +0 -3
  12. package/dist/common/contracts/signer.d.ts +0 -8
  13. package/dist/common/contracts/submitter.d.ts +0 -3
  14. package/dist/common/contracts/uploader.d.ts +0 -3
  15. package/dist/common/data/index.d.ts +0 -2
  16. package/dist/common/data/mesh.d.ts +0 -8
  17. package/dist/common/data/plutus.d.ts +0 -72
  18. package/dist/common/helpers/generateNonce.d.ts +0 -1
  19. package/dist/common/helpers/index.d.ts +0 -2
  20. package/dist/common/helpers/readPlutusData.d.ts +0 -2
  21. package/dist/common/utils/parser.d.ts +0 -5
  22. package/dist/common/utils/resolver.d.ts +0 -17
  23. package/dist/core/CIP2.d.ts +0 -4
  24. package/dist/core/CIP8.d.ts +0 -15
  25. package/dist/index.d.ts +0 -13
  26. package/dist/providers/blockfrost.provider.d.ts +0 -46
  27. package/dist/providers/index.d.ts +0 -6
  28. package/dist/providers/infura.provider.d.ts +0 -12
  29. package/dist/providers/koios.provider.d.ts +0 -27
  30. package/dist/providers/maestro.provider.d.ts +0 -35
  31. package/dist/providers/ogmios.provider.d.ts +0 -12
  32. package/dist/providers/yaci.provider.d.ts +0 -32
  33. package/dist/scripts/forge.script.d.ts +0 -8
  34. package/dist/scripts/index.d.ts +0 -1
  35. package/dist/serializer/index.d.ts +0 -2
  36. package/dist/serializer/serializer.d.ts +0 -42
  37. package/dist/serializer/signatures.d.ts +0 -3
  38. package/dist/transaction/index.d.ts +0 -2
  39. package/dist/transaction/meshTxBuilder/index.d.ts +0 -2
  40. package/dist/transaction/meshTxBuilder/meshTxBuilder.service.d.ts +0 -47
  41. package/dist/transaction/meshTxBuilder/meshTxBuilderCore.d.ts +0 -292
  42. package/dist/transaction/meshTxBuilder/type.d.ts +0 -128
  43. package/dist/transaction/transaction.service.d.ts +0 -150
  44. package/dist/types/Account.d.ts +0 -5
  45. package/dist/types/AccountInfo.d.ts +0 -7
  46. package/dist/types/Action.d.ts +0 -12
  47. package/dist/types/Asset.d.ts +0 -7
  48. package/dist/types/AssetExtended.d.ts +0 -8
  49. package/dist/types/AssetMetadata.d.ts +0 -24
  50. package/dist/types/BlockInfo.d.ts +0 -17
  51. package/dist/types/Data.d.ts +0 -4
  52. package/dist/types/DataSignature.d.ts +0 -4
  53. package/dist/types/Era.d.ts +0 -1
  54. package/dist/types/Mint.d.ts +0 -10
  55. package/dist/types/NativeScript.d.ts +0 -14
  56. package/dist/types/Network.d.ts +0 -4
  57. package/dist/types/PlutusScript.d.ts +0 -5
  58. package/dist/types/PoolParams.d.ts +0 -16
  59. package/dist/types/Protocol.d.ts +0 -22
  60. package/dist/types/Recipient.d.ts +0 -11
  61. package/dist/types/Relay.d.ts +0 -13
  62. package/dist/types/Token.d.ts +0 -2
  63. package/dist/types/TransactionInfo.d.ts +0 -11
  64. package/dist/types/UTxO.d.ts +0 -15
  65. package/dist/types/Wallet.d.ts +0 -5
  66. package/dist/types/index.d.ts +0 -22
  67. package/dist/wallet/app.service.d.ts +0 -43
  68. package/dist/wallet/browser.service.d.ts +0 -205
  69. package/dist/wallet/embedded.service.d.ts +0 -20
  70. package/dist/wallet/index.d.ts +0 -4
  71. package/dist/wallet/mesh.service.d.ts +0 -188
@@ -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
- }
@@ -1,128 +0,0 @@
1
- import { Asset, Budget, Data, LanguageVersion, PlutusScript, UTxO, PoolParams } from '@mesh/types';
2
- export declare type MeshTxBuilderBody = {
3
- inputs: TxIn[];
4
- outputs: Output[];
5
- extraInputs: UTxO[];
6
- selectionThreshold: number;
7
- collaterals: PubKeyTxIn[];
8
- requiredSignatures: string[];
9
- referenceInputs: RefTxIn[];
10
- mints: MintItem[];
11
- changeAddress: string;
12
- metadata: Metadata[];
13
- validityRange: ValidityRange;
14
- certificates: Certificate[];
15
- signingKey: string[];
16
- };
17
- export declare type TxIn = PubKeyTxIn | ScriptTxIn;
18
- export declare type PubKeyTxIn = {
19
- type: 'PubKey';
20
- txIn: TxInParameter;
21
- };
22
- export declare type TxInParameter = {
23
- txHash: string;
24
- txIndex: number;
25
- amount?: Asset[];
26
- address?: string;
27
- };
28
- export declare type ScriptTxIn = {
29
- type: 'Script';
30
- txIn: TxInParameter;
31
- scriptTxIn: ScriptTxInParameter;
32
- };
33
- export declare type ScriptTxInParameter = {
34
- scriptSource?: {
35
- type: 'Provided';
36
- script: PlutusScript;
37
- } | {
38
- type: 'Inline';
39
- txInInfo: ScriptSourceInfo;
40
- };
41
- datumSource?: {
42
- type: 'Provided';
43
- data: BuilderData;
44
- } | {
45
- type: 'Inline';
46
- txHash: string;
47
- txIndex: number;
48
- };
49
- redeemer?: Redeemer;
50
- };
51
- export declare type ScriptSourceInfo = {
52
- txHash: string;
53
- txIndex: number;
54
- spendingScriptHash?: string;
55
- version: LanguageVersion;
56
- };
57
- export declare type RefTxIn = {
58
- txHash: string;
59
- txIndex: number;
60
- };
61
- export declare type Output = {
62
- address: string;
63
- amount: Asset[];
64
- datum?: {
65
- type: 'Hash' | 'Inline';
66
- data: BuilderData;
67
- };
68
- referenceScript?: PlutusScript;
69
- };
70
- export declare type MintItem = {
71
- type: 'Plutus' | 'Native';
72
- policyId: string;
73
- assetName: string;
74
- amount: string;
75
- redeemer?: Redeemer;
76
- scriptSource?: {
77
- type: 'Provided';
78
- script: PlutusScript;
79
- } | {
80
- type: 'Reference Script';
81
- txHash: string;
82
- txIndex: number;
83
- version: LanguageVersion;
84
- };
85
- };
86
- export declare type ValidityRange = {
87
- invalidBefore?: number;
88
- invalidHereafter?: number;
89
- };
90
- export declare type BuilderData = {
91
- type: 'Mesh';
92
- content: Data;
93
- } | {
94
- type: 'JSON';
95
- content: string;
96
- } | {
97
- type: 'CBOR';
98
- content: string;
99
- };
100
- export declare type Redeemer = {
101
- data: BuilderData;
102
- exUnits: Budget;
103
- };
104
- export declare type Metadata = {
105
- tag: string;
106
- metadata: object;
107
- };
108
- export declare type Certificate = {
109
- type: 'RegisterPool';
110
- poolParams: PoolParams;
111
- } | {
112
- type: 'RegisterStake';
113
- stakeKeyHash: string;
114
- } | {
115
- type: 'DelegateStake';
116
- stakeKeyHash: string;
117
- poolId: string;
118
- } | {
119
- type: 'DeregisterStake';
120
- stakeKeyHash: string;
121
- } | {
122
- type: 'RetirePool';
123
- poolId: string;
124
- epoch: number;
125
- };
126
- export declare type RequiredWith<T, K extends keyof T> = Required<T> & {
127
- [P in K]: Required<T[P]>;
128
- };
@@ -1,150 +0,0 @@
1
- import { IInitiator } from '@mesh/common/contracts';
2
- import type { Action, Asset, Data, Era, Mint, Protocol, PlutusScript, PoolParams, Recipient, Token, UTxO } from '@mesh/types';
3
- export declare class Transaction {
4
- private _changeAddress?;
5
- private _txOutputs;
6
- private _recipients;
7
- private _totalBurns;
8
- private _totalMints;
9
- private readonly _era?;
10
- private readonly _initiator?;
11
- private readonly _mintBuilder;
12
- private readonly _protocolParameters;
13
- private readonly _txBuilder;
14
- private readonly _txCertificates;
15
- private readonly _txInputsBuilder;
16
- private readonly _txWithdrawals;
17
- constructor(options?: Partial<CreateTxOptions>);
18
- static attachMetadata(cborTx: string, cborTxMetadata: string, era?: Era): string;
19
- static deattachMetadata(cborTx: string): string;
20
- static maskMetadata(cborTx: string, era?: Era): string;
21
- static readMetadata(cborTx: string): string;
22
- static writeMetadata(cborTx: string, cborTxMetadata: string, era?: Era): string;
23
- get size(): number;
24
- build(): Promise<string>;
25
- burnAsset(forgeScript: string | PlutusScript | UTxO, asset: Asset, redeemer?: Partial<Action>): Transaction;
26
- delegateStake(rewardAddress: string, poolId: string): Transaction;
27
- deregisterStake(rewardAddress: string): Transaction;
28
- mintAsset(forgeScript: string | PlutusScript | UTxO, mint: Mint, redeemer?: Partial<Action>): Transaction;
29
- redeemValue(options: {
30
- value: UTxO;
31
- script: PlutusScript | UTxO;
32
- datum?: Data | UTxO;
33
- redeemer?: Action;
34
- }): Transaction;
35
- registerStake(rewardAddress: string): Transaction;
36
- registerPool(params: PoolParams): Transaction;
37
- retirePool(poolId: string, epochNo: number): Transaction;
38
- /**
39
- * Adds an output to the transaction.
40
- *
41
- * @param recipient The recipient of the output.
42
- * @param assets The assets to send.
43
- * @returns The transaction builder.
44
- * @see {@link https://meshjs.dev/apis/transaction#sendAssets}
45
- */
46
- sendAssets(recipient: Recipient, assets: Asset[]): Transaction;
47
- /**
48
- * Adds a transaction output to the transaction.
49
- *
50
- * @param {Recipient} recipient The recipient of the transaction.
51
- * @param {string} lovelace The amount of lovelace to send.
52
- * @returns {Transaction} The Transaction object.
53
- * @see {@link https://meshjs.dev/apis/transaction#sendAda}
54
- */
55
- sendLovelace(recipient: Recipient, lovelace: string): Transaction;
56
- /**
57
- * Adds stable coins transaction output to the transaction.
58
- * @param {Recipient} recipient The recipient of the transaction.
59
- * @param {Token} ticker The ticker of the token to send.
60
- * @param {string} amount The amount of the token to send.
61
- * @returns {Transaction} The Transaction object.
62
- * @see {@link https://meshjs.dev/apis/transaction#sendToken}
63
- */
64
- sendToken(recipient: Recipient, ticker: Token, amount: string): Transaction;
65
- /**
66
- * Adds an output to the transaction.
67
- *
68
- * @param {Recipient} recipient The recipient of the output.
69
- * @param {UTxO} value The UTxO value of the output.
70
- * @returns {Transaction} The Transaction object.
71
- */
72
- sendValue(recipient: Recipient, value: UTxO): Transaction;
73
- /**
74
- * Sets the change address for the transaction.
75
- *
76
- * @param {string} changeAddress The change address.
77
- * @returns {Transaction} The Transaction object.
78
- */
79
- setChangeAddress(changeAddress: string): Transaction;
80
- /**
81
- * Sets the collateral for the transaction.
82
- *
83
- * @param {UTxO[]} collateral - Set the UTxO for collateral.
84
- * @returns {Transaction} The Transaction object.
85
- */
86
- setCollateral(collateral: UTxO[]): Transaction;
87
- /**
88
- * Add a JSON metadata entry to the transaction.
89
- *
90
- * @param {number} key The key to use for the metadata entry.
91
- * @param {unknown} value The value to use for the metadata entry.
92
- * @returns {Transaction} The Transaction object.
93
- * @see {@link https://meshjs.dev/apis/transaction#setMetadata}
94
- */
95
- setMetadata(key: number, value: unknown): Transaction;
96
- /**
97
- * Sets the required signers for the transaction.
98
- *
99
- * @param {string[]} addresses The addresses of the required signers.
100
- * @returns {Transaction} The Transaction object.
101
- */
102
- setRequiredSigners(addresses: string[]): Transaction;
103
- /**
104
- * Sets the start slot for the transaction.
105
- *
106
- * @param {string} slot The start slot for the transaction.
107
- * @returns {Transaction} The Transaction object.
108
- * @see {@link https://meshjs.dev/apis/transaction#setTimeLimit}
109
- */
110
- setTimeToStart(slot: string): Transaction;
111
- /**
112
- * Set the time to live for the transaction.
113
- *
114
- * @param {string} slot The slot number to expire the transaction at.
115
- * @returns {Transaction} The Transaction object.
116
- * @see {@link https://meshjs.dev/apis/transaction#setTimeLimit}
117
- */
118
- setTimeToExpire(slot: string): Transaction;
119
- /**
120
- * Sets the inputs for the transaction.
121
- *
122
- * @param {UTxO[]} inputs The inputs to set.
123
- * @returns {Transaction} The transaction.
124
- */
125
- setTxInputs(inputs: UTxO[]): Transaction;
126
- /**
127
- * Sets the reference inputs for the transaction.
128
- *
129
- * @param {UTxO[]} inputs The reference inputs to set.
130
- * @returns {Transaction} The transaction.
131
- */
132
- setTxRefInputs(inputs: UTxO[]): Transaction;
133
- withdrawRewards(rewardAddress: string, lovelace: string): Transaction;
134
- private addBurnInputsIfNeeded;
135
- private addChangeAddress;
136
- private addCollateralIfNeeded;
137
- private addRequiredSignersIfNeeded;
138
- private addTxInputsAsNeeded;
139
- private forgeAssetsIfNeeded;
140
- private filterAvailableUTxOs;
141
- private addMintOutputs;
142
- private notVisited;
143
- private setTxOutput;
144
- }
145
- declare type CreateTxOptions = {
146
- initiator: IInitiator;
147
- parameters: Protocol;
148
- era: Era;
149
- };
150
- export {};
@@ -1,5 +0,0 @@
1
- export declare type Account = {
2
- baseAddress: string;
3
- enterpriseAddress: string;
4
- rewardAddress: string;
5
- };
@@ -1,7 +0,0 @@
1
- export declare type AccountInfo = {
2
- active: boolean;
3
- poolId?: string;
4
- balance: string;
5
- rewards: string;
6
- withdrawals: string;
7
- };
@@ -1,12 +0,0 @@
1
- import { REDEEMER_TAGS } from '@mesh/common/constants';
2
- import { Data } from './Data';
3
- export declare type Action = {
4
- data: Data;
5
- index: number;
6
- budget: Budget;
7
- tag: keyof typeof REDEEMER_TAGS;
8
- };
9
- export declare type Budget = {
10
- mem: number;
11
- steps: number;
12
- };
@@ -1,7 +0,0 @@
1
- export declare type Asset = {
2
- unit: Unit;
3
- quantity: Quantity;
4
- };
5
- export declare type Unit = string;
6
- export declare type Quantity = string;
7
- export declare const mergeAssets: (assets: Asset[]) => Asset[];
@@ -1,8 +0,0 @@
1
- import { Quantity, Unit } from './Asset';
2
- export declare type AssetExtended = {
3
- unit: Unit;
4
- policyId: string;
5
- assetName: string;
6
- fingerprint: string;
7
- quantity: Quantity;
8
- };
@@ -1,24 +0,0 @@
1
- import type { MetadataStandard, Files, RoyaltiesStandard } from '@mesh/core';
2
- export declare type AssetMetadata = FungibleAssetMetadata | NonFungibleAssetMetadata | RoyaltiesStandard;
3
- export declare type FungibleAssetMetadata = MetadataStandard & {
4
- ticker: string;
5
- decimals: number;
6
- version: `${number}.${number}`;
7
- };
8
- export declare type NonFungibleAssetMetadata = AudioAssetMetadata | ImageAssetMetadata | SmartAssetMetadata | VideoAssetMetadata;
9
- declare type AudioAssetMetadata = MetadataStandard & Files;
10
- export declare type ImageAssetMetadata = MetadataStandard & Files & {
11
- artists?: [
12
- {
13
- name: string;
14
- twitter?: `https://twitter.com/${string}`;
15
- }
16
- ];
17
- attributes?: {
18
- [key: string]: string;
19
- };
20
- traits?: string[];
21
- };
22
- declare type SmartAssetMetadata = MetadataStandard & Files;
23
- declare type VideoAssetMetadata = MetadataStandard & Files;
24
- export {};
@@ -1,17 +0,0 @@
1
- export declare type BlockInfo = {
2
- time: number;
3
- hash: string;
4
- slot: string;
5
- epoch: number;
6
- epochSlot: string;
7
- slotLeader: string;
8
- size: number;
9
- txCount: number;
10
- output: string;
11
- fees: string;
12
- previousBlock: string;
13
- nextBlock: string;
14
- confirmations: number;
15
- operationalCertificate: string;
16
- VRFKey: string;
17
- };
@@ -1,4 +0,0 @@
1
- export declare type Data = string | number | bigint | Array<Data> | Map<Data, Data> | {
2
- alternative: number;
3
- fields: Array<Data>;
4
- };
@@ -1,4 +0,0 @@
1
- export declare type DataSignature = {
2
- signature: string;
3
- key: string;
4
- };
@@ -1 +0,0 @@
1
- export declare type Era = 'ALONZO' | 'BABBAGE';
@@ -1,10 +0,0 @@
1
- import { Quantity } from './Asset';
2
- import { AssetMetadata } from './AssetMetadata';
3
- import { Recipient } from './Recipient';
4
- export declare type Mint = {
5
- assetName: string;
6
- assetQuantity: Quantity;
7
- metadata: AssetMetadata;
8
- recipient: Recipient;
9
- label: '20' | '721' | '777' | `${number}`;
10
- };