Type alias Address

Address: `0x${string}` & {
    [ADDRESS_OPAQUE]: "pendle.sdk.address";
}

The Address type. Please use toAddress to cast a raw address to this type.

Type declaration

  • Readonly [ADDRESS_OPAQUE]: "pendle.sdk.address"

Remarks

This type is defined to avoid using raw string as address. The address returned by a contract call often have mixed cases, which sometimes causes bug in comparison.

This type is an Opaque type with the help of a private unique symbol. Similar implementation can be found in popular libraries such as ts-essentials. We implemented our own, as the generated documentation are the IDE intellisense are nicer than using the library.

Generated using TypeDoc