Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @ceramicnetwork/blockchain-utils-validation

Utils for validation of linked blockchain accounts

This package contains utility functions to validate links of blockchain accounts linked a DID.

Installation

npm install @ceramicnetwork/blockchain-utils-validation

Contributing

We are happy to accept small and large contributions. Make sure to check out the Ceramic specifications for details of how the protocol works.

License

Apache-2.0 or MIT

Index

Variables

Const ERC1271_ABI

ERC1271_ABI: string[] = ["function isValidSignature(bytes _messageHash, bytes _signature) public view returns (bytes4 magicValue)",]

Const MAGIC_ERC1271_VALUE

MAGIC_ERC1271_VALUE: "0x20c13b0b" = "0x20c13b0b"

Const namespace

namespace: "eip155" = "eip155"

Const namespace

namespace: "fil" = "fil"

Const namespace

namespace: "polkadot" = "polkadot"

Const namespace

namespace: "eosio" = "eosio"

Const namespace

namespace: "cosmos" = "cosmos"

Functions

Const findDID

  • findDID(did: string): string | undefined

getEthersProvider

  • getEthersProvider(chainId: string): any

Const stringDecode

  • stringDecode(str: string): string

Const stringEncode

  • stringEncode(str: string): string

toV2Proof

  • toV2Proof(proof: LinkProof, address?: string): LinkProof

utf8toHex

  • utf8toHex(message: string): string

validateEoaLink

  • validateEoaLink(proof: LinkProof): Promise<LinkProof | null>

validateErc1271Link

  • validateErc1271Link(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

validateLink

  • validateLink(proof: LinkProof): Promise<LinkProof | null>

Object literals

Const ADDRESS_TYPES

ADDRESS_TYPES: object

erc1271

erc1271: string = "erc1271"

ethereumEOA

ethereumEOA: string = "ethereum-eoa"

Const Handler

Handler: object

namespace

namespace: string

validateLink

validateLink: validateLink

Const Handler

Handler: object

namespace

namespace: string

validateLink

validateLink: validateLink

Const Handler

Handler: object

namespace

namespace: string

validateLink

validateLink: validateLink

Const Handler

Handler: object

namespace

namespace: string

validateLink

validateLink: validateLink

Const handler

handler: object

namespace

namespace: string

validateLink

validateLink: validateLink

Const handlers

handlers: object

[cosmos.namespace]

[cosmos.namespace]: BlockchainHandler = cosmos

[eosio.namespace]

[eosio.namespace]: BlockchainHandler = eosio

[ethereum.namespace]

[ethereum.namespace]: BlockchainHandler = ethereum

[filecoin.namespace]

[filecoin.namespace]: BlockchainHandler = filecoin

[polkadot.namespace]

[polkadot.namespace]: BlockchainHandler = polkadot

Const proofs

proofs: object

v0

v0: object

invalid

invalid: object

message

message: string = "Create a new 3Box profile-Your unique profile ID is did:3:bafysdfwefwe"

signature

signature: string = "0xfa69ccf4a94db6139837459873459873498759834500fbb748209890a5780f3365a5335f82d424d7f9a63ee41b637c116e64ef2f32c761bb065e4409f978c4bb1c"

type

type: string = "ethereum-eoa"

valid

valid: object

message

message: string = "Create a new 3Box profile-Your unique profile ID is did:3:bafysdfwefwe"

signature

signature: string = "0xfa69ccf4a94db61325429d37c58c6de534b73f439700fbb748209890a5780f3365a5335f82d424d7f9a63ee41b637c116e64ef2f32c761bb065e4409f978c4bb1c"

type

type: string = "ethereum-eoa"

v1

v1: object

invalid

invalid: object

address

address: string = "0x8fe2c4516e920425e177658aaac451ca0463ed87"

message

message: string = "Create a new 3Box profile-Your unique profile ID is did:3:bafysdfwefwe"

signature

signature: string = "0xfa69ccf4a94db61325429d37c58c6de534b73f439700fbb748209890a5780f3365a5335f82d424d7f9a63ee41b637c116e64ef2f32c761bb065e4409f978c4bb1c"

type

type: string = "ethereum-eoa"

version

version: number = 1

valid

valid: object

address

address: string = "0x8fe2c4516e920425e177658aaac451ca0463ed69"

message

message: string = "Create a new 3Box profile-Your unique profile ID is did:3:bafysdfwefwe"

signature

signature: string = "0xfa69ccf4a94db61325429d37c58c6de534b73f439700fbb748209890a5780f3365a5335f82d424d7f9a63ee41b637c116e64ef2f32c761bb065e4409f978c4bb1c"

type

type: string = "ethereum-eoa"

version

version: number = 1