@meshsdk/common 1.0.0-alpha.2 → 1.0.0-alpha.4
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/cip/CIP25.d.ts +19 -0
- package/dist/cjs/cip/CIP25.js +2 -0
- package/dist/cjs/cip/CIP27.d.ts +4 -0
- package/dist/cjs/cip/CIP27.js +2 -0
- package/dist/cjs/cip/CPS9.d.ts +1 -1
- package/dist/cjs/cip/index.d.ts +3 -0
- package/dist/cjs/cip/index.js +19 -0
- package/dist/cjs/constants.d.ts +1 -1
- package/dist/cjs/index.d.ts +2 -0
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/types/Account.d.ts +5 -0
- package/dist/cjs/types/Account.js +2 -0
- package/dist/cjs/types/AccountInfo.d.ts +7 -0
- package/dist/cjs/types/AccountInfo.js +2 -0
- package/dist/cjs/types/Action.d.ts +12 -0
- package/dist/cjs/types/Action.js +2 -0
- package/dist/cjs/types/Asset.d.ts +7 -0
- package/dist/cjs/types/Asset.js +17 -0
- package/dist/cjs/types/AssetExtended.d.ts +8 -0
- package/dist/cjs/types/AssetExtended.js +2 -0
- package/dist/cjs/types/AssetMetadata.d.ts +24 -0
- package/dist/cjs/types/AssetMetadata.js +2 -0
- package/dist/cjs/types/BlockInfo.d.ts +17 -0
- package/dist/cjs/types/BlockInfo.js +2 -0
- package/dist/cjs/types/Data.d.ts +4 -0
- package/dist/cjs/types/Data.js +2 -0
- package/dist/cjs/types/DataSignature.d.ts +4 -0
- package/dist/cjs/types/DataSignature.js +2 -0
- package/dist/cjs/types/Era.d.ts +1 -0
- package/dist/cjs/types/Era.js +2 -0
- package/dist/cjs/types/Mint.d.ts +10 -0
- package/dist/cjs/types/Mint.js +2 -0
- package/dist/cjs/types/NativeScript.d.ts +14 -0
- package/dist/cjs/types/NativeScript.js +2 -0
- package/dist/cjs/types/Network.d.ts +4 -0
- package/dist/cjs/types/Network.js +8 -0
- package/dist/cjs/types/PlutusScript.d.ts +5 -0
- package/dist/cjs/types/PlutusScript.js +2 -0
- package/dist/cjs/types/PoolParams.d.ts +16 -0
- package/dist/cjs/types/PoolParams.js +2 -0
- package/dist/cjs/types/Protocol.d.ts +22 -0
- package/dist/cjs/types/Protocol.js +2 -0
- package/dist/cjs/types/Recipient.d.ts +11 -0
- package/dist/cjs/types/Recipient.js +2 -0
- package/dist/cjs/types/Relay.d.ts +13 -0
- package/dist/cjs/types/Relay.js +2 -0
- package/dist/cjs/types/Token.d.ts +2 -0
- package/dist/cjs/types/Token.js +2 -0
- package/dist/cjs/types/TransactionInfo.d.ts +11 -0
- package/dist/cjs/types/TransactionInfo.js +2 -0
- package/dist/cjs/types/UTxO.d.ts +15 -0
- package/dist/cjs/types/UTxO.js +2 -0
- package/dist/cjs/types/Wallet.d.ts +5 -0
- package/dist/cjs/types/Wallet.js +2 -0
- package/dist/cjs/types/index.d.ts +22 -0
- package/dist/cjs/types/index.js +38 -0
- package/dist/mjs/cip/CIP25.d.ts +19 -0
- package/dist/mjs/cip/CIP25.js +1 -0
- package/dist/mjs/cip/CIP27.d.ts +4 -0
- package/dist/mjs/cip/CIP27.js +1 -0
- package/dist/mjs/cip/CPS9.d.ts +1 -1
- package/dist/mjs/cip/index.d.ts +3 -0
- package/dist/mjs/cip/index.js +3 -0
- package/dist/mjs/constants.d.ts +1 -1
- package/dist/mjs/index.d.ts +2 -0
- package/dist/mjs/index.js +2 -0
- package/dist/mjs/types/Account.d.ts +5 -0
- package/dist/mjs/types/Account.js +1 -0
- package/dist/mjs/types/AccountInfo.d.ts +7 -0
- package/dist/mjs/types/AccountInfo.js +1 -0
- package/dist/mjs/types/Action.d.ts +12 -0
- package/dist/mjs/types/Action.js +1 -0
- package/dist/mjs/types/Asset.d.ts +7 -0
- package/dist/mjs/types/Asset.js +13 -0
- package/dist/mjs/types/AssetExtended.d.ts +8 -0
- package/dist/mjs/types/AssetExtended.js +1 -0
- package/dist/mjs/types/AssetMetadata.d.ts +24 -0
- package/dist/mjs/types/AssetMetadata.js +1 -0
- package/dist/mjs/types/BlockInfo.d.ts +17 -0
- package/dist/mjs/types/BlockInfo.js +1 -0
- package/dist/mjs/types/Data.d.ts +4 -0
- package/dist/mjs/types/Data.js +1 -0
- package/dist/mjs/types/DataSignature.d.ts +4 -0
- package/dist/mjs/types/DataSignature.js +1 -0
- package/dist/mjs/types/Era.d.ts +1 -0
- package/dist/mjs/types/Era.js +1 -0
- package/dist/mjs/types/Mint.d.ts +10 -0
- package/dist/mjs/types/Mint.js +1 -0
- package/dist/mjs/types/NativeScript.d.ts +14 -0
- package/dist/mjs/types/NativeScript.js +1 -0
- package/dist/mjs/types/Network.d.ts +4 -0
- package/dist/mjs/types/Network.js +4 -0
- package/dist/mjs/types/PlutusScript.d.ts +5 -0
- package/dist/mjs/types/PlutusScript.js +1 -0
- package/dist/mjs/types/PoolParams.d.ts +16 -0
- package/dist/mjs/types/PoolParams.js +1 -0
- package/dist/mjs/types/Protocol.d.ts +22 -0
- package/dist/mjs/types/Protocol.js +1 -0
- package/dist/mjs/types/Recipient.d.ts +11 -0
- package/dist/mjs/types/Recipient.js +1 -0
- package/dist/mjs/types/Relay.d.ts +13 -0
- package/dist/mjs/types/Relay.js +1 -0
- package/dist/mjs/types/Token.d.ts +2 -0
- package/dist/mjs/types/Token.js +1 -0
- package/dist/mjs/types/TransactionInfo.d.ts +11 -0
- package/dist/mjs/types/TransactionInfo.js +1 -0
- package/dist/mjs/types/UTxO.d.ts +15 -0
- package/dist/mjs/types/UTxO.js +1 -0
- package/dist/mjs/types/Wallet.d.ts +5 -0
- package/dist/mjs/types/Wallet.js +1 -0
- package/dist/mjs/types/index.d.ts +22 -0
- package/dist/mjs/types/index.js +22 -0
- package/package.json +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type MetadataStandard = {
|
|
2
|
+
name: string;
|
|
3
|
+
image: `${string}://${string}`;
|
|
4
|
+
mediaType?: `image/${string}`;
|
|
5
|
+
description?: string | string[];
|
|
6
|
+
instagram?: `https://instagram.com/${string}`;
|
|
7
|
+
twitter?: `https://twitter.com/${string}`;
|
|
8
|
+
discord?: `https://discord.gg/${string}`;
|
|
9
|
+
website?: `https://${string}`;
|
|
10
|
+
};
|
|
11
|
+
export type Files = {
|
|
12
|
+
files?: [
|
|
13
|
+
{
|
|
14
|
+
name: string;
|
|
15
|
+
src: `${string}://${string}`;
|
|
16
|
+
mediaType: `${string}/${string}`;
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
};
|
package/dist/cjs/cip/CPS9.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Quantity, UTxO, Unit } from '
|
|
1
|
+
import type { Quantity, UTxO, Unit } from '../types';
|
|
2
2
|
export declare const selectUtxos: (inputs: UTxO[], requiredAssets: Map<Unit, Quantity>, threshold: Quantity) => UTxO[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./CPS9"), exports);
|
|
18
|
+
__exportStar(require("./CIP25"), exports);
|
|
19
|
+
__exportStar(require("./CIP27"), exports);
|
package/dist/cjs/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Budget, Era, LanguageVersion, Network, Protocol } from '
|
|
1
|
+
import type { Budget, Era, LanguageVersion, Network, Protocol } from './types';
|
|
2
2
|
export declare const DEFAULT_REDEEMER_BUDGET: Budget;
|
|
3
3
|
export declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol;
|
|
4
4
|
export declare const HARDENED_KEY_START = 2147483648;
|
package/dist/cjs/index.d.ts
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -15,3 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
|
+
__exportStar(require("./cip"), exports);
|
|
19
|
+
__exportStar(require("./types"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Data } from './Data';
|
|
2
|
+
export type RedeemerTag = 'CERT' | 'MINT' | 'REWARD' | 'SPEND';
|
|
3
|
+
export type Budget = {
|
|
4
|
+
mem: number;
|
|
5
|
+
steps: number;
|
|
6
|
+
};
|
|
7
|
+
export type Action = {
|
|
8
|
+
data: Data;
|
|
9
|
+
index: number;
|
|
10
|
+
budget: Budget;
|
|
11
|
+
tag: RedeemerTag;
|
|
12
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mergeAssets = void 0;
|
|
4
|
+
const mergeAssets = (assets) => {
|
|
5
|
+
const merged = [];
|
|
6
|
+
assets.forEach((asset) => {
|
|
7
|
+
const existing = merged.find((a) => a.unit === asset.unit);
|
|
8
|
+
if (existing) {
|
|
9
|
+
existing.quantity = (parseInt(existing.quantity) + parseInt(asset.quantity)).toString();
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
merged.push(asset);
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
return merged;
|
|
16
|
+
};
|
|
17
|
+
exports.mergeAssets = mergeAssets;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MetadataStandard, Files, RoyaltiesStandard } from '../cip';
|
|
2
|
+
export type AssetMetadata = FungibleAssetMetadata | NonFungibleAssetMetadata | RoyaltiesStandard;
|
|
3
|
+
export type FungibleAssetMetadata = MetadataStandard & {
|
|
4
|
+
ticker: string;
|
|
5
|
+
decimals: number;
|
|
6
|
+
version: `${number}.${number}`;
|
|
7
|
+
};
|
|
8
|
+
export type NonFungibleAssetMetadata = AudioAssetMetadata | ImageAssetMetadata | SmartAssetMetadata | VideoAssetMetadata;
|
|
9
|
+
type AudioAssetMetadata = MetadataStandard & Files;
|
|
10
|
+
export 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
|
+
type SmartAssetMetadata = MetadataStandard & Files;
|
|
23
|
+
type VideoAssetMetadata = MetadataStandard & Files;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export 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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Era = 'ALONZO' | 'BABBAGE';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Quantity } from './Asset';
|
|
2
|
+
import { AssetMetadata } from './AssetMetadata';
|
|
3
|
+
import { Recipient } from './Recipient';
|
|
4
|
+
export type Mint = {
|
|
5
|
+
assetName: string;
|
|
6
|
+
assetQuantity: Quantity;
|
|
7
|
+
metadata: AssetMetadata;
|
|
8
|
+
recipient: Recipient;
|
|
9
|
+
label: '20' | '721' | '777' | `${number}`;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type NativeScript = {
|
|
2
|
+
type: 'after' | 'before';
|
|
3
|
+
slot: string;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'all' | 'any';
|
|
6
|
+
scripts: NativeScript[];
|
|
7
|
+
} | {
|
|
8
|
+
type: 'atLeast';
|
|
9
|
+
required: number;
|
|
10
|
+
scripts: NativeScript[];
|
|
11
|
+
} | {
|
|
12
|
+
type: 'sig';
|
|
13
|
+
keyHash: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isNetwork = void 0;
|
|
4
|
+
const ALL_NETWORKS = ['testnet', 'preview', 'preprod', 'mainnet'];
|
|
5
|
+
const isNetwork = (value) => {
|
|
6
|
+
return ALL_NETWORKS.includes(value);
|
|
7
|
+
};
|
|
8
|
+
exports.isNetwork = isNetwork;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Relay } from './Relay';
|
|
2
|
+
export type PoolParams = {
|
|
3
|
+
VRFKeyHash: string;
|
|
4
|
+
operator: string;
|
|
5
|
+
pledge: string;
|
|
6
|
+
cost: string;
|
|
7
|
+
margin: number;
|
|
8
|
+
relays: Relay[];
|
|
9
|
+
owners: string[];
|
|
10
|
+
rewardAddress: string;
|
|
11
|
+
metadata?: PoolMetadata;
|
|
12
|
+
};
|
|
13
|
+
export type PoolMetadata = {
|
|
14
|
+
URL: string;
|
|
15
|
+
hash: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Protocol = {
|
|
2
|
+
epoch: number;
|
|
3
|
+
minFeeA: number;
|
|
4
|
+
minFeeB: number;
|
|
5
|
+
maxBlockSize: number;
|
|
6
|
+
maxTxSize: number;
|
|
7
|
+
maxBlockHeaderSize: number;
|
|
8
|
+
keyDeposit: string;
|
|
9
|
+
poolDeposit: string;
|
|
10
|
+
decentralisation: number;
|
|
11
|
+
minPoolCost: string;
|
|
12
|
+
priceMem: number;
|
|
13
|
+
priceStep: number;
|
|
14
|
+
maxTxExMem: string;
|
|
15
|
+
maxTxExSteps: string;
|
|
16
|
+
maxBlockExMem: string;
|
|
17
|
+
maxBlockExSteps: string;
|
|
18
|
+
maxValSize: string;
|
|
19
|
+
collateralPercent: number;
|
|
20
|
+
maxCollateralInputs: number;
|
|
21
|
+
coinsPerUTxOSize: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from './Data';
|
|
2
|
+
import { NativeScript } from './NativeScript';
|
|
3
|
+
import { PlutusScript } from './PlutusScript';
|
|
4
|
+
export type Recipient = string | {
|
|
5
|
+
address: string;
|
|
6
|
+
datum?: {
|
|
7
|
+
value: Data;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
};
|
|
10
|
+
script?: PlutusScript | NativeScript;
|
|
11
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Asset } from './Asset';
|
|
2
|
+
export type UTxO = {
|
|
3
|
+
input: {
|
|
4
|
+
outputIndex: number;
|
|
5
|
+
txHash: string;
|
|
6
|
+
};
|
|
7
|
+
output: {
|
|
8
|
+
address: string;
|
|
9
|
+
amount: Asset[];
|
|
10
|
+
dataHash?: string;
|
|
11
|
+
plutusData?: string;
|
|
12
|
+
scriptRef?: string;
|
|
13
|
+
scriptHash?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './Account';
|
|
2
|
+
export * from './AccountInfo';
|
|
3
|
+
export * from './Action';
|
|
4
|
+
export * from './Asset';
|
|
5
|
+
export * from './AssetExtended';
|
|
6
|
+
export * from './AssetMetadata';
|
|
7
|
+
export * from './BlockInfo';
|
|
8
|
+
export * from './Data';
|
|
9
|
+
export * from './DataSignature';
|
|
10
|
+
export * from './Era';
|
|
11
|
+
export * from './Mint';
|
|
12
|
+
export * from './NativeScript';
|
|
13
|
+
export * from './Network';
|
|
14
|
+
export * from './PlutusScript';
|
|
15
|
+
export * from './PoolParams';
|
|
16
|
+
export * from './Protocol';
|
|
17
|
+
export * from './Recipient';
|
|
18
|
+
export * from './Relay';
|
|
19
|
+
export * from './Token';
|
|
20
|
+
export * from './TransactionInfo';
|
|
21
|
+
export * from './UTxO';
|
|
22
|
+
export * from './Wallet';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Account"), exports);
|
|
18
|
+
__exportStar(require("./AccountInfo"), exports);
|
|
19
|
+
__exportStar(require("./Action"), exports);
|
|
20
|
+
__exportStar(require("./Asset"), exports);
|
|
21
|
+
__exportStar(require("./AssetExtended"), exports);
|
|
22
|
+
__exportStar(require("./AssetMetadata"), exports);
|
|
23
|
+
__exportStar(require("./BlockInfo"), exports);
|
|
24
|
+
__exportStar(require("./Data"), exports);
|
|
25
|
+
__exportStar(require("./DataSignature"), exports);
|
|
26
|
+
__exportStar(require("./Era"), exports);
|
|
27
|
+
__exportStar(require("./Mint"), exports);
|
|
28
|
+
__exportStar(require("./NativeScript"), exports);
|
|
29
|
+
__exportStar(require("./Network"), exports);
|
|
30
|
+
__exportStar(require("./PlutusScript"), exports);
|
|
31
|
+
__exportStar(require("./PoolParams"), exports);
|
|
32
|
+
__exportStar(require("./Protocol"), exports);
|
|
33
|
+
__exportStar(require("./Recipient"), exports);
|
|
34
|
+
__exportStar(require("./Relay"), exports);
|
|
35
|
+
__exportStar(require("./Token"), exports);
|
|
36
|
+
__exportStar(require("./TransactionInfo"), exports);
|
|
37
|
+
__exportStar(require("./UTxO"), exports);
|
|
38
|
+
__exportStar(require("./Wallet"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export type MetadataStandard = {
|
|
2
|
+
name: string;
|
|
3
|
+
image: `${string}://${string}`;
|
|
4
|
+
mediaType?: `image/${string}`;
|
|
5
|
+
description?: string | string[];
|
|
6
|
+
instagram?: `https://instagram.com/${string}`;
|
|
7
|
+
twitter?: `https://twitter.com/${string}`;
|
|
8
|
+
discord?: `https://discord.gg/${string}`;
|
|
9
|
+
website?: `https://${string}`;
|
|
10
|
+
};
|
|
11
|
+
export type Files = {
|
|
12
|
+
files?: [
|
|
13
|
+
{
|
|
14
|
+
name: string;
|
|
15
|
+
src: `${string}://${string}`;
|
|
16
|
+
mediaType: `${string}/${string}`;
|
|
17
|
+
}
|
|
18
|
+
];
|
|
19
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/mjs/cip/CPS9.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { Quantity, UTxO, Unit } from '
|
|
1
|
+
import type { Quantity, UTxO, Unit } from '../types';
|
|
2
2
|
export declare const selectUtxos: (inputs: UTxO[], requiredAssets: Map<Unit, Quantity>, threshold: Quantity) => UTxO[];
|
package/dist/mjs/constants.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Budget, Era, LanguageVersion, Network, Protocol } from '
|
|
1
|
+
import type { Budget, Era, LanguageVersion, Network, Protocol } from './types';
|
|
2
2
|
export declare const DEFAULT_REDEEMER_BUDGET: Budget;
|
|
3
3
|
export declare const DEFAULT_PROTOCOL_PARAMETERS: Protocol;
|
|
4
4
|
export declare const HARDENED_KEY_START = 2147483648;
|
package/dist/mjs/index.d.ts
CHANGED
package/dist/mjs/index.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Data } from './Data';
|
|
2
|
+
export type RedeemerTag = 'CERT' | 'MINT' | 'REWARD' | 'SPEND';
|
|
3
|
+
export type Budget = {
|
|
4
|
+
mem: number;
|
|
5
|
+
steps: number;
|
|
6
|
+
};
|
|
7
|
+
export type Action = {
|
|
8
|
+
data: Data;
|
|
9
|
+
index: number;
|
|
10
|
+
budget: Budget;
|
|
11
|
+
tag: RedeemerTag;
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const mergeAssets = (assets) => {
|
|
2
|
+
const merged = [];
|
|
3
|
+
assets.forEach((asset) => {
|
|
4
|
+
const existing = merged.find((a) => a.unit === asset.unit);
|
|
5
|
+
if (existing) {
|
|
6
|
+
existing.quantity = (parseInt(existing.quantity) + parseInt(asset.quantity)).toString();
|
|
7
|
+
}
|
|
8
|
+
else {
|
|
9
|
+
merged.push(asset);
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return merged;
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MetadataStandard, Files, RoyaltiesStandard } from '../cip';
|
|
2
|
+
export type AssetMetadata = FungibleAssetMetadata | NonFungibleAssetMetadata | RoyaltiesStandard;
|
|
3
|
+
export type FungibleAssetMetadata = MetadataStandard & {
|
|
4
|
+
ticker: string;
|
|
5
|
+
decimals: number;
|
|
6
|
+
version: `${number}.${number}`;
|
|
7
|
+
};
|
|
8
|
+
export type NonFungibleAssetMetadata = AudioAssetMetadata | ImageAssetMetadata | SmartAssetMetadata | VideoAssetMetadata;
|
|
9
|
+
type AudioAssetMetadata = MetadataStandard & Files;
|
|
10
|
+
export 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
|
+
type SmartAssetMetadata = MetadataStandard & Files;
|
|
23
|
+
type VideoAssetMetadata = MetadataStandard & Files;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export 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
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type Era = 'ALONZO' | 'BABBAGE';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Quantity } from './Asset';
|
|
2
|
+
import { AssetMetadata } from './AssetMetadata';
|
|
3
|
+
import { Recipient } from './Recipient';
|
|
4
|
+
export type Mint = {
|
|
5
|
+
assetName: string;
|
|
6
|
+
assetQuantity: Quantity;
|
|
7
|
+
metadata: AssetMetadata;
|
|
8
|
+
recipient: Recipient;
|
|
9
|
+
label: '20' | '721' | '777' | `${number}`;
|
|
10
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type NativeScript = {
|
|
2
|
+
type: 'after' | 'before';
|
|
3
|
+
slot: string;
|
|
4
|
+
} | {
|
|
5
|
+
type: 'all' | 'any';
|
|
6
|
+
scripts: NativeScript[];
|
|
7
|
+
} | {
|
|
8
|
+
type: 'atLeast';
|
|
9
|
+
required: number;
|
|
10
|
+
scripts: NativeScript[];
|
|
11
|
+
} | {
|
|
12
|
+
type: 'sig';
|
|
13
|
+
keyHash: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Relay } from './Relay';
|
|
2
|
+
export type PoolParams = {
|
|
3
|
+
VRFKeyHash: string;
|
|
4
|
+
operator: string;
|
|
5
|
+
pledge: string;
|
|
6
|
+
cost: string;
|
|
7
|
+
margin: number;
|
|
8
|
+
relays: Relay[];
|
|
9
|
+
owners: string[];
|
|
10
|
+
rewardAddress: string;
|
|
11
|
+
metadata?: PoolMetadata;
|
|
12
|
+
};
|
|
13
|
+
export type PoolMetadata = {
|
|
14
|
+
URL: string;
|
|
15
|
+
hash: string;
|
|
16
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type Protocol = {
|
|
2
|
+
epoch: number;
|
|
3
|
+
minFeeA: number;
|
|
4
|
+
minFeeB: number;
|
|
5
|
+
maxBlockSize: number;
|
|
6
|
+
maxTxSize: number;
|
|
7
|
+
maxBlockHeaderSize: number;
|
|
8
|
+
keyDeposit: string;
|
|
9
|
+
poolDeposit: string;
|
|
10
|
+
decentralisation: number;
|
|
11
|
+
minPoolCost: string;
|
|
12
|
+
priceMem: number;
|
|
13
|
+
priceStep: number;
|
|
14
|
+
maxTxExMem: string;
|
|
15
|
+
maxTxExSteps: string;
|
|
16
|
+
maxBlockExMem: string;
|
|
17
|
+
maxBlockExSteps: string;
|
|
18
|
+
maxValSize: string;
|
|
19
|
+
collateralPercent: number;
|
|
20
|
+
maxCollateralInputs: number;
|
|
21
|
+
coinsPerUTxOSize: string;
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Data } from './Data';
|
|
2
|
+
import { NativeScript } from './NativeScript';
|
|
3
|
+
import { PlutusScript } from './PlutusScript';
|
|
4
|
+
export type Recipient = string | {
|
|
5
|
+
address: string;
|
|
6
|
+
datum?: {
|
|
7
|
+
value: Data;
|
|
8
|
+
inline?: boolean;
|
|
9
|
+
};
|
|
10
|
+
script?: PlutusScript | NativeScript;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Asset } from './Asset';
|
|
2
|
+
export type UTxO = {
|
|
3
|
+
input: {
|
|
4
|
+
outputIndex: number;
|
|
5
|
+
txHash: string;
|
|
6
|
+
};
|
|
7
|
+
output: {
|
|
8
|
+
address: string;
|
|
9
|
+
amount: Asset[];
|
|
10
|
+
dataHash?: string;
|
|
11
|
+
plutusData?: string;
|
|
12
|
+
scriptRef?: string;
|
|
13
|
+
scriptHash?: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './Account';
|
|
2
|
+
export * from './AccountInfo';
|
|
3
|
+
export * from './Action';
|
|
4
|
+
export * from './Asset';
|
|
5
|
+
export * from './AssetExtended';
|
|
6
|
+
export * from './AssetMetadata';
|
|
7
|
+
export * from './BlockInfo';
|
|
8
|
+
export * from './Data';
|
|
9
|
+
export * from './DataSignature';
|
|
10
|
+
export * from './Era';
|
|
11
|
+
export * from './Mint';
|
|
12
|
+
export * from './NativeScript';
|
|
13
|
+
export * from './Network';
|
|
14
|
+
export * from './PlutusScript';
|
|
15
|
+
export * from './PoolParams';
|
|
16
|
+
export * from './Protocol';
|
|
17
|
+
export * from './Recipient';
|
|
18
|
+
export * from './Relay';
|
|
19
|
+
export * from './Token';
|
|
20
|
+
export * from './TransactionInfo';
|
|
21
|
+
export * from './UTxO';
|
|
22
|
+
export * from './Wallet';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './Account';
|
|
2
|
+
export * from './AccountInfo';
|
|
3
|
+
export * from './Action';
|
|
4
|
+
export * from './Asset';
|
|
5
|
+
export * from './AssetExtended';
|
|
6
|
+
export * from './AssetMetadata';
|
|
7
|
+
export * from './BlockInfo';
|
|
8
|
+
export * from './Data';
|
|
9
|
+
export * from './DataSignature';
|
|
10
|
+
export * from './Era';
|
|
11
|
+
export * from './Mint';
|
|
12
|
+
export * from './NativeScript';
|
|
13
|
+
export * from './Network';
|
|
14
|
+
export * from './PlutusScript';
|
|
15
|
+
export * from './PoolParams';
|
|
16
|
+
export * from './Protocol';
|
|
17
|
+
export * from './Recipient';
|
|
18
|
+
export * from './Relay';
|
|
19
|
+
export * from './Token';
|
|
20
|
+
export * from './TransactionInfo';
|
|
21
|
+
export * from './UTxO';
|
|
22
|
+
export * from './Wallet';
|
package/package.json
CHANGED