Types
AccountType
type AccountType = {
provider: string,
providerSupports: string[]|undefined,
cspr_name: string | null,
public_key: string | null,
connected_at: Number,
token: string | null,
custom?: any,
balance?: string,
liquid_balance?: string;
logo?: string;
}provider
The provider to which the account belongs to.
providerSupports
An array of supported capabilities in the connected wallet. Possible values: "sign-deploy", "sign-transactionv1", "sign-message".
cspr_name
CSPR.name name
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)
liquid_balance
Liquid balance of the account in CSPR motes (includes liquid +staked balance)
logo
A URL to the account avatar or logo.
CsprClickInitOptions
appName
The name of your app as it will be shown in the pop-up windows.
appId
An application identifier. Read more about it here.
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-walletledgermetamask-snap
DecryptMessageResult
cancelled
true when the user has declined the decryption of a message. false otherwise
decryptedMessage
String with the decrypted message.
error
null if the message has been successfully decrypted. It contains an error message otherwise..
EncryptMessageResult
cancelled
true when the user has declined the encryption of a message. false otherwise
encryptedMessage
Hexadecimal string with the encrypted message bytes.
error
null if the message has been successfully encrypted. It contains an error message otherwise..
ProviderInfo
key
Internal name of the provider (wallet).
name
Friendly/Huma readable name of the provider.
version
Version of the provider. Only available for some wallets, when they're installed and/or connected.
supports
Array of keys of the features supported. The values returned may depend on the connected version of the provider.
Currently, the possible supported features are: sign-deploy, sign-transactionv1, and sign-message.
SendResult
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.
status
Indicates the status of the transaction sent. This property is helpful when used in combination with the `waitProcessing` in the `send()` method. Possible values: "sent", "processed", "created", "cancelled", "error", "timeout".
csprCloudTransaction
Raw json object returned by CSPR.cloud streaming API for a processed transaction. Check CSPR.cloud docs for detailed info on the contents.
SignResult
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.
deploy
A json object containing the deploy with the user approval entry (i.e., the new signature).
error
null if the deploy has been successfully signed. It contains an error message otherwise.
SignTypedDataParams
typedData.domain
EIP-712 domain object (e.g. name, version, chain_name, and contract_package_hash).
typedData.types
Map of type names to their field definitions, following EIP-712 conventions.
typedData.primaryType
The top-level type to sign (must be a key in types).
typedData.message
The structured data object to sign, matching the schema of primaryType.
options.domainTypes
Optional explicit domain field definitions for hashing. When omitted, the wallet uses typedData.types.EIP712Domain if present.
options.returnHashArtifacts
When true, the response includes intermediate hash artifacts (domain separator, struct hash, etc.) in the hashArtifacts field of SignTypedDataResult.
options.rejectUnknownFields
When true, the wallet MUST reject the request if the message contains fields not declared in types.
Example:
SignTypedDataResult
cancelled
true when the user has declined the signing operation. false otherwise.
signatureHex
Prefixed signature hex (01 for ed25519, 02 for secp256k1) followed by the signature bytes, or null if cancelled or failed.
digest
0x-prefixed 32-byte hex digest that was signed, or null if cancelled or failed.
publicKey
Prefixed public key used for signing, or null if cancelled or failed.
error
null if the operation succeeded. Contains an error message otherwise.
errorCode
Machine-readable error code. See SignTypedDataErrorCode for possible values.
hashArtifacts
Intermediate hash artifacts for debugging. Only present when returnHashArtifacts was true in the request options. See EIP712HashArtifacts.
SignTypedDataErrorCode
A string union of machine-readable error codes returned in SignTypedDataResult.
USER_REJECTED
The user declined the signing request.
INVALID_PARAMS
The request parameters are malformed or missing required fields.
UNSUPPORTED_TYPE
The wallet does not support the requested type definition.
DOMAIN_TYPES_REQUIRED
Domain type definitions are required but were not provided.
SIGNATURE_SCHEME_NOT_SUPPORTED
The account's key scheme is not supported for typed data signing.
ACCOUNT_NOT_FOUND
The requested account could not be found in the wallet.
NOT_AUTHORIZED
The wallet rejected the request due to an authorization failure.
EIP712HashArtifacts
Intermediate hashing artifacts returned in SignTypedDataResult when options.returnHashArtifacts is true.
domainTypeString
The encoded EIP-712 domain type string used for hashing.
domain
The domain object as used during hashing.
domainSeparator
0x-prefixed domain separator hash.
canonicalTypeString
Canonical type string for the primary type.
typeHash
0x-prefixed type hash.
structHash
0x-prefixed struct hash of the message.
Last updated