Methods

BlocknoteManager methods

prepareBootstrapTransaction

Create a bootstrap transaction for the user to fund the upload process.

Parameters

Name
Description
Type

user_address

The actual public user's address

string

raw_content

The content to upload

string, uint8array, buffer

options

see the options table below

object

Options

Name
Description
Type
Default

title

The content's title

string, null

Untitled

mime

The content's mime type

string

plain/text

compression

  • If not set, Blocknote will automaticaly choose the best compression for the given data.

  • The compression algorithm's name: brotli, gzip, lz-string, pako, zstd, snappy

  • "fast" will choose the fastest compression for the given content.

  • "none" won't compress the data.

string

revision_of

The original payload transaction id of the file to update.

string

fee_multiplier

By default, the user will be asked to fund slightly more than the minimum amount required. Each transaction fee is multiplied by fee_multiplier. This helps prevent losing funds if network fees suddenly increase during the upload. Any unused funds are sent back to the user when the upload is complete. fee_multiplier can be set to any value, even zero. However, keep in mind that using the exact minimum amount may cause the upload to fail if fees rise.

number

3

Return

A uuid then an object when the process is done. The object contains the bootstrap transaction base64 encoded and the bootstrap key. To decode the transaction on the frontend, use: algosdk.decodeUnsignedTransaction(algosdk.base64ToBytes(transaction));

chevron-rightView a response examplehashtag
{
    status: "done",
    result: {
        output: {
            start: 1766890150232,
            simulation: true,
            fees: 14000,
            compression: {
                compression: "brotli",
                original_size: 13808,
                compressed_size: 13008
            },         
            end: 1766890150422,
            duration: 190,
            payload: {
                version: 0.1,
                title: "SSZ20.webp",
                mime: "image/webp",
                size: 13808,
                addid: 635903688,
                accid: 1398542059,
                compression: "brotli",
                txns: 13
            },
            funding: {
                amount: 245000,
                expected_refund: 228000
            }
        },
        key: "ViGbHpIjVfMYK0pWoy6SltPei5/i6EHVdrcgvKFN/5w=",
        transaction: "iqNhbXTOAAO9CKNmZWXNA+iiZnbOA4MFPKNnZW6sdGVzdG5ldC12MS4womdoxCBIY7UYpLPITsgQ8i1PEIHLD3HwWaesIN7GL39w5Qk6IqJsds4DgwkkpG5vdGXFAuB7ImFwcCI6ImJsb2Nrbm90ZS5zcGFjZSIsImJsb2Nrbm90ZSI6ImV5SnBkaUk2SWpFNE5qWmhNREU0WVRNell6YzNOVFl6TkdVelpUQTFPU0lzSW1SaGRHRWlPaUl6TXpKbVpqSTFZbVl3T0dVek5qTTBaak13Wm1ZNE5XUmxNak5qTURrNFpXTTVaVFUyWVRkaVpHUmlaR0ZoTkRkaVpXRXhaR1E0Tnpjell6RmlaRGMzWVdWa016WTRZVGczTVRSa01XRTJNMlUxTTJFM1lUYzBOelkwWVRNNE9EY3lOMkl3TUROaVltSmpZV1k0TUdSaU9USXpaakZoTkRFeFl6WmhPREpoTlRsaFltUmtOVEV3TjJJNVlqYzRNamN6WWpNNU5EWTVPRFpsWlRZeU56VXdNVFpoT0dZM1pUVTVaR0ppTnpCbFlUSXdNRGs0WXpZMU5ETXlOVEl3TmpVM1pETXhaV1F3WlROalpEZzBORE5tTWpobU4yWmtPREJpWkdOa056UTJOekUzWkRSbFkyVTNNakl6WkRKa09EUTNZakEyTW1Fd1lqUXhNVFF4TldFMlpXUmpPR1prTW1FMlpEazNaVGxqTWpNM1l6YzFPVGRqWXprM05qRmlaR1F4TTJJd00yUmxObUl3TVRFNVlqRm1aR1l3WlRCaFkyUmlaREpoTW1Nd1ltUTJNRGd4Tnprek9UVTBNVEl6WkdVeU1XUmhPRE5sWmpoaE1qWmpPREUwWVRFME1UWXpaV1JrTjJJNE5qZzVOR1E0TldFM056WTJPR0kxWWpSaU1XSmlOelZoT1dRME5HTXlObVpoTXpWak1EVTVOVEk0TURBM09URTBNR0V3TkRKaFlUVTJZekJtTW1RME16a3dZelEyWXpFNE1tTWlMQ0owWVdjaU9pSmpObUV3TVRRelltWmhNVGc1TmpWaU0yVmxNMk5pT1RobU1UUTRNREpoTnlKOSJ9o3JjdsQgZwl70IKs4lQ2Nr5VsrCr2gMKmptXz69IQjL6gk6Sx4ujc25kxCDbYTsPFKs6EW2wL70uezPf7Ac1drt6g0oHXixZn79edKR0eXBlo3BheQ=="
    }
}

runFromBootstrapTransaction

Starts the upload from a bootstrap transaction

Parameters

Name
Description
Type

bootstrap_transaction_id

The id of the bootstrap transaction created by prepareBootstrapTransaction() that the user must sign and send from the frontend.

string

key

The bootstrap key created by prepareBootstrapTransaction()

string

encryption

Encryption details. View 'Encryption' table below.

object, null

Encryption

Name
Description
Default

aes_key

An aes_key to encrypt the content

password

A password to encrypt the content

encrypt_title

When encryption is enabled (by setting an aes_key or password), the title is encrypted by default. To leave the title unencrypted, set encrypt_title to false.

true

Return

A uuid then an object when the process is done

chevron-rightView a response examplehashtag

getPayload

Parameters

Name
Description
Type

payload_id

The transaction ID of the payload

string

Return

A uuid then a payload object when the process is done


getPayloadRevisions

Retrieve the transaction ids of each revisions of the given payload.

Parameters

Name
Description
Type

payload_id

The transaction ID of the payload

string

Return

A uuid then an array of transactions id representing each revisions payload.


read

Create a BlocknoteReader instance and invoke its method read() into an async queue.

Parameters

Name
Description
Type

payload_id

The payload_id of the uploaded content to read.

string

options

object

Return

A uuid then BlocknoteReader.read() result when the process is over

chevron-rightView a response examplehashtag

getAllSenders

Retrieve all the senders funded by the given user_address (funder -> senders -> receivers). Senders are identified onchain using the AES_PRIVATE_KEY and the APP_NAME from the .env file that was used for the uploads. If you change one of those, the method won't be able to identify the senders.

Parameters

Name
Description
Type

user_address

the actual public user's address

string

Return

A list of senders (funder -> sender -> receiver)


getPayloadIDFromSender

Parameters

Name
Description
Type

sender

A sender public address

string

Return

The payload's transaction id sent by the given sender to a receiver (funder -> sender -> receiver)


getBootstrapSenderMnemonic

Parameters

Name
Description
Type

sender

A sender public address

string

receiver

The receiver public address

string

Return

The sender's mnemonic (funder -> sender -> receiver) encrypted into the note of the bootstrap transaction.