Retrieves the specified file from the app's data store.
This constant is used in the [[redirectToSignInWithAuthRequest]]
This logic is in a separate file with no dependencies so that it can be loaded and executed as soon as possible to fulfill the purpose of the protocol detection technique. The effectiveness of this is obviously subject to how web apps bundle/consume the blockstack.js lib.
Translates the tx auth hash mode to the corresponding address version.
Broadcast the signed transaction to a core node
the raw serialized transaction buffer to broadcast
the broadcast endpoint URL
that resolves to a response if the operation succeeds
Broadcast the signed transaction to a core node
the token transfer transaction to broadcast
the Stacks network to broadcast transaction to
that resolves to a response if the operation succeeds
Calls a read only function from a contract interface
the options object
Returns an object with a status bool (okay) and a result string that is a serialized clarity value in hex format.
Converts a clarity value to a hex encoded string with 0x
prefix
the clarity value to convert
Decrypt an encrypted mnemonic phrase with a password. Legacy triplesec encrypted payloads are also supported.
Password for data
the raw mnemonic phrase
Decrypts data encrypted with encryptContent
with the
transit private key.
encrypted content.
decrypted content.
Encrypt a raw mnemonic phrase to be password protected
Raw mnemonic phrase
Password to encrypt mnemonic with
The encrypted phrase
Encrypts the data provided with the app public key.
data to encrypt
Stringified ciphertext object
Estimate the total transaction fee in microstacks for a contract deploy
the token transfer transaction to estimate fees for
the Stacks network to estimate transaction for
a promise that resolves to number of microstacks per byte
Estimate the total transaction fee in microstacks for a contract function call
the token transfer transaction to estimate fees for
the Stacks network to estimate transaction for
a promise that resolves to number of microstacks per byte
Estimate the total transaction fee in microstacks for a token transfer
the token transfer transaction to estimate fees for
the Stacks network to estimate transaction for
a promise that resolves to number of microstacks per byte
Extracts a profile from an encoded token and optionally verifies it,
if publicKeyOrAddress
is provided.
the token to be extracted
the public key or address of the keypair that is thought to have signed the token
Fetch a contract's ABI
the contracts address
the contracts name
the Stacks network to broadcast transaction to
that resolves to a ClarityAbi if the operation succeeds
Creates a P2PKH address string from the given private key and tx version.
Creates a P2PKH address string from the given public key and tx version.
Calculate the base64 encoded string length for a given input length. This is equivalent to the byte length when the string is ASCII or UTF8-8 encoded.
Returns a BlockstackError correlating to the given HTTP response, with the provided errorMsg. Throws if the HTTP response is 'ok'.
Lookup the nonce for an address from a core node
the c32check address to look up
the Stacks network to look up address on
a promise that resolves to an integer
Converts a hex encoded string to a clarity value
the hex encoded string with or without 0x
prefix
Type guard to check if a given value is a valid enum value.
Literal enum
type.
A value to check against the enum's values.
Determines if a gaia error response is possible to recover from by refreshing the gaiaHubConfig, and retrying the request.
Load the config file and return a config dict. If no config file exists, then return the default config.
Look up a user profile by blockstack ID
that resolves to a profile object
Generates an authentication request that can be sent to the Blockstack
browser for the user to approve sign in. This authentication request can
then be used for sign in by passing it to the redirectToSignInWithAuthRequest
method.
Note: This method should only be used if you want to roll your own authentication
flow. Typically you'd use redirectToSignIn
which takes care of this
under the hood.
hex encoded transit private key
location to redirect user to after sign in approval
location of this app's manifest file
the permissions this app is requesting
the origin of this app
the time at which this request is no longer valid
Any extra parameters you'd like to pass to the authenticator. Use this to pass options that aren't part of the Blockstack auth spec, but might be supported by special authenticators.
the authentication request
Generates a Clarity smart contract function call transaction
an options object for the contract function call
Returns a signed Stacks smart contract function call transaction.
Generates a Clarity smart contract deploy transaction
an options object for the contract deploy
Returns a signed Stacks smart contract deploy transaction.
Generates a fungible token post condition with a contract principal
Returns a fungible token post condition object
the c32check address
the name of the contract
the condition code
the amount of fungible tokens
asset info describing the fungible token
Generates a non-fungible token post condition with a contract principal
Returns a non-fungible token post condition object
the c32check address
the name of the contract
the condition code
asset info describing the non-fungible token
asset name describing the non-fungible token
Generates a STX post condition with a contract principal
Returns a STX post condition object
the c32check address of the contract
the name of the contract
the condition code
the amount of STX tokens
When you already know the Gaia read URL, make a Gaia config that doesn't have to fetch /hub_info
Generates a signed Stacks token transfer transaction
Returns a signed Stacks token transfer transaction.
an options object for the token transfer
Generates a fungible token post condition with a standard principal
Returns a fungible token post condition object
the c32check address
the condition code
the amount of fungible tokens
asset info describing the fungible token
Generates a non-fungible token post condition with a standard principal
Returns a non-fungible token post condition object
the c32check address
the condition code
asset info describing the non-fungible token
asset name describing the non-fungible token
Generates a STX post condition with a standard principal
Returns a STX post condition object
the c32check address
the condition code
the amount of STX tokens
Generates an unsigned Clarity smart contract function call transaction
an options object for the contract call
Generates an unsigned Stacks token transfer transaction
Returns a Stacks token transfer transaction.
an options object for the token transfer
Parse a fully qualified string that identifies the token type.
String in the format {address}.{contractName}::{assetName}
Parses a principal string for either a standard principal or contract principal.
String in the format {address}.{contractName}
Converts the response of a read-only function call into its Clarity Value
Convert string input to Clarity value based on contract ABI data. Only handles Clarity primitives and buffers. Responses, optionals, tuples and lists are not supported.
string to be parsed into Clarity value
the contract function argument object
returns a Clarity value
Restore identities by recursively making a new identity, and checking if it has a username.
As soon as a username is not found for an identity, the recursion stops.
Register a subdomain for a given identity
Signs a profile token
the JSON of the profile to be signed
the signing private key
the entity that the information is about
the entity that is issuing the token
the signing algorithm to use
the time of issuance of the token
the time of expiration of the token
Constructs and signs a sponsored transaction as the sponsor
the sponsor options object
Returns a signed sponsored transaction.
Validates a contract-call payload with a contract ABI
a contract-call payload
a contract ABI
true if the payloads functionArgs type check against those in the ABI
Validate the format and availability of a subdomain. Will return an error of enum IdentityNameValidityError if an error is present. If no errors are found, will return null.
the subdomain to be registered
a valid Subdomains enum
Verifies a profile token
the token to be verified
the public key or address of the keypair that is thought to have signed the token
Wraps a token for a profile token file
the token to be wrapped
token
and decodedToken
Default user profile object
Generated using TypeDoc
Optional function to generate cryptographically secure random bytes