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

AvalancheAuthProvider

Renames and re-exports EthereumAuthProvider

ConsentMessage

Re-exports ConsentMessage

CosmosAuthProvider

Re-exports CosmosAuthProvider

EosioAuthProvider

Re-exports EosioAuthProvider

EthereumAuthProvider

Re-exports EthereumAuthProvider

FilecoinAuthProvider

Re-exports FilecoinAuthProvider

LinkProof

Re-exports LinkProof

NearAuthProvider

Re-exports NearAuthProvider

PolkadotAuthProvider

Re-exports PolkadotAuthProvider

RpcMessage

Re-exports RpcMessage

TezosAuthProvider

Re-exports TezosAuthProvider

TezosProvider

Re-exports TezosProvider

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

tezos

Re-exports tezos

Type aliases

EthProviderOpts

EthProviderOpts: { eoaSignAccount?: string }

Type declaration

  • Optional eoaSignAccount?: string

Variables

Const CHAIN_ID

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

Const CHAIN_NAMESPACE

CHAIN_NAMESPACE: "eip155" = "eip155"

Const TEZOS_CHAIN_REF

TEZOS_CHAIN_REF: "NetXdQprcVkpaWU" = "NetXdQprcVkpaWU"

Const TEZOS_NAMESPACE

TEZOS_NAMESPACE: "tezos" = "tezos"

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>

buildOcapRequestMessage

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>

encodeMessage

  • encodeMessage(text: string): string

encodeRpcMessage

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

getActiveAddress

getCode

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

getConsentMessage

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

getMetaData

  • getMetaData(): SignMeta

Const getSignature

  • getSignature(signer: Signer, accountId: string, message: any, networkId: string): Promise<string>

isERC1271

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

isEthAddress

  • isEthAddress(address: string): boolean

normalizeAccountId

  • normalizeAccountId(account: AccountID): AccountID

safeSend

  • safeSend(provider: any, method: string, params?: Array<any>): Promise<any>

sanitize

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

sign

  • sign(provider: TezosProvider, message: string): Promise<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>

w3cDate

  • w3cDate(date?: number | string): string

Object literals

Const ADDRESS_TYPES

ADDRESS_TYPES: object

erc1271

erc1271: string = "erc1271"

ethereumEOA

ethereumEOA: string = "ethereum-eoa"