@meshsdk/common 1.0.0-alpha.10 → 1.0.0-alpha.12
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/cjs/builder/data/plutus.d.ts +2 -2
- package/dist/cjs/builder/data/plutus.js +8 -2
- package/dist/cjs/builder/serializer.js +1 -0
- package/dist/cjs/builder/types.d.ts +21 -8
- package/dist/mjs/builder/data/plutus.d.ts +2 -2
- package/dist/mjs/builder/data/plutus.js +8 -2
- package/dist/mjs/builder/serializer.js +1 -0
- package/dist/mjs/builder/types.d.ts +21 -8
- package/package.json +1 -1
|
@@ -55,8 +55,8 @@ export declare const list: (pList: PlutusData[]) => List;
|
|
|
55
55
|
export declare const currencySymbol: (bytes: string) => CurrencySymbol;
|
|
56
56
|
export declare const tokenName: (bytes: string) => TokenName;
|
|
57
57
|
export declare const maybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MaybeStakingHash;
|
|
58
|
-
export declare const pubKeyAddress: (bytes: string, stakeCredential?: string) => PubKeyAddress;
|
|
59
|
-
export declare const scriptAddress: (bytes: string, stakeCredential?: string) => ScriptAddress;
|
|
58
|
+
export declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => PubKeyAddress;
|
|
59
|
+
export declare const scriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => ScriptAddress;
|
|
60
60
|
export declare const assetClass: (policyId: string, assetName: string) => AssetClass;
|
|
61
61
|
export declare const txOutRef: (txHash: string, index: number) => TxOutRef;
|
|
62
62
|
export declare const paymentPubKeyHash: (bytes: string) => PaymentPubKeyHash;
|
|
@@ -40,9 +40,15 @@ const maybeStakingHash = (stakeCredential, isScriptCredential = false) => {
|
|
|
40
40
|
]);
|
|
41
41
|
};
|
|
42
42
|
exports.maybeStakingHash = maybeStakingHash;
|
|
43
|
-
const pubKeyAddress = (bytes, stakeCredential) => (0, exports.conStr0)([
|
|
43
|
+
const pubKeyAddress = (bytes, stakeCredential, isScriptCredential = false) => (0, exports.conStr0)([
|
|
44
|
+
(0, exports.conStr0)([(0, exports.builtinByteString)(bytes)]),
|
|
45
|
+
(0, exports.maybeStakingHash)(stakeCredential || '', isScriptCredential),
|
|
46
|
+
]);
|
|
44
47
|
exports.pubKeyAddress = pubKeyAddress;
|
|
45
|
-
const scriptAddress = (bytes, stakeCredential) => (0, exports.conStr0)([
|
|
48
|
+
const scriptAddress = (bytes, stakeCredential, isScriptCredential = false) => (0, exports.conStr0)([
|
|
49
|
+
(0, exports.conStr1)([(0, exports.builtinByteString)(bytes)]),
|
|
50
|
+
(0, exports.maybeStakingHash)(stakeCredential || '', isScriptCredential),
|
|
51
|
+
]);
|
|
46
52
|
exports.scriptAddress = scriptAddress;
|
|
47
53
|
const assetClass = (policyId, assetName) => (0, exports.conStr0)([(0, exports.currencySymbol)(policyId), (0, exports.tokenName)(assetName)]);
|
|
48
54
|
exports.assetClass = assetClass;
|
|
@@ -5,15 +5,16 @@ export type MeshTxBuilderBody = {
|
|
|
5
5
|
collaterals: PubKeyTxIn[];
|
|
6
6
|
requiredSignatures: string[];
|
|
7
7
|
referenceInputs: RefTxIn[];
|
|
8
|
+
withdrawals: Withdrawal[];
|
|
8
9
|
mints: MintItem[];
|
|
9
10
|
changeAddress: string;
|
|
10
11
|
changeDatum?: BuilderData;
|
|
11
12
|
metadata: Metadata[];
|
|
12
13
|
validityRange: ValidityRange;
|
|
14
|
+
certificates: Certificate[];
|
|
13
15
|
signingKey: string[];
|
|
14
16
|
extraInputs: UTxO[];
|
|
15
17
|
selectionThreshold: number;
|
|
16
|
-
certificates: Certificate[];
|
|
17
18
|
};
|
|
18
19
|
export type TxIn = PubKeyTxIn | ScriptTxIn;
|
|
19
20
|
export type PubKeyTxIn = {
|
|
@@ -32,13 +33,7 @@ export type ScriptTxIn = {
|
|
|
32
33
|
scriptTxIn: ScriptTxInParameter;
|
|
33
34
|
};
|
|
34
35
|
export type ScriptTxInParameter = {
|
|
35
|
-
scriptSource?:
|
|
36
|
-
type: 'Provided';
|
|
37
|
-
script: PlutusScript;
|
|
38
|
-
} | {
|
|
39
|
-
type: 'Inline';
|
|
40
|
-
txInInfo: ScriptSourceInfo;
|
|
41
|
-
};
|
|
36
|
+
scriptSource?: ScriptSource;
|
|
42
37
|
datumSource?: {
|
|
43
38
|
type: 'Provided';
|
|
44
39
|
data: BuilderData;
|
|
@@ -49,6 +44,13 @@ export type ScriptTxInParameter = {
|
|
|
49
44
|
};
|
|
50
45
|
redeemer?: Redeemer;
|
|
51
46
|
};
|
|
47
|
+
export type ScriptSource = {
|
|
48
|
+
type: 'Provided';
|
|
49
|
+
script: PlutusScript;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'Inline';
|
|
52
|
+
txInInfo: ScriptSourceInfo;
|
|
53
|
+
};
|
|
52
54
|
export type ScriptSourceInfo = {
|
|
53
55
|
txHash: string;
|
|
54
56
|
txIndex: number;
|
|
@@ -124,6 +126,17 @@ export type Certificate = {
|
|
|
124
126
|
poolId: string;
|
|
125
127
|
epoch: number;
|
|
126
128
|
};
|
|
129
|
+
export type Withdrawal = {
|
|
130
|
+
type: 'PubKeyWithdrawal';
|
|
131
|
+
address: string;
|
|
132
|
+
coin: number;
|
|
133
|
+
} | {
|
|
134
|
+
type: 'PlutusScriptWithdrawal';
|
|
135
|
+
address: string;
|
|
136
|
+
coin: number;
|
|
137
|
+
scriptSource?: ScriptSource;
|
|
138
|
+
redeemer?: Redeemer;
|
|
139
|
+
};
|
|
127
140
|
export type RequiredWith<T, K extends keyof T> = Required<T> & {
|
|
128
141
|
[P in K]: Required<T[P]>;
|
|
129
142
|
};
|
|
@@ -55,8 +55,8 @@ export declare const list: (pList: PlutusData[]) => List;
|
|
|
55
55
|
export declare const currencySymbol: (bytes: string) => CurrencySymbol;
|
|
56
56
|
export declare const tokenName: (bytes: string) => TokenName;
|
|
57
57
|
export declare const maybeStakingHash: (stakeCredential: string, isScriptCredential?: boolean) => MaybeStakingHash;
|
|
58
|
-
export declare const pubKeyAddress: (bytes: string, stakeCredential?: string) => PubKeyAddress;
|
|
59
|
-
export declare const scriptAddress: (bytes: string, stakeCredential?: string) => ScriptAddress;
|
|
58
|
+
export declare const pubKeyAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => PubKeyAddress;
|
|
59
|
+
export declare const scriptAddress: (bytes: string, stakeCredential?: string, isScriptCredential?: boolean) => ScriptAddress;
|
|
60
60
|
export declare const assetClass: (policyId: string, assetName: string) => AssetClass;
|
|
61
61
|
export declare const txOutRef: (txHash: string, index: number) => TxOutRef;
|
|
62
62
|
export declare const paymentPubKeyHash: (bytes: string) => PaymentPubKeyHash;
|
|
@@ -26,8 +26,14 @@ export const maybeStakingHash = (stakeCredential, isScriptCredential = false) =>
|
|
|
26
26
|
conStr0([conStr0([builtinByteString(stakeCredential)])]),
|
|
27
27
|
]);
|
|
28
28
|
};
|
|
29
|
-
export const pubKeyAddress = (bytes, stakeCredential) => conStr0([
|
|
30
|
-
|
|
29
|
+
export const pubKeyAddress = (bytes, stakeCredential, isScriptCredential = false) => conStr0([
|
|
30
|
+
conStr0([builtinByteString(bytes)]),
|
|
31
|
+
maybeStakingHash(stakeCredential || '', isScriptCredential),
|
|
32
|
+
]);
|
|
33
|
+
export const scriptAddress = (bytes, stakeCredential, isScriptCredential = false) => conStr0([
|
|
34
|
+
conStr1([builtinByteString(bytes)]),
|
|
35
|
+
maybeStakingHash(stakeCredential || '', isScriptCredential),
|
|
36
|
+
]);
|
|
31
37
|
export const assetClass = (policyId, assetName) => conStr0([currencySymbol(policyId), tokenName(assetName)]);
|
|
32
38
|
export const txOutRef = (txHash, index) => conStr0([conStr0([builtinByteString(txHash)]), integer(index)]);
|
|
33
39
|
export const paymentPubKeyHash = (bytes) => builtinByteString(bytes);
|
|
@@ -5,15 +5,16 @@ export type MeshTxBuilderBody = {
|
|
|
5
5
|
collaterals: PubKeyTxIn[];
|
|
6
6
|
requiredSignatures: string[];
|
|
7
7
|
referenceInputs: RefTxIn[];
|
|
8
|
+
withdrawals: Withdrawal[];
|
|
8
9
|
mints: MintItem[];
|
|
9
10
|
changeAddress: string;
|
|
10
11
|
changeDatum?: BuilderData;
|
|
11
12
|
metadata: Metadata[];
|
|
12
13
|
validityRange: ValidityRange;
|
|
14
|
+
certificates: Certificate[];
|
|
13
15
|
signingKey: string[];
|
|
14
16
|
extraInputs: UTxO[];
|
|
15
17
|
selectionThreshold: number;
|
|
16
|
-
certificates: Certificate[];
|
|
17
18
|
};
|
|
18
19
|
export type TxIn = PubKeyTxIn | ScriptTxIn;
|
|
19
20
|
export type PubKeyTxIn = {
|
|
@@ -32,13 +33,7 @@ export type ScriptTxIn = {
|
|
|
32
33
|
scriptTxIn: ScriptTxInParameter;
|
|
33
34
|
};
|
|
34
35
|
export type ScriptTxInParameter = {
|
|
35
|
-
scriptSource?:
|
|
36
|
-
type: 'Provided';
|
|
37
|
-
script: PlutusScript;
|
|
38
|
-
} | {
|
|
39
|
-
type: 'Inline';
|
|
40
|
-
txInInfo: ScriptSourceInfo;
|
|
41
|
-
};
|
|
36
|
+
scriptSource?: ScriptSource;
|
|
42
37
|
datumSource?: {
|
|
43
38
|
type: 'Provided';
|
|
44
39
|
data: BuilderData;
|
|
@@ -49,6 +44,13 @@ export type ScriptTxInParameter = {
|
|
|
49
44
|
};
|
|
50
45
|
redeemer?: Redeemer;
|
|
51
46
|
};
|
|
47
|
+
export type ScriptSource = {
|
|
48
|
+
type: 'Provided';
|
|
49
|
+
script: PlutusScript;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'Inline';
|
|
52
|
+
txInInfo: ScriptSourceInfo;
|
|
53
|
+
};
|
|
52
54
|
export type ScriptSourceInfo = {
|
|
53
55
|
txHash: string;
|
|
54
56
|
txIndex: number;
|
|
@@ -124,6 +126,17 @@ export type Certificate = {
|
|
|
124
126
|
poolId: string;
|
|
125
127
|
epoch: number;
|
|
126
128
|
};
|
|
129
|
+
export type Withdrawal = {
|
|
130
|
+
type: 'PubKeyWithdrawal';
|
|
131
|
+
address: string;
|
|
132
|
+
coin: number;
|
|
133
|
+
} | {
|
|
134
|
+
type: 'PlutusScriptWithdrawal';
|
|
135
|
+
address: string;
|
|
136
|
+
coin: number;
|
|
137
|
+
scriptSource?: ScriptSource;
|
|
138
|
+
redeemer?: Redeemer;
|
|
139
|
+
};
|
|
127
140
|
export type RequiredWith<T, K extends keyof T> = Required<T> & {
|
|
128
141
|
[P in K]: Required<T[P]>;
|
|
129
142
|
};
|
package/package.json
CHANGED