Skip to content

v1.0.0-rc.25

Pre-release
Pre-release

Choose a tag to compare

@andriiKyrylov andriiKyrylov released this 20 May 08:46
· 122 commits to main since this release
7a032b5
npm install --save @midcontract/protocol@1.0.0-rc.25

fullFee key was changed to feeConfig which is enum:

export enum FeeConfig {
  CLIENT_COVERS_ALL,
  CLIENT_COVERS_ONLY,
  CONTRACTOR_COVERS_CLAIM,
  NO_FEES,
}

SDK methods updates:

  • escrowDeposit() changed input from
export interface DepositInput {
  depositId: bigint;
  token?: SymbolToken;
  amount: number;
  timeLock?: bigint;
  fullFee?: boolean;
  recipientData: Hash;
}

to

export interface DepositInput {
 contractorAddress: Address;
 token: SymbolToken;
 amount: number;
 amountToClaim?: number;
 timeLock?: bigint;
 recipientData: Hash;
 feeConfig: FeeConfig;
 status?: DepositStatus;
}
  • new method deploy(adminAddress), on user's first deposit, before deposit itself, this method should be called in order to deploy a proxy smart contract per user, returns new user smart contract address and salt, both 2 fields should be stored in db.
  • escrowDepositAmount(amount: number, feeConfig: FeeConfig = 1, tokenSymbol: SymbolToken = "MockUSDT") added new field to input, feeConfig, for now feeConfig has default value CLIENT_COVERS_ONLY
  • escrowMakeDataHash(data: string, salt: Hash) added new required field in input - salt
  • escrowDeposit(input: DepositInput, waitReceipt = true) input param changed due to change of deposit interface in SDK, output -> added new field contractId that should be stored in deposit/contract entity in db. This value changed old value -> depositId, and should be used in all methods after deposit (submit, approve, refill, claim, withdraw)