Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@midcontract/protocol

Package Overview
Dependencies
Maintainers
2
Versions
102
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@midcontract/protocol - npm Package Compare versions

Comparing version 1.0.0-rc.25-0e212c3-0e212c3 to 1.0.0-rc.25-30c596f

dist/ccip-C_V7j74o.js

122

dist/index.d.ts

@@ -24,22 +24,12 @@ // Generated by dts-bundle-generator v9.3.1

};
export interface ContractInput {
functionName: string;
}
export interface EscrowDepositInput extends ContractInput {
contractor: Address;
tokenAddress: Address;
tokenSymbol: SymbolToken;
amount: number;
timeLock: bigint;
feeConfig: number;
recipientData: Hash;
}
export interface EscrowWithdrawInput extends ContractInput {
depositId: bigint;
}
export type TransactionInput = EscrowDepositInput | EscrowWithdrawInput;
declare enum DepositStatus {
PENDING = 0,
SUBMITTED = 1,
APPROVED = 2
ACTIVE = 0,// The contract is active and ongoing
SUBMITTED = 1,// Work submitted by the contractor but not yet approved
APPROVED = 2,// Work has been approved
COMPLETED = 3,// The final claim has been done
RETURN_REQUESTED = 4,// Client has requested a return of funds
DISPUTED = 5,// A dispute has been raised following a denied return request
RESOLVED = 6,// The dispute has been resolved
REFUND_APPROVED = 7,// Refund has been approved, funds can be withdrawn
CANCELED = 8
}

