Skip to content

Commit

Permalink
try to fix wrapper issue
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Jun 12, 2023
1 parent b22b3b3 commit 77cea73
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/contracts/masa-contracts.ts
Expand Up @@ -67,13 +67,31 @@ export class MasaContracts extends MasaBase {
...contractOverrides,
};

/**
* SBTS
*/
this.sbt = new SBT(this.masa, this.instances);
this.sssbt = new SSSBT(this.masa, this.instances);
this.asbt = new ASBT(this.masa, this.instances);
/**
* Soul Linker
*/
this.soulLinker = new SoulLinker(this.masa, this.instances);
/**
* Soul Name
*/
this.soulName = new SoulName(this.masa, this.instances);
/**
* Identity
*/
this.identity = new Identity(this.masa, this.instances);
/**
* Credit Score
*/
this.creditScore = new CreditScore(this.masa, this.instances);
/**
* Greens
*/
this.green = new Green(this.masa, this.instances);
}

Expand Down
16 changes: 15 additions & 1 deletion src/contracts/modules/sbt/ASBT/asbt.ts
Expand Up @@ -3,13 +3,27 @@ import type { ReferenceSBTAuthority } from "@masa-finance/masa-contracts-identit
import type { BigNumber, PayableOverrides } from "ethers";

import { Messages } from "../../../../collections";
import type { PaymentMethod } from "../../../../interface";
import type {
IIdentityContracts,
MasaInterface,
PaymentMethod,
} from "../../../../interface";
import { SBT } from "../SBT";
import type { ASBTContractWrapper } from "./ASBTContractWrapper";

export class ASBT<
Contract extends ReferenceSBTAuthority
> extends SBT<Contract> {
constructor(masa: MasaInterface, instances: IIdentityContracts) {
super(masa, instances);

this.wrapper.bind(this);
}

/**
*
* @param sbtContract
*/
protected wrapper = (
sbtContract: Contract
): ASBTContractWrapper<Contract> => ({
Expand Down
11 changes: 11 additions & 0 deletions src/contracts/modules/sbt/SSSBT/sssbt.ts
Expand Up @@ -5,13 +5,24 @@ import type { PayableOverrides, TypedDataDomain, TypedDataField } from "ethers";

import { Messages } from "../../../../collections";
import type { PaymentMethod } from "../../../../interface";
import { IIdentityContracts, MasaInterface } from "../../../../interface";
import { generateSignatureDomain, signTypedData } from "../../../../utils";
import { SBT } from "../SBT";
import type { SSSBTContractWrapper } from "./SSSBTContractWrapper";

export class SSSBT<
Contract extends ReferenceSBTSelfSovereign
> extends SBT<Contract> {
constructor(masa: MasaInterface, instances: IIdentityContracts) {
super(masa, instances);

this.wrapper.bind(this);
}

/**
*
* @param sbtContract
*/
protected wrapper = (
sbtContract: Contract
): SSSBTContractWrapper<Contract> => ({
Expand Down

0 comments on commit 77cea73

Please sign in to comment.