@meshsdk/contracts
Advanced tools
Comparing version
@@ -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 }; |
@@ -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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
308346
531.64%64
540%6078
406.08%1
-50%4
Infinity%3
50%7
Infinity%2
Infinity%+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed