@test-org122/hypernet-core
Version:
Hypernet Core. Represents the SDK for running the Hypernet Protocol.
55 lines (46 loc) • 1.42 kB
text/typescript
import { EthereumAddress } from "@test-org122/utils/src/objects/EthereumAddress";
import { PublicKey } from "./PublicKey";
import "reflect-metadata";
import { Type } from "class-transformer";
// tslint:disable: max-classes-per-file
export class EstablishLinkRequest {
(() => String)
public linkId: string;
(() => String)
public consumer: EthereumAddress;
(() => String)
public provider: EthereumAddress;
(() => String)
public paymentToken: EthereumAddress;
(() => String)
public merchantUrl: string;
(() => String)
public threadAddress: string;
constructor(
linkId: string,
consumer: string,
provider: string,
paymentToken: EthereumAddress,
merchantUrl: string,
threadAddress: string,
) {
this.linkId = linkId;
this.consumer = consumer;
this.provider = provider;
this.paymentToken = paymentToken;
this.merchantUrl = merchantUrl;
this.threadAddress = threadAddress;
}
}
export class EstablishLinkRequestWithApproval extends EstablishLinkRequest {
constructor(establishLinkRequest: EstablishLinkRequest, public approve: (approve: boolean) => void) {
super(
establishLinkRequest.linkId,
establishLinkRequest.consumer,
establishLinkRequest.provider,
establishLinkRequest.paymentToken,
establishLinkRequest.merchantUrl,
establishLinkRequest.threadAddress,
);
}
}