🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

@meshsdk/contracts

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@meshsdk/contracts - npm Package Compare versions

Comparing version

to
1.0.0-beta.5

src/common.ts

108

dist/index.d.ts

@@ -1,2 +0,4 @@

import { IInitiator, ISubmitter, IFetcher, Network, ISigner } from '@meshsdk/core';
import { IInitiator, ISubmitter, IFetcher, Network, ISigner, MeshTxBuilder, BrowserWallet, UTxO, Asset } from '@meshsdk/core';
import * as _meshsdk_mesh_csl from '@meshsdk/mesh-csl';
import { ConStr0, PubKeyAddress, Integer, CurrencySymbol, TokenName, BuiltinByteString, Value, ConStr1 } from '@meshsdk/mesh-csl';

@@ -33,2 +35,104 @@ declare type OwnerAddress = string;

export { BasicMarketplace };
declare type MeshTxInitiatorInput = {
mesh: MeshTxBuilder;
fetcher?: IFetcher;
wallet?: BrowserWallet;
networkId?: number;
};
declare class MeshTxInitiator {
mesh: MeshTxBuilder;
fetcher?: IFetcher;
wallet?: BrowserWallet;
networkId: number;
constructor({ mesh, fetcher, wallet, networkId }: MeshTxInitiatorInput);
protected signSubmitReset: () => Promise<string | undefined>;
protected queryUtxos: (walletAddress: string) => Promise<UTxO[]>;
protected getWalletDappAddress: () => Promise<string>;
protected getWalletCollateral: () => Promise<UTxO | undefined>;
protected getWalletUtxosWithMinLovelace: (lovelace: number, providedUtxos?: UTxO[]) => Promise<UTxO[]>;
protected getWalletUtxosWithToken: (assetHex: string, userUtxos?: UTxO[]) => Promise<UTxO[]>;
protected getAddressUtxosWithMinLovelace: (walletAddress: string, lovelace: number, providedUtxos?: UTxO[]) => Promise<UTxO[]>;
protected getAddressUtxosWithToken: (walletAddress: string, assetHex: string, userUtxos?: UTxO[]) => Promise<UTxO[]>;
protected getWalletInfoForTx: () => Promise<{
utxos: UTxO[];
collateral: UTxO;
walletAddress: string;
}>;
protected _getUtxoByTxHash: (scriptCbor: string, txHash: string) => Promise<UTxO | undefined>;
}
declare type MarketplaceDatum = ConStr0<[
PubKeyAddress,
Integer,
CurrencySymbol,
TokenName
]>;
declare const marketplaceDatum: (sellerAddress: string, lovelaceFee: number, assetHex: string) => MarketplaceDatum;
declare class MeshMarketplaceContract extends MeshTxInitiator {
ownerAddress: string;
feePercentageBasisPoint: number;
scriptCbor: string;
constructor(inputs: MeshTxInitiatorInput, ownerAddress: string, feePercentageBasisPoint: number);
listAsset: (asset: string, price: number) => Promise<string>;
delistAsset: (marketplaceUtxo: UTxO) => Promise<string>;
purchaseAsset: (marketplaceUtxo: UTxO) => Promise<string>;
relistAsset: (marketplaceUtxo: UTxO, newPrice: number) => Promise<string>;
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
}
declare type VestingDatum = ConStr0<[
Integer,
BuiltinByteString,
BuiltinByteString
]>;
declare class MeshVestingContract extends MeshTxInitiator {
scriptCbor: string;
constructor(inputs: MeshTxInitiatorInput);
depositFund: (amount: Asset[], lockUntilTimeStampMs: number, beneficiary: string) => Promise<string>;
withdrawFund: (vestingUtxo: UTxO) => Promise<string>;
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
}
declare type InitiationDatum = ConStr0<[PubKeyAddress, Value]>;
declare const initiateEscrowDatum: (walletAddress: string, amount: Asset[]) => InitiationDatum;
declare type ActiveEscrowDatum = ConStr1<[
PubKeyAddress,
Value,
PubKeyAddress,
Value
]>;
declare const activeEscrowDatum: (initiationDatum: InitiationDatum, walletAddress: string, amount: Asset[]) => ActiveEscrowDatum;
declare type RecipientDepositRedeemer = ConStr0<[PubKeyAddress, Value]>;
declare const recipientDepositRedeemer: (recipient: string, depositAmount: Asset[]) => InitiationDatum;
declare class MeshEscrowContract extends MeshTxInitiator {
scriptCbor: string;
constructor(inputs: MeshTxInitiatorInput);
initiateEscrow: (escrowAmount: Asset[]) => Promise<string>;
cancelEscrow: (escrowUtxo: UTxO) => Promise<string>;
recipientDeposit: (escrowUtxo: UTxO, depositAmount: Asset[]) => Promise<string>;
completeEscrow: (escrowUtxo: UTxO) => Promise<string>;
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
}
declare class MeshGiftCardContract extends MeshTxInitiator {
tokenNameHex: string;
paramUtxo: UTxO['input'];
giftCardCbor: (tokenNameHex: string, utxoTxHash: string, utxoTxId: number) => string;
redeemCbor: (tokenNameHex: string, policyId: string) => string;
constructor(inputs: MeshTxInitiatorInput, tokenNameHex?: string, paramUtxo?: UTxO['input']);
createGiftCard: (tokenName: string, giftValue: Asset[]) => Promise<string>;
redeemGiftCard: (giftCardUtxo: UTxO) => Promise<string>;
getUtxoByTxHash: (txHash: string) => Promise<UTxO | undefined>;
private getScripts;
}
declare class MeshPaymentSplitterContract extends MeshTxInitiator {
wrapPayees: (payees: string[]) => _meshsdk_mesh_csl.List;
scriptCbor: () => string;
payees: string[];
constructor(inputs: MeshTxInitiatorInput, payees: string[]);
sendLovelaceToSplitter: (lovelaceAmount: number) => Promise<string | undefined>;
triggerPayout: () => Promise<string | undefined>;
}
export { ActiveEscrowDatum, BasicMarketplace, InitiationDatum, MarketplaceDatum, MeshEscrowContract, MeshGiftCardContract, MeshMarketplaceContract, MeshPaymentSplitterContract, MeshVestingContract, RecipientDepositRedeemer, VestingDatum, activeEscrowDatum, initiateEscrowDatum, marketplaceDatum, recipientDepositRedeemer };

7

package.json

@@ -6,3 +6,3 @@ {

"author": "MeshJS",
"version": "1.0.0-beta.4",
"version": "1.0.0-beta.5",
"license": "Apache-2.0",

@@ -38,7 +38,8 @@ "type": "module",

"peerDependencies": {
"@meshsdk/core": "1.5.7"
"@meshsdk/core": "1.5.16"
},
"dependencies": {
"@harmoniclabs/plu-ts": "0.2.2"
"@harmoniclabs/plu-ts": "0.2.2",
"@meshsdk/mesh-csl": "^0.0.4"
}
}
export * from './marketplace';
export * from './vesting';
export * from './escrow';
export * from './giftcard';
export * from './payment-splitter';
export * from './basic.service';
export * from './offchain';

@@ -40,3 +40,3 @@ {

// "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
// "resolveJsonModule": true, /* Enable importing .json files. */
"resolveJsonModule": true, /* Enable importing .json files. */
// "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */

@@ -43,0 +43,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display