mirror of
https://github.com/oceanprotocol-archive/squid-js.git
synced 2024-02-02 15:31:51 +01:00
26 lines
862 B
TypeScript
26 lines
862 B
TypeScript
import { Condition } from "./Condition.abstract"
|
|
import { zeroX } from "../../../utils"
|
|
|
|
export class EscrowReward extends Condition {
|
|
|
|
public static async getInstance(): Promise<EscrowReward> {
|
|
return Condition.getInstance("EscrowReward", EscrowReward)
|
|
}
|
|
|
|
public hashValues(amount: number, receiver: string, sender: string, lockCondition: string, releaseCondition: string) {
|
|
return super.hashValues(amount, ...[receiver, sender, lockCondition, releaseCondition].map(zeroX))
|
|
}
|
|
|
|
public fulfill(
|
|
agreementId: string,
|
|
amount: number,
|
|
receiver: string,
|
|
sender: string,
|
|
lockCondition: string,
|
|
releaseCondition: string,
|
|
from?: string,
|
|
) {
|
|
return super.fulfill(agreementId, [amount, ...[receiver, sender, lockCondition, releaseCondition].map(zeroX)], from)
|
|
}
|
|
}
|