Skip to content

@gala-chain/apiAPI


API > signatures

Variable: signatures

signatures: object

Type declaration

calculateKeccak256

calculateKeccak256: (data) => Buffer

Parameters

data: Buffer

enforceValidPublicKey

enforceValidPublicKey: (signature, payload, publicKey) => string

Parameters

signature: undefined | string

payload: object

publicKey: undefined | string

genKeyPair

genKeyPair: () => object

Returns

privateKey

privateKey: string

publicKey

publicKey: string

getCompactBase64PublicKey

getCompactBase64PublicKey: (publicKey) => string

Parameters

publicKey: string

getDERSignature

getDERSignature: (obj, privateKey) => string

Parameters

obj: object

privateKey: Buffer

getEthAddress

getEthAddress: (publicKey) => string

Parameters

publicKey: string

getNonCompactHexPublicKey

getNonCompactHexPublicKey: (publicKey) => string

Parameters

publicKey: string

getPayloadToSign

getPayloadToSign: (obj) => string

Parameters

obj: object

getPublicKey

getPublicKey: (privateKey) => string

Parameters

privateKey: string

getSignature

getSignature: (obj, privateKey) => string

Parameters

obj: object

privateKey: Buffer

isChecksumedEthAddress

isChecksumedEthAddress: (address) => boolean

Parameters

address: string

isLowercasedEthAddress

isLowercasedEthAddress: (address) => boolean

Parameters

address: string

isValid

isValid: (signature, obj, publicKey) => boolean

Parameters

signature: string

obj: object

publicKey: string

isValidBase64

isValidBase64: (input) => boolean

Parameters

input: string

isValidHex

isValidHex: (input) => boolean

Parameters

input: string

isValidSecp256k1Signature

isValidSecp256k1Signature: (signature, dataHash, publicKey) => boolean

Parameters

signature: Secp256k1Signature

dataHash: Buffer

publicKey: Buffer

normalizeEthAddress

normalizeEthAddress: (address) => string

Parameters

address: string

normalizePrivateKey

normalizePrivateKey: (input) => Buffer

Parameters

input: string

normalizePublicKey

normalizePublicKey: (input) => Buffer

Parameters

input: string

parseSecp256k1Signature

parseSecp256k1Signature: (s) => Secp256k1Signature

Parameters

s: string

recoverPublicKey

recoverPublicKey: (signature, obj, prefix?) => string

Parameters

signature: string

obj: object

prefix?: string

ton

ton: object

ton.genKeyPair

ton.genKeyPair: () => Promise\<object>

ton.getSignature

ton.getSignature: (obj, privateKey, seed) => Buffer

Parameters

obj: object

privateKey: Buffer

seed: undefined | string

ton.getTonAddress

ton.getTonAddress: (publicKey, workChain) => string

Parameters

publicKey: Buffer

workChain: number= 0

ton.isValidSignature

ton.isValidSignature: (signature, obj, publicKey, seed) => boolean

Parameters

signature: Buffer

obj: object

publicKey: Buffer

seed: undefined | string

ton.isValidTonAddress

ton.isValidTonAddress: (address) => boolean

Parameters

address: string

validatePublicKey

validatePublicKey: (publicKey) => void

Parameters

publicKey: Buffer

validateSecp256k1PublicKey

validateSecp256k1PublicKey: (publicKey) => ec.KeyPair

Parameters

publicKey: Buffer

Source

chain-api/src/utils/signatures/index.ts:24