Types

AccountType

type AccountType = {
    provider: string,
    name: string | null,
    public_key: string | null,
    connected_at: Number,
    token: string | null,
    custom?: any,
    balance?: string,
}
Property
Description

provider

The provider to which the account belongs to.

name

n/a (for future use)

public_key

The public key.

connected_at

Timestamp for the initial connection of the account

token

n/a (for future use)

custom

Custom data. Depends on the provider.

balance

Total balance of the account in CSPR motes (includes liquid +staked balance)

CsprClickInitOptions

type CsprClickInitOptions = {
    appName: string,
    appId: string,
    contentMode: 'iframe' | 'popup',
    casperNode?: string,
    chainName?: string,
    providers: Array<string>,
}
Property
Description

appName

The name of your app as it will be shown in the pop-up windows.

appId

contentMode

Defines whether the sign in interface is shown within an iframe in your application or in external pop-up windows.

casperNode

The RPC endpoint CSPR.click uses to get information from the Casper network and to send deploys.

chainName

Use casper or casper-test to interact with Casper Mainnet or Casper Testnet, respectively.

providers

The list of providers (wallets) you want to allow in your application

The wallets you can add to the providers array are:

  • casper-wallet

  • casper-signer

  • casperdash

  • ledger

  • metamask-snap

  • torus-wallet

SendResult

type SendResult = {
    cancelled: boolean,
    deployHash: string | null,
    error: string | null,
    errorData: object | null,
}
Property
Description

cancelled

true when the user has declined the signature of the transaction. false otherwise

deployHash

The hash of the deploy signed and sent to the Casper network. null when the deploy signature has been cancelled or there was an error sending it to the network

error

null if the deploy has been successfully signed and sent to the network. It contains an error message when the network rejects the deploy.

errorData

extra information on the error. It's usually a json object.

SignResult

type SignResult = {
    cancelled: boolean,
    signatureHex: string | null,
    signature: Uint8Array | null,
    error: string | null,
}
Property
Description

cancelled

true when the user has declined the signature of the transaction. false otherwise

signatureHex

An hexadecimal string with the crytpographic signature of the deploy.

signature

A byte array with the cryptographic signature of the deploy.

error

null if the deploy has been successfully signed. It contains an error message otherwise.

Last updated