@@ -52,2 +42,7 @@ declare enum FeeConfig {

}
declare enum DisputeWinner {
CLIENT = 0,
CONTRACTOR = 1,
SPLIT = 2
}
declare class Deposit {

@@ -58,2 +53,3 @@ readonly contractor: Address;

readonly amountToClaim: number;
readonly amountToWithdraw: number;
readonly timeLock: bigint;

@@ -68,2 +64,3 @@ readonly contractorData: Hash;

number,
number,
bigint,

@@ -75,2 +72,18 @@ Hash,

}
export interface ContractInput {
functionName: string;
}
export interface EscrowDepositInput extends ContractInput {
contractor: Address;
tokenAddress: Address;
tokenSymbol: SymbolToken;
amount: number;
timeLock: bigint;
feeConfig: number;
recipientData: Hash;
}
export interface EscrowWithdrawInput extends ContractInput {
depositId: bigint;
}
export type TransactionInput = EscrowDepositInput | EscrowWithdrawInput;
export interface DepositAmount {

@@ -80,2 +93,7 @@ totalDepositAmount: number;

}
export interface ClaimableAmount {
claimableAmount: number;
feeDeducted: number;
clientFee: number;
}
export interface DepositInput {

@@ -86,2 +104,3 @@ contractorAddress: Address;

amountToClaim?: number;
amountToWithdraw?: number;
timeLock?: bigint;

@@ -122,2 +141,3 @@ recipientData: Hash;

private readonly feeManagerEscrow;
private readonly ownerAddress;
constructor(chain: Chain, transport: HttpTransport, contractList: ContractList, account?: Account);

@@ -131,2 +151,6 @@ static buildByEnvironment(name?: Environment, account?: Account, url?: string): MidcontractProtocol;

escrowDepositAmount(amount: number, feeConfig?: FeeConfig, tokenSymbol?: SymbolToken): Promise<DepositAmount>;
escrowClaimableAmount(amount: number, feeConfig?: FeeConfig, tokenSymbol?: SymbolToken): Promise<ClaimableAmount>;
getCoverageFee(): Promise<number>;
getClaimFee(): Promise<number>;
getMaxBPS(): Promise<number>;
getDepositList(contractId: bigint): Promise<Deposit>;

@@ -152,3 +176,8 @@ currentContractId(): Promise<bigint>;

escrowWithdraw(contractId: bigint, waitReceipt?: boolean): Promise<TransactionId>;
deployEscrow(adminAddress: Address): Promise<{
requestReturn(contractId: bigint, waitReceipt?: boolean): Promise<TransactionId>;
approveReturn(contractId: bigint, waitReceipt?: boolean): Promise<TransactionId>;
cancelReturn(contractId: bigint, status: DepositStatus, waitReceipt?: boolean): Promise<TransactionId>;
createDispute(contractId: bigint, waitReceipt?: boolean): Promise<TransactionId>;
resolveDispute(contractId: bigint, winner: DisputeWinner, clientAmount: number, contractorAmount: number, waitReceipt?: boolean): Promise<TransactionId>;
deployEscrow(): Promise<{
userEscrow: Address;

@@ -177,2 +206,13 @@ salt: Hash;

];
functionName: "approveReturn";
} | {
args: readonly [
bigint,
number
];
functionName: "cancelReturn";
} | {
args: readonly [
bigint
];
functionName: "claim";

@@ -185,2 +225,7 @@ } | {

args: readonly [
bigint
];
functionName: "createDispute";
} | {
args: readonly [
{

@@ -191,2 +236,3 @@ contractor: `0x${string}`;

amountToClaim: bigint;
amountToWithdraw: bigint;
timeLock: bigint;

@@ -227,3 +273,9 @@ contractorData: `0x${string}`;

args: readonly [
`0x${string}`,
`0x${string}`
];
functionName: "isValidSignature";
} | {
args: readonly [
];
functionName: "owner";

@@ -238,3 +290,16 @@ } | {

args: readonly [
bigint
];
functionName: "requestReturn";
} | {
args: readonly [
bigint,
number,
bigint,
bigint
];
functionName: "resolveDispute";
} | {
args: readonly [
bigint,
`0x${string}`,

@@ -261,3 +326,3 @@ `0x${string}`

events: {
eventName: "Approved" | "Claimed" | "Deposited" | "OwnershipTransferred" | "Refilled" | "RegistryUpdated" | "Submitted" | "Withdrawn";
eventName: "Approved" | "Claimed" | "Deposited" | "DisputeCreated" | "DisputeResolved" | "OwnershipTransferred" | "Refilled" | "RegistryUpdated" | "ReturnApproved" | "ReturnCanceled" | "ReturnRequested" | "Submitted" | "Withdrawn";
args: {

@@ -268,3 +333,2 @@ contractId: bigint;

} | {
sender: `0x${string}`;
contractId: bigint;

@@ -281,2 +345,10 @@ paymentToken: `0x${string}`;

} | {
contractId: bigint;
sender: `0x${string}`;
} | {
contractId: bigint;
winner: number;
clientAmount: bigint;
contractorAmount: bigint;
} | {
oldOwner: `0x${string}`;

@@ -290,7 +362,13 @@ newOwner: `0x${string}`;

} | {
contractId: bigint;
sender: `0x${string}`;
} | {
contractId: bigint;
} | {
contractId: bigint;
} | {
sender: `0x${string}`;
contractId: bigint;
} | {
contractId: bigint;
paymentToken: `0x${string}`;

@@ -297,0 +375,0 @@ amount: bigint;

4

package.json
{
"name": "@midcontract/protocol",
"version": "1.0.0-rc.25-0e212c3-0e212c3",
"version": "1.0.0-rc.25-30c596f",
"description": "Crypto payment protocol with escrow",

@@ -49,3 +49,3 @@ "keywords": [

"build:types": "npx dts-bundle-generator --silent --no-check --out-file dist/index.d.ts sdk/index.ts",
"canary": "pnpm canary:version && npm publish --access public --tag canary",
"canary": "pnpm canary:version && npm publish --access public --tag canary --no-git-tag-version",
"canary:version": "pnpm version --new-version $(jq -r .version package.json)-$(git log -n 1 --pretty=format:%h) --no-git-tag-version",

@@ -52,0 +52,0 @@ "deploy:blast": "source .env && forge script Deployment --broadcast --rpc-url $BLAST_RPC --private-key $BLAST_DEPLOYER_PK --verifier-url $BLAST_VERIFIER_URL --etherscan-api-key $BLAST_ETHERSCAN_API_KEY",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc