Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Reference — Core SDK: ERC20 / 721 / 1155 mixins · Boson Protocol
Skip to content

ERC20 / 721 / 1155 mixins

These mixins wrap the standard ERC token interfaces. They're used internally for approvals and balance reads and exposed for application code.

erc1155

Class: ERC1155Mixin

Source: packages/core-sdk/src/erc1155/mixin.ts

Methods (4)

erc1155BalanceOf, erc1155Name, erc1155Symbol, erc1155Uri

Signatures

erc1155BalanceOf (1 signature)

public async erc1155BalanceOf(
    args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
  ): Promise<ReturnType<typeof balanceOf>>

erc1155Name (1 signature)

public async erc1155Name(
    args: Omit<Parameters<typeof name>[0], "web3Lib">
  ): Promise<ReturnType<typeof name>>

erc1155Symbol (1 signature)

public async erc1155Symbol(
    args: Omit<Parameters<typeof symbol>[0], "web3Lib">
  ): Promise<ReturnType<typeof symbol>>

erc1155Uri (1 signature)

public async erc1155Uri(
    args: Omit<Parameters<typeof uri>[0], "web3Lib">
  ): Promise<ReturnType<typeof uri>>

erc165

Class: ERC165Mixin

Source: packages/core-sdk/src/erc165/mixin.ts

Methods (1)

erc165SupportsInterface

Signatures

erc165SupportsInterface (1 signature)

public async erc165SupportsInterface(
    args: Omit<Parameters<typeof supportsInterface>[0], "web3Lib">
  ): Promise<ReturnType<typeof supportsInterface>>

erc20

Class: ERC20Mixin

Source: packages/core-sdk/src/erc20/mixin.ts

Methods (10)

erc20Approve, erc20BalanceOf, erc20EnsureAllowance, erc20GetAllowance, erc20GetDecimals, erc20GetName, erc20GetSymbol, signReceiveWithErc2612Permit, signReceiveWithErc3009Authorization, signReceiveWithPermit2

Signatures

erc20Approve (3 signatures)

Overload: returnTxInfo is true → returns TransactionRequest

public async erc20Approve(
    args: Omit<
      Parameters<typeof approve>[0],
      "web3Lib" | "theGraphStorage" | "metadataStorage"
    >,
    overrides: Partial<{
      contractAddress: string;
      txRequest: TransactionRequest;
      returnTxInfo: true;
    }>
  ): Promise<TransactionRequest>
 
public async erc20Approve(
    args: Omit<
      Parameters<typeof approve>[0],
      "web3Lib" | "theGraphStorage" | "metadataStorage"
    >,
    overrides?: Partial<{
      contractAddress: string;
      txRequest: TransactionRequest;
      returnTxInfo?: false | undefined;
    }>
  ): Promise<TransactionResponse>
 
public async erc20Approve(
    args: Omit<
      Parameters<typeof approve>[0],
      "web3Lib" | "theGraphStorage" | "metadataStorage"
    >,
    overrides: Partial<{
      contractAddress: string;
      txRequest: TransactionRequest;
      returnTxInfo?: boolean;
    }> = {}
  ): Promise<TransactionResponse | TransactionRequest>

erc20BalanceOf (1 signature)

public async erc20BalanceOf(
    args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
  ): Promise<ReturnType<typeof balanceOf>>

erc20EnsureAllowance (1 signature)

public async erc20EnsureAllowance(
    args: Omit<Parameters<typeof ensureAllowance>[0], "web3Lib">
  ): Promise<ReturnType<typeof ensureAllowance>>

erc20GetAllowance (1 signature)

public async erc20GetAllowance(
    args: Omit<Parameters<typeof getAllowance>[0], "web3Lib">
  ): Promise<ReturnType<typeof getAllowance>>

erc20GetDecimals (1 signature)

public async erc20GetDecimals(
    args: Omit<Parameters<typeof getDecimals>[0], "web3Lib">
  ): Promise<ReturnType<typeof getDecimals>>

erc20GetName (1 signature)

public async erc20GetName(
    args: Omit<Parameters<typeof getName>[0], "web3Lib">
  ): Promise<ReturnType<typeof getName>>

erc20GetSymbol (1 signature)

public async erc20GetSymbol(
    args: Omit<Parameters<typeof getSymbol>[0], "web3Lib">
  ): Promise<ReturnType<typeof getSymbol>>

signReceiveWithErc2612Permit (3 signatures)

Overload: returnTypedDataToSign is true → returns StructuredData

public async signReceiveWithErc2612Permit(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    deadline: BigNumberish,
    overrides: Partial<{ spender: string }> & { returnTypedDataToSign: true }
  ): Promise<StructuredData>
 
public async signReceiveWithErc2612Permit(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    deadline: BigNumberish,
    overrides?: Partial<{ spender: string; returnTypedDataToSign?: false }>
  ): Promise<TransferAuthorization & { strategy: "EIP2612" }>
 
public async signReceiveWithErc2612Permit(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    deadline: BigNumberish,
    overrides: Partial<{
      spender: string;
      returnTypedDataToSign: boolean;
    }> = {}
  ): Promise<
    (TransferAuthorization & { strategy: "EIP2612" }) | StructuredData
  >

signReceiveWithErc3009Authorization (3 signatures)

Overload: returnTypedDataToSign is true → returns StructuredData

public async signReceiveWithErc3009Authorization(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    validAfter: BigNumberish,
    validBefore: BigNumberish,
    overrides: Partial<{ spender: string }> & { returnTypedDataToSign: true }
  ): Promise<StructuredData>
 
public async signReceiveWithErc3009Authorization(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    validAfter: BigNumberish,
    validBefore: BigNumberish,
    overrides?: Partial<{ spender: string; returnTypedDataToSign?: false }>
  ): Promise<TransferAuthorization & { strategy: "ERC3009" }>
 
public async signReceiveWithErc3009Authorization(
    exchangeToken: string,
    tokenDomain: { name: string; version: string },
    value: BigNumberish,
    validAfter: BigNumberish,
    validBefore: BigNumberish,
    overrides: Partial<{
      spender: string;
      returnTypedDataToSign: boolean;
    }> = {}
  ): Promise<
    (TransferAuthorization & { strategy: "ERC3009" }) | StructuredData
  >

signReceiveWithPermit2 (3 signatures)

Overload: returnTypedDataToSign is true → returns StructuredData

public async signReceiveWithPermit2(
    exchangeToken: string,
    value: BigNumberish,
    deadline: BigNumberish,
    overrides: Partial<{
      spender: string;
      permit2Address: string;
      permit2Nonce: BigNumberish;
    }> & { returnTypedDataToSign: true }
  ): Promise<StructuredData>
 
public async signReceiveWithPermit2(
    exchangeToken: string,
    value: BigNumberish,
    deadline: BigNumberish,
    overrides?: Partial<{
      spender: string;
      permit2Address: string;
      permit2Nonce: BigNumberish;
      returnTypedDataToSign?: false;
    }>
  ): Promise<TransferAuthorization & { strategy: "Permit2" }>
 
public async signReceiveWithPermit2(
    exchangeToken: string,
    value: BigNumberish,
    deadline: BigNumberish,
    overrides: Partial<{
      spender: string;
      permit2Address: string;
      permit2Nonce: BigNumberish;
      returnTypedDataToSign: boolean;
    }> = {}
  ): Promise<
    (TransferAuthorization & { strategy: "Permit2" }) | StructuredData
  >

erc721

Class: ERC721Mixin

Source: packages/core-sdk/src/erc721/mixin.ts

Methods (6)

erc721BalanceOf, erc721Name, erc721OwnerOf, erc721Symbol, erc721TokenOfOwnerByIndex, erc721TokenUri

Signatures

erc721BalanceOf (1 signature)

public async erc721BalanceOf(
    args: Omit<Parameters<typeof balanceOf>[0], "web3Lib">
  ): Promise<ReturnType<typeof balanceOf>>

erc721Name (1 signature)

public async erc721Name(
    args: Omit<Parameters<typeof name>[0], "web3Lib">
  ): Promise<ReturnType<typeof name>>

erc721OwnerOf (1 signature)

public async erc721OwnerOf(
    args: Omit<Parameters<typeof ownerOf>[0], "web3Lib">
  ): Promise<ReturnType<typeof ownerOf>>

erc721Symbol (1 signature)

public async erc721Symbol(
    args: Omit<Parameters<typeof symbol>[0], "web3Lib">
  ): Promise<ReturnType<typeof symbol>>

erc721TokenOfOwnerByIndex (1 signature)

public async erc721TokenOfOwnerByIndex(
    args: Omit<Parameters<typeof tokenOfOwnerByIndex>[0], "web3Lib">
  ): Promise<ReturnType<typeof tokenOfOwnerByIndex>>

erc721TokenUri (1 signature)

public async erc721TokenUri(
    args: Omit<Parameters<typeof tokenUri>[0], "web3Lib">
  ): Promise<ReturnType<typeof tokenUri>>

Related