Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @ceramicnetwork/blockchain-utils-linking

Utils for linking blockchain accounts

This package contains utility functions to link blockchain accounts to a DID.

Installation

npm install @ceramicnetwork/blockchain-utils-linking

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

References

AuthProvider

Re-exports AuthProvider

ConsentMessage

Re-exports ConsentMessage

CosmosAuthProvider

Re-exports CosmosAuthProvider

EosioAuthProvider

Re-exports EosioAuthProvider

EthereumAuthProvider

Re-exports EthereumAuthProvider

FilecoinAuthProvider

Re-exports FilecoinAuthProvider

LinkProof

Re-exports LinkProof

PolkadotAuthProvider

Re-exports PolkadotAuthProvider

RpcMessage

Re-exports RpcMessage

cosmos

Re-exports cosmos

encodeRpcMessage

Re-exports encodeRpcMessage

eosio

Re-exports eosio

ethereum

Re-exports ethereum

filecoin

Re-exports filecoin

getConsentMessage

Re-exports getConsentMessage

polkadot

Re-exports polkadot

Variables

Const CHAIN_ID

CHAIN_ID: "polkadot:b0a8d493285c2df73290dfb7e61f870f" = "polkadot:b0a8d493285c2df73290dfb7e61f870f"

Const CHAIN_NAMESPACE

CHAIN_NAMESPACE: "eip155" = "eip155"

Const maxWordLength

maxWordLength: 12 = 12

Functions

asTransaction

  • asTransaction(address: string, message: string): Tx

asTransaction

  • asTransaction(address: string, message: string): MessageParams

authenticate

  • authenticate(message: string, account: AccountID, provider: any): Promise<string>

createErc1271Link

  • createErc1271Link(did: string, account: AccountID, provider: any, opts: any): Promise<LinkProof>

createEthLink

  • createEthLink(did: string, account: AccountID, provider: any, opts?: any): Promise<LinkProof>

createLink

  • createLink(did: string, account: AccountID, provider: any, opts: any): Promise<LinkProof>

encodeRpcMessage

  • encodeRpcMessage(method: string, params?: any): any

getCode

  • getCode(address: string, provider: any): Promise<string>

getConsentMessage

  • getConsentMessage(did: string, addTimestamp?: boolean): ConsentMessage

getMetaData

  • getMetaData(): SignMeta

isERC1271

  • isERC1271(account: AccountID, provider: any): Promise<boolean>

isEthAddress

  • isEthAddress(address: string): boolean

normalizeAccountId

  • normalizeAccountId(account: AccountID): AccountID

safeSend

  • safeSend(data: RpcMessage, provider: any): Promise<any>

sanitize

  • sanitize(str: string, size: number): string

Const stringEncode

  • stringEncode(str: string): string

Const stringHex

  • stringHex(str: string): string

toCAIPChainId

  • toCAIPChainId(chainId: string): string

toPayload

  • toPayload(message: string, accountID: AccountID): string

toSignedPayload

  • toSignedPayload(message: string, accountID: AccountID, provider: any): Promise<string>

utf8toHex

  • utf8toHex(message: string): string

validateChainId

  • validateChainId(account: AccountID, provider: any): Promise<void>

Object literals

Const ADDRESS_TYPES

ADDRESS_TYPES: object

erc1271

erc1271: string = "erc1271"

ethereumEOA

ethereumEOA: string = "ethereum-eoa"