Creates a UserSession object
Decrypts data encrypted with encryptContent
with the
transit private key.
encrypted content.
The hex string of the ECDSA private key to use for decryption. If not provided, will use user's appPrivateKey.
decrypted content.
Deletes the specified file from the app's data store.
The path to the file to delete.
Optional options object.
Set to true if the file was originally signed in order for the corresponding signature file to also be deleted.
Resolves when the file has been removed or rejects with an error.
Encrypts the data provided with the app public key.
the data to encrypt
Stringified ciphertext object
Generates a ECDSA keypair to use as the ephemeral app transit private key and store in the session.
the hex encoded private key
Retrieve the authentication token from the URL query.
the authentication token if it exists otherwise null
Retrieves the specified file from the app's data store.
the path to the file to read
a GetFileOptions object
that resolves to the raw data in the file or rejects with an error
Get the URL for reading a file from an app's data store.
the path to the file to read
that resolves to the URL or rejects with an error
@ignore
Try to process any pending sign in request by returning a Promise
that resolves
to the user data object if the sign in succeeds.
the signed authentication response token
that resolves to the user data object if successful and rejects if handling the sign in request fails or there was no pending sign in request.
Check if there is a authentication request that hasn't been handled.
Check if a user is currently signed in.
true
if the user is signed in, false
if not.
List the set of files in this application's Gaia storage bucket.
a callback to invoke on each named file that
returns true
to continue the listing operation or false
to end it
that resolves to the number of files listed
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 use a customized authentication flow. Typically, you'd use redirectToSignIn which is the default sign in method.
A HEX encoded transit private key.
Location to redirect the user to after sign in approval.
Location of this app's manifest file.
The permissions this app is requesting. The default is store_write
.
The origin of the app.
The time at which this request is no longer valid.
Any extra parameters to pass to the authenticator. Use this to pass options that aren't part of the Blockstack authentication specification, but might be supported by special authenticators.
the authentication request
Stores the data provided in the app's data store to to the file specified.
the path to store the data in
the data to store in the file
a PutFileOptions object
that resolves if the operation succeed and rejects if it failed
Generates an authentication request and redirects the user to the Blockstack browser to approve the sign in request.
Please note that this requires that the web browser properly handles the
blockstack:
URL protocol handler.
Most applications should use this method for sign in unless they require more fine grained control over how the authentication request is generated. If your app falls into this category, use generateAndStoreTransitKey, makeAuthRequest, and redirectToSignInWithAuthRequest to build your own sign in process.
Location of your application.
Location of the manifest.json file
Permissions requested by the application. Possible values are
store_write
(default) or publish_data
.
Redirects the user to the Blockstack browser to approve the sign in request. To construct a request see the makeAuthRequest function.
The user is redirected to the authenticator URL specified in the AppConfig
if the blockstack:
protocol handler is not detected.
Please note that the protocol handler detection does not work on all browsers.
A request string built by the makeAuthRequest function
The ID of the Blockstack Browser application.
These two functions are app-specific connections to gaia hub, they read the user data object for information on setting up a hub connection, and store the hub config to localstorage
that resolves to the new gaia hub connection
Sign the user out and optionally redirect to given location.
Location to redirect user to after sign out.
Only used in environments with window
available
Generated using TypeDoc
Represents an instance of a signed in user for a particular app.
A signed in user has access to two major pieces of information about the user, the user's private key for that app and the location of the user's gaia storage bucket for the app.
A user can be signed in either directly through the interactive sign in process or by directly providing the app private key.