diff --git a/404.html b/404.html index 4e60b8c..93e202a 100644 --- a/404.html +++ b/404.html @@ -18,13 +18,13 @@ - + -

404

There's nothing here.
+ - + diff --git a/assets/js/10.24fca494.js b/assets/js/10.59990180.js similarity index 99% rename from assets/js/10.24fca494.js rename to assets/js/10.59990180.js index 4ea2b87..0a888ef 100644 --- a/assets/js/10.24fca494.js +++ b/assets/js/10.59990180.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{304:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"entity-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-types"}},[t._v("#")]),t._v(" Entity Types")]),t._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("Arweave transactions are composed of transaction headers and data payloads.")]),t._v(" "),a("p",[t._v("ArFS entities, therefore, have their data split between being stored as tags on their transaction header and encoded as JSON and stored as the data of a transaction. In the case of private entities, JSON data and file data payloads are always encrypted according to the protocol processes defined below.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive entities require a single metadata transaction, with standard Drive tags and encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("Folder entities require a single metadata transaction, with standard Folder tags and an encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("File entities require a metadata transaction, with standard File tags and an encoded Data JSON with secondary metadata relating to the file.")])]),t._v(" "),a("li",[a("p",[t._v("File entities also require a second data transaction, which includes a limited set of File tags and the actual file data itself.")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities require a single transaction. which contains a Data JSON with all of the Drive’s rolled up ArFS metadata and standard Snapshot GQL tags that identify the Snapshot.")])])]),t._v(" "),a("p",[t._v("ArFS v0.14 introduces the "),a("code",[t._v("isHidden")]),t._v(" metadata property. "),a("code",[t._v("isHidden")]),t._v(" is a boolean (true/false) that tells clients if they should display the file or folder. Hidden files still exist and will be included in "),a("a",{attrs:{href:"#snapshot"}},[t._v("snapshots")]),t._v(", but should not be rendered by clients. If "),a("code",[t._v("isHidden")]),t._v(" is not present, its value should be assumed false.")]),t._v(" "),a("h2",{attrs:{id:"drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#drive"}},[t._v("#")]),t._v(" Drive")]),t._v(" "),a("p",[t._v("A drive is the highest level logical grouping of folders and files. All folders and files must be part of a drive, and reference the Drive ID of that drive.")]),t._v(" "),a("p",[t._v("When creating a Drive, a corresponding folder must be created as well. This will act as the root folder of the drive. This separation of drive and folder entity enables features such as folder view queries, renaming, and linking.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Privacy"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Auth-Mode?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rootFolderId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Drive Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"folder"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#folder"}},[t._v("#")]),t._v(" Folder")]),t._v(" "),a("p",[t._v("A folder is a logical grouping of other folders and files. Folder entity metadata transactions without a parent folder id are considered the Drive Root Folder of their corresponding Drives. All other Folder entities must have a parent folder id. Since folders do not have underlying data, there is no Folder data transaction required.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFolder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Folder Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file"}},[t._v("#")]),t._v(" File")]),t._v(" "),a("p",[t._v("A File contains uploaded data, like a photo, document, or movie.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("A File entity metadata transaction does not include the actual File data. Instead, the File data must be uploaded as a separate transaction, called the File Data Transaction. The File JSON metadata transaction contains a reference to the File Data Transaction ID so that it can retrieve the actual data. This separation allows for file metadata to be updated without requiring the file itself to be reuploaded. It also ensures that private files can have their JSON Metadata Transaction encrypted as well, ensuring that no one without authorization can see either the file or its metadata.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lastModifiedDate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataTxId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataContentType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pinnedDataOwner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" # Optional\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"pinning-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pinning-files"}},[t._v("#")]),t._v(" Pinning Files")]),t._v(" "),a("p",[t._v("Since the version v0.13, ArFS suports Pins. Pins are files whose data may be any transaction uploaded to Arweave, that may or may not be owned by the wallet that created the pin.")]),t._v(" "),a("p",[t._v("When a new File Pin is created, the only created transaction is the Metadata Transaction. The "),a("code",[t._v("dataTxId")]),t._v(" field will point it to any transaction in Arweave, and the optional "),a("code",[t._v("pinnedDataOwner")]),t._v(" field is gonna hold the address of the wallet that owns the original copy of the data transaction.")]),t._v(" "),a("h3",{attrs:{id:"file-data-transaction-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-data-transaction-example"}},[t._v("#")]),t._v(" File Data Transaction Example")]),t._v(" "),a("p",[t._v("The File Data Transaction contains limited information about the file, such as the information required to decrypt it, or the Content-Type (mime-type) needed to view in the browser.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("Cipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File Data - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"file-metadata-transaction-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-metadata-transaction-example"}},[t._v("#")]),t._v(" File Metadata Transaction Example")]),t._v(" "),a("p",[t._v("The the File Metadata Transaction contains the GQL Tags necessary to identify the file within a drive and folder.")]),t._v(" "),a("p",[t._v("Its data contains the JSON metadata for the file. This includes the file name, size, last modified date, data transaction id, and data content type.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File JSON Metadata - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"snapshot"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot"}},[t._v("#")]),t._v(" Snapshot")]),t._v(" "),a("p",[t._v("ArFS applications generate the latest state of a drive by querying for all ArFS transactions made relating to a user's particular "),a("code",[t._v("Drive-Id")]),t._v(". This includes both paged queries for indexed ArFS data via GQL, as well as the ArFS JSON metadata entries for each ArFS transaction.")]),t._v(" "),a("p",[t._v("For small drives (less than 1000 files), a few thousand requests for very small volumes of data can be achieved relatively quickly and reliably. For larger drives, however, this results in long sync times to pull every piece of ArFS metadata when the local database cache is empty. This can also potentially trigger rate-limiting related ArWeave Gateway delays.")]),t._v(" "),a("p",[t._v("Once a drive state has been completely, and accurately generated, in can be rolled up into a single snapshot and uploaded as an Arweave transaction. ArFS clients can use GQL to find and retrieve this snapshot in order to rapidly reconstitute the total state of the drive, or a large portion of it. They can then query individual transactions performed after the snapshot.")]),t._v(" "),a("p",[t._v("This optional method offers convenience and resource efficiency when building the drive state, at the cost of paying for uploading the snapshot data. Using this method means a client will only have to iterate through a few snapshots instead of every transaction performed on the drive.")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-tags"}},[t._v("#")]),t._v(" Snapshot Entity Tags")]),t._v(" "),a("p",[t._v("Snapshot entities require the following tags. These are queried by ArFS clients to find drive snapshots, organize them together with any other transactions not included within them, and build the latest state of the drive.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"snapshot"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nSnapshot-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-End"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nData-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction GQL tags example")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-data"}},[t._v("#")]),t._v(" Snapshot Entity Data")]),t._v(" "),a("p",[t._v("A JSON data object must also be uploaded with every ArFS Snapshot entity. THis data contains all ArFS Drive, Folder, and File metadata changes within the associated drive, as well as any previous Snapshots. The Snapshot Data contains an array "),a("code",[t._v("txSnapshots")]),t._v(". Each item includes both the GQL and ArFS metadata details of each transaction made for the associated drive, within the snapshot's start and end period.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("tsSnapshot")]),t._v(" contains a "),a("code",[t._v("gqlNode")]),t._v(" object which uses the same GQL tags interface returned by the Arweave Gateway. It includes all of the important "),a("code",[t._v("block")]),t._v(", "),a("code",[t._v("owner")]),t._v(", "),a("code",[t._v("tags")]),t._v(", and "),a("code",[t._v("bundledIn")]),t._v(" information needed by ArFS clients. It also contains a "),a("code",[t._v("dataJson")]),t._v(" object which stores the correlated Data JSON for that ArFS entity.")]),t._v(" "),a("p",[t._v("For private drives, the "),a("code",[t._v("dataJson")]),t._v(" object contains the JSON-string-escaped encrypted text of the associated file or folder. This encrypted text uses the file's existing "),a("code",[t._v("Cipher")]),t._v(" and "),a("code",[t._v("Cipher-IV")]),t._v(". This ensures clients can decrypt this information quickly using the existing ArFS privacy protocols.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txSnapshots"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gqlNode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bWCvIc3cOzwVgquD349HUVsn5Dd1_GIri8Dglok41Vg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"owner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hlWRbyJ6WUoErm3b0wqVgd1l3LTgaQeLBhB36v2HxgY"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bundledIn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"39n5evzP1Ip9MhGytuFm7F3TDaozwHuVUbS55My-MBk"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"block"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1062005")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1669053791")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tags"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"application/json"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArFS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.11"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Entity-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f27abc4b-ed6f-4108-a9f5-e545fc4ff55b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Privacy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"public"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArDrive-App"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Platform"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Web"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Version"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.39.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unix-Time"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1669053323"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataJson"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{\\"name\\":\\"november\\",\\"rootFolderId\\":\\"71dfc1cb-5368-4323-972a-e9dd0b1c63a0\\", \\"isHidden\\":false}"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction JSON data example")]),t._v(" "),a("h2",{attrs:{id:"schema-diagrams"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[t._v("#")]),t._v(" Schema Diagrams")]),t._v(" "),a("p",[t._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),t._v(" "),a("h3",{attrs:{id:"public-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[t._v("#")]),t._v(" Public Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/public-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Public Drive Schema")]),t._v(" "),a("h3",{attrs:{id:"private-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[t._v("#")]),t._v(" Private Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/private-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Private Drive Schema")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[10],{307:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"entity-types"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-types"}},[t._v("#")]),t._v(" Entity Types")]),t._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("Arweave transactions are composed of transaction headers and data payloads.")]),t._v(" "),a("p",[t._v("ArFS entities, therefore, have their data split between being stored as tags on their transaction header and encoded as JSON and stored as the data of a transaction. In the case of private entities, JSON data and file data payloads are always encrypted according to the protocol processes defined below.")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive entities require a single metadata transaction, with standard Drive tags and encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("Folder entities require a single metadata transaction, with standard Folder tags and an encoded JSON with secondary metadata.")])]),t._v(" "),a("li",[a("p",[t._v("File entities require a metadata transaction, with standard File tags and an encoded Data JSON with secondary metadata relating to the file.")])]),t._v(" "),a("li",[a("p",[t._v("File entities also require a second data transaction, which includes a limited set of File tags and the actual file data itself.")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities require a single transaction. which contains a Data JSON with all of the Drive’s rolled up ArFS metadata and standard Snapshot GQL tags that identify the Snapshot.")])])]),t._v(" "),a("p",[t._v("ArFS v0.14 introduces the "),a("code",[t._v("isHidden")]),t._v(" metadata property. "),a("code",[t._v("isHidden")]),t._v(" is a boolean (true/false) that tells clients if they should display the file or folder. Hidden files still exist and will be included in "),a("a",{attrs:{href:"#snapshot"}},[t._v("snapshots")]),t._v(", but should not be rendered by clients. If "),a("code",[t._v("isHidden")]),t._v(" is not present, its value should be assumed false.")]),t._v(" "),a("h2",{attrs:{id:"drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#drive"}},[t._v("#")]),t._v(" Drive")]),t._v(" "),a("p",[t._v("A drive is the highest level logical grouping of folders and files. All folders and files must be part of a drive, and reference the Drive ID of that drive.")]),t._v(" "),a("p",[t._v("When creating a Drive, a corresponding folder must be created as well. This will act as the root folder of the drive. This separation of drive and folder entity enables features such as folder view queries, renaming, and linking.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Privacy"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\nDrive-Auth-Mode?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"password"')]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"rootFolderId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Drive Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"folder"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#folder"}},[t._v("#")]),t._v(" Folder")]),t._v(" "),a("p",[t._v("A folder is a logical grouping of other folders and files. Folder entity metadata transactions without a parent folder id are considered the Drive Root Folder of their corresponding Drives. All other Folder entities must have a parent folder id. Since folders do not have underlying data, there is no Folder data transaction required.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFolder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Folder Entity Transaction Example")]),t._v(" "),a("h2",{attrs:{id:"file"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file"}},[t._v("#")]),t._v(" File")]),t._v(" "),a("p",[t._v("A File contains uploaded data, like a photo, document, or movie.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("In the Arweave File System, a single file is broken into 2 parts - its metadata and its data.")]),t._v(" "),a("p",[t._v("A File entity metadata transaction does not include the actual File data. Instead, the File data must be uploaded as a separate transaction, called the File Data Transaction. The File JSON metadata transaction contains a reference to the File Data Transaction ID so that it can retrieve the actual data. This separation allows for file metadata to be updated without requiring the file itself to be reuploaded. It also ensures that private files can have their JSON Metadata Transaction encrypted as well, ensuring that no one without authorization can see either the file or its metadata.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n\n\nMetadata JSON "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"size"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"lastModifiedDate"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataTxId"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataContentType"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"isHidden"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"pinnedDataOwner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" # Optional\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"pinning-files"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#pinning-files"}},[t._v("#")]),t._v(" Pinning Files")]),t._v(" "),a("p",[t._v("Since the version v0.13, ArFS suports Pins. Pins are files whose data may be any transaction uploaded to Arweave, that may or may not be owned by the wallet that created the pin.")]),t._v(" "),a("p",[t._v("When a new File Pin is created, the only created transaction is the Metadata Transaction. The "),a("code",[t._v("dataTxId")]),t._v(" field will point it to any transaction in Arweave, and the optional "),a("code",[t._v("pinnedDataOwner")]),t._v(" field is gonna hold the address of the wallet that owns the original copy of the data transaction.")]),t._v(" "),a("h3",{attrs:{id:"file-data-transaction-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-data-transaction-example"}},[t._v("#")]),t._v(" File Data Transaction Example")]),t._v(" "),a("p",[t._v("The File Data Transaction contains limited information about the file, such as the information required to decrypt it, or the Content-Type (mime-type) needed to view in the browser.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("Cipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File Data - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h3",{attrs:{id:"file-metadata-transaction-example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#file-metadata-transaction-example"}},[t._v("#")]),t._v(" File Metadata Transaction Example")]),t._v(" "),a("p",[t._v("The the File Metadata Transaction contains the GQL Tags necessary to identify the file within a drive and folder.")]),t._v(" "),a("p",[t._v("Its data contains the JSON metadata for the file. This includes the file name, size, last modified date, data transaction id, and data content type.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"AES256-GCM"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nCipher-IV?"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"<12 byte initialization vector as Base64>"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nFile-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nParent-Folder-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nUnix-Time"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" File JSON Metadata - Encrypted if private "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("h2",{attrs:{id:"snapshot"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot"}},[t._v("#")]),t._v(" Snapshot")]),t._v(" "),a("p",[t._v("ArFS applications generate the latest state of a drive by querying for all ArFS transactions made relating to a user's particular "),a("code",[t._v("Drive-Id")]),t._v(". This includes both paged queries for indexed ArFS data via GQL, as well as the ArFS JSON metadata entries for each ArFS transaction.")]),t._v(" "),a("p",[t._v("For small drives (less than 1000 files), a few thousand requests for very small volumes of data can be achieved relatively quickly and reliably. For larger drives, however, this results in long sync times to pull every piece of ArFS metadata when the local database cache is empty. This can also potentially trigger rate-limiting related ArWeave Gateway delays.")]),t._v(" "),a("p",[t._v("Once a drive state has been completely, and accurately generated, in can be rolled up into a single snapshot and uploaded as an Arweave transaction. ArFS clients can use GQL to find and retrieve this snapshot in order to rapidly reconstitute the total state of the drive, or a large portion of it. They can then query individual transactions performed after the snapshot.")]),t._v(" "),a("p",[t._v("This optional method offers convenience and resource efficiency when building the drive state, at the cost of paying for uploading the snapshot data. Using this method means a client will only have to iterate through a few snapshots instead of every transaction performed on the drive.")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-tags"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-tags"}},[t._v("#")]),t._v(" Snapshot Entity Tags")]),t._v(" "),a("p",[t._v("Snapshot entities require the following tags. These are queried by ArFS clients to find drive snapshots, organize them together with any other transactions not included within them, and build the latest state of the drive.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[t._v("ArFS"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.14"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nDrive-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nEntity-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"snapshot"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nSnapshot-Id"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nContent-Type"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nBlock-End"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\nData-Start"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('""')]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction GQL tags example")]),t._v(" "),a("h3",{attrs:{id:"snapshot-entity-data"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#snapshot-entity-data"}},[t._v("#")]),t._v(" Snapshot Entity Data")]),t._v(" "),a("p",[t._v("A JSON data object must also be uploaded with every ArFS Snapshot entity. THis data contains all ArFS Drive, Folder, and File metadata changes within the associated drive, as well as any previous Snapshots. The Snapshot Data contains an array "),a("code",[t._v("txSnapshots")]),t._v(". Each item includes both the GQL and ArFS metadata details of each transaction made for the associated drive, within the snapshot's start and end period.")]),t._v(" "),a("p",[t._v("A "),a("code",[t._v("tsSnapshot")]),t._v(" contains a "),a("code",[t._v("gqlNode")]),t._v(" object which uses the same GQL tags interface returned by the Arweave Gateway. It includes all of the important "),a("code",[t._v("block")]),t._v(", "),a("code",[t._v("owner")]),t._v(", "),a("code",[t._v("tags")]),t._v(", and "),a("code",[t._v("bundledIn")]),t._v(" information needed by ArFS clients. It also contains a "),a("code",[t._v("dataJson")]),t._v(" object which stores the correlated Data JSON for that ArFS entity.")]),t._v(" "),a("p",[t._v("For private drives, the "),a("code",[t._v("dataJson")]),t._v(" object contains the JSON-string-escaped encrypted text of the associated file or folder. This encrypted text uses the file's existing "),a("code",[t._v("Cipher")]),t._v(" and "),a("code",[t._v("Cipher-IV")]),t._v(". This ensures clients can decrypt this information quickly using the existing ArFS privacy protocols.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"txSnapshots"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"gqlNode"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"bWCvIc3cOzwVgquD349HUVsn5Dd1_GIri8Dglok41Vg"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"owner"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"address"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"hlWRbyJ6WUoErm3b0wqVgd1l3LTgaQeLBhB36v2HxgY"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"bundledIn"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"id"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"39n5evzP1Ip9MhGytuFm7F3TDaozwHuVUbS55My-MBk"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"block"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"height"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1062005")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"timestamp"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1669053791")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"tags"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"application/json"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArFS"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"0.11"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Entity-Type"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"drive"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Id"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"f27abc4b-ed6f-4108-a9f5-e545fc4ff55b"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Drive-Privacy"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"public"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Name"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ArDrive-App"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Platform"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Web"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"App-Version"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.39.0"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Unix-Time"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1669053323"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dataJson"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"{\\"name\\":\\"november\\",\\"rootFolderId\\":\\"71dfc1cb-5368-4323-972a-e9dd0b1c63a0\\", \\"isHidden\\":false}"')]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("div",{staticClass:"caption"},[t._v("Snapshot Transaction JSON data example")]),t._v(" "),a("h2",{attrs:{id:"schema-diagrams"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#schema-diagrams"}},[t._v("#")]),t._v(" Schema Diagrams")]),t._v(" "),a("p",[t._v("The following diagrams show complete examples of Drive, Folder, and File entity Schemas.")]),t._v(" "),a("h3",{attrs:{id:"public-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#public-drive"}},[t._v("#")]),t._v(" Public Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/public-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Public Drive Schema")]),t._v(" "),a("h3",{attrs:{id:"private-drive"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#private-drive"}},[t._v("#")]),t._v(" Private Drive")]),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/private-drive-schema.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Private Drive Schema")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/11.273c0017.js b/assets/js/11.44ba014e.js similarity index 99% rename from assets/js/11.273c0017.js rename to assets/js/11.44ba014e.js index 082c321..4455a1e 100644 --- a/assets/js/11.273c0017.js +++ b/assets/js/11.44ba014e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{306:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"arfs-protocol-a-decentralized-file-system-on-arweave"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-protocol-a-decentralized-file-system-on-arweave"}},[e._v("#")]),e._v(" ArFS Protocol: A Decentralized File System on Arweave")]),e._v(" "),t("p",[e._v("Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),t("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v("'s otherwise permanent, immutable data storage blockweave.")]),e._v(" "),t("p",[e._v("Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.")]),e._v(" "),t("p",[e._v("ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within "),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Transaction headers"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features"}},[e._v("#")]),e._v(" Key Features")]),e._v(" "),t("h3",{attrs:{id:"file-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[e._v("#")]),e._v(" File Structure")]),e._v(" "),t("p",[e._v("ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.")]),e._v(" "),t("h3",{attrs:{id:"metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[e._v("#")]),e._v(" Metadata")]),e._v(" "),t("p",[e._v("Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.")]),e._v(" "),t("h3",{attrs:{id:"file-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-permissions"}},[e._v("#")]),e._v(" File Permissions")]),e._v(" "),t("p",[e._v("ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.")]),e._v(" "),t("h3",{attrs:{id:"file-versioning"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-versioning"}},[e._v("#")]),e._v(" File Versioning")]),e._v(" "),t("p",[e._v("ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.")]),e._v(" "),t("h3",{attrs:{id:"data-deduplication"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-deduplication"}},[e._v("#")]),e._v(" Data Deduplication")]),e._v(" "),t("p",[e._v("To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.")]),e._v(" "),t("h3",{attrs:{id:"search-and-discovery"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#search-and-discovery"}},[e._v("#")]),e._v(" Search and Discovery")]),e._v(" "),t("p",[e._v("ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.")]),e._v(" "),t("h3",{attrs:{id:"interoperability"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#interoperability"}},[e._v("#")]),e._v(" Interoperability")]),e._v(" "),t("p",[e._v("ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.")]),e._v(" "),t("h2",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.")]),e._v(" "),t("h2",{attrs:{id:"arfs-version-history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-version-history"}},[e._v("#")]),e._v(" ArFS Version History")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[e._v("Version")]),e._v(" "),t("th",[e._v("Date")]),e._v(" "),t("th",[e._v("Release Notes")])]),e._v(" "),t("tr",[t("td",[e._v("0.10")]),e._v(" "),t("td",[e._v("August 2020")]),e._v(" "),t("td",[e._v("The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).")])]),e._v(" "),t("tr",[t("td",[e._v("0.11")]),e._v(" "),t("td",[e._v("September 2020")]),e._v(" "),t("td",[e._v("Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.")])]),e._v(" "),t("tr",[t("td",[e._v("0.12")]),e._v(" "),t("td",[e._v("December 2022")]),e._v(" "),t("td",[e._v("Added Snapshot entities to support quick synchronization of drive state.")])]),e._v(" "),t("tr",[t("td",[e._v("0.13")]),e._v(" "),t("td",[e._v("August 2023")]),e._v(" "),t("td",[e._v("Added pins")])]),e._v(" "),t("tr",[t("td",[e._v("0.14")]),e._v(" "),t("td",[e._v("January 2024")]),e._v(" "),t("td",[e._v("Added "),t("code",[e._v("isHidden")]),e._v(' property to file and folder metadata to enable clients to "hide" content from end users.')])])])]),e._v(" "),t("h2",{attrs:{id:"resources"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[e._v("#")]),e._v(" Resources")]),e._v(" "),t("p",[e._v("For more information, documentation, and community support, refer to the following resources:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Official Website"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://docs.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Developer Documentation"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://community.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Community Forums"),t("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[11],{305:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"arfs-protocol-a-decentralized-file-system-on-arweave"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-protocol-a-decentralized-file-system-on-arweave"}},[e._v("#")]),e._v(" ArFS Protocol: A Decentralized File System on Arweave")]),e._v(" "),t("p",[e._v("Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on "),t("a",{attrs:{href:"https://ardrive.io/what-is-arweave/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v("'s otherwise permanent, immutable data storage blockweave.")]),e._v(" "),t("p",[e._v("Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.")]),e._v(" "),t("p",[e._v("ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within "),t("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Transaction headers"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"key-features"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#key-features"}},[e._v("#")]),e._v(" Key Features")]),e._v(" "),t("h3",{attrs:{id:"file-structure"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-structure"}},[e._v("#")]),e._v(" File Structure")]),e._v(" "),t("p",[e._v("ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.")]),e._v(" "),t("h3",{attrs:{id:"metadata"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#metadata"}},[e._v("#")]),e._v(" Metadata")]),e._v(" "),t("p",[e._v("Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.")]),e._v(" "),t("h3",{attrs:{id:"file-permissions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-permissions"}},[e._v("#")]),e._v(" File Permissions")]),e._v(" "),t("p",[e._v("ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.")]),e._v(" "),t("h3",{attrs:{id:"file-versioning"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-versioning"}},[e._v("#")]),e._v(" File Versioning")]),e._v(" "),t("p",[e._v("ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.")]),e._v(" "),t("h3",{attrs:{id:"data-deduplication"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-deduplication"}},[e._v("#")]),e._v(" Data Deduplication")]),e._v(" "),t("p",[e._v("To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.")]),e._v(" "),t("h3",{attrs:{id:"search-and-discovery"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#search-and-discovery"}},[e._v("#")]),e._v(" Search and Discovery")]),e._v(" "),t("p",[e._v("ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.")]),e._v(" "),t("h3",{attrs:{id:"interoperability"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#interoperability"}},[e._v("#")]),e._v(" Interoperability")]),e._v(" "),t("p",[e._v("ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.")]),e._v(" "),t("h2",{attrs:{id:"getting-started"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#getting-started"}},[e._v("#")]),e._v(" Getting Started")]),e._v(" "),t("p",[e._v("To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.")]),e._v(" "),t("h2",{attrs:{id:"arfs-version-history"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#arfs-version-history"}},[e._v("#")]),e._v(" ArFS Version History")]),e._v(" "),t("div",{staticStyle:{"text-align":"center"}},[t("table",{staticClass:"inline-table"},[t("tr",[t("th",[e._v("Version")]),e._v(" "),t("th",[e._v("Date")]),e._v(" "),t("th",[e._v("Release Notes")])]),e._v(" "),t("tr",[t("td",[e._v("0.10")]),e._v(" "),t("td",[e._v("August 2020")]),e._v(" "),t("td",[e._v("The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).")])]),e._v(" "),t("tr",[t("td",[e._v("0.11")]),e._v(" "),t("td",[e._v("September 2020")]),e._v(" "),t("td",[e._v("Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.")])]),e._v(" "),t("tr",[t("td",[e._v("0.12")]),e._v(" "),t("td",[e._v("December 2022")]),e._v(" "),t("td",[e._v("Added Snapshot entities to support quick synchronization of drive state.")])]),e._v(" "),t("tr",[t("td",[e._v("0.13")]),e._v(" "),t("td",[e._v("August 2023")]),e._v(" "),t("td",[e._v("Added pins")])]),e._v(" "),t("tr",[t("td",[e._v("0.14")]),e._v(" "),t("td",[e._v("January 2024")]),e._v(" "),t("td",[e._v("Added "),t("code",[e._v("isHidden")]),e._v(' property to file and folder metadata to enable clients to "hide" content from end users.')])])])]),e._v(" "),t("h2",{attrs:{id:"resources"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#resources"}},[e._v("#")]),e._v(" Resources")]),e._v(" "),t("p",[e._v("For more information, documentation, and community support, refer to the following resources:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Official Website"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://docs.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Developer Documentation"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://community.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Community Forums"),t("OutboundLink")],1)])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/12.64f87dc2.js b/assets/js/12.52d79d28.js similarity index 99% rename from assets/js/12.64f87dc2.js rename to assets/js/12.52d79d28.js index 7dd4a16..f6ac563 100644 --- a/assets/js/12.64f87dc2.js +++ b/assets/js/12.52d79d28.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{307:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"privacy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#privacy"}},[e._v("#")]),e._v(" Privacy")]),e._v(" "),t("p",[e._v("The Arweave blockweave is inherently public. But with apps that use ArFS, like ArDrive, your private data never leaves your computer without using military grade (and "),t("a",{attrs:{href:"https://blog.boot.dev/cryptography/is-aes-256-quantum-resistant/#:~:text=Symmetric%20encryption%2C%20or%20more%20specifically,key%20sizes%20are%20large%20enough",target:"_blank",rel:"noopener noreferrer"}},[e._v("quantum resistant"),t("OutboundLink")],1),e._v(") encryption. This privacy layer is applied at the Drive level, and users determine whether a Drive is public or private when they first create it. Private drives must follow the ArFS privacy model.")]),e._v(" "),t("p",[e._v("With ArDrive specifically, every file within a Private Drive is symmetrically encrypted using "),t("a",{attrs:{href:"https://iopscience.iop.org/article/10.1088/1742-6596/1019/1/012008/pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-GCM"),t("OutboundLink")],1),e._v(" (for small files and metadata transactions) or "),t("a",{attrs:{href:"https://xilinx.github.io/Vitis_Libraries/security/2020.1/guide_L1/internals/ctr.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-CTR"),t("OutboundLink")],1),e._v(' (for large files, over 100MiB). Every Private drive has a master "Drive Key" which uses a combination of the user\'s Arweave wallet signature, a user defined drive password, and a unique drive identifier ('),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuidv4"),t("OutboundLink")],1),e._v('). Each file has its own "File Key" derived from the "Drive Key". This allows for single files to be shared without exposing access to the other files within the Drive.')]),e._v(" "),t("p",[e._v("Once a file is encrypted and stored on Arweave, it is locked forever and can only be decrypted using its file key.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": Usable encryption standards are not limited to AES-256-GCM or AES-256-CTR. Any Encryption method may be used so long as it is clearly indicated in the "),t("code",[e._v("cipher")]),e._v(" tag.")]),e._v(" "),t("h2",{attrs:{id:"deriving-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deriving-keys"}},[e._v("#")]),e._v(" Deriving Keys")]),e._v(" "),t("p",[e._v("Private drives have a global drive key, "),t("code",[e._v("D")]),e._v(", and multiple file keys "),t("code",[e._v("F")]),e._v(", for encryption. This enables a drive to have as many uniquely encrypted files as needed. One key is used for all versions of a single file (since new file versions use the same File-Id)")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is used for encrypting both Drive and Folder metadata, while "),t("code",[e._v("F")]),e._v(" is used for encrypting File metadata and the actual stored data. Having these different keys, "),t("code",[e._v("D")]),e._v(" and "),t("code",[e._v("F")]),e._v(", allows a user to share specific files without revealing the contents of their entire drive.")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is derived using HKDF-SHA256 with an "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Salt_(cryptography)",target:"_blank",rel:"noopener noreferrer"}},[e._v("unsalted"),t("OutboundLink")],1),e._v(" RSA-PSS signature of the drive's id and a user provided password.")]),e._v(" "),t("p",[t("code",[e._v("F")]),e._v(" is also derived using HKDF-SHA256 with the drive key and the file's id.")]),e._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:e.$withBase("/images/encryption-diagram.png")}}),e._v(" "),t("p",[e._v("Other wallets (like "),t("a",{attrs:{href:"https://www.arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArConnect"),t("OutboundLink")],1),e._v(") integrate with this Key Derivation protocol just exposing an API to collect a signature from a given Arweave Wallet in order to get the SHA-256 signature needed for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/HKDF",target:"_blank",rel:"noopener noreferrer"}},[e._v("HKDF"),t("OutboundLink")],1),e._v(" to derive the Drive Key.")]),e._v(" "),t("p",[e._v("An example implementation, using Dart, is available "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-web/blob/187b3fb30808bda452123c2b18931c898df6a3fb/docs/private_drive_kdf_reference.dart",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", with a Typescript implementation "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js/blob/f19da30efd30a4370be53c9b07834eae764f8535/src/utils/crypto.ts",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"private-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drives"}},[e._v("#")]),e._v(" Private Drives")]),e._v(" "),t("p",[e._v("Drives can store either public or private data. This is indicated by the "),t("code",[e._v("Drive-Privacy")]),e._v(" tag in the Drive entity metadata.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Drive-Privacy: ""\n')])])]),t("p",[e._v("If a Drive entity is private, an additional tag "),t("code",[e._v("Drive-Auth-Mode")]),e._v(" must also be used to indicate how the Drive Key is derived. ArDrive clients currently leverage a secure password along with the Arweave Wallet private key signature to derive the global Drive Key.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Drive-Auth-Mode?: 'password'\n")])])]),t("p",[e._v("On every encrypted Drive Entity, a "),t("code",[e._v("Cipher")]),e._v(" tag must be specified, along with the public parameters for decrypting the data. This is done by specifying the parameter with a "),t("code",[e._v("Cipher-*")]),e._v(" tag. eg. "),t("code",[e._v("Cipher-IV")]),e._v(". If the parameter is byte data, it must be encoded as Base64 in the tag.")]),e._v(" "),t("p",[e._v("ArDrive clients currently leverage AES256-GCM for all symmetric encryption, which requires a Cipher Initialization Vector consisting of 12 random bytes.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Additionally, all encrypted transactions must have the "),t("code",[e._v("Content-Type")]),e._v(" tag "),t("code",[e._v("application/octet-stream")]),e._v(" as opposed to "),t("code",[e._v("application/json")])]),e._v(" "),t("p",[e._v("Private Drive Entities and their corresponding Root Folder Entities will both use these keys and ciphers generated to symmetrically encrypt the JSON files that are included in the transaction. This ensures that only the Drive Owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.")]),e._v(" "),t("h2",{attrs:{id:"private-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-files"}},[e._v("#")]),e._v(" Private Files")]),e._v(" "),t("p",[e._v("When a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. Each unique file in a drive will get its own set of file keys based off of that file's unique "),t("code",[e._v("FileId")]),e._v(". If a single file gets a new version, its "),t("code",[e._v("File-Id")]),e._v(" will be reused, effectively leveraging the same File Key for all versions in that file's history.")]),e._v(" "),t("p",[e._v("These file keys can be shared by the drive's owner as needed.")]),e._v(" "),t("p",[e._v("Private File entities have both its metadata and data transactions encrypted using the same File Key, ensuring all facets of the data is truly private. As such, both the file's metadata and data transactions must both have a unique "),t("code",[e._v("Cipher-IV")]),e._v(" and "),t("code",[e._v("Cipher")]),e._v(" tag:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Just like drives, private files must have the "),t("code",[e._v("Content-Type")]),e._v(" tag set as "),t("code",[e._v("application/octet-stream")]),e._v(" in both its metadata and data transactions:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Content-Type: "application/octet-stream"\n')])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[12],{306:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"privacy"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#privacy"}},[e._v("#")]),e._v(" Privacy")]),e._v(" "),t("p",[e._v("The Arweave blockweave is inherently public. But with apps that use ArFS, like ArDrive, your private data never leaves your computer without using military grade (and "),t("a",{attrs:{href:"https://blog.boot.dev/cryptography/is-aes-256-quantum-resistant/#:~:text=Symmetric%20encryption%2C%20or%20more%20specifically,key%20sizes%20are%20large%20enough",target:"_blank",rel:"noopener noreferrer"}},[e._v("quantum resistant"),t("OutboundLink")],1),e._v(") encryption. This privacy layer is applied at the Drive level, and users determine whether a Drive is public or private when they first create it. Private drives must follow the ArFS privacy model.")]),e._v(" "),t("p",[e._v("With ArDrive specifically, every file within a Private Drive is symmetrically encrypted using "),t("a",{attrs:{href:"https://iopscience.iop.org/article/10.1088/1742-6596/1019/1/012008/pdf",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-GCM"),t("OutboundLink")],1),e._v(" (for small files and metadata transactions) or "),t("a",{attrs:{href:"https://xilinx.github.io/Vitis_Libraries/security/2020.1/guide_L1/internals/ctr.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("AES-256-CTR"),t("OutboundLink")],1),e._v(' (for large files, over 100MiB). Every Private drive has a master "Drive Key" which uses a combination of the user\'s Arweave wallet signature, a user defined drive password, and a unique drive identifier ('),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[e._v("uuidv4"),t("OutboundLink")],1),e._v('). Each file has its own "File Key" derived from the "Drive Key". This allows for single files to be shared without exposing access to the other files within the Drive.')]),e._v(" "),t("p",[e._v("Once a file is encrypted and stored on Arweave, it is locked forever and can only be decrypted using its file key.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": Usable encryption standards are not limited to AES-256-GCM or AES-256-CTR. Any Encryption method may be used so long as it is clearly indicated in the "),t("code",[e._v("cipher")]),e._v(" tag.")]),e._v(" "),t("h2",{attrs:{id:"deriving-keys"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deriving-keys"}},[e._v("#")]),e._v(" Deriving Keys")]),e._v(" "),t("p",[e._v("Private drives have a global drive key, "),t("code",[e._v("D")]),e._v(", and multiple file keys "),t("code",[e._v("F")]),e._v(", for encryption. This enables a drive to have as many uniquely encrypted files as needed. One key is used for all versions of a single file (since new file versions use the same File-Id)")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is used for encrypting both Drive and Folder metadata, while "),t("code",[e._v("F")]),e._v(" is used for encrypting File metadata and the actual stored data. Having these different keys, "),t("code",[e._v("D")]),e._v(" and "),t("code",[e._v("F")]),e._v(", allows a user to share specific files without revealing the contents of their entire drive.")]),e._v(" "),t("p",[t("code",[e._v("D")]),e._v(" is derived using HKDF-SHA256 with an "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/Salt_(cryptography)",target:"_blank",rel:"noopener noreferrer"}},[e._v("unsalted"),t("OutboundLink")],1),e._v(" RSA-PSS signature of the drive's id and a user provided password.")]),e._v(" "),t("p",[t("code",[e._v("F")]),e._v(" is also derived using HKDF-SHA256 with the drive key and the file's id.")]),e._v(" "),t("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:e.$withBase("/images/encryption-diagram.png")}}),e._v(" "),t("p",[e._v("Other wallets (like "),t("a",{attrs:{href:"https://www.arconnect.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArConnect"),t("OutboundLink")],1),e._v(") integrate with this Key Derivation protocol just exposing an API to collect a signature from a given Arweave Wallet in order to get the SHA-256 signature needed for the "),t("a",{attrs:{href:"https://en.wikipedia.org/wiki/HKDF",target:"_blank",rel:"noopener noreferrer"}},[e._v("HKDF"),t("OutboundLink")],1),e._v(" to derive the Drive Key.")]),e._v(" "),t("p",[e._v("An example implementation, using Dart, is available "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-web/blob/187b3fb30808bda452123c2b18931c898df6a3fb/docs/private_drive_kdf_reference.dart",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", with a Typescript implementation "),t("a",{attrs:{href:"https://github.com/ardriveapp/ardrive-core-js/blob/f19da30efd30a4370be53c9b07834eae764f8535/src/utils/crypto.ts",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"private-drives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-drives"}},[e._v("#")]),e._v(" Private Drives")]),e._v(" "),t("p",[e._v("Drives can store either public or private data. This is indicated by the "),t("code",[e._v("Drive-Privacy")]),e._v(" tag in the Drive entity metadata.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Drive-Privacy: ""\n')])])]),t("p",[e._v("If a Drive entity is private, an additional tag "),t("code",[e._v("Drive-Auth-Mode")]),e._v(" must also be used to indicate how the Drive Key is derived. ArDrive clients currently leverage a secure password along with the Arweave Wallet private key signature to derive the global Drive Key.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v("Drive-Auth-Mode?: 'password'\n")])])]),t("p",[e._v("On every encrypted Drive Entity, a "),t("code",[e._v("Cipher")]),e._v(" tag must be specified, along with the public parameters for decrypting the data. This is done by specifying the parameter with a "),t("code",[e._v("Cipher-*")]),e._v(" tag. eg. "),t("code",[e._v("Cipher-IV")]),e._v(". If the parameter is byte data, it must be encoded as Base64 in the tag.")]),e._v(" "),t("p",[e._v("ArDrive clients currently leverage AES256-GCM for all symmetric encryption, which requires a Cipher Initialization Vector consisting of 12 random bytes.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Additionally, all encrypted transactions must have the "),t("code",[e._v("Content-Type")]),e._v(" tag "),t("code",[e._v("application/octet-stream")]),e._v(" as opposed to "),t("code",[e._v("application/json")])]),e._v(" "),t("p",[e._v("Private Drive Entities and their corresponding Root Folder Entities will both use these keys and ciphers generated to symmetrically encrypt the JSON files that are included in the transaction. This ensures that only the Drive Owner (and whomever the keys have been shared with) can open the drive, discover the root folder, and continue to load the rest of the children in the drive.")]),e._v(" "),t("h2",{attrs:{id:"private-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#private-files"}},[e._v("#")]),e._v(" Private Files")]),e._v(" "),t("p",[e._v("When a file is uploaded to a private drive, it by default also becomes private and leverages the same drive keys used for its parent drive. Each unique file in a drive will get its own set of file keys based off of that file's unique "),t("code",[e._v("FileId")]),e._v(". If a single file gets a new version, its "),t("code",[e._v("File-Id")]),e._v(" will be reused, effectively leveraging the same File Key for all versions in that file's history.")]),e._v(" "),t("p",[e._v("These file keys can be shared by the drive's owner as needed.")]),e._v(" "),t("p",[e._v("Private File entities have both its metadata and data transactions encrypted using the same File Key, ensuring all facets of the data is truly private. As such, both the file's metadata and data transactions must both have a unique "),t("code",[e._v("Cipher-IV")]),e._v(" and "),t("code",[e._v("Cipher")]),e._v(" tag:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Cipher?: "AES256-GCM"\nCipher-IV?: "<12 byte initialization vector as Base64>"\n')])])]),t("p",[e._v("Just like drives, private files must have the "),t("code",[e._v("Content-Type")]),e._v(" tag set as "),t("code",[e._v("application/octet-stream")]),e._v(" in both its metadata and data transactions:")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('Content-Type: "application/octet-stream"\n')])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/16.d38b52bc.js b/assets/js/16.75df57ff.js similarity index 97% rename from assets/js/16.d38b52bc.js rename to assets/js/16.75df57ff.js index 3b3ea0d..cba3e0a 100644 --- a/assets/js/16.d38b52bc.js +++ b/assets/js/16.75df57ff.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{311:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"folder-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-write-operations"}},[e._v("#")]),e._v(" Folder Write Operations")]),e._v(" "),t("h2",{attrs:{id:"move-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#move-folder"}},[e._v("#")]),e._v(" Move Folder")]),e._v(" "),t("p",[e._v("Folders can be moved from one folder to another within the same Drive.")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction is created when a user wants to move a folder into a different folder.")]),e._v(" "),t("li",[e._v("The new file metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the file’s "),t("code",[e._v("Parent-Folder-Id")]),e._v(" must be updated to the "),t("code",[e._v("Folder-Id")]),e._v(" of the folder is was just moved to.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.")])]),e._v(" "),t("h2",{attrs:{id:"rename-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-folder"}},[e._v("#")]),e._v(" Rename Folder")]),e._v(" "),t("p",[e._v("Folders can be renamed from one name to another.")]),e._v(" "),t("ul",[t("li",[e._v("A new folder metadata transaction is created when a user wants to rename an existing folder.")]),e._v(" "),t("li",[e._v("The new folder metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the folder’s "),t("code",[e._v("name")]),e._v(" field in its Data JSON must be updated to the new folder name.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[16],{316:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"folder-write-operations"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#folder-write-operations"}},[e._v("#")]),e._v(" Folder Write Operations")]),e._v(" "),t("h2",{attrs:{id:"move-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#move-folder"}},[e._v("#")]),e._v(" Move Folder")]),e._v(" "),t("p",[e._v("Folders can be moved from one folder to another within the same Drive.")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction is created when a user wants to move a folder into a different folder.")]),e._v(" "),t("li",[e._v("The new file metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the file’s "),t("code",[e._v("Parent-Folder-Id")]),e._v(" must be updated to the "),t("code",[e._v("Folder-Id")]),e._v(" of the folder is was just moved to.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.")])]),e._v(" "),t("h2",{attrs:{id:"rename-folder"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#rename-folder"}},[e._v("#")]),e._v(" Rename Folder")]),e._v(" "),t("p",[e._v("Folders can be renamed from one name to another.")]),e._v(" "),t("ul",[t("li",[e._v("A new folder metadata transaction is created when a user wants to rename an existing folder.")]),e._v(" "),t("li",[e._v("The new folder metadata transaction reuses the existing folder’s "),t("code",[e._v("Folder-Id")]),e._v(" and copies all of it’s old metadata values, but the folder’s "),t("code",[e._v("name")]),e._v(" field in its Data JSON must be updated to the new folder name.\n"),t("ul",[t("li",[e._v("For private folders, new ciphers are generated for this new metadata transaction.")])])]),e._v(" "),t("li",[e._v("Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.")])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/17.c2356ca0.js b/assets/js/17.bfa916b3.js similarity index 77% rename from assets/js/17.c2356ca0.js rename to assets/js/17.bfa916b3.js index 8addf20..d46a9e8 100644 --- a/assets/js/17.c2356ca0.js +++ b/assets/js/17.bfa916b3.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{312:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[17],{311:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/19.06bffdea.js b/assets/js/19.daac847e.js similarity index 97% rename from assets/js/19.06bffdea.js rename to assets/js/19.daac847e.js index 6d525a3..3ef6528 100644 --- a/assets/js/19.06bffdea.js +++ b/assets/js/19.daac847e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{315:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-file"}},[e._v("#")]),e._v(" Create File")]),e._v(" "),t("h2",{attrs:{id:"new-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-file-entity"}},[e._v("#")]),e._v(" New File Entity")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.")]),e._v(" "),t("li",[e._v("Files can only be created in existing drives, and must have a valid Drive-Id.")]),e._v(" "),t("li",[e._v("Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.")]),e._v(" "),t("li",[e._v("The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.")]),e._v(" "),t("li",[e._v("The new file metadata transaction must generate a new UUIDv4 for the File-Id.")]),e._v(" "),t("li",[e._v('File metadata transactions must have Entity-Type: "file".')]),e._v(" "),t("li",[e._v("The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n"),t("ul",[t("li",[e._v("The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.")]),e._v(" "),t("li",[t("code",[e._v("name")]),e._v(" The name of the file including extension.")]),e._v(" "),t("li",[t("code",[e._v("size")]),e._v(" The size of the file on disk, in bytes as an integer.")]),e._v(" "),t("li",[t("code",[e._v("lastModifiedDate")]),e._v(" The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.")]),e._v(" "),t("li",[t("code",[e._v("dataTxId")]),e._v(" The Arweave transaction id of this File Entity’s Data Transaction.")]),e._v(" "),t("li",[t("code",[e._v("dataContentType")]),e._v(" The mime time of this File Entity’s data must be determined by the client.")]),e._v(" "),t("li",[t("code",[e._v("isHidden")]),e._v(" A boolean telling clients if they should display the file or not.")])])]),e._v(" "),t("li",[e._v("If the File is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the respective encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(") for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.")]),e._v(" "),t("li",[e._v("It must have the content type "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(" for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[19],{312:function(e,t,a){"use strict";a.r(t);var i=a(10),n=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"create-file"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#create-file"}},[e._v("#")]),e._v(" Create File")]),e._v(" "),t("h2",{attrs:{id:"new-file-entity"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#new-file-entity"}},[e._v("#")]),e._v(" New File Entity")]),e._v(" "),t("ul",[t("li",[e._v("A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.")]),e._v(" "),t("li",[e._v("Files can only be created in existing drives, and must have a valid Drive-Id.")]),e._v(" "),t("li",[e._v("Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.")]),e._v(" "),t("li",[e._v("The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.")]),e._v(" "),t("li",[e._v("The new file metadata transaction must generate a new UUIDv4 for the File-Id.")]),e._v(" "),t("li",[e._v('File metadata transactions must have Entity-Type: "file".')]),e._v(" "),t("li",[e._v("The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.\n"),t("ul",[t("li",[e._v("The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.")]),e._v(" "),t("li",[t("code",[e._v("name")]),e._v(" The name of the file including extension.")]),e._v(" "),t("li",[t("code",[e._v("size")]),e._v(" The size of the file on disk, in bytes as an integer.")]),e._v(" "),t("li",[t("code",[e._v("lastModifiedDate")]),e._v(" The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.")]),e._v(" "),t("li",[t("code",[e._v("dataTxId")]),e._v(" The Arweave transaction id of this File Entity’s Data Transaction.")]),e._v(" "),t("li",[t("code",[e._v("dataContentType")]),e._v(" The mime time of this File Entity’s data must be determined by the client.")]),e._v(" "),t("li",[t("code",[e._v("isHidden")]),e._v(" A boolean telling clients if they should display the file or not.")])])]),e._v(" "),t("li",[e._v("If the File is private:\n"),t("ul",[t("li",[e._v("Its "),t("code",[e._v("Cipher")]),e._v(" tag must be filled out with the respective encryption algorithm (currently "),t("code",[e._v("AES256-GCM")]),e._v(") for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("Its "),t("code",[e._v("Cipher-IV")]),e._v(" tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.")]),e._v(" "),t("li",[e._v("It must have the content type "),t("code",[e._v('Content-Type: "application/octet-stream"')]),e._v(" for both the Metadata and Data transactions.")]),e._v(" "),t("li",[e._v("The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned "),t("code",[e._v("Cipher")]),e._v(" and "),t("code",[e._v("Cipher-IV")])])])])])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/21.0b8a84f4.js b/assets/js/21.2493ed7e.js similarity index 77% rename from assets/js/21.0b8a84f4.js rename to assets/js/21.2493ed7e.js index a3cffff..d72a87b 100644 --- a/assets/js/21.0b8a84f4.js +++ b/assets/js/21.2493ed7e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{316:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[21],{315:function(t,n,s){"use strict";s.r(n);var e=s(10),o=Object(e.a)({},(function(){return(0,this._self._c)("ContentSlotsDistributor",{attrs:{"slot-key":this.$parent.slotKey}})}),[],!1,null,null,null);n.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/29.6828cc78.js b/assets/js/29.d82aae63.js similarity index 99% rename from assets/js/29.6828cc78.js rename to assets/js/29.d82aae63.js index b1e4843..d18bc6d 100644 --- a/assets/js/29.6828cc78.js +++ b/assets/js/29.d82aae63.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{324:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("ArDrive Core is a TypeScript library that contains the essential back end application features to support the ArDrive CLI and Desktop apps, such as file management, Permaweb upload/download, wallet management, and other common functions.")]),t._v(" "),a("p",[t._v("Engage with the community in "),a("a",{attrs:{href:"https://discord.gg/7RuTBckX",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord"),a("OutboundLink")],1),t._v(" for more information.")]),t._v(" "),a("h2",{attrs:{id:"integrating-with-ardrive-core"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integrating-with-ardrive-core"}},[t._v("#")]),t._v(" Integrating with ArDrive Core")]),t._v(" "),a("p",[t._v("To add the ArDrive Core library to your project, simply add it as a dependency:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" ardrive-core-js\n")])])]),a("p",[t._v("The recommended approach for integrating with ArDrive Core as a dependency in your project is to construct and use the methods provided on the "),a("code",[t._v("ArDrive")]),t._v(" class. Developers can use the convenience function "),a("code",[t._v("arDriveFactory")]),t._v(" to construct the "),a("code",[t._v("ArDrive")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Below are a few common examples of interacting with Core:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" readJWKFile"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arDriveFactory "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read wallet from file")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("readJWKFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'/path/to/wallet'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct ArDrive class")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a public drive and its root folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createDriveResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPublicDrive")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" driveName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Drive'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap file for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct a safe Entity ID Type")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'10108b54a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a public file to destination folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" deriveDriveKey "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from password, wallet, and drive ID")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("deriveDriveKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mySecretPassWord'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'12345674a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("myWallet "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" JWKWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a private folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createFolderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPrivateFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My New Private Folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n parentFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'47162534a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" EntityKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from raw drive key string")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EntityKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Buffer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MyAwesomeDriveKeyZZZZZZZZZZZZZZZZZZZZFAKE/s'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'base64'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap folder and all of its contents for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedFolder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a private folder and all its contents")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wrappedFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'76543214a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// And some other public file to a different destination 🀯")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" someOtherWrappedFile\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'675489321-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload ArFS Entities To Turbo (BETA)")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The presence of `turboSettings` in `arDriveFactory` enables sending to Turbo")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" turboSettings"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h2",{attrs:{id:"development-environment-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-environment-setup"}},[t._v("#")]),t._v(" Development Environment Setup")]),t._v(" "),a("p",[t._v("We use nvm to manage our Node engine version and, if necessary, to install an npm version that we can then use to install Yarn.")]),t._v(" "),a("p",[t._v("Note for Windows: "),a("strong",[t._v("We recommend using WSL")]),t._v(" for setting up NVM on Windows using the "),a("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[t._v("instructions described here"),a("OutboundLink")],1),t._v(" then continue the steps below.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Install nvm "),a("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[t._v("using their instructions"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("We use Node 18.x -- ensure that the correct Node version is installed and activated by performing "),a("code",[t._v("nvm install")]),t._v(" and then "),a("code",[t._v("nvm use")])])]),t._v(" "),a("li",[a("p",[t._v("We use Yarn 3.x please "),a("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow the installation guidelines here"),a("OutboundLink")],1)])]),t._v(" "),a("li",[a("p",[t._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:\n"),a("code",[t._v("yarn husky install")]),t._v("\nto enable git hooks for this local repository. Without doing so, you risk committing non-compliant code to the repository.")])]),t._v(" "),a("li",[a("p",[t._v("Install all node package dependencies by running "),a("code",[t._v("yarn install --check-cache")])])])]),t._v(" "),a("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[t._v("#")]),t._v(" Recommended Visual Studio Code extensions")]),t._v(" "),a("p",[t._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[t._v("ES-Lint"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[t._v("Editor-Config"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[t._v("Prettier"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[t._v("ZipFS"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"building-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#building-the-library"}},[t._v("#")]),t._v(" Building the Library")]),t._v(" "),a("p",[t._v("Simply run "),a("code",[t._v("yarn build")]),t._v(". This will clean the project and compile the TypeScript library.")]),t._v(" "),a("h2",{attrs:{id:"testing-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#testing-the-library"}},[t._v("#")]),t._v(" Testing the Library")]),t._v(" "),a("p",[t._v("This library is setup for "),a("a",{attrs:{href:"https://github.com/mochajs/mocha",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mocha"),a("OutboundLink")],1),t._v(" testing with "),a("a",{attrs:{href:"https://github.com/chaijs/chai",target:"_blank",rel:"noopener noreferrer"}},[t._v("Chai"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://github.com/sinonjs/sinon",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sinon"),a("OutboundLink")],1),t._v(". Configuration for Mocha can be found in "),a("code",[t._v(".mocharc.js")])]),t._v(" "),a("p",[t._v("To run all of the tests use:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("p",[t._v("To run a specific test, use Mocha's "),a("a",{attrs:{href:"https://mochajs.org/#-grep-regexp-g-regexp",target:"_blank",rel:"noopener noreferrer"}},[t._v("grep"),a("OutboundLink")],1),t._v(" command. This will cause Mocha to only run the tests that contain the provided RegExp.")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("-g")]),t._v(" command will "),a("strong",[t._v("only")]),t._v(" match the characters used in the "),a("code",[t._v("describe()")]),t._v(" and "),a("code",[t._v("it()")]),t._v(" title arguments. It will "),a("strong",[t._v("not")]),t._v(" match files names or folders.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),t._v("\n")])])]),a("p",[t._v("Will run this test:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("describe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("it")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'functions correctly'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"coverage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#coverage"}},[t._v("#")]),t._v(" Coverage")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/istanbuljs/nyc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Istanbul.js (nyc)"),a("OutboundLink")],1),t._v(" has been added for code coverage reporting. Configuration for the nyc package can be found in "),a("code",[t._v("nyc.config.js")])]),t._v(" "),a("p",[t._v("On each "),a("code",[t._v("yarn test")]),t._v(" command, nyc will output a code coverage summary in the terminal. In addition, a more detailed HTML version will output to the "),a("code",[t._v("/coverage")]),t._v(" directory. Simply run "),a("code",[t._v("/coverage/index.html")]),t._v(" in your browser to view the HTML version.")]),t._v(" "),a("p",[t._v("Alternatively, you can view a verbose coverage output in the terminal by running:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" coverage\n")])])]),a("h3",{attrs:{id:"adding-tests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-tests"}},[t._v("#")]),t._v(" Adding tests")]),t._v(" "),a("p",[t._v("There are many different syntax options available with the Chai library, which can be found in their "),a("a",{attrs:{href:"https://www.chaijs.com/api/bdd/",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(". For examples on unit testing, visit "),a("code",[t._v("src/example.test.ts")]),t._v(", and for integration testing: "),a("code",[t._v("tests/example.test.ts")]),t._v(".")]),t._v(" "),a("p",[t._v("Unit tests should be located adjacent (or right next to) the file they are referencing. They should also be named the same with the "),a("code",[t._v(".test.ts")]),t._v(" extension. In contrast, integration tests will live in the "),a("code",[t._v("/tests")]),t._v(" directory.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("ardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ fileToTest.ts\nβ”‚ └── fileToTest.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-- Unit "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n└── tests\n └── bestApi.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("----- Integration "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("h3",{attrs:{id:"using-sinon"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-sinon"}},[t._v("#")]),t._v(" Using Sinon")]),t._v(" "),a("p",[t._v("Sinon can be used to create spies, mocks, fakes, stubs, and more. There are some basic examples of using the library shown in the example test files shared above.")]),t._v(" "),a("p",[t._v("For more information on what you can do with Sinon, visit their "),a("a",{attrs:{href:"https://sinonjs.org/releases/latest",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"debugging-with-power-assert"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#debugging-with-power-assert"}},[t._v("#")]),t._v(" Debugging with Power-Assert")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/power-assert-js/power-assert",target:"_blank",rel:"noopener noreferrer"}},[t._v("Power-Assert"),a("OutboundLink")],1),t._v(" is setup as another testing tool. The library can be used to provide a very detailed output of your failing test cases. This can become super useful while debugging a test.")]),t._v(" "),a("p",[t._v("To use this tool, it must be imported using this syntax:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" assert "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'assert'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Then use "),a("code",[t._v("assert")]),t._v(" in your error throwing test case. Commenting out the Chai assertion will produce a cleaner output:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// expect(failingOutput).to.equal(expectedOutput);")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("assert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("failingOutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" expectedOutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And finally, to view the detailed error messages in your terminal:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" power-assert "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My test case'")]),t._v("\n")])])]),a("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[t._v("#")]),t._v(" Progress Logging of Transaction Uploads")]),t._v(" "),a("p",[t._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_PROGRESS_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Uploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\nUploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("76")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\n")])])]),a("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[t._v("#")]),t._v(" Persistent Caching of ArFS Entity Metadata")]),t._v(" "),a("p",[t._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/ardrive-caches/metadata\nNon-Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/.ardrive/caches/metadata\n")])])]),a("p",[t._v("The "),a("code",[t._v("XDG_CACHE_HOME")]),t._v(" environment variable is honored, where applicable, and will be used in place of "),a("code",[t._v("os.homedir()")]),t._v(" in the scenarios described above.")]),t._v(" "),a("p",[t._v("Metadata cache logging to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_CACHE_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(".")]),t._v(" "),a("p",[t._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),t._v(" "),a("p",[t._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")]),t._v(" "),a("h3",{attrs:{id:"applying-custom-metadata-to-arfs-file-transactions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#applying-custom-metadata-to-arfs-file-transactions"}},[t._v("#")]),t._v(" Applying Custom MetaData to ArFS File Transactions")]),t._v(" "),a("p",[t._v("Custom metadata can be attached to ArFS File Transactions. Metadata can be applied to either the GQL tags on the MetaData Transaction, the MetaData Transaction's Data JSON, or both.")]),t._v(" "),a("p",[t._v("All custom tags can be accessed by using by using "),a("code",[t._v("ArDrive")]),t._v(" class read methods such as "),a("code",[t._v("getPublicFile")]),t._v(", "),a("code",[t._v("getPrivateFile")]),t._v(", "),a("code",[t._v("listPrivateFolder")]),t._v(", etc.")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveAnonymousFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPublicFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" fileId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataGqlTags "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataJsonFields "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataJson"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),t._v(" "),a("p",[t._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),a("code",[t._v("https://arweave.net/")]),t._v(".")]),t._v(" "),a("p",[t._v("To add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileToUpload "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file/on/system'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File or Folder Path")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'application/custom-content-type'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom Content Type")]),t._v("\n customMetaData"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom MetaData")]),t._v("\n metaDataJson"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag-Name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Single-Custom-Value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n metaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Another-Custom-Tag'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'First-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Second-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Third-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[29],{325:function(t,a,s){"use strict";s.r(a);var e=s(10),n=Object(e.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[t._v("#")]),t._v(" Overview")]),t._v(" "),a("p",[t._v("ArDrive Core is a TypeScript library that contains the essential back end application features to support the ArDrive CLI and Desktop apps, such as file management, Permaweb upload/download, wallet management, and other common functions.")]),t._v(" "),a("p",[t._v("Engage with the community in "),a("a",{attrs:{href:"https://discord.gg/7RuTBckX",target:"_blank",rel:"noopener noreferrer"}},[t._v("Discord"),a("OutboundLink")],1),t._v(" for more information.")]),t._v(" "),a("h2",{attrs:{id:"integrating-with-ardrive-core"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#integrating-with-ardrive-core"}},[t._v("#")]),t._v(" Integrating with ArDrive Core")]),t._v(" "),a("p",[t._v("To add the ArDrive Core library to your project, simply add it as a dependency:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" ardrive-core-js\n")])])]),a("p",[t._v("The recommended approach for integrating with ArDrive Core as a dependency in your project is to construct and use the methods provided on the "),a("code",[t._v("ArDrive")]),t._v(" class. Developers can use the convenience function "),a("code",[t._v("arDriveFactory")]),t._v(" to construct the "),a("code",[t._v("ArDrive")]),t._v(" class.")]),t._v(" "),a("p",[t._v("Below are a few common examples of interacting with Core:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" readJWKFile"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" arDriveFactory "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Read wallet from file")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("readJWKFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'/path/to/wallet'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct ArDrive class")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token class-name"}},[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a public drive and its root folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createDriveResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPublicDrive")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" driveName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Drive'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap file for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedEntity "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Construct a safe Entity ID Type")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'10108b54a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a public file to destination folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" deriveDriveKey "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from password, wallet, and drive ID")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("deriveDriveKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'mySecretPassWord'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'12345674a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("myWallet "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("as")]),t._v(" JWKWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPrivateKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Create a private folder")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" createFolderResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("createPrivateFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderName"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My New Private Folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n parentFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'47162534a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrapFileOrFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" EntityKey"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ardrive-core-js'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Derive a private drive key from raw drive key string")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" driveKey "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EntityKey")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("Buffer"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MyAwesomeDriveKeyZZZZZZZZZZZZZZZZZZZZFAKE/s'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'base64'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Wrap folder and all of its contents for upload")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" wrappedFolder "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/folder'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload a private folder and all its contents")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" wrappedFolder"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'76543214a-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n driveKey\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// And some other public file to a different destination 🀯")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n wrappedEntity"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" someOtherWrappedFile\n destFolderId"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token constant"}},[t._v("EID")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'675489321-eb5e-4134-8ae2-a3946a428ec7'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Upload ArFS Entities To Turbo (BETA)")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// The presence of `turboSettings` in `arDriveFactory` enables sending to Turbo")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wallet"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" myWallet"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" turboSettings"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadFileResult "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadAllEntities")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n entitiesToUpload"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" wrappedEntity"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" destFolderId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h2",{attrs:{id:"development-environment-setup"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#development-environment-setup"}},[t._v("#")]),t._v(" Development Environment Setup")]),t._v(" "),a("p",[t._v("We use nvm to manage our Node engine version and, if necessary, to install an npm version that we can then use to install Yarn.")]),t._v(" "),a("p",[t._v("Note for Windows: "),a("strong",[t._v("We recommend using WSL")]),t._v(" for setting up NVM on Windows using the "),a("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[t._v("instructions described here"),a("OutboundLink")],1),t._v(" then continue the steps below.")]),t._v(" "),a("ol",[a("li",[a("p",[t._v("Install nvm "),a("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[t._v("using their instructions"),a("OutboundLink")],1),t._v(".")])]),t._v(" "),a("li",[a("p",[t._v("We use Node 18.x -- ensure that the correct Node version is installed and activated by performing "),a("code",[t._v("nvm install")]),t._v(" and then "),a("code",[t._v("nvm use")])])]),t._v(" "),a("li",[a("p",[t._v("We use Yarn 3.x please "),a("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[t._v("follow the installation guidelines here"),a("OutboundLink")],1)])]),t._v(" "),a("li",[a("p",[t._v("We use husky 6.x to manage the git commit hooks that help to improve the quality of our commits. Please run:\n"),a("code",[t._v("yarn husky install")]),t._v("\nto enable git hooks for this local repository. Without doing so, you risk committing non-compliant code to the repository.")])]),t._v(" "),a("li",[a("p",[t._v("Install all node package dependencies by running "),a("code",[t._v("yarn install --check-cache")])])])]),t._v(" "),a("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[t._v("#")]),t._v(" Recommended Visual Studio Code extensions")]),t._v(" "),a("p",[t._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),t._v(" "),a("ul",[a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[t._v("ES-Lint"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[t._v("Editor-Config"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[t._v("Prettier"),a("OutboundLink")],1)]),t._v(" "),a("li",[a("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[t._v("ZipFS"),a("OutboundLink")],1)])]),t._v(" "),a("h2",{attrs:{id:"building-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#building-the-library"}},[t._v("#")]),t._v(" Building the Library")]),t._v(" "),a("p",[t._v("Simply run "),a("code",[t._v("yarn build")]),t._v(". This will clean the project and compile the TypeScript library.")]),t._v(" "),a("h2",{attrs:{id:"testing-the-library"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#testing-the-library"}},[t._v("#")]),t._v(" Testing the Library")]),t._v(" "),a("p",[t._v("This library is setup for "),a("a",{attrs:{href:"https://github.com/mochajs/mocha",target:"_blank",rel:"noopener noreferrer"}},[t._v("Mocha"),a("OutboundLink")],1),t._v(" testing with "),a("a",{attrs:{href:"https://github.com/chaijs/chai",target:"_blank",rel:"noopener noreferrer"}},[t._v("Chai"),a("OutboundLink")],1),t._v(" and "),a("a",{attrs:{href:"https://github.com/sinonjs/sinon",target:"_blank",rel:"noopener noreferrer"}},[t._v("Sinon"),a("OutboundLink")],1),t._v(". Configuration for Mocha can be found in "),a("code",[t._v(".mocharc.js")])]),t._v(" "),a("p",[t._v("To run all of the tests use:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("p",[t._v("To run a specific test, use Mocha's "),a("a",{attrs:{href:"https://mochajs.org/#-grep-regexp-g-regexp",target:"_blank",rel:"noopener noreferrer"}},[t._v("grep"),a("OutboundLink")],1),t._v(" command. This will cause Mocha to only run the tests that contain the provided RegExp.")]),t._v(" "),a("p",[t._v("The "),a("code",[t._v("-g")]),t._v(" command will "),a("strong",[t._v("only")]),t._v(" match the characters used in the "),a("code",[t._v("describe()")]),t._v(" and "),a("code",[t._v("it()")]),t._v(" title arguments. It will "),a("strong",[t._v("not")]),t._v(" match files names or folders.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),t._v("\n")])])]),a("p",[t._v("Will run this test:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("describe")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My specific unit test'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("it")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'functions correctly'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// ...")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("h3",{attrs:{id:"coverage"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#coverage"}},[t._v("#")]),t._v(" Coverage")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/istanbuljs/nyc",target:"_blank",rel:"noopener noreferrer"}},[t._v("Istanbul.js (nyc)"),a("OutboundLink")],1),t._v(" has been added for code coverage reporting. Configuration for the nyc package can be found in "),a("code",[t._v("nyc.config.js")])]),t._v(" "),a("p",[t._v("On each "),a("code",[t._v("yarn test")]),t._v(" command, nyc will output a code coverage summary in the terminal. In addition, a more detailed HTML version will output to the "),a("code",[t._v("/coverage")]),t._v(" directory. Simply run "),a("code",[t._v("/coverage/index.html")]),t._v(" in your browser to view the HTML version.")]),t._v(" "),a("p",[t._v("Alternatively, you can view a verbose coverage output in the terminal by running:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" coverage\n")])])]),a("h3",{attrs:{id:"adding-tests"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#adding-tests"}},[t._v("#")]),t._v(" Adding tests")]),t._v(" "),a("p",[t._v("There are many different syntax options available with the Chai library, which can be found in their "),a("a",{attrs:{href:"https://www.chaijs.com/api/bdd/",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(". For examples on unit testing, visit "),a("code",[t._v("src/example.test.ts")]),t._v(", and for integration testing: "),a("code",[t._v("tests/example.test.ts")]),t._v(".")]),t._v(" "),a("p",[t._v("Unit tests should be located adjacent (or right next to) the file they are referencing. They should also be named the same with the "),a("code",[t._v(".test.ts")]),t._v(" extension. In contrast, integration tests will live in the "),a("code",[t._v("/tests")]),t._v(" directory.")]),t._v(" "),a("p",[t._v("For example:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("ardrive-core-js/\nβ”œβ”€β”€ src\nβ”‚ β”œβ”€β”€ fileToTest.ts\nβ”‚ └── fileToTest.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("-- Unit "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n└── tests\n └── bestApi.test.ts "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("----- Integration "),a("span",{pre:!0,attrs:{class:"token builtin class-name"}},[t._v("test")]),t._v("\n")])])]),a("h3",{attrs:{id:"using-sinon"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#using-sinon"}},[t._v("#")]),t._v(" Using Sinon")]),t._v(" "),a("p",[t._v("Sinon can be used to create spies, mocks, fakes, stubs, and more. There are some basic examples of using the library shown in the example test files shared above.")]),t._v(" "),a("p",[t._v("For more information on what you can do with Sinon, visit their "),a("a",{attrs:{href:"https://sinonjs.org/releases/latest",target:"_blank",rel:"noopener noreferrer"}},[t._v("documentation"),a("OutboundLink")],1),t._v(".")]),t._v(" "),a("h3",{attrs:{id:"debugging-with-power-assert"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#debugging-with-power-assert"}},[t._v("#")]),t._v(" Debugging with Power-Assert")]),t._v(" "),a("p",[a("a",{attrs:{href:"https://github.com/power-assert-js/power-assert",target:"_blank",rel:"noopener noreferrer"}},[t._v("Power-Assert"),a("OutboundLink")],1),t._v(" is setup as another testing tool. The library can be used to provide a very detailed output of your failing test cases. This can become super useful while debugging a test.")]),t._v(" "),a("p",[t._v("To use this tool, it must be imported using this syntax:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" assert "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("require")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'assert'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("Then use "),a("code",[t._v("assert")]),t._v(" in your error throwing test case. Commenting out the Chai assertion will produce a cleaner output:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// expect(failingOutput).to.equal(expectedOutput);")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("assert")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("failingOutput "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" expectedOutput"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("And finally, to view the detailed error messages in your terminal:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[a("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" power-assert "),a("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My test case'")]),t._v("\n")])])]),a("h3",{attrs:{id:"progress-logging-of-transaction-uploads"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#progress-logging-of-transaction-uploads"}},[t._v("#")]),t._v(" Progress Logging of Transaction Uploads")]),t._v(" "),a("p",[t._v("Progress logging of transaction uploads to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_PROGRESS_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(":")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Uploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("1")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("35")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("66")]),t._v("%\nTransaction _GKQasQX194a364Hph8Oe-oku1AdfHwxWOw9_JC1yjc Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\nUploading "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("file")]),t._v(" transaction "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" of total "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),t._v(" transactions"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("0")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("13")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("28")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("42")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("60")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("76")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("91")]),t._v("%\nTransaction nA1stCdTkuf290k0qsqvmJ78isEC0bwgrAi3D8Cl1LU Upload Progress: "),a("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),t._v("%\n")])])]),a("h3",{attrs:{id:"persistent-caching-of-arfs-entity-metadata"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#persistent-caching-of-arfs-entity-metadata"}},[t._v("#")]),t._v(" Persistent Caching of ArFS Entity Metadata")]),t._v(" "),a("p",[t._v("To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:")]),t._v(" "),a("div",{staticClass:"language-shell extra-class"},[a("pre",{pre:!0,attrs:{class:"language-shell"}},[a("code",[t._v("Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/ardrive-caches/metadata\nNon-Windows: "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("os.homedir"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("/.ardrive/caches/metadata\n")])])]),a("p",[t._v("The "),a("code",[t._v("XDG_CACHE_HOME")]),t._v(" environment variable is honored, where applicable, and will be used in place of "),a("code",[t._v("os.homedir()")]),t._v(" in the scenarios described above.")]),t._v(" "),a("p",[t._v("Metadata cache logging to stderr can be enabled by setting the "),a("code",[t._v("ARDRIVE_CACHE_LOG")]),t._v(" environment variable to "),a("code",[t._v("1")]),t._v(".")]),t._v(" "),a("p",[t._v("Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.")]),t._v(" "),a("p",[t._v("The cache can be manually cleared safely at any time that any integrating app is not in operation.")]),t._v(" "),a("h3",{attrs:{id:"applying-custom-metadata-to-arfs-file-transactions"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#applying-custom-metadata-to-arfs-file-transactions"}},[t._v("#")]),t._v(" Applying Custom MetaData to ArFS File Transactions")]),t._v(" "),a("p",[t._v("Custom metadata can be attached to ArFS File Transactions. Metadata can be applied to either the GQL tags on the MetaData Transaction, the MetaData Transaction's Data JSON, or both.")]),t._v(" "),a("p",[t._v("All custom tags can be accessed by using by using "),a("code",[t._v("ArDrive")]),t._v(" class read methods such as "),a("code",[t._v("getPublicFile")]),t._v(", "),a("code",[t._v("getPrivateFile")]),t._v(", "),a("code",[t._v("listPrivateFolder")]),t._v(", etc.")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arDrive "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("arDriveAnonymousFactory")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileInfo "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arDrive"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("getPublicFile")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" fileId "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataGqlTags "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" myMetaDataJsonFields "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fileInfo"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("customMetaDataJson"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),a("p",[t._v("When the custom metadata is attached to the MetaData Transaction's GQL tags, they will become visible on any Arweave GQL gateway and also third party tools that read GQL data.")]),t._v(" "),a("p",[t._v("When these tags are added to the MetaData Transaction's Data JSON they can be read by downloading the JSON data directly from "),a("code",[t._v("https://arweave.net/")]),t._v(".")]),t._v(" "),a("p",[t._v("To add this custom metadata to your file metadata transactions, users can pass an object containing custom tags when wrapping content to upload:")]),t._v(" "),a("div",{staticClass:"language-ts extra-class"},[a("pre",{pre:!0,attrs:{class:"language-ts"}},[a("code",[a("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileToUpload "),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token function"}},[t._v("wrapFileOrFolder")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'path/to/file/on/system'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// File or Folder Path")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'application/custom-content-type'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom Content Type")]),t._v("\n customMetaData"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Custom MetaData")]),t._v("\n metaDataJson"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag-Name'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Single-Custom-Value'")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n metaDataGqlTags"),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Another-Custom-Tag'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'First-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Second-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Third-Custom-Value'")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/30.06ab7fce.js b/assets/js/30.54ebb572.js similarity index 98% rename from assets/js/30.06ab7fce.js rename to assets/js/30.54ebb572.js index be85f9f..291fd8b 100644 --- a/assets/js/30.06ab7fce.js +++ b/assets/js/30.54ebb572.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{325:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"deploying-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying-your-dapp"}},[e._v("#")]),e._v(" Deploying your dApp")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).")]),e._v(" "),t("h2",{attrs:{id:"deploying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying"}},[e._v("#")]),e._v(" Deploying")]),e._v(" "),t("h3",{attrs:{id:"step-1-log-into-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-log-into-ardrive"}},[e._v("#")]),e._v(" Step 1: Log into ArDrive")]),e._v(" "),t("p",[e._v("Go to the "),t("a",{attrs:{href:"https://app.ardrive.io/#/sign-in",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive web app"),t("OutboundLink")],1),e._v(" and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.")]),e._v(" "),t("h3",{attrs:{id:"step-2-select-or-create-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-select-or-create-a-drive"}},[e._v("#")]),e._v(" Step 2: Select or Create a Drive")]),e._v(" "),t("p",[e._v('Once logged in, navigate to the drive where you want your project to be hosted. If you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.')]),e._v(" "),t("h3",{attrs:{id:"step-3-upload-your-project"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-3-upload-your-project"}},[e._v("#")]),e._v(" Step 3: Upload your project")]),e._v(" "),t("p",[e._v('With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project\'s root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project\'s file structure.')]),e._v(" "),t("h3",{attrs:{id:"step-4-confirm-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-4-confirm-upload"}},[e._v("#")]),e._v(" Step 4: Confirm Upload")]),e._v(" "),t("p",[e._v('You\'ll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.')]),e._v(" "),t("h3",{attrs:{id:"step-5-create-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-5-create-the-manifest"}},[e._v("#")]),e._v(" Step 5: Create the Manifest")]),e._v(" "),t("p",[e._v('While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You\'ll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.')]),e._v(" "),t("h3",{attrs:{id:"step-6-get-the-data-tx-id"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-6-get-the-data-tx-id"}},[e._v("#")]),e._v(" Step 6: Get the Data TX ID")]),e._v(" "),t("p",[e._v('Once the manifest is created, click on it to expand its details. On the bottom right, there\'s a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.')]),e._v(" "),t("h3",{attrs:{id:"step-7-view-and-share-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-7-view-and-share-your-dapp"}},[e._v("#")]),e._v(" Step 7: View and Share your dApp")]),e._v(" "),t("p",[e._v("Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like "),t("code",[e._v("https://arweave.net/")]),e._v(" . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.")]),e._v(" "),t("h2",{attrs:{id:"updating-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-your-dapp"}},[e._v("#")]),e._v(" Updating your dApp")]),e._v(" "),t("p",[e._v("Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the "),t("RouterLink",{attrs:{to:"/docs/arfs/overview.html"}},[e._v("Arweave File System (ArFS)")]),e._v(' protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won\'t be displayed in the ArDrive web app unless you click on a file to view its history.')],1),e._v(" "),t("p",[e._v('Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.')]),e._v(" "),t("p",[e._v("The old version of the dApp will always be available to anyone who has the correct TX ID")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[30],{324:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"deploying-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying-your-dapp"}},[e._v("#")]),e._v(" Deploying your dApp")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).")]),e._v(" "),t("h2",{attrs:{id:"deploying"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#deploying"}},[e._v("#")]),e._v(" Deploying")]),e._v(" "),t("h3",{attrs:{id:"step-1-log-into-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-1-log-into-ardrive"}},[e._v("#")]),e._v(" Step 1: Log into ArDrive")]),e._v(" "),t("p",[e._v("Go to the "),t("a",{attrs:{href:"https://app.ardrive.io/#/sign-in",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive web app"),t("OutboundLink")],1),e._v(" and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.")]),e._v(" "),t("h3",{attrs:{id:"step-2-select-or-create-a-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-2-select-or-create-a-drive"}},[e._v("#")]),e._v(" Step 2: Select or Create a Drive")]),e._v(" "),t("p",[e._v('Once logged in, navigate to the drive where you want your project to be hosted. If you haven\'t created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.')]),e._v(" "),t("h3",{attrs:{id:"step-3-upload-your-project"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-3-upload-your-project"}},[e._v("#")]),e._v(" Step 3: Upload your project")]),e._v(" "),t("p",[e._v('With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project\'s root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project\'s file structure.')]),e._v(" "),t("h3",{attrs:{id:"step-4-confirm-upload"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-4-confirm-upload"}},[e._v("#")]),e._v(" Step 4: Confirm Upload")]),e._v(" "),t("p",[e._v('You\'ll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.')]),e._v(" "),t("h3",{attrs:{id:"step-5-create-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-5-create-the-manifest"}},[e._v("#")]),e._v(" Step 5: Create the Manifest")]),e._v(" "),t("p",[e._v('While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You\'ll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.')]),e._v(" "),t("h3",{attrs:{id:"step-6-get-the-data-tx-id"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-6-get-the-data-tx-id"}},[e._v("#")]),e._v(" Step 6: Get the Data TX ID")]),e._v(" "),t("p",[e._v('Once the manifest is created, click on it to expand its details. On the bottom right, there\'s a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.')]),e._v(" "),t("h3",{attrs:{id:"step-7-view-and-share-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#step-7-view-and-share-your-dapp"}},[e._v("#")]),e._v(" Step 7: View and Share your dApp")]),e._v(" "),t("p",[e._v("Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like "),t("code",[e._v("https://arweave.net/")]),e._v(" . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.")]),e._v(" "),t("h2",{attrs:{id:"updating-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#updating-your-dapp"}},[e._v("#")]),e._v(" Updating your dApp")]),e._v(" "),t("p",[e._v("Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the "),t("RouterLink",{attrs:{to:"/docs/arfs/overview.html"}},[e._v("Arweave File System (ArFS)")]),e._v(' protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won\'t be displayed in the ArDrive web app unless you click on a file to view its history.')],1),e._v(" "),t("p",[e._v('Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.')]),e._v(" "),t("p",[e._v("The old version of the dApp will always be available to anyone who has the correct TX ID")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/31.1aee18a8.js b/assets/js/31.f642d679.js similarity index 97% rename from assets/js/31.1aee18a8.js rename to assets/js/31.f642d679.js index fbeb532..82b7a37 100644 --- a/assets/js/31.1aee18a8.js +++ b/assets/js/31.f642d679.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{326:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[e._v("#")]),e._v(" Examples")]),e._v(" "),t("p",[e._v("Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.")]),e._v(" "),t("h2",{attrs:{id:"basic-html"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#basic-html"}},[e._v("#")]),e._v(" Basic HTML")]),e._v(" "),t("p",[e._v("A basic HTML website with a javascript script to facilitate hash routing:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50",target:"_blank",rel:"noopener noreferrer"}},[e._v("GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"react"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#react"}},[e._v("#")]),e._v(" React")]),e._v(" "),t("p",[e._v("A React dApp created using Create-React-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0",target:"_blank",rel:"noopener noreferrer"}},[e._v("BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"next"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next"}},[e._v("#")]),e._v(" Next")]),e._v(" "),t("p",[e._v("A Nextjs dApp created using Create-Next-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s",target:"_blank",rel:"noopener noreferrer"}},[e._v("01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU",target:"_blank",rel:"noopener noreferrer"}},[e._v("ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[31],{327:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"examples"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#examples"}},[e._v("#")]),e._v(" Examples")]),e._v(" "),t("p",[e._v("Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.")]),e._v(" "),t("h2",{attrs:{id:"basic-html"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#basic-html"}},[e._v("#")]),e._v(" Basic HTML")]),e._v(" "),t("p",[e._v("A basic HTML website with a javascript script to facilitate hash routing:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50",target:"_blank",rel:"noopener noreferrer"}},[e._v("GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"react"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#react"}},[e._v("#")]),e._v(" React")]),e._v(" "),t("p",[e._v("A React dApp created using Create-React-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0",target:"_blank",rel:"noopener noreferrer"}},[e._v("BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"next"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#next"}},[e._v("#")]),e._v(" Next")]),e._v(" "),t("p",[e._v("A Nextjs dApp created using Create-Next-App:")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s",target:"_blank",rel:"noopener noreferrer"}},[e._v("01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://arweave.net/ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU",target:"_blank",rel:"noopener noreferrer"}},[e._v("ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/32.86c23a62.js b/assets/js/32.00467e0b.js similarity index 98% rename from assets/js/32.86c23a62.js rename to assets/js/32.00467e0b.js index a81cdcb..544051c 100644 --- a/assets/js/32.86c23a62.js +++ b/assets/js/32.00467e0b.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{327:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-paths"}},[e._v("#")]),e._v(" File Paths")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.")]),e._v(" "),t("h2",{attrs:{id:"absolute-vs-relative"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#absolute-vs-relative"}},[e._v("#")]),e._v(" Absolute Vs. Relative")]),e._v(" "),t("p",[e._v("An absolute path is the full URL to a resource, starting from the root. For example, "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" is an absolute path. It points directly to the image no matter where the code referencing it is located.")]),e._v(" "),t("p",[e._v("A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path "),t("code",[e._v("images/myImage.jpg")]),e._v(" to reference the image.")]),e._v(" "),t("h2",{attrs:{id:"why-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-relative-paths"}},[e._v("#")]),e._v(" Why Relative Paths")]),e._v(" "),t("p",[e._v("When deploying dApps on Arweave, relative paths are essential because:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Domain agnostic")]),e._v(": Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.")]),e._v(" "),t("li",[t("strong",[e._v("Decentralized")]),e._v(": Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.")])]),e._v(" "),t("h2",{attrs:{id:"identifying-relative-and-absolute-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#identifying-relative-and-absolute-paths"}},[e._v("#")]),e._v(" Identifying Relative and Absolute Paths")]),e._v(" "),t("p",[e._v("The key difference between relative and absolute file paths is where they start from:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Absolute Paths")]),e._v(" start with a slash (/) or a full URL (including the protocol, such as "),t("code",[e._v("http://")]),e._v("). For example, "),t("code",[e._v("/images/myImage.jpg")]),e._v(" or "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" are absolute paths.")]),e._v(" "),t("li",[t("strong",[e._v("Relative Paths")]),e._v(" do not start with a slash. They are relative to the current directory. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" or "),t("code",[e._v("../myImage.jpg")]),e._v(" are relative paths.")])]),e._v(" "),t("h2",{attrs:{id:"navigating-with-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#navigating-with-relative-paths"}},[e._v("#")]),e._v(" Navigating with Relative Paths")]),e._v(" "),t("p",[e._v("You can navigate around the files of your project with relative paths by following these principles:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Same Directory")]),e._v(": If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if "),t("code",[e._v("index.html")]),e._v(" and "),t("code",[e._v("about.html")]),e._v(" are in the same directory, you can link to "),t("code",[e._v("about.html")]),e._v(" just using "),t("code",[e._v("about.html")]),e._v(".")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Subdirectory")]),e._v(": If the file is in a subdirectory, you can use the directory name followed by the filename. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" will point to the "),t("code",[e._v("myImage.jpg")]),e._v(" file in the "),t("code",[e._v("images")]),e._v(" subdirectory.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Parent Directory")]),e._v(": If the file is in a parent directory, you can use "),t("code",[e._v("../")]),e._v(" to go up one level. For example, "),t("code",[e._v("../index.html")]),e._v(" will point to "),t("code",[e._v("index.html")]),e._v(" in the parent directory. You can use multiple "),t("code",[e._v("../")]),e._v(" to go up multiple levels, like "),t("code",[e._v("../../index.html")]),e._v(".")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[32],{326:function(e,t,a){"use strict";a.r(t);var i=a(10),r=Object(i.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"file-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#file-paths"}},[e._v("#")]),e._v(" File Paths")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.")]),e._v(" "),t("h2",{attrs:{id:"absolute-vs-relative"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#absolute-vs-relative"}},[e._v("#")]),e._v(" Absolute Vs. Relative")]),e._v(" "),t("p",[e._v("An absolute path is the full URL to a resource, starting from the root. For example, "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" is an absolute path. It points directly to the image no matter where the code referencing it is located.")]),e._v(" "),t("p",[e._v("A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path "),t("code",[e._v("images/myImage.jpg")]),e._v(" to reference the image.")]),e._v(" "),t("h2",{attrs:{id:"why-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-relative-paths"}},[e._v("#")]),e._v(" Why Relative Paths")]),e._v(" "),t("p",[e._v("When deploying dApps on Arweave, relative paths are essential because:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Domain agnostic")]),e._v(": Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.")]),e._v(" "),t("li",[t("strong",[e._v("Decentralized")]),e._v(": Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.")])]),e._v(" "),t("h2",{attrs:{id:"identifying-relative-and-absolute-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#identifying-relative-and-absolute-paths"}},[e._v("#")]),e._v(" Identifying Relative and Absolute Paths")]),e._v(" "),t("p",[e._v("The key difference between relative and absolute file paths is where they start from:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Absolute Paths")]),e._v(" start with a slash (/) or a full URL (including the protocol, such as "),t("code",[e._v("http://")]),e._v("). For example, "),t("code",[e._v("/images/myImage.jpg")]),e._v(" or "),t("code",[e._v("http://www.example.com/images/myImage.jpg")]),e._v(" are absolute paths.")]),e._v(" "),t("li",[t("strong",[e._v("Relative Paths")]),e._v(" do not start with a slash. They are relative to the current directory. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" or "),t("code",[e._v("../myImage.jpg")]),e._v(" are relative paths.")])]),e._v(" "),t("h2",{attrs:{id:"navigating-with-relative-paths"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#navigating-with-relative-paths"}},[e._v("#")]),e._v(" Navigating with Relative Paths")]),e._v(" "),t("p",[e._v("You can navigate around the files of your project with relative paths by following these principles:")]),e._v(" "),t("ul",[t("li",[t("p",[t("strong",[e._v("Same Directory")]),e._v(": If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if "),t("code",[e._v("index.html")]),e._v(" and "),t("code",[e._v("about.html")]),e._v(" are in the same directory, you can link to "),t("code",[e._v("about.html")]),e._v(" just using "),t("code",[e._v("about.html")]),e._v(".")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Subdirectory")]),e._v(": If the file is in a subdirectory, you can use the directory name followed by the filename. For example, "),t("code",[e._v("images/myImage.jpg")]),e._v(" will point to the "),t("code",[e._v("myImage.jpg")]),e._v(" file in the "),t("code",[e._v("images")]),e._v(" subdirectory.")])]),e._v(" "),t("li",[t("p",[t("strong",[e._v("Parent Directory")]),e._v(": If the file is in a parent directory, you can use "),t("code",[e._v("../")]),e._v(" to go up one level. For example, "),t("code",[e._v("../index.html")]),e._v(" will point to "),t("code",[e._v("index.html")]),e._v(" in the parent directory. You can use multiple "),t("code",[e._v("../")]),e._v(" to go up multiple levels, like "),t("code",[e._v("../../index.html")]),e._v(".")])])])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/33.daad6256.js b/assets/js/33.58d20ff8.js similarity index 95% rename from assets/js/33.daad6256.js rename to assets/js/33.58d20ff8.js index 4db2ca7..c4a34f2 100644 --- a/assets/js/33.daad6256.js +++ b/assets/js/33.58d20ff8.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{335:function(e,t,r){"use strict";r.r(t);var o=r(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"preparing-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preparing-your-dapp"}},[e._v("#")]),e._v(" Preparing Your dApp")]),e._v(" "),t("p",[e._v("To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:")]),e._v(" "),t("ul",[t("li",[e._v("Your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/routing.html"}},[e._v("hash routing")])],1),e._v(" "),t("li",[e._v("All internal links in your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/paths.html"}},[e._v("relative file paths")]),e._v(".")],1)]),e._v(" "),t("p",[e._v("Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{328:function(e,t,r){"use strict";r.r(t);var o=r(10),n=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"preparing-your-dapp"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#preparing-your-dapp"}},[e._v("#")]),e._v(" Preparing Your dApp")]),e._v(" "),t("p",[e._v("To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:")]),e._v(" "),t("ul",[t("li",[e._v("Your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/routing.html"}},[e._v("hash routing")])],1),e._v(" "),t("li",[e._v("All internal links in your dApp must use "),t("RouterLink",{attrs:{to:"/docs/misc/deploy/paths.html"}},[e._v("relative file paths")]),e._v(".")],1)]),e._v(" "),t("p",[e._v("Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.")])])}),[],!1,null,null,null);t.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/34.317b309f.js b/assets/js/34.eed76ce4.js similarity index 97% rename from assets/js/34.317b309f.js rename to assets/js/34.eed76ce4.js index a4431be..0efbdd2 100644 --- a/assets/js/34.317b309f.js +++ b/assets/js/34.eed76ce4.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{328:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"hash-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing"}},[e._v("#")]),e._v(" Hash Routing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v('Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.')]),e._v(" "),t("p",[e._v('For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.')]),e._v(" "),t("h2",{attrs:{id:"hash-routing-vs-history-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing-vs-history-routing"}},[e._v("#")]),e._v(" Hash Routing Vs. History Routing")]),e._v(" "),t("p",[e._v('Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.')]),e._v(" "),t("p",[e._v("In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.")]),e._v(" "),t("h2",{attrs:{id:"why-hash-routing-for-dapps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-hash-routing-for-dapps"}},[e._v("#")]),e._v(" Why Hash Routing for dApps")]),e._v(" "),t("p",[e._v("Hash routing is particularly useful for apps deployed on Arweave for several reasons:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Serverless")]),e._v(": Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.")]),e._v(" "),t("li",[t("strong",[e._v("Persistence")]),e._v(': Once data is stored on Arweave, it can\'t be changed. Hash routing allows you to have "dynamic" content within this immutable structure.')]),e._v(" "),t("li",[t("strong",[e._v("Performance")]),e._v(": With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{329:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"hash-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing"}},[e._v("#")]),e._v(" Hash Routing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v('Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.')]),e._v(" "),t("p",[e._v('For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app\'s "about" page.')]),e._v(" "),t("h2",{attrs:{id:"hash-routing-vs-history-routing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#hash-routing-vs-history-routing"}},[e._v("#")]),e._v(" Hash Routing Vs. History Routing")]),e._v(" "),t("p",[e._v('Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app\'s server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.')]),e._v(" "),t("p",[e._v("In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.")]),e._v(" "),t("h2",{attrs:{id:"why-hash-routing-for-dapps"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#why-hash-routing-for-dapps"}},[e._v("#")]),e._v(" Why Hash Routing for dApps")]),e._v(" "),t("p",[e._v("Hash routing is particularly useful for apps deployed on Arweave for several reasons:")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("Serverless")]),e._v(": Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.")]),e._v(" "),t("li",[t("strong",[e._v("Persistence")]),e._v(': Once data is stored on Arweave, it can\'t be changed. Hash routing allows you to have "dynamic" content within this immutable structure.')]),e._v(" "),t("li",[t("strong",[e._v("Performance")]),e._v(": With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.")])])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/35.545d22f7.js b/assets/js/35.feadd28a.js similarity index 98% rename from assets/js/35.545d22f7.js rename to assets/js/35.feadd28a.js index cee23a7..a9f299b 100644 --- a/assets/js/35.545d22f7.js +++ b/assets/js/35.feadd28a.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{330:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ethareum"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ethareum"}},[e._v("#")]),e._v(" EthAReum")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like "),t("a",{attrs:{href:"https://metamask.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("MetaMask"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and "),t("RouterLink",{attrs:{to:"/docs/turbo/what-is-turbo.html"}},[e._v("Turbo Credits")]),e._v(", and uploading data to the Arweave network.")],1),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Recommended Browser")]),e._v(" "),t("p",[e._v("For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.")])]),e._v(" "),t("h2",{attrs:{id:"password"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#password"}},[e._v("#")]),e._v(" Password")]),e._v(" "),t("p",[e._v("The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.")]),e._v(" "),t("p",[e._v("For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": The password used during the derivation of private keys is permanent and "),t("em",[t("strong",[e._v("CAN NOT")])]),e._v(" be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.")]),e._v(" "),t("h2",{attrs:{id:"public-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-address"}},[e._v("#")]),e._v(" Public Address")]),e._v(" "),t("p",[e._v("The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.")]),e._v(" "),t("p",[e._v("The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"keyfile-and-seed-phrase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#keyfile-and-seed-phrase"}},[e._v("#")]),e._v(" Keyfile and Seed Phrase")]),e._v(" "),t("p",[e._v("The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.")]),e._v(" "),t("p",[e._v("A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the "),t("a",{attrs:{href:"https://cookbook.arweave.dev/concepts/keyfiles-and-wallets.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Cookbook"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"security"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security"}},[e._v("#")]),e._v(" Security")]),e._v(" "),t("p",[e._v("EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.")]),e._v(" "),t("p",[e._v("However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like "),t("a",{attrs:{href:"https://app.ardrive.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive"),t("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[35],{334:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ethareum"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ethareum"}},[e._v("#")]),e._v(" EthAReum")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like "),t("a",{attrs:{href:"https://metamask.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("MetaMask"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and "),t("RouterLink",{attrs:{to:"/docs/turbo/what-is-turbo.html"}},[e._v("Turbo Credits")]),e._v(", and uploading data to the Arweave network.")],1),e._v(" "),t("div",{staticClass:"custom-block tip"},[t("p",{staticClass:"custom-block-title"},[e._v("Recommended Browser")]),e._v(" "),t("p",[e._v("For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.")])]),e._v(" "),t("h2",{attrs:{id:"password"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#password"}},[e._v("#")]),e._v(" Password")]),e._v(" "),t("p",[e._v("The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.")]),e._v(" "),t("p",[e._v("For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.")]),e._v(" "),t("p",[t("strong",[e._v("NOTE")]),e._v(": The password used during the derivation of private keys is permanent and "),t("em",[t("strong",[e._v("CAN NOT")])]),e._v(" be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.")]),e._v(" "),t("h2",{attrs:{id:"public-address"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#public-address"}},[e._v("#")]),e._v(" Public Address")]),e._v(" "),t("p",[e._v("The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.")]),e._v(" "),t("p",[e._v("The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"keyfile-and-seed-phrase"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#keyfile-and-seed-phrase"}},[e._v("#")]),e._v(" Keyfile and Seed Phrase")]),e._v(" "),t("p",[e._v("The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.")]),e._v(" "),t("p",[e._v("A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the "),t("a",{attrs:{href:"https://cookbook.arweave.dev/concepts/keyfiles-and-wallets.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave Cookbook"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("p",[e._v("Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.")]),e._v(" "),t("h2",{attrs:{id:"security"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#security"}},[e._v("#")]),e._v(" Security")]),e._v(" "),t("p",[e._v("EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.")]),e._v(" "),t("p",[e._v("However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like "),t("a",{attrs:{href:"https://app.ardrive.io/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive"),t("OutboundLink")],1),e._v(".")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/36.2eec7b3b.js b/assets/js/36.b317fdae.js similarity index 99% rename from assets/js/36.2eec7b3b.js rename to assets/js/36.b317fdae.js index eb98498..712719d 100644 --- a/assets/js/36.2eec7b3b.js +++ b/assets/js/36.b317fdae.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{329:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"how-to-save-a-website-permanently"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-save-a-website-permanently"}},[e._v("#")]),e._v(" How to Save a Website Permanently")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("ArDrive offers the ability to save working copies of static websites permanently on "),t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v(". This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.")]),e._v(" "),t("p",[e._v("Resources like the "),t("a",{attrs:{href:"https://archive.org/web/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wayback Machine"),t("OutboundLink")],1),e._v(" are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.")]),e._v(" "),t("p",[e._v("The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the "),t("RouterLink",{attrs:{to:"/docs/cli/intro.html"}},[e._v("ArDrive CLI")]),e._v(".")],1),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_1-download-static-site-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-static-site-files"}},[e._v("#")]),e._v(" 1. Download Static Site Files")]),e._v(" "),t("p",[e._v("ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:")]),e._v(" "),t("ul",[t("li",[e._v("Permanent sites will not enable backend interaction with your website’s CMS,")]),e._v(" "),t("li",[e._v("nor allow you to make further changes to the content of your site,")]),e._v(" "),t("li",[e._v("nor support dynamic functionality like contact forms and eCommerce.")])]),e._v(" "),t("p",[e._v("To generate your static site files, we recommend:")]),e._v(" "),t("h3",{attrs:{id:"windows-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#windows-users"}},[e._v("#")]),e._v(" Windows Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.cyotek.com/cyotek-webcopy",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebCopy"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://www.httrack.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("HtTrack"),t("OutboundLink")],1),e._v(" enable Windows users to download static copies of entire websites.")]),e._v(" "),t("h3",{attrs:{id:"mac-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mac-users"}},[e._v("#")]),e._v(" Mac Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://apps.apple.com/us/app/offline-pages-pro/id391462107",target:"_blank",rel:"noopener noreferrer"}},[e._v("Offline Pages Pro"),t("OutboundLink")],1),e._v(" (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files."),t("br"),e._v(" "),t("a",{attrs:{href:"https://ricks-apps.com/osx/sitesucker/index.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("SiteSucker"),t("OutboundLink")],1),e._v(" is another option for Mac users.")]),e._v(" "),t("h3",{attrs:{id:"command-line-utility"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#command-line-utility"}},[e._v("#")]),e._v(" Command Line Utility")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.gnu.org/software/wget/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wget"),t("OutboundLink")],1),e._v(" is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.")]),e._v(" "),t("h3",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://wordpress.org/plugins/simply-static/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Simply Static"),t("OutboundLink")],1),e._v(" is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.")]),e._v(" "),t("h2",{attrs:{id:"_2-create-an-account-on-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-an-account-on-ardrive"}},[e._v("#")]),e._v(" 2. Create an Account on ArDrive")]),e._v(" "),t("p",[e._v("Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.")]),e._v(" "),t("h2",{attrs:{id:"_3-create-a-new-public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-create-a-new-public-drive"}},[e._v("#")]),e._v(" 3. Create a New Public Drive")]),e._v(" "),t("p",[e._v("Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.")]),e._v(" "),t("h2",{attrs:{id:"_4-top-up"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-top-up"}},[e._v("#")]),e._v(" 4. Top Up")]),e._v(" "),t("p",[e._v("To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("See current prices"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_5-upload-static-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-upload-static-files"}},[e._v("#")]),e._v(" 5. Upload Static Files")]),e._v(" "),t("p",[e._v("Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is "),t("em",[e._v("separate")]),e._v(" from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.")]),e._v(" "),t("h2",{attrs:{id:"_6-wait"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-wait"}},[e._v("#")]),e._v(" 6. Wait")]),e._v(" "),t("p",[e._v("Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.")]),e._v(" "),t("p",[e._v("To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)")]),e._v(" "),t("h2",{attrs:{id:"_7-create-a-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-create-a-manifest"}},[e._v("#")]),e._v(" 7. Create a Manifest")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io/manifests/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Manifests"),t("OutboundLink")],1),e._v(" are specialΒ "),t("code",[e._v(".json")]),e._v("Β files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.")]),e._v(" "),t("p",[e._v("Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.")]),e._v(" "),t("p",[e._v("Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.")]),e._v(" "),t("h2",{attrs:{id:"_8-wait-again"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_8-wait-again"}},[e._v("#")]),e._v(" 8. Wait Again")]),e._v(" "),t("p",[e._v("Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.")]),e._v(" "),t("p",[e._v("After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.")]),e._v(" "),t("h2",{attrs:{id:"_9-preview-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_9-preview-the-manifest"}},[e._v("#")]),e._v(" 9. Preview the Manifest")]),e._v(" "),t("p",[e._v("Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.")]),e._v(" "),t("p",[e._v("If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!")]),e._v(" "),t("p",[e._v("Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).")]),e._v(" "),t("h2",{attrs:{id:"_10-add-a-redirect-or-domain-masking"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_10-add-a-redirect-or-domain-masking"}},[e._v("#")]),e._v(" 10. Add a Redirect or Domain Masking")]),e._v(" "),t("p",[e._v("You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.")]),e._v(" "),t("p",[e._v("Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an "),t("a",{attrs:{href:"https://ar.io/docs/arns/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArNS name"),t("OutboundLink")],1),e._v(" that enables you to create a custom, permanent name for your permasite.")]),e._v(" "),t("h2",{attrs:{id:"notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notes"}},[e._v("#")]),e._v(" Notes")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.")])]),e._v(" "),t("li",[t("p",[e._v("Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the "),t("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive CLI"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.")])]),e._v(" "),t("li",[t("p",[e._v("Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.")])])]),e._v(" "),t("h2",{attrs:{id:"other-use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-use-cases"}},[e._v("#")]),e._v(" Other Use Cases")]),e._v(" "),t("p",[e._v("Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.")]),e._v(" "),t("p",[e._v("Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.")]),e._v(" "),t("h2",{attrs:{id:"example"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[36],{333:function(e,t,a){"use strict";a.r(t);var r=a(10),s=Object(r.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"how-to-save-a-website-permanently"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-to-save-a-website-permanently"}},[e._v("#")]),e._v(" How to Save a Website Permanently")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("ArDrive offers the ability to save working copies of static websites permanently on "),t("a",{attrs:{href:"https://www.arweave.org/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Arweave"),t("OutboundLink")],1),e._v(". This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.")]),e._v(" "),t("p",[e._v("Resources like the "),t("a",{attrs:{href:"https://archive.org/web/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wayback Machine"),t("OutboundLink")],1),e._v(" are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.")]),e._v(" "),t("p",[e._v("The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the "),t("RouterLink",{attrs:{to:"/docs/cli/intro.html"}},[e._v("ArDrive CLI")]),e._v(".")],1),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_1-download-static-site-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-download-static-site-files"}},[e._v("#")]),e._v(" 1. Download Static Site Files")]),e._v(" "),t("p",[e._v("ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:")]),e._v(" "),t("ul",[t("li",[e._v("Permanent sites will not enable backend interaction with your website’s CMS,")]),e._v(" "),t("li",[e._v("nor allow you to make further changes to the content of your site,")]),e._v(" "),t("li",[e._v("nor support dynamic functionality like contact forms and eCommerce.")])]),e._v(" "),t("p",[e._v("To generate your static site files, we recommend:")]),e._v(" "),t("h3",{attrs:{id:"windows-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#windows-users"}},[e._v("#")]),e._v(" Windows Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.cyotek.com/cyotek-webcopy",target:"_blank",rel:"noopener noreferrer"}},[e._v("WebCopy"),t("OutboundLink")],1),e._v(" and "),t("a",{attrs:{href:"https://www.httrack.com/",target:"_blank",rel:"noopener noreferrer"}},[e._v("HtTrack"),t("OutboundLink")],1),e._v(" enable Windows users to download static copies of entire websites.")]),e._v(" "),t("h3",{attrs:{id:"mac-users"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#mac-users"}},[e._v("#")]),e._v(" Mac Users")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://apps.apple.com/us/app/offline-pages-pro/id391462107",target:"_blank",rel:"noopener noreferrer"}},[e._v("Offline Pages Pro"),t("OutboundLink")],1),e._v(" (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files."),t("br"),e._v(" "),t("a",{attrs:{href:"https://ricks-apps.com/osx/sitesucker/index.html",target:"_blank",rel:"noopener noreferrer"}},[e._v("SiteSucker"),t("OutboundLink")],1),e._v(" is another option for Mac users.")]),e._v(" "),t("h3",{attrs:{id:"command-line-utility"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#command-line-utility"}},[e._v("#")]),e._v(" Command Line Utility")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://www.gnu.org/software/wget/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Wget"),t("OutboundLink")],1),e._v(" is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.")]),e._v(" "),t("h3",{attrs:{id:"wordpress"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#wordpress"}},[e._v("#")]),e._v(" WordPress")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://wordpress.org/plugins/simply-static/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Simply Static"),t("OutboundLink")],1),e._v(" is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.")]),e._v(" "),t("h2",{attrs:{id:"_2-create-an-account-on-ardrive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_2-create-an-account-on-ardrive"}},[e._v("#")]),e._v(" 2. Create an Account on ArDrive")]),e._v(" "),t("p",[e._v("Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.")]),e._v(" "),t("h2",{attrs:{id:"_3-create-a-new-public-drive"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_3-create-a-new-public-drive"}},[e._v("#")]),e._v(" 3. Create a New Public Drive")]),e._v(" "),t("p",[e._v("Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.")]),e._v(" "),t("h2",{attrs:{id:"_4-top-up"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_4-top-up"}},[e._v("#")]),e._v(" 4. Top Up")]),e._v(" "),t("p",[e._v("To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("See current prices"),t("OutboundLink")],1)]),e._v(" "),t("h2",{attrs:{id:"_5-upload-static-files"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_5-upload-static-files"}},[e._v("#")]),e._v(" 5. Upload Static Files")]),e._v(" "),t("p",[e._v("Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is "),t("em",[e._v("separate")]),e._v(" from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.")]),e._v(" "),t("h2",{attrs:{id:"_6-wait"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_6-wait"}},[e._v("#")]),e._v(" 6. Wait")]),e._v(" "),t("p",[e._v("Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.")]),e._v(" "),t("p",[e._v("To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)")]),e._v(" "),t("h2",{attrs:{id:"_7-create-a-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_7-create-a-manifest"}},[e._v("#")]),e._v(" 7. Create a Manifest")]),e._v(" "),t("p",[t("a",{attrs:{href:"https://ardrive.io/manifests/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Manifests"),t("OutboundLink")],1),e._v(" are specialΒ "),t("code",[e._v(".json")]),e._v("Β files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.")]),e._v(" "),t("p",[e._v("Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.")]),e._v(" "),t("p",[e._v("Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.")]),e._v(" "),t("h2",{attrs:{id:"_8-wait-again"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_8-wait-again"}},[e._v("#")]),e._v(" 8. Wait Again")]),e._v(" "),t("p",[e._v("Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.")]),e._v(" "),t("p",[e._v("After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.")]),e._v(" "),t("h2",{attrs:{id:"_9-preview-the-manifest"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_9-preview-the-manifest"}},[e._v("#")]),e._v(" 9. Preview the Manifest")]),e._v(" "),t("p",[e._v("Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.")]),e._v(" "),t("p",[e._v("If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!")]),e._v(" "),t("p",[e._v("Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).")]),e._v(" "),t("h2",{attrs:{id:"_10-add-a-redirect-or-domain-masking"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_10-add-a-redirect-or-domain-masking"}},[e._v("#")]),e._v(" 10. Add a Redirect or Domain Masking")]),e._v(" "),t("p",[e._v("You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.")]),e._v(" "),t("p",[e._v("Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an "),t("a",{attrs:{href:"https://ar.io/docs/arns/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArNS name"),t("OutboundLink")],1),e._v(" that enables you to create a custom, permanent name for your permasite.")]),e._v(" "),t("h2",{attrs:{id:"notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#notes"}},[e._v("#")]),e._v(" Notes")]),e._v(" "),t("ul",[t("li",[t("p",[e._v("There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.")])]),e._v(" "),t("li",[t("p",[e._v("Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the "),t("a",{attrs:{href:"https://app.ardrive.io",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive CLI"),t("OutboundLink")],1),e._v(".")])]),e._v(" "),t("li",[t("p",[e._v("Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.")])]),e._v(" "),t("li",[t("p",[e._v("Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.")])])]),e._v(" "),t("h2",{attrs:{id:"other-use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#other-use-cases"}},[e._v("#")]),e._v(" Other Use Cases")]),e._v(" "),t("p",[e._v("Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.")]),e._v(" "),t("p",[e._v("Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.")]),e._v(" "),t("h2",{attrs:{id:"example"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[e._v("#")]),e._v(" Example")]),e._v(" "),t("p",[e._v("You can view a permasite version of this information at "),t("a",{attrs:{href:"https://permasite.arweave.dev",target:"_blank",rel:"noopener noreferrer"}},[e._v("permasite.arweave.dev"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/37.77ab9219.js b/assets/js/37.aaed2390.js similarity index 99% rename from assets/js/37.77ab9219.js rename to assets/js/37.aaed2390.js index 5684bf2..f5d6b99 100644 --- a/assets/js/37.77ab9219.js +++ b/assets/js/37.aaed2390.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{332:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ardrive-price-calculator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ardrive-price-calculator"}},[e._v("#")]),e._v(" ArDrive Price Calculator")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive Price Calculator website"),t("OutboundLink")],1),e._v(" is open source, and its code can be viewed "),t("a",{attrs:{href:"https://github.com/ardriveapp/price-calculator",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("This website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to Arweave. You can spin up your own version by cloning the code from Github and following these steps.")]),e._v(" "),t("h2",{attrs:{id:"developer-setup"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#developer-setup"}},[e._v("#")]),e._v(" Developer Setup")]),e._v(" "),t("p",[e._v("Follow these steps to get the developer environment up and running:")]),e._v(" "),t("h3",{attrs:{id:"install-yarn-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-2"}},[e._v("#")]),e._v(" Install Yarn 2")]),e._v(" "),t("p",[e._v("The ArDrive Price Calculator uses Yarn 2, so install the latest version with the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(". In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew:")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("p",[e._v("We also use husky to manage the git commit hooks that help to improve the quality of our commits. Without installing husky, you risk committing non-compliant code to the repository.")]),e._v(" "),t("p",[e._v("Using husky triggers two pre-commit hooks. The first will run "),t("code",[e._v("lint-staged")]),e._v(" on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that TypeScript can compile the code. The second hook will test the codebase prior to committing, ensuring that all tests must pass.")]),e._v(" "),t("p",[e._v("To enable hooks locally, you will need to run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("h3",{attrs:{id:"nvm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm"}},[e._v("#")]),e._v(" NVM")]),e._v(" "),t("p",[e._v("This repository uses NVM and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the Node version to the current version used by "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[e._v("Note for Windows: "),t("strong",[e._v("We recommend using WSL")]),e._v(" for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[t("strong",[e._v("Every time you start a new terminal session or switch to this project from another NPM project")]),e._v(", you should set the correct version of Node by running: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions")]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"available-scripts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#available-scripts"}},[e._v("#")]),e._v(" Available Scripts")]),e._v(" "),t("h3",{attrs:{id:"yarn-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-start"}},[e._v("#")]),e._v(" yarn start")]),e._v(" "),t("p",[e._v("Runs the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.")]),e._v(" "),t("p",[e._v("The page will reload if you make edits.\nYou will also see any lint errors in the console.")]),e._v(" "),t("h3",{attrs:{id:"yarn-build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-build"}},[e._v("#")]),e._v(" yarn build")]),e._v(" "),t("p",[e._v("Builds a static copy of your site to the "),t("code",[e._v("build/")]),e._v(" folder.\nYour app is ready to be deployed!")]),e._v(" "),t("h3",{attrs:{id:"yarn-test"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-test"}},[e._v("#")]),e._v(" yarn test")]),e._v(" "),t("p",[e._v("Launches the application test runner.\nRun with the "),t("code",[e._v("--watch")]),e._v(" flag ("),t("code",[e._v("yarn test -- --watch")]),e._v(") to run in interactive watch mode.")]),e._v(" "),t("h3",{attrs:{id:"yarn-run-prod"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-run-prod"}},[e._v("#")]),e._v(" yarn run:prod")]),e._v(" "),t("p",[e._v("Builds a fresh snowpack production build to the "),t("code",[e._v("build/")]),e._v(" folder\nThen launches that copy with "),t("code",[e._v("http-server-spa")]),e._v(" for local testing\nThe build will be available for preview at: "),t("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://localhost:8080"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[37],{330:function(e,t,r){"use strict";r.r(t);var a=r(10),s=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"ardrive-price-calculator"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#ardrive-price-calculator"}},[e._v("#")]),e._v(" ArDrive Price Calculator")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The "),t("a",{attrs:{href:"https://ardrive.io/pricing/",target:"_blank",rel:"noopener noreferrer"}},[e._v("ArDrive Price Calculator website"),t("OutboundLink")],1),e._v(" is open source, and its code can be viewed "),t("a",{attrs:{href:"https://github.com/ardriveapp/price-calculator",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("This website is intended to calculate the cost, in a wide variety of denominations and cryptocurrencies, of uploading data to Arweave. You can spin up your own version by cloning the code from Github and following these steps.")]),e._v(" "),t("h2",{attrs:{id:"developer-setup"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#developer-setup"}},[e._v("#")]),e._v(" Developer Setup")]),e._v(" "),t("p",[e._v("Follow these steps to get the developer environment up and running:")]),e._v(" "),t("h3",{attrs:{id:"install-yarn-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#install-yarn-2"}},[e._v("#")]),e._v(" Install Yarn 2")]),e._v(" "),t("p",[e._v("The ArDrive Price Calculator uses Yarn 2, so install the latest version with the "),t("a",{attrs:{href:"https://yarnpkg.com/getting-started/install",target:"_blank",rel:"noopener noreferrer"}},[e._v("yarn installation instructions"),t("OutboundLink")],1),e._v(". In most cases:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Brew:")]),e._v("\nbrew "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n\n"),t("span",{pre:!0,attrs:{class:"token comment"}},[e._v("# Or with NPM:")]),e._v("\n"),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("npm")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token parameter variable"}},[e._v("-g")]),e._v(" "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v("\n")])])]),t("p",[e._v("We also use husky to manage the git commit hooks that help to improve the quality of our commits. Without installing husky, you risk committing non-compliant code to the repository.")]),e._v(" "),t("p",[e._v("Using husky triggers two pre-commit hooks. The first will run "),t("code",[e._v("lint-staged")]),e._v(" on each staged file, which includes running prettier to format, eslint for linting, and also tsc-files for quickly checking that TypeScript can compile the code. The second hook will test the codebase prior to committing, ensuring that all tests must pass.")]),e._v(" "),t("p",[e._v("To enable hooks locally, you will need to run:")]),e._v(" "),t("div",{staticClass:"language-shell extra-class"},[t("pre",{pre:!0,attrs:{class:"language-shell"}},[t("code",[t("span",{pre:!0,attrs:{class:"token function"}},[e._v("yarn")]),e._v(" husky "),t("span",{pre:!0,attrs:{class:"token function"}},[e._v("install")]),e._v("\n")])])]),t("h3",{attrs:{id:"nvm"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#nvm"}},[e._v("#")]),e._v(" NVM")]),e._v(" "),t("p",[e._v("This repository uses NVM and an "),t("code",[e._v(".nvmrc")]),e._v(" file to lock the Node version to the current version used by "),t("code",[e._v("ardrive-core-js")]),e._v(".")]),e._v(" "),t("p",[e._v("Note for Windows: "),t("strong",[e._v("We recommend using WSL")]),e._v(" for setting up NVM on Windows using the "),t("a",{attrs:{href:"https://code.visualstudio.com/docs/remote/wsl",target:"_blank",rel:"noopener noreferrer"}},[e._v("instructions described here"),t("OutboundLink")],1)]),e._v(" "),t("p",[e._v("Follow these steps to get NVM up and running on your system:")]),e._v(" "),t("ol",[t("li",[e._v("Install NVM using "),t("a",{attrs:{href:"https://github.com/nvm-sh/nvm#installing-and-updating",target:"_blank",rel:"noopener noreferrer"}},[e._v("these installation instructions"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("li",[e._v("Navigate to this project's root directory")]),e._v(" "),t("li",[e._v("Ensure that the correct version of Node is installed by performing: "),t("code",[e._v("nvm install")])]),e._v(" "),t("li",[t("strong",[e._v("Every time you start a new terminal session or switch to this project from another NPM project")]),e._v(", you should set the correct version of Node by running: "),t("code",[e._v("nvm use")])])]),e._v(" "),t("h3",{attrs:{id:"recommended-visual-studio-code-extensions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#recommended-visual-studio-code-extensions"}},[e._v("#")]),e._v(" Recommended Visual Studio Code extensions")]),e._v(" "),t("p",[e._v("To ensure your environment is compatible, we also recommend the following VSCode extensions:")]),e._v(" "),t("ul",[t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint",target:"_blank",rel:"noopener noreferrer"}},[e._v("ES-Lint"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=EditorConfig.EditorConfig",target:"_blank",rel:"noopener noreferrer"}},[e._v("Editor-Config"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode",target:"_blank",rel:"noopener noreferrer"}},[e._v("Prettier"),t("OutboundLink")],1)]),e._v(" "),t("li",[t("a",{attrs:{href:"https://marketplace.visualstudio.com/items?itemName=arcanis.vscode-zipfs",target:"_blank",rel:"noopener noreferrer"}},[e._v("ZipFS"),t("OutboundLink")],1)])]),e._v(" "),t("h2",{attrs:{id:"available-scripts"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#available-scripts"}},[e._v("#")]),e._v(" Available Scripts")]),e._v(" "),t("h3",{attrs:{id:"yarn-start"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-start"}},[e._v("#")]),e._v(" yarn start")]),e._v(" "),t("p",[e._v("Runs the app in the development mode.\nOpen http://localhost:8080 to view it in the browser.")]),e._v(" "),t("p",[e._v("The page will reload if you make edits.\nYou will also see any lint errors in the console.")]),e._v(" "),t("h3",{attrs:{id:"yarn-build"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-build"}},[e._v("#")]),e._v(" yarn build")]),e._v(" "),t("p",[e._v("Builds a static copy of your site to the "),t("code",[e._v("build/")]),e._v(" folder.\nYour app is ready to be deployed!")]),e._v(" "),t("h3",{attrs:{id:"yarn-test"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-test"}},[e._v("#")]),e._v(" yarn test")]),e._v(" "),t("p",[e._v("Launches the application test runner.\nRun with the "),t("code",[e._v("--watch")]),e._v(" flag ("),t("code",[e._v("yarn test -- --watch")]),e._v(") to run in interactive watch mode.")]),e._v(" "),t("h3",{attrs:{id:"yarn-run-prod"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#yarn-run-prod"}},[e._v("#")]),e._v(" yarn run:prod")]),e._v(" "),t("p",[e._v("Builds a fresh snowpack production build to the "),t("code",[e._v("build/")]),e._v(" folder\nThen launches that copy with "),t("code",[e._v("http-server-spa")]),e._v(" for local testing\nThe build will be available for preview at: "),t("a",{attrs:{href:"http://localhost:8080",target:"_blank",rel:"noopener noreferrer"}},[e._v("http://localhost:8080"),t("OutboundLink")],1)])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/39.ac0f94d7.js b/assets/js/39.56ae0201.js similarity index 99% rename from assets/js/39.ac0f94d7.js rename to assets/js/39.56ae0201.js index e954487..06bcc3f 100644 --- a/assets/js/39.ac0f94d7.js +++ b/assets/js/39.56ae0201.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{333:function(n,a,e){"use strict";e.r(a);var t=e(10),r=Object(t.a)({},(function(){var n=this,a=n._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":n.$parent.slotKey}},[a("h1",{attrs:{id:"payment-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#payment-api"}},[n._v("#")]),n._v(" Payment API")]),n._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[n._v("#")]),n._v(" Overview")]),n._v(" "),a("p",[n._v('ArDrive offers several API endpoints to help manage and determine costs associated with converting currencies into Turbo credits. The below endpoints offer access to useful information that can help stay in control when uploading data to Arweave using Turbo. "winc" refers to "winston credits", the smallest denomination of a Turbo credit.')]),n._v(" "),a("p",[a("strong",[n._v("Note")]),n._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),a("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(", or view the raw json for that documentation "),a("a",{attrs:{href:"https://payment.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(".")]),n._v(" "),a("h2",{attrs:{id:"endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#endpoints"}},[n._v("#")]),n._v(" Endpoints")]),n._v(" "),a("p",[n._v("The host url for all below endpoints is:")]),n._v(" "),a("p",[a("code",[n._v("https://payment.ardrive.io/v1")])]),n._v(" "),a("p",[n._v("All of these endpoints use GET requests")]),n._v(" "),a("h3",{attrs:{id:"get-amount-of-credits-for-byte-count"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-amount-of-credits-for-byte-count"}},[n._v("#")]),n._v(" Get Amount of Credits for Byte Count")]),n._v(" "),a("p",[n._v("Returns the current amount of winc it will cost to upload a provided byte count worth of data.")]),n._v(" "),a("p",[a("code",[n._v("/price/bytes/{byteCount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("byteCount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/bytes/5242880\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-2514975546"\n }\n ]\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-winc-for-payment-type-and-amount"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-winc-for-payment-type-and-amount"}},[n._v("#")]),n._v(" Get winc for Payment Type and Amount")]),n._v(" "),a("p",[n._v("Returns the current amount of winc Turbo will quote for a given payment type and amount.")]),n._v(" "),a("p",[a("code",[n._v("/price/{type}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-2"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("type")]),n._v('*: string - must match a supported currency, such as "usd" - (path)')]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/usd/1000\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1365248226950"\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-current-balance-of-winc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-current-balance-of-winc"}},[n._v("#")]),n._v(" Get Current Balance of winc")]),n._v(" "),a("p",[n._v("use a signed request of a previously obtained JWT to get the signing wallet's current service balance in winc.")]),n._v(" "),a("p",[a("code",[n._v("/balance")])]),n._v(" "),a("h4",{attrs:{id:"parameters-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-3"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("x-signature")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-nonce")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-public-key")]),n._v("*: string - (header)")]),n._v(" "),a("h3",{attrs:{id:"get-quote-for-credits"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-quote-for-credits"}},[n._v("#")]),n._v(" Get Quote for Credits")]),n._v(" "),a("p",[n._v("Gets a quote and payment session for a given payment method, destination address, currency type, and payment amount")]),n._v(" "),a("p",[a("code",[n._v("/top-up/{method}/{address}/{currency}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-4"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("method")]),n._v("*: string - payment-intent | checkout-session - (path)")]),n._v(" "),a("p",[a("code",[n._v("address")]),n._v("*: string - public address of wallet - (path)")]),n._v(" "),a("p",[a("code",[n._v("currency")]),n._v("*: string - must match supported currency, such as usd - (path)")]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-3"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/top-up/checkout-session/cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q/usd/1000\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "topUpQuote": {\n "topUpQuoteId": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationAddressType": "arweave",\n "paymentAmount": 1000,\n "winstonCreditAmount": "1360424028269",\n "destinationAddress": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "currencyType": "usd",\n "quoteExpirationDate": "2023-07-27T01:56:26.436Z",\n "paymentProvider": "stripe"\n },\n "paymentSession": {\n "id": "cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-currencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-currencies"}},[n._v("#")]),n._v(" Get Supported Currencies")]),n._v(" "),a("p",[n._v("Returns a list of currency types supported by Turbo")]),n._v(" "),a("p",[a("code",[n._v("/currencies")])]),n._v(" "),a("h4",{attrs:{id:"parameters-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-5"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-4"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/currencies\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "supportedCurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "brl": {\n "maximumPaymentAmount": 5000000,\n "minimumPaymentAmount": 5000,\n "suggestedPaymentAmounts": [\n 12500,\n 25000,\n 50000\n ],\n "zeroDecimalCurrency": false\n },\n "cad": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1400,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "eur": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "gbp": {\n "maximumPaymentAmount": 770000,\n "minimumPaymentAmount": 780,\n "suggestedPaymentAmounts": [\n 2000,\n 4000,\n 8000\n ],\n "zeroDecimalCurrency": false\n },\n "hkd": {\n "maximumPaymentAmount": 7800000,\n "minimumPaymentAmount": 7900,\n "suggestedPaymentAmounts": [\n 20000,\n 40000,\n 80000\n ],\n "zeroDecimalCurrency": false\n },\n "inr": {\n "maximumPaymentAmount": 90000000,\n "minimumPaymentAmount": 83000,\n "suggestedPaymentAmounts": [\n 200000,\n 400000,\n 800000\n ],\n "zeroDecimalCurrency": false\n },\n "jpy": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 3500,\n 6500,\n 15000\n ],\n "zeroDecimalCurrency": true\n },\n "sgd": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "usd": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n }\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-countries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-countries"}},[n._v("#")]),n._v(" Get Supported Countries")]),n._v(" "),a("p",[n._v("Returns a list of countries where Turbo is available")]),n._v(" "),a("p",[a("code",[n._v("/countries")])]),n._v(" "),a("h4",{attrs:{id:"parameters-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-6"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-5"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/countries\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('[\n "United States",\n "United Kingdom",\n "Afghanistan",\n "Albania",\n "Algeria",\n "Andorra",\n "Angola",\n "Antigua and Barbuda",\n "Argentina",\n "Armenia",\n "Australia",\n "Austria",\n "Azerbaijan",\n "Bahamas",\n "Bahrain",\n "Bangladesh",\n "Barbados",\n "Belarus",\n "Belgium",\n "Belize",\n "Benin",\n "Bhutan",\n "Bolivia",\n "Bosnia and Herzegovina",\n "Botswana",\n "Brazil",\n "Brunei",\n "Bulgaria",\n "Burkina Faso",\n "Burundi",\n "Cabo Verde",\n "Cambodia",\n "Cameroon",\n "Canada",\n "Central African Republic",\n "Chad",\n "Chile",\n "China",\n "Colombia",\n "Comoros",\n "Congo",\n "Costa Rica",\n "Cote d\'Ivoire",\n "Croatia",\n "Cyprus",\n "Czech Republic",\n "Democratic Republic of the Congo",\n "Denmark",\n "Djibouti",\n "Dominica",\n "Dominican Republic",\n "East Timor",\n "Ecuador",\n "Egypt",\n "El Salvador",\n "Equatorial Guinea",\n "Eritrea",\n "Estonia",\n "Eswatini",\n "Ethiopia",\n "Fiji",\n "Finland",\n "France",\n "Gabon",\n "Gambia",\n "Georgia",\n "Germany",\n "Ghana",\n "Greece",\n "Grenada",\n "Guatemala",\n "Guinea",\n "Guinea-Bissau",\n "Guyana",\n "Haiti",\n "Honduras",\n "Hungary",\n "Iceland",\n "India",\n "Indonesia",\n "Iraq",\n "Ireland",\n "Israel",\n "Italy",\n "Jamaica",\n "Japan",\n "Jordan",\n "Kazakhstan",\n "Kenya",\n "Kiribati",\n "Kuwait",\n "Kyrgyzstan",\n "Laos",\n "Latvia",\n "Lebanon",\n "Lesotho",\n "Liberia",\n "Libya",\n "Liechtenstein",\n "Lithuania",\n "Luxembourg",\n "Madagascar",\n "Malawi",\n "Malaysia",\n "Maldives",\n "Mali",\n "Malta",\n "Marshall Islands",\n "Mauritania",\n "Mauritius",\n "Mexico",\n "Micronesia",\n "Moldova",\n "Monaco",\n "Mongolia",\n "Montenegro",\n "Morocco",\n "Mozambique",\n "Myanmar",\n "Namibia",\n "Nauru",\n "Nepal",\n "Netherlands",\n "New Zealand",\n "Nicaragua",\n "Niger",\n "Nigeria",\n "North Macedonia",\n "Norway",\n "Oman",\n "Pakistan",\n "Palau",\n "Palestine",\n "Panama",\n "Papua New Guinea",\n "Paraguay",\n "Peru",\n "Philippines",\n "Poland",\n "Portugal",\n "Qatar",\n "Romania",\n "Russia",\n "Rwanda",\n "Saint Kitts and Nevis",\n "Saint Lucia",\n "Saint Vincent and the Grenadines",\n "Samoa",\n "San Marino",\n "Sao Tome and Principe",\n "Saudi Arabia",\n "Senegal",\n "Serbia",\n "Seychelles",\n "Sierra Leone",\n "Singapore",\n "Slovakia",\n "Slovenia",\n "Solomon Islands",\n "Somalia",\n "South Africa",\n "South Korea",\n "South Sudan",\n "Spain",\n "Sri Lanka",\n "Sudan",\n "Suriname",\n "Sweden",\n "Switzerland",\n "Taiwan",\n "Tajikistan",\n "Tanzania",\n "Thailand",\n "Togo",\n "Tonga",\n "Trinidad and Tobago",\n "Tunisia",\n "Turkey",\n "Turkmenistan",\n "Tuvalu",\n "Uganda",\n "Ukraine",\n "United Arab Emirates",\n "Uruguay",\n "Uzbekistan",\n "Vanuatu",\n "Vatican City",\n "Venezuela",\n "Vietnam",\n "Yemen",\n "Zambia",\n "Zimbabwe"\n]\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-conversion-rates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-conversion-rates"}},[n._v("#")]),n._v(" Get Conversion Rates")]),n._v(" "),a("p",[n._v("Returns supported fiat conversion rates for 1GB of storage based on current market prices")]),n._v(" "),a("p",[a("code",[n._v("/rates")])]),n._v(" "),a("h4",{attrs:{id:"parameters-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-7"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-6"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/rates\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-514753369299"\n }\n ]\n}\n')])])])]),n._v(" "),a("p",[n._v("* required")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[39],{332:function(n,a,e){"use strict";e.r(a);var t=e(10),r=Object(t.a)({},(function(){var n=this,a=n._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":n.$parent.slotKey}},[a("h1",{attrs:{id:"payment-api"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#payment-api"}},[n._v("#")]),n._v(" Payment API")]),n._v(" "),a("h2",{attrs:{id:"overview"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[n._v("#")]),n._v(" Overview")]),n._v(" "),a("p",[n._v('ArDrive offers several API endpoints to help manage and determine costs associated with converting currencies into Turbo credits. The below endpoints offer access to useful information that can help stay in control when uploading data to Arweave using Turbo. "winc" refers to "winston credits", the smallest denomination of a Turbo credit.')]),n._v(" "),a("p",[a("strong",[n._v("Note")]),n._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),a("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(", or view the raw json for that documentation "),a("a",{attrs:{href:"https://payment.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[n._v("here"),a("OutboundLink")],1),n._v(".")]),n._v(" "),a("h2",{attrs:{id:"endpoints"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#endpoints"}},[n._v("#")]),n._v(" Endpoints")]),n._v(" "),a("p",[n._v("The host url for all below endpoints is:")]),n._v(" "),a("p",[a("code",[n._v("https://payment.ardrive.io/v1")])]),n._v(" "),a("p",[n._v("All of these endpoints use GET requests")]),n._v(" "),a("h3",{attrs:{id:"get-amount-of-credits-for-byte-count"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-amount-of-credits-for-byte-count"}},[n._v("#")]),n._v(" Get Amount of Credits for Byte Count")]),n._v(" "),a("p",[n._v("Returns the current amount of winc it will cost to upload a provided byte count worth of data.")]),n._v(" "),a("p",[a("code",[n._v("/price/bytes/{byteCount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("byteCount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/bytes/5242880\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1676650364",\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-2514975546"\n }\n ]\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-winc-for-payment-type-and-amount"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-winc-for-payment-type-and-amount"}},[n._v("#")]),n._v(" Get winc for Payment Type and Amount")]),n._v(" "),a("p",[n._v("Returns the current amount of winc Turbo will quote for a given payment type and amount.")]),n._v(" "),a("p",[a("code",[n._v("/price/{type}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-2"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("type")]),n._v('*: string - must match a supported currency, such as "usd" - (path)')]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-2"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-2"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/price/usd/1000\n")])])]),a("details",[a("summary",[n._v("Response Body (JSON)")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "1365248226950"\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-current-balance-of-winc"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-current-balance-of-winc"}},[n._v("#")]),n._v(" Get Current Balance of winc")]),n._v(" "),a("p",[n._v("use a signed request of a previously obtained JWT to get the signing wallet's current service balance in winc.")]),n._v(" "),a("p",[a("code",[n._v("/balance")])]),n._v(" "),a("h4",{attrs:{id:"parameters-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-3"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("x-signature")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-nonce")]),n._v("*: string - (header)")]),n._v(" "),a("p",[a("code",[n._v("x-public-key")]),n._v("*: string - (header)")]),n._v(" "),a("h3",{attrs:{id:"get-quote-for-credits"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-quote-for-credits"}},[n._v("#")]),n._v(" Get Quote for Credits")]),n._v(" "),a("p",[n._v("Gets a quote and payment session for a given payment method, destination address, currency type, and payment amount")]),n._v(" "),a("p",[a("code",[n._v("/top-up/{method}/{address}/{currency}/{amount}")])]),n._v(" "),a("h4",{attrs:{id:"parameters-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-4"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[a("code",[n._v("method")]),n._v("*: string - payment-intent | checkout-session - (path)")]),n._v(" "),a("p",[a("code",[n._v("address")]),n._v("*: string - public address of wallet - (path)")]),n._v(" "),a("p",[a("code",[n._v("currency")]),n._v("*: string - must match supported currency, such as usd - (path)")]),n._v(" "),a("p",[a("code",[n._v("amount")]),n._v("*: integer - amount of the currency to convert to winc, usd has a minimum transaction amount of 1000 ($10.00) - (path)")]),n._v(" "),a("h4",{attrs:{id:"example-3"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-3"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/top-up/checkout-session/cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q/usd/1000\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "topUpQuote": {\n "topUpQuoteId": "54f57b67-4fcf-47fb-85e6-85d4a8c96f25",\n "destinationAddressType": "arweave",\n "paymentAmount": 1000,\n "winstonCreditAmount": "1360424028269",\n "destinationAddress": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "currencyType": "usd",\n "quoteExpirationDate": "2023-07-27T01:56:26.436Z",\n "paymentProvider": "stripe"\n },\n "paymentSession": {\n "id": "cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51",\n "object": "checkout.session",\n "after_expiration": null,\n "allow_promotion_codes": null,\n "amount_subtotal": 1000,\n "amount_total": 1000,\n "automatic_tax": {\n "enabled": false,\n "status": null\n },\n "billing_address_collection": null,\n "cancel_url": "https://app.ardrive.io",\n "client_reference_id": null,\n "consent": null,\n "consent_collection": null,\n "created": 1690422686,\n "currency": "usd",\n "currency_conversion": null,\n "custom_fields": [],\n "custom_text": {\n "shipping_address": null,\n "submit": null\n },\n "customer": null,\n "customer_creation": "if_required",\n "customer_details": null,\n "customer_email": null,\n "expires_at": 1690509086,\n "invoice": null,\n "invoice_creation": {\n "enabled": false,\n "invoice_data": {\n "account_tax_ids": null,\n "custom_fields": null,\n "description": null,\n "footer": null,\n "metadata": {},\n "rendering_options": null\n }\n },\n "livemode": true,\n "locale": null,\n "metadata": {},\n "mode": "payment",\n "payment_intent": null,\n "payment_link": null,\n "payment_method_collection": "always",\n "payment_method_options": {},\n "payment_method_types": [\n "card"\n ],\n "payment_status": "unpaid",\n "phone_number_collection": {\n "enabled": false\n },\n "recovered_from": null,\n "setup_intent": null,\n "shipping_address_collection": null,\n "shipping_cost": null,\n "shipping_details": null,\n "shipping_options": [],\n "status": "open",\n "submit_type": null,\n "subscription": null,\n "success_url": "https://app.ardrive.io",\n "total_details": {\n "amount_discount": 0,\n "amount_shipping": 0,\n "amount_tax": 0\n },\n "url": "https://checkout.stripe.com/c/pay/cs_live_a1p47UpvijHGe7sI8AI1kScZdd5qKzdyaHUWRaeuFVvVvDHXeuck68Pf51#fidkdWxOYHwnPyd1blppbHNgWjA0T1BEcXJGPWR1VUpSbkFJSFR0S0M8dlV1Y2tgS1ZVa3JdPVxfPXw0Q0tBaTNzPDFtX0xyf2JDVlxpNzJnUkAxSmp2PUZJdHBwa1B2ck53TmZkQW1BSjNoNTU3XG88RGBObycpJ2N3amhWYHdzYHcnP3F3cGApJ2lkfGpwcVF8dWAnPyd2bGtiaWBabHFgaCcpJ2BrZGdpYFVpZGZgbWppYWB3dic%2FcXdwYHgl"\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-currencies"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-currencies"}},[n._v("#")]),n._v(" Get Supported Currencies")]),n._v(" "),a("p",[n._v("Returns a list of currency types supported by Turbo")]),n._v(" "),a("p",[a("code",[n._v("/currencies")])]),n._v(" "),a("h4",{attrs:{id:"parameters-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-5"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-4"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-4"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/currencies\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "supportedCurrencies": [\n "aud",\n "brl",\n "cad",\n "eur",\n "gbp",\n "hkd",\n "inr",\n "jpy",\n "sgd",\n "usd"\n ],\n "limits": {\n "aud": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "brl": {\n "maximumPaymentAmount": 5000000,\n "minimumPaymentAmount": 5000,\n "suggestedPaymentAmounts": [\n 12500,\n 25000,\n 50000\n ],\n "zeroDecimalCurrency": false\n },\n "cad": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1400,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "eur": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n },\n "gbp": {\n "maximumPaymentAmount": 770000,\n "minimumPaymentAmount": 780,\n "suggestedPaymentAmounts": [\n 2000,\n 4000,\n 8000\n ],\n "zeroDecimalCurrency": false\n },\n "hkd": {\n "maximumPaymentAmount": 7800000,\n "minimumPaymentAmount": 7900,\n "suggestedPaymentAmounts": [\n 20000,\n 40000,\n 80000\n ],\n "zeroDecimalCurrency": false\n },\n "inr": {\n "maximumPaymentAmount": 90000000,\n "minimumPaymentAmount": 83000,\n "suggestedPaymentAmounts": [\n 200000,\n 400000,\n 800000\n ],\n "zeroDecimalCurrency": false\n },\n "jpy": {\n "maximumPaymentAmount": 1500000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 3500,\n 6500,\n 15000\n ],\n "zeroDecimalCurrency": true\n },\n "sgd": {\n "maximumPaymentAmount": 1300000,\n "minimumPaymentAmount": 1500,\n "suggestedPaymentAmounts": [\n 2500,\n 7500,\n 15000\n ],\n "zeroDecimalCurrency": false\n },\n "usd": {\n "maximumPaymentAmount": 1000000,\n "minimumPaymentAmount": 1000,\n "suggestedPaymentAmounts": [\n 2500,\n 5000,\n 10000\n ],\n "zeroDecimalCurrency": false\n }\n }\n}\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-supported-countries"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-supported-countries"}},[n._v("#")]),n._v(" Get Supported Countries")]),n._v(" "),a("p",[n._v("Returns a list of countries where Turbo is available")]),n._v(" "),a("p",[a("code",[n._v("/countries")])]),n._v(" "),a("h4",{attrs:{id:"parameters-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-6"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-5"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-5"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/countries\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('[\n "United States",\n "United Kingdom",\n "Afghanistan",\n "Albania",\n "Algeria",\n "Andorra",\n "Angola",\n "Antigua and Barbuda",\n "Argentina",\n "Armenia",\n "Australia",\n "Austria",\n "Azerbaijan",\n "Bahamas",\n "Bahrain",\n "Bangladesh",\n "Barbados",\n "Belarus",\n "Belgium",\n "Belize",\n "Benin",\n "Bhutan",\n "Bolivia",\n "Bosnia and Herzegovina",\n "Botswana",\n "Brazil",\n "Brunei",\n "Bulgaria",\n "Burkina Faso",\n "Burundi",\n "Cabo Verde",\n "Cambodia",\n "Cameroon",\n "Canada",\n "Central African Republic",\n "Chad",\n "Chile",\n "China",\n "Colombia",\n "Comoros",\n "Congo",\n "Costa Rica",\n "Cote d\'Ivoire",\n "Croatia",\n "Cyprus",\n "Czech Republic",\n "Democratic Republic of the Congo",\n "Denmark",\n "Djibouti",\n "Dominica",\n "Dominican Republic",\n "East Timor",\n "Ecuador",\n "Egypt",\n "El Salvador",\n "Equatorial Guinea",\n "Eritrea",\n "Estonia",\n "Eswatini",\n "Ethiopia",\n "Fiji",\n "Finland",\n "France",\n "Gabon",\n "Gambia",\n "Georgia",\n "Germany",\n "Ghana",\n "Greece",\n "Grenada",\n "Guatemala",\n "Guinea",\n "Guinea-Bissau",\n "Guyana",\n "Haiti",\n "Honduras",\n "Hungary",\n "Iceland",\n "India",\n "Indonesia",\n "Iraq",\n "Ireland",\n "Israel",\n "Italy",\n "Jamaica",\n "Japan",\n "Jordan",\n "Kazakhstan",\n "Kenya",\n "Kiribati",\n "Kuwait",\n "Kyrgyzstan",\n "Laos",\n "Latvia",\n "Lebanon",\n "Lesotho",\n "Liberia",\n "Libya",\n "Liechtenstein",\n "Lithuania",\n "Luxembourg",\n "Madagascar",\n "Malawi",\n "Malaysia",\n "Maldives",\n "Mali",\n "Malta",\n "Marshall Islands",\n "Mauritania",\n "Mauritius",\n "Mexico",\n "Micronesia",\n "Moldova",\n "Monaco",\n "Mongolia",\n "Montenegro",\n "Morocco",\n "Mozambique",\n "Myanmar",\n "Namibia",\n "Nauru",\n "Nepal",\n "Netherlands",\n "New Zealand",\n "Nicaragua",\n "Niger",\n "Nigeria",\n "North Macedonia",\n "Norway",\n "Oman",\n "Pakistan",\n "Palau",\n "Palestine",\n "Panama",\n "Papua New Guinea",\n "Paraguay",\n "Peru",\n "Philippines",\n "Poland",\n "Portugal",\n "Qatar",\n "Romania",\n "Russia",\n "Rwanda",\n "Saint Kitts and Nevis",\n "Saint Lucia",\n "Saint Vincent and the Grenadines",\n "Samoa",\n "San Marino",\n "Sao Tome and Principe",\n "Saudi Arabia",\n "Senegal",\n "Serbia",\n "Seychelles",\n "Sierra Leone",\n "Singapore",\n "Slovakia",\n "Slovenia",\n "Solomon Islands",\n "Somalia",\n "South Africa",\n "South Korea",\n "South Sudan",\n "Spain",\n "Sri Lanka",\n "Sudan",\n "Suriname",\n "Sweden",\n "Switzerland",\n "Taiwan",\n "Tajikistan",\n "Tanzania",\n "Thailand",\n "Togo",\n "Tonga",\n "Trinidad and Tobago",\n "Tunisia",\n "Turkey",\n "Turkmenistan",\n "Tuvalu",\n "Uganda",\n "Ukraine",\n "United Arab Emirates",\n "Uruguay",\n "Uzbekistan",\n "Vanuatu",\n "Vatican City",\n "Venezuela",\n "Vietnam",\n "Yemen",\n "Zambia",\n "Zimbabwe"\n]\n')])])])]),n._v(" "),a("h3",{attrs:{id:"get-conversion-rates"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#get-conversion-rates"}},[n._v("#")]),n._v(" Get Conversion Rates")]),n._v(" "),a("p",[n._v("Returns supported fiat conversion rates for 1GB of storage based on current market prices")]),n._v(" "),a("p",[a("code",[n._v("/rates")])]),n._v(" "),a("h4",{attrs:{id:"parameters-7"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#parameters-7"}},[n._v("#")]),n._v(" Parameters")]),n._v(" "),a("p",[n._v("None")]),n._v(" "),a("h4",{attrs:{id:"example-6"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#example-6"}},[n._v("#")]),n._v(" Example")]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v("https://payment.ardrive.io/v1/rates\n")])])]),a("details",[a("summary",[a("b",[n._v("Response Body (JSON)")])]),n._v(" "),a("div",{staticClass:"language- extra-class"},[a("pre",{pre:!0,attrs:{class:"language-text"}},[a("code",[n._v('{\n "winc": "343168912867",\n "fiat": {\n "aud": 3.52873729722864,\n "brl": 11.34598786477272,\n "cad": 3.15729126594135,\n "eur": 2.1569195680425,\n "gbp": 1.8487882011791101,\n "hkd": 18.66938404981161,\n "inr": 196.24591287088242,\n "jpy": 334.744630809484,\n "sgd": 3.16995419882613,\n "usd": 2.39329431522465\n },\n "adjustments": [\n {\n "name": "FWD Research July 2023 Subsidy",\n "description": "A 60% discount for uploads over 500KiB",\n "operator": "multiply",\n "value": 0.6,\n "adjustmentAmount": "-514753369299"\n }\n ]\n}\n')])])])]),n._v(" "),a("p",[n._v("* required")])])}),[],!1,null,null,null);a.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/40.21f11466.js b/assets/js/40.7664d8e6.js similarity index 98% rename from assets/js/40.21f11466.js rename to assets/js/40.7664d8e6.js index 1ec82ea..9de112f 100644 --- a/assets/js/40.21f11466.js +++ b/assets/js/40.7664d8e6.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{334:function(e,t,a){"use strict";a.r(t);var n=a(10),s=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upload-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upload-api"}},[e._v("#")]),e._v(" Upload API")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The Turbo Upload Service supports payment for signed data-items to upload.ardrive.io using Turbo Credits. An API endpoint has been created to facilitate the payments. A signed data-item can be posted to upload.ardrive.io using the below schema.")]),e._v(" "),t("p",[t("strong",[e._v("Note")]),e._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),t("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", or view the raw json for that documentation "),t("a",{attrs:{href:"https://upload.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"endpoint"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#endpoint"}},[e._v("#")]),e._v(" Endpoint")]),e._v(" "),t("p",[t("code",[e._v("https://upload.ardrive.io/v1/tx")])]),e._v(" "),t("h2",{attrs:{id:"schema"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema"}},[e._v("#")]),e._v(" Schema")]),e._v(" "),t("h3",{attrs:{id:"headers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#headers"}},[e._v("#")]),e._v(" Headers")]),e._v(" "),t("p",[t("code",[e._v("content-type")]),e._v('*: "application/octet-stream"')]),e._v(" "),t("p",[t("code",[e._v("accept")]),e._v('*: string - media type, such as "application/json"')]),e._v(" "),t("h3",{attrs:{id:"body"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#body"}},[e._v("#")]),e._v(" Body")]),e._v(" "),t("p",[e._v("The body of your request should contain a signed data-item.")]),e._v(" "),t("p",[e._v("Data-items can be created and signed with the arbundles library, following the below example.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('// Initiates the arbundles Arweave signer with your wallet\nconst signer = new ArweaveSigner(jwk);\n\n// Sets the data you would like to use to create a data-item\nconst data = "Any value can Go here";\n\n// Creates a data-item using your data and the Arweave Signer\nconst dataItem = createData(data, signer);\n\n// Signs the data-item\nawait dataItem.sign(signer);\n\n')])])]),t("p",[e._v("In this example, the variable "),t("code",[e._v("dataItem")]),e._v(" is what should be sent in your api post request in order to finalize and pay for the upload using Turbo Credits. "),t("code",[e._v("dataItem.sign()")]),e._v(" is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.")]),e._v(" "),t("h3",{attrs:{id:"response"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#response"}},[e._v("#")]),e._v(" Response")]),e._v(" "),t("details",[t("summary",[e._v("Headers")]),e._v("\n```\n access-control-allow-methods: PUT,GET,HEAD,POST,DELETE,OPTIONS \n access-control-allow-origin: https://upload.ardrive.io \n content-length: 173 \n content-security-policy: frame-ancestors 'none'; default-src 'self'; img-src data: https:; script-src 'self' 'unsafe-inline' https:; style-src 'unsafe-inline' https:; object-src 'none'; font-src 'self' https:; \n content-type: application/json; charset=utf-8 \n date: Thu,27 Jul 2023 22:06:33 GMT \n strict-transport-security: max-age=3600; includeSubDomains; preload \n vary: Origin \n via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (CloudFront) \n x-amz-cf-id: eypqkKDp-ADDMHmBOp3UQzDK4gZ8iYE8fbmYAyZjfyR3Cj8gevgF6g== \n x-amz-cf-pop: IAD12-P3 \n x-cache: Miss from cloudfront \n x-content-type-options: nosniff \n x-frame-options: SAMEORIGIN \n x-xss-protection: 1; mode=block \n```\n")]),e._v(" "),t("details",[t("summary",[e._v("Body")]),e._v('\n```\n{\n "id": "1wk8nyVTHTHpbmEZ-IGNsGcro4og8XXVbBhHvMFxUgQ",\n "owner": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "dataCaches": [\n "arweave.net"\n ],\n "fastFinalityIndexes": [\n "arweave.net"\n ]\n}\n```\n')]),e._v(" "),t("p",[e._v("* required")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[40],{335:function(e,t,a){"use strict";a.r(t);var n=a(10),s=Object(n.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"upload-api"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#upload-api"}},[e._v("#")]),e._v(" Upload API")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("The Turbo Upload Service supports payment for signed data-items to upload.ardrive.io using Turbo Credits. An API endpoint has been created to facilitate the payments. A signed data-item can be posted to upload.ardrive.io using the below schema.")]),e._v(" "),t("p",[t("strong",[e._v("Note")]),e._v(": This service is still evolving and the information provided below may be out of date. You can view the most up to date information about the available endpoints "),t("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(", or view the raw json for that documentation "),t("a",{attrs:{href:"https://upload.ardrive.io/openapi.json",target:"_blank",rel:"noopener noreferrer"}},[e._v("here"),t("OutboundLink")],1),e._v(".")]),e._v(" "),t("h2",{attrs:{id:"endpoint"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#endpoint"}},[e._v("#")]),e._v(" Endpoint")]),e._v(" "),t("p",[t("code",[e._v("https://upload.ardrive.io/v1/tx")])]),e._v(" "),t("h2",{attrs:{id:"schema"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#schema"}},[e._v("#")]),e._v(" Schema")]),e._v(" "),t("h3",{attrs:{id:"headers"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#headers"}},[e._v("#")]),e._v(" Headers")]),e._v(" "),t("p",[t("code",[e._v("content-type")]),e._v('*: "application/octet-stream"')]),e._v(" "),t("p",[t("code",[e._v("accept")]),e._v('*: string - media type, such as "application/json"')]),e._v(" "),t("h3",{attrs:{id:"body"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#body"}},[e._v("#")]),e._v(" Body")]),e._v(" "),t("p",[e._v("The body of your request should contain a signed data-item.")]),e._v(" "),t("p",[e._v("Data-items can be created and signed with the arbundles library, following the below example.")]),e._v(" "),t("div",{staticClass:"language- extra-class"},[t("pre",{pre:!0,attrs:{class:"language-text"}},[t("code",[e._v('// Initiates the arbundles Arweave signer with your wallet\nconst signer = new ArweaveSigner(jwk);\n\n// Sets the data you would like to use to create a data-item\nconst data = "Any value can Go here";\n\n// Creates a data-item using your data and the Arweave Signer\nconst dataItem = createData(data, signer);\n\n// Signs the data-item\nawait dataItem.sign(signer);\n\n')])])]),t("p",[e._v("In this example, the variable "),t("code",[e._v("dataItem")]),e._v(" is what should be sent in your api post request in order to finalize and pay for the upload using Turbo Credits. "),t("code",[e._v("dataItem.sign()")]),e._v(" is a mutating method, so there is no need to create a separate variable to hold the results of signing the data-item.")]),e._v(" "),t("h3",{attrs:{id:"response"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#response"}},[e._v("#")]),e._v(" Response")]),e._v(" "),t("details",[t("summary",[e._v("Headers")]),e._v("\n```\n access-control-allow-methods: PUT,GET,HEAD,POST,DELETE,OPTIONS \n access-control-allow-origin: https://upload.ardrive.io \n content-length: 173 \n content-security-policy: frame-ancestors 'none'; default-src 'self'; img-src data: https:; script-src 'self' 'unsafe-inline' https:; style-src 'unsafe-inline' https:; object-src 'none'; font-src 'self' https:; \n content-type: application/json; charset=utf-8 \n date: Thu,27 Jul 2023 22:06:33 GMT \n strict-transport-security: max-age=3600; includeSubDomains; preload \n vary: Origin \n via: 1.1 d0d53eedec01ac540f737b5fafb16436.cloudfront.net (CloudFront) \n x-amz-cf-id: eypqkKDp-ADDMHmBOp3UQzDK4gZ8iYE8fbmYAyZjfyR3Cj8gevgF6g== \n x-amz-cf-pop: IAD12-P3 \n x-cache: Miss from cloudfront \n x-content-type-options: nosniff \n x-frame-options: SAMEORIGIN \n x-xss-protection: 1; mode=block \n```\n")]),e._v(" "),t("details",[t("summary",[e._v("Body")]),e._v('\n```\n{\n "id": "1wk8nyVTHTHpbmEZ-IGNsGcro4og8XXVbBhHvMFxUgQ",\n "owner": "cF0H0SKdnaDTqWKY9iJKBktTpdEWgb3GnlndE7ABv0Q",\n "dataCaches": [\n "arweave.net"\n ],\n "fastFinalityIndexes": [\n "arweave.net"\n ]\n}\n```\n')]),e._v(" "),t("p",[e._v("* required")])])}),[],!1,null,null,null);t.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/41.42cd5cd8.js b/assets/js/41.42cd5cd8.js new file mode 100644 index 0000000..e6dcb48 --- /dev/null +++ b/assets/js/41.42cd5cd8.js @@ -0,0 +1 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{336:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-credit-sharing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-credit-sharing"}},[e._v("#")]),e._v(" Turbo Credit Sharing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Turbo Credits are the payment medium used by the Turbo Upload Service to facilitate uploading data to the Arweave Blockweave. While they exist as assets accessible on Arweave, they are not a cryptocurrency token in the traditional sense. They cannot be transferred, traded, exchanged, or otherwise interacted with in a way that you typically could with a cryptocurrency token. A purchase of Turbo Credits also cannot be refunded, whether obtained via fiat or through exchanging supported cryptocurrency tokens like Ethereum or Kyve.")]),e._v(" "),t("p",[e._v("Recently, however, the Turbo Upload Service has been upgraded to allow holders of Turbo Credits to share the upload power of those Credits with other users. This means holders of Turbo Credits can authorize other users to use some of their Credits for uploading data to Arweave without giving away control of those Credits.")]),e._v(" "),t("h2",{attrs:{id:"how-it-works"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-it-works"}},[e._v("#")]),e._v(" How it Works")]),e._v(" "),t("p",[e._v('A holder of Turbo Credits may explicitly authorize another wallet to use some of their Turbo Credits for uploading to Arweave. The shared Credits become "locked", meaning that ONLY the authorized user is able to access those Credits to pay for uploading data. This happens without control of the Credits being lost by the wallet of the original holder.')]),e._v(" "),t("p",[e._v('Authorizations, or "Approvals" are data items that are uploaded to Arweave that the Turbo Upload Service is able to see when processing transactions. The uploaded data item states the address of the user being approved, the amount of Turbo Credits (in winc) being approved for that user, and an optional time limit at which point the approval will expire and the user will lose access to those Credits. While processing upload transactions, Turbo will automatically find these approvals for the uploading user and pull funds from shared Credits before Credits held by the user directly. Approvals that are closest to expiring will be pulled from first, unless a different criteria is provided.')]),e._v(" "),t("p",[e._v("Uploading users have several options for specifying which approval should be prioritized to pay for uploads in the case where they have more than one:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("paidBy")]),e._v(": Uploading users can specify the order of wallet addresses that funds should be pulled from to pay for their current upload by supplying a "),t("code",[e._v("paidBy")]),e._v(" value. This is an ordered list of wallet addresses or native addresses, and can include the uploader's own address.")]),e._v(" "),t("li",[t("code",[e._v("ignore-approvals")]),e._v(": When using the Turbo CLI to upload data, the "),t("code",[e._v("--ignore-approvals")]),e._v(" flag will ignore any approved Credits and only attempt to pay for an upload from the user's own balance of Credits.")]),e._v(" "),t("li",[t("code",[e._v("use-signer-balance-first")]),e._v(": When using the Turbo CLI to upload data, the "),t("code",[e._v("--use-signer-balance-first")]),e._v(" flag will attempt to pay for an upload using the user's own balance of credits first. If the user does not have enough Credits to cover the entire upload, only after their balance is exhausted will approved Credits be accessed to cover the remaining cost.")])]),e._v(" "),t("p",[e._v("Holders of Turbo Credits can create approvals for users via the Turbo SDK or the Turbo CLI, with the specific methods used to do so being outlined, with examples, in the "),t("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/"}},[e._v("Turbo SDK/CLI docs")]),e._v(". Holders can also revoke approvals at any time to regain access to their Credits, even if an approval has an explicit expiry time.")],1),e._v(" "),t("h2",{attrs:{id:"use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#use-cases"}},[e._v("#")]),e._v(" Use Cases")]),e._v(" "),t("h3",{attrs:{id:"organizational-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#organizational-funds"}},[e._v("#")]),e._v(" Organizational Funds")]),e._v(" "),t("p",[e._v("For companies or organizations that routinely upload data to Arweave, it can be challenging to keep individual user wallets funded sufficiently to complete their work. There is also a risk of over funding users who only have an occasional need to upload data. Given that Turbo Credits are non-refundable, this can be a significant waste of limited resources. One possible solution is to give all employees access to the core organizational wallet. This is usually a very bad idea though. Anyone who has keys to access a crypto wallet has complete control of that wallet. Any other assets held by the wallet could be transferred out, or an employee could take those keys with them when they leave to retain access to the Turbo Credits held.")]),e._v(" "),t("p",[e._v("Turbo Credit Sharing solves this issue by allowing a central organizational wallet to keep only itself funded with Turbo Credits that can then be shared with wallets for any partners or employees as needed, and easily recovered if they are not needed by a particular user.")]),e._v(" "),t("h3",{attrs:{id:"onboarding-periods"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#onboarding-periods"}},[e._v("#")]),e._v(" Onboarding Periods")]),e._v(" "),t("p",[e._v("Any product or service that has users upload data to Arweave can use Turbo Credit Sharing to give new users uploading power for a certain period of time as an introduction to what they have to offer. Having to make a purchase, especially of a third-party product, can be a major blocker for onboarding new users, but a period of controlled free-for-them access can give the company a chance to showcase why what they have to offer is worth the cost.")]),e._v(" "),t("h3",{attrs:{id:"collaboration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#collaboration"}},[e._v("#")]),e._v(" Collaboration")]),e._v(" "),t("p",[e._v("When multiple devolopers or contributor are working on a joint project that requires uploading data to Arweave, managing the funding for each participant can be cumbersome. By sharing Turbo Credits, the project leader or funding entity can grant each collaborator access to upload without directly handling individual wallets. This facilitates seamless cooperation without the risk of losing control over funds or overfunding specific contributors.")]),e._v(" "),t("h3",{attrs:{id:"community-or-open-source-initiatives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-or-open-source-initiatives"}},[e._v("#")]),e._v(" Community or Open Source Initiatives")]),e._v(" "),t("p",[e._v("In open source or community-driven efforts that involve uploading data to Arweave, such as the "),t("a",{attrs:{href:"https://bannedbooksweek.org/event/the-power-of-the-permaweb-in-protecting-banned-books/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Banned Books Week"),t("OutboundLink")],1),e._v(" project to protect books that are often censored, project managers can share Turbo Credits with trusted contributors. This supports collaborative efforts without having to worry about decentralized funding. By using approvals, maintainers can control how Credits are used, set expiration times, and ensure that shared resources are managed responsibly.")]),e._v(" "),t("h3",{attrs:{id:"event-based-or-seasonal-promotions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#event-based-or-seasonal-promotions"}},[e._v("#")]),e._v(" Event Based or Seasonal Promotions")]),e._v(" "),t("p",[e._v("Companies and services can run promotional events or campaigns where users can upload data for free-to-them for a limited time. Turbo Credit Sharing makes it easy to share upload power with participants, allowing them to experience the service without initial investment. After the promotional period ends, the Credits remain with the original holder, ensuring that company resources are not permanently allocated.")]),e._v(" "),t("h3",{attrs:{id:"research-and-development-trials"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#research-and-development-trials"}},[e._v("#")]),e._v(" Research and Development Trials")]),e._v(" "),t("p",[e._v("Academic institutions or research organizations conducting studies involving data uploads to Arweave can benefit from shared Turbo Credits. A central research wallet can allocate upload power to various project teams or individual researchers. This approach helps ensure that project budgets are managed centrally while allowing flexibility in data uploads, without distributing sensitive wallet keys to team members.")]),e._v(" "),t("h3",{attrs:{id:"educational-programs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#educational-programs"}},[e._v("#")]),e._v(" Educational Programs")]),e._v(" "),t("p",[e._v("Schools or educational platforms teaching blockchain development or data permanence could use Turbo Credit Sharing to allow students or participants to upload data as part of their learning exercises. This gives learners hands-on experience without requiring them to fund their wallets, making it more accessible and encouraging engagement with the technology.")]),e._v(" "),t("h3",{attrs:{id:"data-migration-services"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-migration-services"}},[e._v("#")]),e._v(" Data Migration Services")]),e._v(" "),t("p",[e._v("Data migration services or third-party consultants assisting with moving data onto the Arweave Blockweave can be given controlled access to an organization’s Turbo Credits for a project’s duration. This ensures that consultants can carry out the migration without needing their own funding or wallet management, streamlining project operations while maintaining security.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/41.4c9da2d3.js b/assets/js/41.4c9da2d3.js deleted file mode 100644 index 780d11f..0000000 --- a/assets/js/41.4c9da2d3.js +++ /dev/null @@ -1 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[41],{336:function(e,t,a){"use strict";a.r(t);var o=a(10),r=Object(o.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-credit-sharing"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-credit-sharing"}},[e._v("#")]),e._v(" Turbo Credit Sharing")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Turbo Credits are the payment medium used by the Turbo Upload Service to facilitate uploading data to the Arweave Blockweave. While they exist as assets accessible on Arweave, they are not a cryptocurrency token in the traditional sense. They cannot be transferred, traded, exchanged, or otherwise interacted with in a way that you typically could with a cryptocurrency token. A purchase of Turbo Credits also cannot be refunded, whether obtained via fiat or through exchanging supported cryptocurrency tokens like Ethereum or Kyve.")]),e._v(" "),t("p",[e._v("Recently, however, the Turbo Upload Service has been upgraded to allow holders of Turbo Credits to share the upload power of those Credits with other users. This means holders of Turbo Credits can authorize other users to use some of their Credits for uploading data to Arweave without those Credits ever leaving their own wallet.")]),e._v(" "),t("h2",{attrs:{id:"how-it-works"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#how-it-works"}},[e._v("#")]),e._v(" How it Works")]),e._v(" "),t("p",[e._v('A holder of Turbo Credits may explicitly authorize another wallet to use some of their Turbo Credits for uploading to Arweave. The shared Credits become "locked", meaning that ONLY the authorized user is able to access those Credits to pay for uploading data. This happens without the Credits ever leaving the wallet of the original holder.')]),e._v(" "),t("p",[e._v('Authorizations, or "Approvals" are data items that are uploaded to Arweave that the Turbo Upload Service is able to see when processing transactions. The uploaded data item states the address of the user being approved, the amount of Turbo Credits (in winc) being approved for that user, and an optional time limit at which point the approval will expire and the user will lose access to those Credits. While processing upload transactions, Turbo will automatically find these approvals for the uploading user and pull funds from shared Credits before Credits held by the user directly. Approvals that are closest to expiring will be pulled from first, unless a different criteria is provided.')]),e._v(" "),t("p",[e._v("Uploading users have several options for specifying which approval should be prioritized to pay for uploads in the case where they have more than one:")]),e._v(" "),t("ul",[t("li",[t("code",[e._v("paidBy")]),e._v(": Uploading users can specify the order of wallet addresses that funds should be pulled from to pay for their current upload by supplying a "),t("code",[e._v("paidBy")]),e._v(" value. This is an ordered list of wallet addresses or native addresses, and can include the uploader's own address.")]),e._v(" "),t("li",[t("code",[e._v("ignore-approvals")]),e._v(": When using the Turbo CLI to upload data, the "),t("code",[e._v("--ignore-approvals")]),e._v(" flag will ignore any approved Credits and only attempt to pay for an upload from the user's own balance of Credits.")]),e._v(" "),t("li",[t("code",[e._v("use-signer-balance-first")]),e._v(": When using the Turbo CLI to upload data, the "),t("code",[e._v("--use-signer-balance-first")]),e._v(" flag will attempt to pay for an upload using the user's own balance of credits first. If the user does not have enough Credits to cover the entire upload, only after their balance is exhausted will approved Credits be accessed to cover the remaining cost.")])]),e._v(" "),t("p",[e._v("Holders of Turbo Credits can create approvals for users via the Turbo SDK or the Turbo CLI, with the specific methods used to do so being outlined, with examples, in the "),t("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/"}},[e._v("Turbo SDK/CLI docs")]),e._v(". Holders can also revoke approvals at any time to regain access to their Credits, even if an approval has an explicit expiry time.")],1),e._v(" "),t("h2",{attrs:{id:"use-cases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#use-cases"}},[e._v("#")]),e._v(" Use Cases")]),e._v(" "),t("h3",{attrs:{id:"organizational-funds"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#organizational-funds"}},[e._v("#")]),e._v(" Organizational Funds")]),e._v(" "),t("p",[e._v("For companies or organizations that routinely upload data to Arweave, it can be challenging to keep individual user wallets funded sufficiently to complete their work. There is also a risk of over funding users who only have an occasional need to upload data. Given that Turbo Credits are non-refundable, this can be a significant waste of limited resources. One possible solution is to give all employees access to the core organizational wallet. This is usually a very bad idea though. Anyone who has keys to access a crypto wallet has complete control of that wallet. Any other assets held by the wallet could be transferred out, or an employee could take those keys with them when they leave to retain access to the Turbo Credits held.")]),e._v(" "),t("p",[e._v("Turbo Credit Sharing solves this issue by allowing a central organizational wallet to keep only itself funded with Turbo Credits that can then be shared with wallets for any partners or employees as needed, and easily recovered if they are not needed by a particular user.")]),e._v(" "),t("h3",{attrs:{id:"onboarding-periods"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#onboarding-periods"}},[e._v("#")]),e._v(" Onboarding Periods")]),e._v(" "),t("p",[e._v("Any product or service that has users upload data to Arweave can use Turbo Credit Sharing to give new users uploading power for a certain period of time as an introduction to what they have to offer. Having to make a purchase, especially of a third-party product, can be a major blocker for onboarding new users, but a period of controlled free-for-them access can give the company a chance to showcase why what they have to offer is worth the cost.")]),e._v(" "),t("h3",{attrs:{id:"collaboration"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#collaboration"}},[e._v("#")]),e._v(" Collaboration")]),e._v(" "),t("p",[e._v("When multiple devolopers or contributor are working on a joint project that requires uploading data to Arweave, managing the funding for each participant can be cumbersome. By sharing Turbo Credits, the project leader or funding entity can grant each collaborator access to upload without directly handling individual wallets. This facilitates seamless cooperation without the risk of losing control over funds or overfunding specific contributors.")]),e._v(" "),t("h3",{attrs:{id:"community-or-open-source-initiatives"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#community-or-open-source-initiatives"}},[e._v("#")]),e._v(" Community or Open Source Initiatives")]),e._v(" "),t("p",[e._v("In open source or community-driven efforts that involve uploading data to Arweave, such as the "),t("a",{attrs:{href:"https://bannedbooksweek.org/event/the-power-of-the-permaweb-in-protecting-banned-books/",target:"_blank",rel:"noopener noreferrer"}},[e._v("Banned Books Week"),t("OutboundLink")],1),e._v(" project to protect books that are often censored, project managers can share Turbo Credits with trusted contributors. This supports collaborative efforts without having to worry about decentralized funding. By using approvals, maintainers can control how Credits are used, set expiration times, and ensure that shared resources are managed responsibly.")]),e._v(" "),t("h3",{attrs:{id:"event-based-or-seasonal-promotions"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#event-based-or-seasonal-promotions"}},[e._v("#")]),e._v(" Event Based or Seasonal Promotions")]),e._v(" "),t("p",[e._v("Companies and services can run promotional events or campaigns where users can upload data for free-to-them for a limited time. Turbo Credit Sharing makes it easy to share upload power with participants, allowing them to experience the service without initial investment. After the promotional period ends, the Credits remain with the original holder, ensuring that company resources are not permanently allocated.")]),e._v(" "),t("h3",{attrs:{id:"research-and-development-trials"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#research-and-development-trials"}},[e._v("#")]),e._v(" Research and Development Trials")]),e._v(" "),t("p",[e._v("Academic institutions or research organizations conducting studies involving data uploads to Arweave can benefit from shared Turbo Credits. A central research wallet can allocate upload power to various project teams or individual researchers. This approach helps ensure that project budgets are managed centrally while allowing flexibility in data uploads, without distributing sensitive wallet keys to team members.")]),e._v(" "),t("h3",{attrs:{id:"educational-programs"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#educational-programs"}},[e._v("#")]),e._v(" Educational Programs")]),e._v(" "),t("p",[e._v("Schools or educational platforms teaching blockchain development or data permanence could use Turbo Credit Sharing to allow students or participants to upload data as part of their learning exercises. This gives learners hands-on experience without requiring them to fund their wallets, making it more accessible and encouraging engagement with the technology.")]),e._v(" "),t("h3",{attrs:{id:"data-migration-services"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#data-migration-services"}},[e._v("#")]),e._v(" Data Migration Services")]),e._v(" "),t("p",[e._v("Data migration services or third-party consultants assisting with moving data onto the Arweave Blockweave can be given controlled access to an organization’s Turbo Credits for a project’s duration. This ensures that consultants can carry out the migration without needing their own funding or wallet management, streamlining project operations while maintaining security.")])])}),[],!1,null,null,null);t.default=r.exports}}]); \ No newline at end of file diff --git a/assets/js/44.35c769da.js b/assets/js/44.36393e3d.js similarity index 99% rename from assets/js/44.35c769da.js rename to assets/js/44.36393e3d.js index 1a56343..d59e2d1 100644 --- a/assets/js/44.35c769da.js +++ b/assets/js/44.36393e3d.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{342:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ardriveapp-turbo-sdk-πŸš€"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardriveapp-turbo-sdk-πŸš€"}},[t._v("#")]),t._v(" @ardriveapp/turbo-sdk πŸš€")]),t._v(" "),s("p",[t._v("Welcome to the "),s("code",[t._v("@ardrive/turbo-sdk")]),t._v("! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[t._v("#")]),t._v(" Quick Start")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ArweaveSigner "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load your JWK directly to authenticate")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-jwk.json'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("jwkToAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or provide your own signer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the wallet balance")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// prep file for upload")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-image.png'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the cost of uploading the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// check if balance greater than upload cost")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add a promo code if you have one")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// open the URL to top-up, continue when done")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload complete!")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Successfully upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload failed")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("error")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Failed to upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("finally")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" newBalance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'New balance:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newBalance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v("The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/blob/main/package.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("package.json"),s("OutboundLink")],1),t._v(" based on your project's configuration. Refer to the "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/tree/main/examples",target:"_blank",rel:"noopener noreferrer"}},[t._v("examples"),s("OutboundLink")],1),t._v(" directory to see how to use the SDK in various environments.")]),t._v(" "),s("h3",{attrs:{id:"web"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),t._v(" "),s("h4",{attrs:{id:"bundlers-webpack-rollup-esbuild-etc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundlers-webpack-rollup-esbuild-etc"}},[t._v("#")]),t._v(" Bundlers (Webpack, Rollup, ESbuild, etc.)")]),t._v(" "),s("p",[t._v("CommonJS:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("ESM:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Browser:")]),t._v(" "),s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token script"}},[s("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://unpkg.com/@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("NOTE")])]),t._v(": Polyfills are not provided by default for bundled web projects (Vite, ESBuild, Webpack, Rollup, etc.) . Depending on your apps bundler configuration and plugins, you will need to provide polyfills for various imports including "),s("code",[t._v("crypto")]),t._v(", "),s("code",[t._v("process")]),t._v(", "),s("code",[t._v("fs")]),t._v(" and "),s("code",[t._v("buffer")]),t._v(". Refer to your bundler's documentation for how to provide the necessary polyfills.")]),t._v(" "),s("h3",{attrs:{id:"nodejs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nodejs"}},[t._v("#")]),t._v(" NodeJS")]),t._v(" "),s("h4",{attrs:{id:"commonjs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commonjs"}},[t._v("#")]),t._v(" CommonJS")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commonjs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"typescript"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.4.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CommonJS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ES2021"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esModuleInterop"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("privateKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("amount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("signal")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("tokenAmount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"esm"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#esm"}},[t._v("#")]),t._v(" ESM")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ESNext"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esm"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or use @ardrive/turbo-sdk/web depending on your environment")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("URL")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("meta"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pathname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"typescript"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#typescript"}},[t._v("#")]),t._v(" Typescript")]),t._v(" "),s("p",[t._v("The SDK provides TypeScript types. When you import the SDK in a TypeScript project:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/web"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or '@ardrive/turbo-sdk/node' for Node.js projects")]),t._v("\n")])])]),s("p",[t._v("Types are exported from "),s("code",[t._v("./lib/types/[node/web]/index.d.ts")]),t._v(" and should be automatically recognized, offering benefits such as type-checking and autocompletion.")]),t._v(" "),s("p",[t._v("Examples:")]),t._v(" "),s("p",[t._v("Examples are available in the "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/tree/main/examples",target:"_blank",rel:"noopener noreferrer"}},[t._v("examples"),s("OutboundLink")],1),t._v(" directory. To run examples:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn example:web")]),t._v(" - opens up the example web page")]),t._v(" "),s("li",[s("code",[t._v("yarn example:cjs")]),t._v(" - runs example CJS node script")]),t._v(" "),s("li",[s("code",[t._v("yarn example:esm")]),t._v(" - runs example ESM node script")])]),t._v(" "),s("h2",{attrs:{id:"apis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#apis"}},[t._v("#")]),t._v(" APIs")]),t._v(" "),s("h3",{attrs:{id:"turbofactory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbofactory"}},[t._v("#")]),t._v(" TurboFactory")]),t._v(" "),s("h4",{attrs:{id:"unauthenticated"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#unauthenticated"}},[t._v("#")]),t._v(" "),s("code",[t._v("unauthenticated()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates an instance of a client that accesses Turbo's unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"authenticated"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#authenticated"}},[t._v("#")]),t._v(" "),s("code",[t._v("authenticated()")])]),t._v(" "),s("p",[t._v("Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services. Requires either a signer, or private key to be provided.")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Construct Turbo with an Arweave JWK")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("crypto"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateJWK")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an Arweave signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an Arconnect signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an ETH signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EthereumSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("privateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an ETH private key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ethHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ethereum"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with POL (MATIC) Private Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\nprivateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ethHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\ntoken"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("\n- Construct Turbo with a HexSolanaSigner\n\n ```typescript\n const signer = new HexSolanaSigner(bs58.encode(secretKey));\n const turbo = TurboFactory.authenticated({ signer });\n")])])]),s("ul",[s("li",[s("p",[t._v("Construct Turbo with a SOL secret Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" bs58"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("encode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("secretKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solana"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Private Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" kyveHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Mnemonic")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKeyFromKyveMnemonic "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("privateKeyFromKyveMnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turbounauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbounauthenticatedclient"}},[t._v("#")]),t._v(" TurboUnauthenticatedClient")]),t._v(" "),s("h4",{attrs:{id:"getsupportedcurrencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getsupportedcurrencies"}},[t._v("#")]),t._v(" "),s("code",[t._v("getSupportedCurrencies()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" currencies "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCurrencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getsupportedcountries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getsupportedcountries"}},[t._v("#")]),t._v(" "),s("code",[t._v("getSupportedCountries()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the list of countries supported by the Turbo Payment Service's top up workflow.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" countries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCountries")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getfiattoar-currency"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getfiattoar-currency"}},[t._v("#")]),t._v(" "),s("code",[t._v("getFiatToAR({ currency })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fiatToAR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatToAR")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" currency"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getfiatrates"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getfiatrates"}},[t._v("#")]),t._v(" "),s("code",[t._v("getFiatRates()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current fiat rates for 1 GiB of data for supported currencies, including all top-up adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getwincforfiat-amount"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getwincforfiat-amount"}},[t._v("#")]),t._v(" "),s("code",[t._v("getWincForFiat({ amount })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getuploadcosts-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getuploadcosts-bytes"}},[t._v("#")]),t._v(" "),s("code",[t._v("getUploadCosts({ bytes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the estimated cost in Winston Credits for the provided file sizes, including all upload adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadsigneddataitem-dataitemstreamfactory-dataitemsizefactory-signal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadsigneddataitem-dataitemstreamfactory-dataitemsizefactory-signal"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Uploads a signed data item. The provided "),s("code",[t._v("dataItemStreamFactory")]),t._v(" should produce a NEW signed data item stream each time is it invoked. The "),s("code",[t._v("dataItemSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-signed-data-item"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" dataItemSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResponse "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadSignedDataItem")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" dataItemSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"createcheckoutsession-amount-owner"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#createcheckoutsession-amount-owner"}},[t._v("#")]),t._v(" "),s("code",[t._v("createCheckoutSession({ amount, owner })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")])]),t._v(" "),s("li",[s("p",[t._v("Arweave (AR) Fiat Top UP")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Ethereum (ETH) Fiat Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ethereum'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicEthereumAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Solana (SOL) Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'solana'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicSolanaAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Polygon (POL / MATIC) Fiat Top UP")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicPolygonAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Fiat Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicKyveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"submitfundtransaction-txid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#submitfundtransaction-txid"}},[t._v("#")]),t._v(" "),s("code",[t._v("submitFundTransaction({ txId})")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Submits the transaction ID of a funding transaction to Turbo Payment Service for top up processing. The "),s("code",[t._v("txId")]),t._v(" is the transaction ID of the transaction to be submitted.")]),t._v(" "),s("ul",[s("li",[t._v("Note: use this API if you've already executed your token transfer to the Turbo wallet. Otherwise, consider using "),s("code",[t._v("topUpWithTokens")]),t._v(" to execute a new token transfer to the Turbo wallet and submit its resulting transaction ID for top up processing all in one go.")])]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// defaults to arweave token type")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("submitFundTransaction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n txId"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my-valid-arweave-fund-transaction-id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turboauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turboauthenticatedclient"}},[t._v("#")]),t._v(" TurboAuthenticatedClient")]),t._v(" "),s("h4",{attrs:{id:"getbalance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getbalance"}},[t._v("#")]),t._v(" "),s("code",[t._v("getBalance()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"signer-getnativeaddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#signer-getnativeaddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("signer.getNativeAddress()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the "),s("a",{attrs:{href:"https://docs.ar.io/glossary.html#native-address",target:"_blank",rel:"noopener noreferrer"}},[t._v("native address"),s("OutboundLink")],1),t._v(" of the connected signer.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNativeAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getwincforfiat-amount-promocodes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getwincforfiat-amount-promocodes"}},[t._v("#")]),t._v(" "),s("code",[t._v("getWincForFiat({ amount, promoCodes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MY_PROMO_CODE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"createcheckoutsession-amount-owner-promocodes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#createcheckoutsession-amount-owner-promocodes"}},[t._v("#")]),t._v(" "),s("code",[t._v("createCheckoutSession({ amount, owner, promoCodes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner, and optional promo codes. The returned URL can be opened in the browser, all payments are processed by Stripe. Promo codes require an authenticated client.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MY_PROMO_CODE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadfile-filestreamfactory-filesizefactory-signal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadfile-filestreamfactory-filesizefactory-signal"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadFile({ fileStreamFactory, fileSizeFactory, signal })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Signs and uploads a raw file. The provided "),s("code",[t._v("fileStreamFactory")]),t._v(" should produce a NEW file data stream each time is it invoked. The "),s("code",[t._v("fileSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request. "),s("code",[t._v("dataItemOpts")]),t._v(" is an optional object that can be used to configure tags, target, and anchor for the data item upload.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-unsigned-file.txt"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stateSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n dataItemOpts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n tags"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/plain"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My-Custom-Tag"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my-custom-value"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadfolder-folderpath-files-dataitemopts-signal-maxconcurrentuploads-throwonfailure-manifestoptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadfolder-folderpath-files-dataitemopts-signal-maxconcurrentuploads-throwonfailure-manifestoptions"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadFolder({ folderPath, files, dataItemOpts, signal, maxConcurrentUploads, throwOnFailure, manifestOptions})")])]),t._v(" "),s("ul",[s("li",[t._v("Signs and uploads a folder of files. For NodeJS, the "),s("code",[t._v("folderPath")]),t._v(" of the folder to upload is required.")]),t._v(" "),s("li",[t._v("For the browser, an array of "),s("code",[t._v("files")]),t._v(" is required.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("dataItemOpts")]),t._v(" is an optional object that can be used to configure tags, target, and anchor for the data item upload.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("maxConcurrentUploads")]),t._v(" is an optional number that can be used to limit the number of concurrent uploads.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("throwOnFailure")]),t._v(" is an optional boolean that can be used to throw an error if any upload fails.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("manifestOptions")]),t._v(" is an optional object that can be used to configure the manifest file, including a custom index file, fallback file, or whether to disable manifests altogether. Manifests are enabled by default.")])]),t._v(" "),s("p",[t._v("NodeJS Upload Folder")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" folderPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-folder'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFolder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n dataItemOpts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n tags"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// User defined content type will overwrite file content type")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'text/plain'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my-custom-value'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n manifestOptions"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n indexFile"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'custom-index.html'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fallbackFile"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'custom-fallback.html'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n disableManifests"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Browser Upload Folder")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(" name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(" webkitdirectory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" folderInput "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getElementById")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'folder'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n folderInput"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'change'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("event"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" selectedFiles "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" folderInput"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("files"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Folder selected:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" selectedFiles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFolder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n files"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Array")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("selectedFiles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("map")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),s("h4",{attrs:{id:"topupwithtokens-tokenamount-feemultiplier"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#topupwithtokens-tokenamount-feemultiplier"}},[t._v("#")]),t._v(" "),s("code",[t._v("topUpWithTokens({ tokenAmount, feeMultiplier })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Tops up the connected wallet with Credits by submitting a payment transaction for the token amount to the Turbo wallet and then submitting that transaction ID to Turbo Payment Service for top up processing.")]),t._v(" "),s("ul",[s("li",[t._v("The "),s("code",[t._v("tokenAmount")]),t._v(" is the amount of tokens in the token type's smallest unit value (e.g: Winston for arweave token type) to fund the wallet with.\n"),s("ul",[s("li",[t._v("Note: As of release 1.5.0, only AR tokens are supported with "),s("code",[t._v("topUpWithTokens")]),t._v(".")])])]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("feeMultiplier")]),t._v(" (optional) is the multiplier to apply to the reward for the transaction to modify its chances of being mined. Credits will be added to the wallet balance after the transaction is confirmed on the given blockchain. Defaults to 1.0, meaning no multiplier.")])])]),t._v(" "),s("li",[s("p",[t._v("Arweave (AR) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'arweave'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n feeMultiplier"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 10% increase in reward for improved mining chances")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Ethereum (ETH) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ethereum'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ETHToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 ETH")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Solana (SOL) Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'solana'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SOLToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 SOL")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Polygon ( POL / MATIC ) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("POLToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 POL")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("KYVEToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 KYVE")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"sharecredits-approvedaddress-approvedwincamount-expiresbyseconds"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sharecredits-approvedaddress-approvedwincamount-expiresbyseconds"}},[t._v("#")]),t._v(" `shareCredits({ approvedAddress, approvedWincAmount, expiresBySeconds })")]),t._v(" "),s("p",[t._v("Shares credits from the connected wallet to the provided native address and approved winc amount. This action will create a signed data item for the approval.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" approvalDataItemId"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" approvedWincAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("shareCredits")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n approvedAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n approvedWincAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.08315565032")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n expiresBySeconds"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3600")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"revokecredits-approvedaddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#revokecredits-approvedaddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("revokeCredits({ approvedAddress })")])]),t._v(" "),s("p",[t._v("Revokes all credits shared from the connected wallet to the provided native address.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" revokedApprovals "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("revokeCredits")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n approvedAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"getcreditshareapprovals-useraddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getcreditshareapprovals-useraddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("getCreditShareApprovals({ userAddress })")])]),t._v(" "),s("p",[t._v("Returns all given or received credit share approvals for the connected wallet or the provided native address.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" givenApprovals"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" receivedApprovals "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getCreditShareApprovals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n userAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli"}},[t._v("#")]),t._v(" CLI")]),t._v(" "),s("h3",{attrs:{id:"install-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-cli"}},[t._v("#")]),t._v(" Install CLI")]),t._v(" "),s("p",[t._v("Global installation:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" global "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or install locally as a dev dependency:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" --save-dev @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-D")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h3",{attrs:{id:"cli-usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli-usage"}},[t._v("#")]),t._v(" CLI Usage")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("p",[t._v("or from local installation:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("npx turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("h4",{attrs:{id:"options"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#options"}},[t._v("#")]),t._v(" Options")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("-V, --version")]),t._v(" - output the version number")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-h, --help")]),t._v(" - display help for command")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("--dev")]),t._v(" - Enable development endpoints (default: false)")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-g, --gateway ")]),t._v(" - Set a custom crypto gateway URL")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-t, --token ")]),t._v(' - Token type for the command or connected wallet (default: "arweave")')])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-w, --wallet-file ")]),t._v(" - Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-m, --mnemonic ")]),t._v(" - Mnemonic to use with the action (KYVE only)")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-p, --private-key ")]),t._v(" - Private key to use with the action")])])]),t._v(" "),s("h4",{attrs:{id:"commands"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commands"}},[t._v("#")]),t._v(" Commands")]),t._v(" "),s("h5",{attrs:{id:"balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balance"}},[t._v("#")]),t._v(" "),s("code",[t._v("balance")])]),t._v(" "),s("p",[t._v("Get the balance of a connected wallet or native address in Turbo Credits.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to get the balance of")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo balance "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("crypto-wallet-public-native-address"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" solana\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo balance --wallet-file "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet.json"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" arweave\n")])])]),s("h5",{attrs:{id:"top-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#top-up"}},[t._v("#")]),t._v(" "),s("code",[t._v("top-up")])]),t._v(" "),s("p",[t._v("Top up a connected wallet or native address with Turbo Credits using a supported fiat currency. This command will create a Stripe checkout session for the top-up amount and open the URL in the default browser.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to top up")]),t._v(" "),s("li",[s("code",[t._v("-c, --currency ")]),t._v(" - Currency to top up with")]),t._v(" "),s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of fiat currency for top up. e.g: 10.50 for $10.50 USD")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Open Stripe hosted checkout session in browser to top up for 10.00 USD worth of Turbo Credits")]),t._v("\nturbo top-up "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'crypto-wallet-public-native-address'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" ethereum "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--currency")]),t._v(" USD "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n")])])]),s("h5",{attrs:{id:"crypto-fund"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crypto-fund"}},[t._v("#")]),t._v(" "),s("code",[t._v("crypto-fund")])]),t._v(" "),s("p",[t._v("Fund a wallet with Turbo Credits by submitting a payment transaction for the crypto amount to the Turbo wallet and then submitting that transaction id to Turbo Payment Service for top up processing. Alternatively, submit a transaction ID of an existing funding transaction to Turbo Payment Service for top up processing.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of crypto token for fund. e.g: 0.0001 for 0.0001 KYVE")]),t._v(" "),s("li",[s("code",[t._v("-i, --tx-id ")]),t._v(" - Transaction ID of an existing funding transaction")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo crypto-fund "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0001")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" kyve --private-key "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'b27...45c'")]),t._v("\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo crypto-fund --tx-id "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my-valid-arweave-fund-transaction-id'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" arweave\n")])])]),s("h5",{attrs:{id:"upload-folder"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upload-folder"}},[t._v("#")]),t._v(" "),s("code",[t._v("upload-folder")])]),t._v(" "),s("p",[t._v("Upload a folder of files and create and upload a manifest file for the folder upload to the Turbo Upload Service.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-f, --folder-path ")]),t._v(" - Path to the folder to upload")]),t._v(" "),s("li",[s("code",[t._v("--index-file ")]),t._v(' - File to use for the "index" path in the resulting manifest')]),t._v(" "),s("li",[s("code",[t._v("--fallback-file ")]),t._v(" - Maximum number of concurrent uploads")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo upload-folder --folder-path "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../path/to/my/folder'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" solana --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/sol/sec/key.json\n")])])]),s("h5",{attrs:{id:"upload-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upload-file"}},[t._v("#")]),t._v(" "),s("code",[t._v("upload-file")])]),t._v(" "),s("p",[t._v("Upload a file to the Turbo Upload Service.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-f, --file-path ")]),t._v(" - Path to the file to upload")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo upload-file --file-path "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../path/to/my/file.txt'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" ethereum --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/eth/private/key.txt\n")])])]),s("h5",{attrs:{id:"price"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#price"}},[t._v("#")]),t._v(" "),s("code",[t._v("price")])]),t._v(" "),s("p",[t._v("Get the current credit price estimate from Turbo Payment Service for a given value and price type.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("--value ")]),t._v(" - Value to get the price for. e.g: 10.50 for $10.50 USD, 1024 for 1 KiB, 1.1 for 1.1AR")]),t._v(" "),s("li",[s("code",[t._v("--type ")]),t._v(" - Type of price to get, e.g: 'bytes', 'arweave', 'usd', 'kyve'. Default: 'bytes'")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.50")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" usd\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" bytes\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" arweave\n")])])]),s("h4",{attrs:{id:"share-credits"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#share-credits"}},[t._v("#")]),t._v(" "),s("code",[t._v("share-credits")])]),t._v(" "),s("p",[t._v("Shares credits from the connected wallet to the provided native address and approved winc amount.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address that will receive the Credits")]),t._v(" "),s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of winc to share to the target address")]),t._v(" "),s("li",[s("code",[t._v("-e, --expires-by-seconds ")]),t._v(" - Expiry time in seconds for the credit share approval")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo share-credits "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" 2cor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".VUa "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.083155650320")]),t._v(" --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet --expires-by-seconds "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3600")]),t._v("\n")])])]),s("h4",{attrs:{id:"revoke-credits"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#revoke-credits"}},[t._v("#")]),t._v(" "),s("code",[t._v("revoke-credits")])]),t._v(" "),s("p",[t._v("Revoke all credits shared from the connected wallet to the provided native address.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to revoke credit share approvals for")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo revoke-credits --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet\n")])])]),s("h4",{attrs:{id:"list-share"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#list-share"}},[t._v("#")]),t._v(" "),s("code",[t._v("list-share")])]),t._v(" "),s("p",[t._v("List all given and received credit share approvals from the connected wallet or the provided native address.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to list credit share approvals for")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo list-shares "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" 2cor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".VUa --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet\n")])])]),s("h2",{attrs:{id:"turbo-credit-sharing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbo-credit-sharing"}},[t._v("#")]),t._v(" Turbo Credit Sharing")]),t._v(" "),s("p",[t._v("Users can share their purchased Credits with other users' wallets by creating Credit Share Approvals. These approvals are created by uploading a signed data item with tags indicating the recipient's wallet address, the amount of Credits to share, and an optional amount of seconds that the approval will expire in. The recipient can then use the shared Credits to pay for their own uploads to Turbo.")]),t._v(" "),s("p",[t._v("Shared Credits cannot be re-shared by the recipient to other recipients. Only the original owner of the Credits can share or revoke Credit Share Approvals. Credits that are shared to other wallets may not be used by the original owner of the Credits for sharing or uploading unless the Credit Share Approval is revoked or expired.")]),t._v(" "),s("p",[t._v("Approvals can be revoked at any time by similarly uploading a signed data item with tags indicating the recipient's wallet address. This will remove all approvals and prevent the recipient from using the shared Credits. All unused Credits from expired or revoked approvals are returned to the original owner of the Credits.")]),t._v(" "),s("p",[t._v("To use the shared Credits, recipient users must provide the wallet address of the user who shared the Credits with them in the "),s("code",[t._v("x-paid-by")]),t._v(" HTTP header when uploading data. This tells Turbo services to look for and use Credit Share Approvals to pay for the upload before using the signer's balance.")]),t._v(" "),s("p",[t._v("For user convenience, during upload the Turbo CLI will use any available Credit Share Approvals found for the connected wallet before using the signing wallet's balance. To instead ignore all Credit shares and only use the signer's balance, use the "),s("code",[t._v("--ignore-approvals")]),t._v(" flag. To use the signer's balance first before using Credit shares, use the "),s("code",[t._v("--use-signer-balance-first")]),t._v(" flag. In contrast, the Turbo SDK layer does not provide this functionality and will only use approvals when "),s("code",[t._v("paidBy")]),t._v(" is provided.")]),t._v(" "),s("p",[t._v("The Turbo SDK provides the following methods to manage Credit Share Approvals:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("shareCredits")]),t._v(": Creates a Credit Share Approval for the specified wallet address and amount of Credits.")]),t._v(" "),s("li",[s("code",[t._v("revokeCredits")]),t._v(": Revokes all Credit Share Approvals for the specified wallet address.")]),t._v(" "),s("li",[s("code",[t._v("listShares")]),t._v(": Lists all Credit Share Approvals for the specified wallet address or connected wallet.")]),t._v(" "),s("li",[s("code",[t._v("dataItemOpts: { ...opts, paidBy: string[] }")]),t._v(": Upload methods now accept "),s("code",[t._v("paidBy")]),t._v(", an array of wallet addresses that have provided Credit Share Approvals to the user from which to pay, in the order provided and as necessary, for the upload.")])]),t._v(" "),s("p",[t._v("The Turbo CLI provides the following commands to manage Credit Share Approvals:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("share-credits")]),t._v(": Creates a Credit Share Approval for the specified wallet address and amount of Credits.")]),t._v(" "),s("li",[s("code",[t._v("revoke-credits")]),t._v(": Revokes all Credit Share Approvals for the specified wallet address.")]),t._v(" "),s("li",[s("code",[t._v("list-shares")]),t._v(": Lists all Credit Share Approvals for the specified wallet address or connected wallet.")]),t._v(" "),s("li",[s("code",[t._v("paidBy: --paid-by ")]),t._v(": Upload commands now accept "),s("code",[t._v("--paid-by")]),t._v(", an array of wallet addresses that have provided credit share approvals to the user from which to pay, in the order provided and as necessary, for the upload.")]),t._v(" "),s("li",[s("code",[t._v("--ignore-approvals")]),t._v(": Ignore all Credit Share Approvals and only use the signer's balance.")]),t._v(" "),s("li",[s("code",[t._v("--use-signer-balance-first")]),t._v(": Use the signer's balance first before using Credit Share Approvals.")])]),t._v(" "),s("h2",{attrs:{id:"developers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#developers"}},[t._v("#")]),t._v(" Developers")]),t._v(" "),s("h3",{attrs:{id:"requirements"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[t._v("#")]),t._v(" Requirements")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("nvm")])]),t._v(" "),s("li",[s("code",[t._v("node")]),t._v(" (>= 18)")]),t._v(" "),s("li",[s("code",[t._v("yarn")])])]),t._v(" "),s("h3",{attrs:{id:"setup-build"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup-build"}},[t._v("#")]),t._v(" Setup & Build")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn install")]),t._v(" - installs dependencies")]),t._v(" "),s("li",[s("code",[t._v("yarn build")]),t._v(" - builds web/node/bundled outputs")])]),t._v(" "),s("h3",{attrs:{id:"testing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#testing"}},[t._v("#")]),t._v(" Testing")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn test")]),t._v(" - runs integration tests against dev environment (e.g. "),s("code",[t._v("https://payment.ardrive.dev")]),t._v(" and "),s("code",[t._v("https://upload.ardrive.dev")]),t._v(")")]),t._v(" "),s("li",[s("code",[t._v("yarn test:docker")]),t._v(" - runs integration tests against locally running docker containers (recommended)")]),t._v(" "),s("li",[s("code",[t._v("yarn example:web")]),t._v(" - opens up the example web page")]),t._v(" "),s("li",[s("code",[t._v("yarn example:cjs")]),t._v(" - runs example CJS node script")]),t._v(" "),s("li",[s("code",[t._v("yarn example:esm")]),t._v(" - runs example ESM node script")])]),t._v(" "),s("h3",{attrs:{id:"linting-formatting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#linting-formatting"}},[t._v("#")]),t._v(" Linting & Formatting")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn lint:check")]),t._v(" - checks for linting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn lint:fix")]),t._v(" - fixes linting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn format:check")]),t._v(" - checks for formatting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn format:fix")]),t._v(" - fixes formatting errors")])]),t._v(" "),s("h3",{attrs:{id:"architecture"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[t._v("#")]),t._v(" Architecture")]),t._v(" "),s("ul",[s("li",[t._v("Code to interfaces.")]),t._v(" "),s("li",[t._v("Prefer type safety over runtime safety.")]),t._v(" "),s("li",[t._v("Prefer composition over inheritance.")]),t._v(" "),s("li",[t._v("Prefer integration tests over unit tests.")])]),t._v(" "),s("h2",{attrs:{id:"contributions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributions"}},[t._v("#")]),t._v(" Contributions")]),t._v(" "),s("p",[t._v("If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.")]),t._v(" "),s("p",[t._v("For more information on how to contribute, please see "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("CONTRIBUTING.md"),s("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[44],{339:function(t,s,a){"use strict";a.r(s);var n=a(10),e=Object(n.a)({},(function(){var t=this,s=t._self._c;return s("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[s("h1",{attrs:{id:"ardriveapp-turbo-sdk-πŸš€"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#ardriveapp-turbo-sdk-πŸš€"}},[t._v("#")]),t._v(" @ardriveapp/turbo-sdk πŸš€")]),t._v(" "),s("p",[t._v("Welcome to the "),s("code",[t._v("@ardrive/turbo-sdk")]),t._v("! This SDK provides functionality for interacting with the Turbo Upload and Payment Services and is available for both NodeJS and Web environments.")]),t._v(" "),s("h2",{attrs:{id:"installation"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#installation"}},[t._v("#")]),t._v(" Installation")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h2",{attrs:{id:"quick-start"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#quick-start"}},[t._v("#")]),t._v(" Quick Start")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" ArweaveSigner "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// load your JWK directly to authenticate")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("readFileSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-jwk.json'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("jwkToAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or provide your own signer")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the wallet balance")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// prep file for upload")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-image.png'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// get the cost of uploading the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// check if balance greater than upload cost")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" fileSizeCost"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" address"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// add a promo code if you have one")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// open the URL to top-up, continue when done")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("return")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload the file")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("try")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload complete!")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Successfully upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" owner"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" dataCaches"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fastFinalityIndexes "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("catch")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// upload failed")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("error")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Failed to upload data item!'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" error"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("finally")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" newBalance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'New balance:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" newBalance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("h2",{attrs:{id:"usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#usage"}},[t._v("#")]),t._v(" Usage")]),t._v(" "),s("p",[t._v("The SDK is provided in both CommonJS and ESM formats, and it's compatible with bundlers such as Webpack, Rollup, and ESbuild. Utilize the appropriate named exports provided by this SDK's "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/blob/main/package.json",target:"_blank",rel:"noopener noreferrer"}},[t._v("package.json"),s("OutboundLink")],1),t._v(" based on your project's configuration. Refer to the "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/tree/main/examples",target:"_blank",rel:"noopener noreferrer"}},[t._v("examples"),s("OutboundLink")],1),t._v(" directory to see how to use the SDK in various environments.")]),t._v(" "),s("h3",{attrs:{id:"web"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#web"}},[t._v("#")]),t._v(" Web")]),t._v(" "),s("h4",{attrs:{id:"bundlers-webpack-rollup-esbuild-etc"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#bundlers-webpack-rollup-esbuild-etc"}},[t._v("#")]),t._v(" Bundlers (Webpack, Rollup, ESbuild, etc.)")]),t._v(" "),s("p",[t._v("CommonJS:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("ESM:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Browser:")]),t._v(" "),s("div",{staticClass:"language-html extra-class"},[s("pre",{pre:!0,attrs:{class:"language-html"}},[s("code",[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("<")]),t._v("script")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token attr-name"}},[t._v("type")]),s("span",{pre:!0,attrs:{class:"token attr-value"}},[s("span",{pre:!0,attrs:{class:"token punctuation attr-equals"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')]),t._v("module"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v('"')])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(">")])]),s("span",{pre:!0,attrs:{class:"token script"}},[s("span",{pre:!0,attrs:{class:"token language-javascript"}},[t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"https://unpkg.com/@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])]),s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token tag"}},[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("")])]),t._v("\n")])])]),s("p",[s("em",[s("strong",[t._v("NOTE")])]),t._v(": Polyfills are not provided by default for bundled web projects (Vite, ESBuild, Webpack, Rollup, etc.) . Depending on your apps bundler configuration and plugins, you will need to provide polyfills for various imports including "),s("code",[t._v("crypto")]),t._v(", "),s("code",[t._v("process")]),t._v(", "),s("code",[t._v("fs")]),t._v(" and "),s("code",[t._v("buffer")]),t._v(". Refer to your bundler's documentation for how to provide the necessary polyfills.")]),t._v(" "),s("h3",{attrs:{id:"nodejs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#nodejs"}},[t._v("#")]),t._v(" NodeJS")]),t._v(" "),s("h4",{attrs:{id:"commonjs"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commonjs"}},[t._v("#")]),t._v(" CommonJS")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"commonjs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"typescript"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^5.4.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"CommonJS"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ES2021"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esModuleInterop"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-javascript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-javascript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" path "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"path"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("privateKey")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("amount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("signal")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token literal-property property"}},[t._v("tokenAmount")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n console"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"esm"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#esm"}},[t._v("#")]),t._v(" ESM")]),t._v(" "),s("p",[t._v("Project's "),s("code",[t._v("package.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"type"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"scripts"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"test"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ts-node ./index.ts"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"dependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"@ardrive/turbo-sdk"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"latest"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^1.14.4"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"devDependencies"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"^10.9.2"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Project's "),s("code",[t._v("tsconfig.json")]),t._v(":")]),t._v(" "),s("div",{staticClass:"language-json extra-class"},[s("pre",{pre:!0,attrs:{class:"language-json"}},[s("code",[s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"compilerOptions"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"moduleResolution"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"NodeNext"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"target"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ESNext"')]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"include"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./index.ts"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exclude"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"node_modules"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"ts-node"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token property"}},[t._v('"esm"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),s("p",[t._v("Usage:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or use @ardrive/turbo-sdk/web depending on your environment")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n WinstonToTokenAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/node"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" Arweave "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"arweave"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" fs "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"fs"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Generate a key from the arweave wallet.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" arweave "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("Arweave")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("wallets"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generate")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Use the arweave key to create an authenticated turbo client\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turboAuthClient "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("developmentTurboConfiguration"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the balance for the private key.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Balance:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" balance"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Fetch the estimated amount of winc returned for 10 USD (1000 cents).\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" estimatedWinc "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"10 USD to winc:"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" estimatedWinc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Post local files to the Turbo service.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Posting raw file to Turbo service..."')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("URL")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"../../files/1KB_file"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("meta"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("pathname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("uploadResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("/**\n * Tops up a wallet with Credits using tokens.\n * Default token is AR, using Winston as the unit.\n */")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" topUpResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turboAuthClient"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("JSON")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stringify")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("topUpResult"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("null")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("2")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h3",{attrs:{id:"typescript"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#typescript"}},[t._v("#")]),t._v(" Typescript")]),t._v(" "),s("p",[t._v("The SDK provides TypeScript types. When you import the SDK in a TypeScript project:")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" TurboFactory "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"@ardrive/turbo-sdk/web"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// or '@ardrive/turbo-sdk/node' for Node.js projects")]),t._v("\n")])])]),s("p",[t._v("Types are exported from "),s("code",[t._v("./lib/types/[node/web]/index.d.ts")]),t._v(" and should be automatically recognized, offering benefits such as type-checking and autocompletion.")]),t._v(" "),s("p",[t._v("Examples:")]),t._v(" "),s("p",[t._v("Examples are available in the "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/tree/main/examples",target:"_blank",rel:"noopener noreferrer"}},[t._v("examples"),s("OutboundLink")],1),t._v(" directory. To run examples:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn example:web")]),t._v(" - opens up the example web page")]),t._v(" "),s("li",[s("code",[t._v("yarn example:cjs")]),t._v(" - runs example CJS node script")]),t._v(" "),s("li",[s("code",[t._v("yarn example:esm")]),t._v(" - runs example ESM node script")])]),t._v(" "),s("h2",{attrs:{id:"apis"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#apis"}},[t._v("#")]),t._v(" APIs")]),t._v(" "),s("h3",{attrs:{id:"turbofactory"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbofactory"}},[t._v("#")]),t._v(" TurboFactory")]),t._v(" "),s("h4",{attrs:{id:"unauthenticated"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#unauthenticated"}},[t._v("#")]),t._v(" "),s("code",[t._v("unauthenticated()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates an instance of a client that accesses Turbo's unauthenticated services.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"authenticated"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#authenticated"}},[t._v("#")]),t._v(" "),s("code",[t._v("authenticated()")])]),t._v(" "),s("p",[t._v("Creates an instance of a client that accesses Turbo's authenticated and unauthenticated services. Requires either a signer, or private key to be provided.")]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Construct Turbo with an Arweave JWK")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" arweave"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("crypto"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("generateJWK")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" jwk "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an Arweave signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an Arconnect signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("ArweaveSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("jwk"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an ETH signer")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("new")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token class-name"}},[t._v("EthereumSigner")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("privateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with an ETH private key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ethHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"ethereum"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Construct Turbo with POL (MATIC) Private Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\nprivateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" ethHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\ntoken"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("div",{staticClass:"language- extra-class"},[s("pre",{pre:!0,attrs:{class:"language-text"}},[s("code",[t._v("\n- Construct Turbo with a HexSolanaSigner\n\n ```typescript\n const signer = new HexSolanaSigner(bs58.encode(secretKey));\n const turbo = TurboFactory.authenticated({ signer });\n")])])]),s("ul",[s("li",[s("p",[t._v("Construct Turbo with a SOL secret Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" bs58"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("encode")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("secretKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"solana"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Private Key")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" kyveHexadecimalPrivateKey"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Mnemonic")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("import")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" privateKeyFromKyveMnemonic "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("from")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'@ardrive/turbo-sdk'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n privateKey"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("privateKeyFromKyveMnemonic")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("mnemonic"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turbounauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbounauthenticatedclient"}},[t._v("#")]),t._v(" TurboUnauthenticatedClient")]),t._v(" "),s("h4",{attrs:{id:"getsupportedcurrencies"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getsupportedcurrencies"}},[t._v("#")]),t._v(" "),s("code",[t._v("getSupportedCurrencies()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the list of currencies supported by the Turbo Payment Service for topping up a user balance of AR Credits (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" currencies "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCurrencies")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getsupportedcountries"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getsupportedcountries"}},[t._v("#")]),t._v(" "),s("code",[t._v("getSupportedCountries()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the list of countries supported by the Turbo Payment Service's top up workflow.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" countries "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getSupportedCountries")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getfiattoar-currency"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getfiattoar-currency"}},[t._v("#")]),t._v(" "),s("code",[t._v("getFiatToAR({ currency })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current raw fiat to AR conversion rate for a specific currency as reported by third-party pricing oracles.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fiatToAR "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatToAR")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" currency"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"USD"')]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getfiatrates"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getfiatrates"}},[t._v("#")]),t._v(" "),s("code",[t._v("getFiatRates()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current fiat rates for 1 GiB of data for supported currencies, including all top-up adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" rates "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getFiatRates")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getwincforfiat-amount"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getwincforfiat-amount"}},[t._v("#")]),t._v(" "),s("code",[t._v("getWincForFiat({ amount })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getuploadcosts-bytes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getuploadcosts-bytes"}},[t._v("#")]),t._v(" "),s("code",[t._v("getUploadCosts({ bytes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the estimated cost in Winston Credits for the provided file sizes, including all upload adjustments and fees.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getUploadCosts")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" bytes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" uploadCostForFile"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadsigneddataitem-dataitemstreamfactory-dataitemsizefactory-signal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadsigneddataitem-dataitemstreamfactory-dataitemsizefactory-signal"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadSignedDataItem({ dataItemStreamFactory, dataItemSizeFactory, signal })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Uploads a signed data item. The provided "),s("code",[t._v("dataItemStreamFactory")]),t._v(" should produce a NEW signed data item stream each time is it invoked. The "),s("code",[t._v("dataItemSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-signed-data-item"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" dataItemSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("statSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResponse "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadSignedDataItem")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("dataItemSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" dataItemSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n signal"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" AbortSignal"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("timeout")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// cancel the upload after 10 seconds")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"createcheckoutsession-amount-owner"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#createcheckoutsession-amount-owner"}},[t._v("#")]),t._v(" "),s("code",[t._v("createCheckoutSession({ amount, owner })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner. The returned URL can be opened in the browser, all payments are processed by Stripe. To leverage promo codes, see "),s("a",{attrs:{href:"#turboauthenticatedclient"}},[t._v("TurboAuthenticatedClient")]),t._v(".")])]),t._v(" "),s("li",[s("p",[t._v("Arweave (AR) Fiat Top UP")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Ethereum (ETH) Fiat Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ethereum'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicEthereumAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Solana (SOL) Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'solana'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicSolanaAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Polygon (POL / MATIC) Fiat Top UP")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicPolygonAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Fiat Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicKyveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"submitfundtransaction-txid"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#submitfundtransaction-txid"}},[t._v("#")]),t._v(" "),s("code",[t._v("submitFundTransaction({ txId})")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Submits the transaction ID of a funding transaction to Turbo Payment Service for top up processing. The "),s("code",[t._v("txId")]),t._v(" is the transaction ID of the transaction to be submitted.")]),t._v(" "),s("ul",[s("li",[t._v("Note: use this API if you've already executed your token transfer to the Turbo wallet. Otherwise, consider using "),s("code",[t._v("topUpWithTokens")]),t._v(" to execute a new token transfer to the Turbo wallet and submit its resulting transaction ID for top up processing all in one go.")])]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("unauthenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// defaults to arweave token type")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token class-name"}},[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("submitFundTransaction")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n txId"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my-valid-arweave-fund-transaction-id"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h3",{attrs:{id:"turboauthenticatedclient"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turboauthenticatedclient"}},[t._v("#")]),t._v(" TurboAuthenticatedClient")]),t._v(" "),s("h4",{attrs:{id:"getbalance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getbalance"}},[t._v("#")]),t._v(" "),s("code",[t._v("getBalance()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Issues a signed request to get the credit balance of a wallet measured in AR (measured in Winston Credits, or winc).")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" balance "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getBalance")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"signer-getnativeaddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#signer-getnativeaddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("signer.getNativeAddress()")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the "),s("a",{attrs:{href:"https://docs.ar.io/glossary.html#native-address",target:"_blank",rel:"noopener noreferrer"}},[t._v("native address"),s("OutboundLink")],1),t._v(" of the connected signer.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" address "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getNativeAddress")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"getwincforfiat-amount-promocodes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getwincforfiat-amount-promocodes"}},[t._v("#")]),t._v(" "),s("code",[t._v("getWincForFiat({ amount, promoCodes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Returns the current amount of Winston Credits including all adjustments for the provided fiat currency, amount, and optional promo codes.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getWincForFiat")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"MY_PROMO_CODE"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"createcheckoutsession-amount-owner-promocodes"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#createcheckoutsession-amount-owner-promocodes"}},[t._v("#")]),t._v(" "),s("code",[t._v("createCheckoutSession({ amount, owner, promoCodes })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Creates a Stripe checkout session for a Turbo Top Up with the provided amount, currency, owner, and optional promo codes. The returned URL can be opened in the browser, all payments are processed by Stripe. Promo codes require an authenticated client.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" paymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" quotedPaymentAmount"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" adjustments "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createCheckoutSession")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n amount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token constant"}},[t._v("USD")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.0")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// $10.00 USD")]),t._v("\n owner"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" publicArweaveAddress"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n promoCodes"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'MY_PROMO_CODE'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// promo codes require an authenticated client")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Open checkout session in a browser")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'darwin'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// macOS")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("open ")]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("if")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("process"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("platform "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("===")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'win32'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Windows")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("exec")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token template-string"}},[s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('start "" "')]),s("span",{pre:!0,attrs:{class:"token interpolation"}},[s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("${")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token interpolation-punctuation punctuation"}},[t._v("}")])]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"')]),s("span",{pre:!0,attrs:{class:"token template-punctuation string"}},[t._v("`")])]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" shell"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("true")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("else")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// Linux/Unix")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("open")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("url"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadfile-filestreamfactory-filesizefactory-signal"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadfile-filestreamfactory-filesizefactory-signal"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadFile({ fileStreamFactory, fileSizeFactory, signal })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Signs and uploads a raw file. The provided "),s("code",[t._v("fileStreamFactory")]),t._v(" should produce a NEW file data stream each time is it invoked. The "),s("code",[t._v("fileSizeFactory")]),t._v(" is a function that returns the size of the file. The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request. "),s("code",[t._v("dataItemOpts")]),t._v(" is an optional object that can be used to configure tags, target, and anchor for the data item upload.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" filePath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"./my-unsigned-file.txt"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" fileSize "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("stateSync")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("size"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" uploadResult "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFile")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileStreamFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fs"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("createReadStream")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("filePath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token function-variable function"}},[t._v("fileSizeFactory")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" fileSize"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n dataItemOpts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n tags"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Content-Type"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"text/plain"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My-Custom-Tag"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"my-custom-value"')]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"uploadfolder-folderpath-files-dataitemopts-signal-maxconcurrentuploads-throwonfailure-manifestoptions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#uploadfolder-folderpath-files-dataitemopts-signal-maxconcurrentuploads-throwonfailure-manifestoptions"}},[t._v("#")]),t._v(" "),s("code",[t._v("uploadFolder({ folderPath, files, dataItemOpts, signal, maxConcurrentUploads, throwOnFailure, manifestOptions})")])]),t._v(" "),s("ul",[s("li",[t._v("Signs and uploads a folder of files. For NodeJS, the "),s("code",[t._v("folderPath")]),t._v(" of the folder to upload is required.")]),t._v(" "),s("li",[t._v("For the browser, an array of "),s("code",[t._v("files")]),t._v(" is required.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("dataItemOpts")]),t._v(" is an optional object that can be used to configure tags, target, and anchor for the data item upload.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("signal")]),t._v(" is an optional "),s("a",{attrs:{href:"https://developer.mozilla.org/en-US/docs/Web/API/AbortSignal",target:"_blank",rel:"noopener noreferrer"}},[t._v("AbortSignal"),s("OutboundLink")],1),t._v(" that can be used to cancel the upload or timeout the request.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("maxConcurrentUploads")]),t._v(" is an optional number that can be used to limit the number of concurrent uploads.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("throwOnFailure")]),t._v(" is an optional boolean that can be used to throw an error if any upload fails.")]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("manifestOptions")]),t._v(" is an optional object that can be used to configure the manifest file, including a custom index file, fallback file, or whether to disable manifests altogether. Manifests are enabled by default.")])]),t._v(" "),s("p",[t._v("NodeJS Upload Folder")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" folderPath "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" path"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("join")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("__dirname"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'./my-folder'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFolder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n folderPath"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n dataItemOpts"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n tags"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("[")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// User defined content type will overwrite file content type")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Content-Type'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'text/plain'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'My-Custom-Tag'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n value"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my-custom-value'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("]")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// no timeout or AbortSignal provided")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n manifestOptions"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// optional")]),t._v("\n indexFile"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'custom-index.html'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n fallbackFile"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'custom-fallback.html'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n disableManifests"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token boolean"}},[t._v("false")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("p",[t._v("Browser Upload Folder")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("input type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"file"')]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(" name"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"folder"')]),t._v(" webkitdirectory "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),t._v("script type"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v('"module"')]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" folderInput "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" document"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getElementById")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'folder'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n folderInput"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("addEventListener")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'change'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("async")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("event"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" selectedFiles "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" folderInput"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),t._v("files"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'Folder selected:'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" selectedFiles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("uploadFolder")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n files"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("Array")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("from")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("selectedFiles"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("map")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=>")]),t._v(" file"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n "),s("span",{pre:!0,attrs:{class:"token builtin"}},[t._v("console")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("log")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),t._v("manifest"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" fileResponses"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" manifestResponse"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("<")]),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("/")]),t._v("script"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(">")]),t._v("\n")])])]),s("h4",{attrs:{id:"topupwithtokens-tokenamount-feemultiplier"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#topupwithtokens-tokenamount-feemultiplier"}},[t._v("#")]),t._v(" "),s("code",[t._v("topUpWithTokens({ tokenAmount, feeMultiplier })")])]),t._v(" "),s("ul",[s("li",[s("p",[t._v("Tops up the connected wallet with Credits by submitting a payment transaction for the token amount to the Turbo wallet and then submitting that transaction ID to Turbo Payment Service for top up processing.")]),t._v(" "),s("ul",[s("li",[t._v("The "),s("code",[t._v("tokenAmount")]),t._v(" is the amount of tokens in the token type's smallest unit value (e.g: Winston for arweave token type) to fund the wallet with.\n"),s("ul",[s("li",[t._v("Note: As of release 1.5.0, only AR tokens are supported with "),s("code",[t._v("topUpWithTokens")]),t._v(".")])])]),t._v(" "),s("li",[t._v("The "),s("code",[t._v("feeMultiplier")]),t._v(" (optional) is the multiplier to apply to the reward for the transaction to modify its chances of being mined. Credits will be added to the wallet balance after the transaction is confirmed on the given blockchain. Defaults to 1.0, meaning no multiplier.")])])]),t._v(" "),s("li",[s("p",[t._v("Arweave (AR) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'arweave'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("WinstonToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("100_000_000")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.0001 AR")]),t._v("\n feeMultiplier"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.1")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 10% increase in reward for improved mining chances")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Ethereum (ETH) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'ethereum'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("ETHToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 ETH")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Solana (SOL) Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'solana'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("SOLToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 SOL")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("Polygon ( POL / MATIC ) Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'pol'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("POLToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 POL")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])]),t._v(" "),s("li",[s("p",[t._v("KYVE Crypto Top Up")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" TurboFactory"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("authenticated")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" signer"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" token"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'kyve'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n\n"),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" winc"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" status"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" id"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("...")]),t._v("fundResult "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("topUpWithTokens")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n tokenAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("KYVEToTokenAmount")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.00001")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("// 0.00001 KYVE")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])])])]),t._v(" "),s("h4",{attrs:{id:"sharecredits-approvedaddress-approvedwincamount-expiresbyseconds"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#sharecredits-approvedaddress-approvedwincamount-expiresbyseconds"}},[t._v("#")]),t._v(" `shareCredits({ approvedAddress, approvedWincAmount, expiresBySeconds })")]),t._v(" "),s("p",[t._v("Shares credits from the connected wallet to the provided native address and approved winc amount. This action will create a signed data item for the approval.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" approvalDataItemId"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" approvedWincAmount "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("shareCredits")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n approvedAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n approvedWincAmount"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.08315565032")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n expiresBySeconds"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3600")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"revokecredits-approvedaddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#revokecredits-approvedaddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("revokeCredits({ approvedAddress })")])]),t._v(" "),s("p",[t._v("Revokes all credits shared from the connected wallet to the provided native address.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" revokedApprovals "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("revokeCredits")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n approvedAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h4",{attrs:{id:"getcreditshareapprovals-useraddress"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#getcreditshareapprovals-useraddress"}},[t._v("#")]),t._v(" "),s("code",[t._v("getCreditShareApprovals({ userAddress })")])]),t._v(" "),s("p",[t._v("Returns all given or received credit share approvals for the connected wallet or the provided native address.")]),t._v(" "),s("div",{staticClass:"language-typescript extra-class"},[s("pre",{pre:!0,attrs:{class:"language-typescript"}},[s("code",[s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("const")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" givenApprovals"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" receivedApprovals "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v("=")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token keyword"}},[t._v("await")]),t._v(" turbo"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(".")]),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("getCreditShareApprovals")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("(")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n userAddress"),s("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'2cor...VUa'")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(")")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(";")]),t._v("\n")])])]),s("h2",{attrs:{id:"cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli"}},[t._v("#")]),t._v(" CLI")]),t._v(" "),s("h3",{attrs:{id:"install-cli"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#install-cli"}},[t._v("#")]),t._v(" Install CLI")]),t._v(" "),s("p",[t._v("Global installation:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-g")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" global "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or install locally as a dev dependency:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("npm")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("install")]),t._v(" --save-dev @ardrive/turbo-sdk\n")])])]),s("p",[t._v("or")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token function"}},[t._v("add")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("-D")]),t._v(" @ardrive/turbo-sdk\n")])])]),s("h3",{attrs:{id:"cli-usage"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#cli-usage"}},[t._v("#")]),t._v(" CLI Usage")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("p",[t._v("or from local installation:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token function"}},[t._v("yarn")]),t._v(" turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("npx turbo "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--help")]),t._v("\n")])])]),s("h4",{attrs:{id:"options"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#options"}},[t._v("#")]),t._v(" Options")]),t._v(" "),s("ul",[s("li",[s("p",[s("code",[t._v("-V, --version")]),t._v(" - output the version number")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-h, --help")]),t._v(" - display help for command")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("--dev")]),t._v(" - Enable development endpoints (default: false)")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-g, --gateway ")]),t._v(" - Set a custom crypto gateway URL")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-t, --token ")]),t._v(' - Token type for the command or connected wallet (default: "arweave")')])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-w, --wallet-file ")]),t._v(" - Wallet file to use with the action. Formats accepted: JWK.json, KYVE or ETH private key as a string, or SOL Secret Key as a Uint8Array")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-m, --mnemonic ")]),t._v(" - Mnemonic to use with the action (KYVE only)")])]),t._v(" "),s("li",[s("p",[s("code",[t._v("-p, --private-key ")]),t._v(" - Private key to use with the action")])])]),t._v(" "),s("h4",{attrs:{id:"commands"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#commands"}},[t._v("#")]),t._v(" Commands")]),t._v(" "),s("h5",{attrs:{id:"balance"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#balance"}},[t._v("#")]),t._v(" "),s("code",[t._v("balance")])]),t._v(" "),s("p",[t._v("Get the balance of a connected wallet or native address in Turbo Credits.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to get the balance of")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo balance "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),t._v("crypto-wallet-public-native-address"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" solana\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo balance --wallet-file "),s("span",{pre:!0,attrs:{class:"token variable"}},[s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")]),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet.json"),s("span",{pre:!0,attrs:{class:"token variable"}},[t._v("`")])]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" arweave\n")])])]),s("h5",{attrs:{id:"top-up"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#top-up"}},[t._v("#")]),t._v(" "),s("code",[t._v("top-up")])]),t._v(" "),s("p",[t._v("Top up a connected wallet or native address with Turbo Credits using a supported fiat currency. This command will create a Stripe checkout session for the top-up amount and open the URL in the default browser.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to top up")]),t._v(" "),s("li",[s("code",[t._v("-c, --currency ")]),t._v(" - Currency to top up with")]),t._v(" "),s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of fiat currency for top up. e.g: 10.50 for $10.50 USD")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[s("span",{pre:!0,attrs:{class:"token comment"}},[t._v("# Open Stripe hosted checkout session in browser to top up for 10.00 USD worth of Turbo Credits")]),t._v("\nturbo top-up "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'crypto-wallet-public-native-address'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" ethereum "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--currency")]),t._v(" USD "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10")]),t._v("\n")])])]),s("h5",{attrs:{id:"crypto-fund"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#crypto-fund"}},[t._v("#")]),t._v(" "),s("code",[t._v("crypto-fund")])]),t._v(" "),s("p",[t._v("Fund a wallet with Turbo Credits by submitting a payment transaction for the crypto amount to the Turbo wallet and then submitting that transaction id to Turbo Payment Service for top up processing. Alternatively, submit a transaction ID of an existing funding transaction to Turbo Payment Service for top up processing.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of crypto token for fund. e.g: 0.0001 for 0.0001 KYVE")]),t._v(" "),s("li",[s("code",[t._v("-i, --tx-id ")]),t._v(" - Transaction ID of an existing funding transaction")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo crypto-fund "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.0001")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" kyve --private-key "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'b27...45c'")]),t._v("\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo crypto-fund --tx-id "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'my-valid-arweave-fund-transaction-id'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" arweave\n")])])]),s("h5",{attrs:{id:"upload-folder"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upload-folder"}},[t._v("#")]),t._v(" "),s("code",[t._v("upload-folder")])]),t._v(" "),s("p",[t._v("Upload a folder of files and create and upload a manifest file for the folder upload to the Turbo Upload Service.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-f, --folder-path ")]),t._v(" - Path to the folder to upload")]),t._v(" "),s("li",[s("code",[t._v("--index-file ")]),t._v(' - File to use for the "index" path in the resulting manifest')]),t._v(" "),s("li",[s("code",[t._v("--fallback-file ")]),t._v(" - Maximum number of concurrent uploads")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo upload-folder --folder-path "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../path/to/my/folder'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" solana --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/sol/sec/key.json\n")])])]),s("h5",{attrs:{id:"upload-file"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#upload-file"}},[t._v("#")]),t._v(" "),s("code",[t._v("upload-file")])]),t._v(" "),s("p",[t._v("Upload a file to the Turbo Upload Service.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-f, --file-path ")]),t._v(" - Path to the file to upload")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo upload-file --file-path "),s("span",{pre:!0,attrs:{class:"token string"}},[t._v("'../path/to/my/file.txt'")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--token")]),t._v(" ethereum --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/eth/private/key.txt\n")])])]),s("h5",{attrs:{id:"price"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#price"}},[t._v("#")]),t._v(" "),s("code",[t._v("price")])]),t._v(" "),s("p",[t._v("Get the current credit price estimate from Turbo Payment Service for a given value and price type.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("--value ")]),t._v(" - Value to get the price for. e.g: 10.50 for $10.50 USD, 1024 for 1 KiB, 1.1 for 1.1AR")]),t._v(" "),s("li",[s("code",[t._v("--type ")]),t._v(" - Type of price to get, e.g: 'bytes', 'arweave', 'usd', 'kyve'. Default: 'bytes'")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("10.50")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" usd\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1024")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" bytes\n")])])]),s("div",{staticClass:"language-shell extra-class"},[s("pre",{pre:!0,attrs:{class:"language-shell"}},[s("code",[t._v("turbo price "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("1.1")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--type")]),t._v(" arweave\n")])])]),s("h4",{attrs:{id:"share-credits"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#share-credits"}},[t._v("#")]),t._v(" "),s("code",[t._v("share-credits")])]),t._v(" "),s("p",[t._v("Shares credits from the connected wallet to the provided native address and approved winc amount.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address that will receive the Credits")]),t._v(" "),s("li",[s("code",[t._v("-v, --value ")]),t._v(" - Value of winc to share to the target address")]),t._v(" "),s("li",[s("code",[t._v("-e, --expires-by-seconds ")]),t._v(" - Expiry time in seconds for the credit share approval")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo share-credits "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" 2cor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".VUa "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--value")]),t._v(" "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("0.083155650320")]),t._v(" --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet --expires-by-seconds "),s("span",{pre:!0,attrs:{class:"token number"}},[t._v("3600")]),t._v("\n")])])]),s("h4",{attrs:{id:"revoke-credits"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#revoke-credits"}},[t._v("#")]),t._v(" "),s("code",[t._v("revoke-credits")])]),t._v(" "),s("p",[t._v("Revoke all credits shared from the connected wallet to the provided native address.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to revoke credit share approvals for")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo revoke-credits --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet\n")])])]),s("h4",{attrs:{id:"list-share"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#list-share"}},[t._v("#")]),t._v(" "),s("code",[t._v("list-share")])]),t._v(" "),s("p",[t._v("List all given and received credit share approvals from the connected wallet or the provided native address.")]),t._v(" "),s("p",[t._v("Command Options:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("-a, --address ")]),t._v(" - Native address to list credit share approvals for")])]),t._v(" "),s("p",[t._v("e.g:")]),t._v(" "),s("div",{staticClass:"language-bash extra-class"},[s("pre",{pre:!0,attrs:{class:"language-bash"}},[s("code",[t._v("turbo list-shares "),s("span",{pre:!0,attrs:{class:"token parameter variable"}},[t._v("--address")]),t._v(" 2cor"),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v(".VUa --wallet-file "),s("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("..")]),t._v("/path/to/my/wallet\n")])])]),s("h2",{attrs:{id:"turbo-credit-sharing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#turbo-credit-sharing"}},[t._v("#")]),t._v(" Turbo Credit Sharing")]),t._v(" "),s("p",[t._v("Users can share their purchased Credits with other users' wallets by creating Credit Share Approvals. These approvals are created by uploading a signed data item with tags indicating the recipient's wallet address, the amount of Credits to share, and an optional amount of seconds that the approval will expire in. The recipient can then use the shared Credits to pay for their own uploads to Turbo.")]),t._v(" "),s("p",[t._v("Shared Credits cannot be re-shared by the recipient to other recipients. Only the original owner of the Credits can share or revoke Credit Share Approvals. Credits that are shared to other wallets may not be used by the original owner of the Credits for sharing or uploading unless the Credit Share Approval is revoked or expired.")]),t._v(" "),s("p",[t._v("Approvals can be revoked at any time by similarly uploading a signed data item with tags indicating the recipient's wallet address. This will remove all approvals and prevent the recipient from using the shared Credits. All unused Credits from expired or revoked approvals are returned to the original owner of the Credits.")]),t._v(" "),s("p",[t._v("To use the shared Credits, recipient users must provide the wallet address of the user who shared the Credits with them in the "),s("code",[t._v("x-paid-by")]),t._v(" HTTP header when uploading data. This tells Turbo services to look for and use Credit Share Approvals to pay for the upload before using the signer's balance.")]),t._v(" "),s("p",[t._v("For user convenience, during upload the Turbo CLI will use any available Credit Share Approvals found for the connected wallet before using the signing wallet's balance. To instead ignore all Credit shares and only use the signer's balance, use the "),s("code",[t._v("--ignore-approvals")]),t._v(" flag. To use the signer's balance first before using Credit shares, use the "),s("code",[t._v("--use-signer-balance-first")]),t._v(" flag. In contrast, the Turbo SDK layer does not provide this functionality and will only use approvals when "),s("code",[t._v("paidBy")]),t._v(" is provided.")]),t._v(" "),s("p",[t._v("The Turbo SDK provides the following methods to manage Credit Share Approvals:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("shareCredits")]),t._v(": Creates a Credit Share Approval for the specified wallet address and amount of Credits.")]),t._v(" "),s("li",[s("code",[t._v("revokeCredits")]),t._v(": Revokes all Credit Share Approvals for the specified wallet address.")]),t._v(" "),s("li",[s("code",[t._v("listShares")]),t._v(": Lists all Credit Share Approvals for the specified wallet address or connected wallet.")]),t._v(" "),s("li",[s("code",[t._v("dataItemOpts: { ...opts, paidBy: string[] }")]),t._v(": Upload methods now accept "),s("code",[t._v("paidBy")]),t._v(", an array of wallet addresses that have provided Credit Share Approvals to the user from which to pay, in the order provided and as necessary, for the upload.")])]),t._v(" "),s("p",[t._v("The Turbo CLI provides the following commands to manage Credit Share Approvals:")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("share-credits")]),t._v(": Creates a Credit Share Approval for the specified wallet address and amount of Credits.")]),t._v(" "),s("li",[s("code",[t._v("revoke-credits")]),t._v(": Revokes all Credit Share Approvals for the specified wallet address.")]),t._v(" "),s("li",[s("code",[t._v("list-shares")]),t._v(": Lists all Credit Share Approvals for the specified wallet address or connected wallet.")]),t._v(" "),s("li",[s("code",[t._v("paidBy: --paid-by ")]),t._v(": Upload commands now accept "),s("code",[t._v("--paid-by")]),t._v(", an array of wallet addresses that have provided credit share approvals to the user from which to pay, in the order provided and as necessary, for the upload.")]),t._v(" "),s("li",[s("code",[t._v("--ignore-approvals")]),t._v(": Ignore all Credit Share Approvals and only use the signer's balance.")]),t._v(" "),s("li",[s("code",[t._v("--use-signer-balance-first")]),t._v(": Use the signer's balance first before using Credit Share Approvals.")])]),t._v(" "),s("h2",{attrs:{id:"developers"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#developers"}},[t._v("#")]),t._v(" Developers")]),t._v(" "),s("h3",{attrs:{id:"requirements"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#requirements"}},[t._v("#")]),t._v(" Requirements")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("nvm")])]),t._v(" "),s("li",[s("code",[t._v("node")]),t._v(" (>= 18)")]),t._v(" "),s("li",[s("code",[t._v("yarn")])])]),t._v(" "),s("h3",{attrs:{id:"setup-build"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#setup-build"}},[t._v("#")]),t._v(" Setup & Build")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn install")]),t._v(" - installs dependencies")]),t._v(" "),s("li",[s("code",[t._v("yarn build")]),t._v(" - builds web/node/bundled outputs")])]),t._v(" "),s("h3",{attrs:{id:"testing"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#testing"}},[t._v("#")]),t._v(" Testing")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn test")]),t._v(" - runs integration tests against dev environment (e.g. "),s("code",[t._v("https://payment.ardrive.dev")]),t._v(" and "),s("code",[t._v("https://upload.ardrive.dev")]),t._v(")")]),t._v(" "),s("li",[s("code",[t._v("yarn test:docker")]),t._v(" - runs integration tests against locally running docker containers (recommended)")]),t._v(" "),s("li",[s("code",[t._v("yarn example:web")]),t._v(" - opens up the example web page")]),t._v(" "),s("li",[s("code",[t._v("yarn example:cjs")]),t._v(" - runs example CJS node script")]),t._v(" "),s("li",[s("code",[t._v("yarn example:esm")]),t._v(" - runs example ESM node script")])]),t._v(" "),s("h3",{attrs:{id:"linting-formatting"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#linting-formatting"}},[t._v("#")]),t._v(" Linting & Formatting")]),t._v(" "),s("ul",[s("li",[s("code",[t._v("yarn lint:check")]),t._v(" - checks for linting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn lint:fix")]),t._v(" - fixes linting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn format:check")]),t._v(" - checks for formatting errors")]),t._v(" "),s("li",[s("code",[t._v("yarn format:fix")]),t._v(" - fixes formatting errors")])]),t._v(" "),s("h3",{attrs:{id:"architecture"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#architecture"}},[t._v("#")]),t._v(" Architecture")]),t._v(" "),s("ul",[s("li",[t._v("Code to interfaces.")]),t._v(" "),s("li",[t._v("Prefer type safety over runtime safety.")]),t._v(" "),s("li",[t._v("Prefer composition over inheritance.")]),t._v(" "),s("li",[t._v("Prefer integration tests over unit tests.")])]),t._v(" "),s("h2",{attrs:{id:"contributions"}},[s("a",{staticClass:"header-anchor",attrs:{href:"#contributions"}},[t._v("#")]),t._v(" Contributions")]),t._v(" "),s("p",[t._v("If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.")]),t._v(" "),s("p",[t._v("For more information on how to contribute, please see "),s("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/blob/main/CONTRIBUTING.md",target:"_blank",rel:"noopener noreferrer"}},[t._v("CONTRIBUTING.md"),s("OutboundLink")],1),t._v(".")])])}),[],!1,null,null,null);s.default=e.exports}}]); \ No newline at end of file diff --git a/assets/js/45.c7be73e9.js b/assets/js/45.f39179cd.js similarity index 99% rename from assets/js/45.c7be73e9.js rename to assets/js/45.f39179cd.js index 577363c..0bd7893 100644 --- a/assets/js/45.c7be73e9.js +++ b/assets/js/45.f39179cd.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{339:function(e,t,r){"use strict";r.r(t);var a=r(10),o=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-sdk-release-notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-sdk-release-notes"}},[e._v("#")]),e._v(" Turbo SDK Release Notes")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: "),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("Turbo SDK Releases"),t("OutboundLink")],1),e._v(". Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.")]),e._v(" "),t("h2",{attrs:{id:"releases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#releases"}},[e._v("#")]),e._v(" Releases")]),e._v(" "),t("h3",{attrs:{id:"_1-17-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-0"}},[e._v("#")]),e._v(" 1.17.0")]),e._v(" "),t("p",[e._v("(2024-09-13)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("pol:")]),e._v(" add support for matic/pol crypto fund PE-6722 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/ee523bacac0b0e3213e6e132af6b0195cbf64562",target:"_blank",rel:"noopener noreferrer"}},[e._v("ee523ba"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("pol:")]),e._v(" add support for matic/pol token uploads and top ups PE-6721 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/62ff2c881f51c492b37dc87bfb47354cdc978766",target:"_blank",rel:"noopener noreferrer"}},[e._v("62ff2c8"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("price commands:")]),e._v(" init CLI price command PE-6728 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/d737b8e7bdfc9cd3c0eab5d505f805477db16106",target:"_blank",rel:"noopener noreferrer"}},[e._v("d737b8e"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-16-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-1"}},[e._v("#")]),e._v(" 1.16.1")]),e._v(" "),t("p",[e._v("(2024-09-13)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("bump kyvejs to resolve downstream errors PE-6664 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/3ccc0bf06daad6e6c182f4a13d955fc24a9097d7",target:"_blank",rel:"noopener noreferrer"}},[e._v("3ccc0bf"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-16-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-0"}},[e._v("#")]),e._v(" 1.16.0")]),e._v(" "),t("p",[e._v("(2024-09-12)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" assign token to config PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/d6444b27fd3dd774e5ffefbda785cf5f86306f91",target:"_blank",rel:"noopener noreferrer"}},[e._v("d6444b2"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("crypto fund:")]),e._v(" add --tx-id parameter with submitFundTransaction compatibility and docs PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/23b6035d3e8edbd9b16864930266880056231c9b",target:"_blank",rel:"noopener noreferrer"}},[e._v("23b6035"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("crypto fund:")]),e._v(" init confirmation promot PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/3714599bd3fc050e0d97299972de0e8343b6b4ea",target:"_blank",rel:"noopener noreferrer"}},[e._v("3714599"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("crypto fund:")]),e._v(" show target wallet in confirmation prompt PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/06f1c9a2a153ec8d5e8103f87617617e3854157d",target:"_blank",rel:"noopener noreferrer"}},[e._v("06f1c9a"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("winc for token:")]),e._v(" init getWincForToken PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/143cb398aa9d13437a34877003a68fc4ecdf6059",target:"_blank",rel:"noopener noreferrer"}},[e._v("143cb39"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-15-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-0"}},[e._v("#")]),e._v(" 1.15.0")]),e._v(" "),t("p",[e._v("(2024-09-12)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("repair types returned from payment service PE-6718 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/f97dfcb4bc042ad4755b7e3fe2bb39ceab8c21bf",target:"_blank",rel:"noopener noreferrer"}},[e._v("f97dfcb"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("enable unauthenticated winc for fiat promo code PE-6716 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/b2ade37b67444f4b0e63041746a39e6385c27d2c",target:"_blank",rel:"noopener noreferrer"}},[e._v("b2ade37"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-14-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-1"}},[e._v("#")]),e._v(" 1.14.1")]),e._v(" "),t("p",[e._v("(2024-09-11)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" assign token to config PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/5a0e837853888cb3536ea69a45fe6245b6a8d108",target:"_blank",rel:"noopener noreferrer"}},[e._v("5a0e837"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-14-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-0"}},[e._v("#")]),e._v(" 1.14.0")]),e._v(" "),t("p",[e._v("(2024-09-11)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("repair dependency errors; upgrade arweave; upgrade to "),t("a",{attrs:{href:"https://github.com/ar",target:"_blank",rel:"noopener noreferrer"}},[e._v("@ar"),t("OutboundLink")],1),e._v(".io/arbundles PE-6664 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a2e421f593abe9e37fa52a93e212445ea96bd17e",target:"_blank",rel:"noopener noreferrer"}},[e._v("a2e421f"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload file:")]),e._v(" init cli upload file command PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/f802fc5208ef574853f134e8ca3197fc1e6941c0",target:"_blank",rel:"noopener noreferrer"}},[e._v("f802fc5"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init CLI command PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/17af9f36ff9d826ae92664691d557eb198582ccb",target:"_blank",rel:"noopener noreferrer"}},[e._v("17af9f3"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init manifest options PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/305bd5a6b49ab9b326954548ab22e75807c9e080",target:"_blank",rel:"noopener noreferrer"}},[e._v("305bd5a"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-13-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-0"}},[e._v("#")]),e._v(" 1.13.0")]),e._v(" "),t("p",[e._v("(2024-09-06)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("balance:")]),e._v(" init CLI balance command PE-6635 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/18de65605d985a901b9211f94ce68fd305c0d8e6",target:"_blank",rel:"noopener noreferrer"}},[e._v("18de656"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("top-up:")]),e._v(" init top-up with stripe checkout command PE-6635 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/c43e11bc82f63f9b99e061848787fd1458c71a21",target:"_blank",rel:"noopener noreferrer"}},[e._v("c43e11b"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-12-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-0"}},[e._v("#")]),e._v(" 1.12.0")]),e._v(" "),t("p",[e._v("(2024-08-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("balance:")]),e._v(" add an unauthenticated getBalance method PE-6630 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/63bb4f8b05560848a67016d08f6bbe4d3724cf74",target:"_blank",rel:"noopener noreferrer"}},[e._v("63bb4f8"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("native address:")]),e._v(" get native address from connected signer PE-6629 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/7432156311811e921eff99254c4c44dfb97ca353",target:"_blank",rel:"noopener noreferrer"}},[e._v("7432156"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-11-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-0"}},[e._v("#")]),e._v(" 1.11.0")]),e._v(" "),t("p",[e._v("(2024-08-29)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" include bin/turbo in argv check PE-6449 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/cf575154a679ea846ff049d3390ca0cea6989a7a",target:"_blank",rel:"noopener noreferrer"}},[e._v("cf57515"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" init a turbo cli tool featuring KYVE crypto fund PE-6449 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/2eff402a7d759a91930d898343a0a97f1c2e9cb2",target:"_blank",rel:"noopener noreferrer"}},[e._v("2eff402"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" add exported isTokenType helper PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/bf70d596e9f3f4e31b63525ae533a166206ad736",target:"_blank",rel:"noopener noreferrer"}},[e._v("bf70d59"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" add tokenAmountToBase map PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/b2864b3ccad2b0488868b1740fbbf3bb55f1e8d0",target:"_blank",rel:"noopener noreferrer"}},[e._v("b2864b3"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" allow kyve token type for uploads and top ups PE-6447 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/861d542a7198620e94c1e5210e8c18420953749e",target:"_blank",rel:"noopener noreferrer"}},[e._v("861d542"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" init KYVE crypto fund PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/120735f8f0d342d6ebbeb16c05cabcdef2ec20f9",target:"_blank",rel:"noopener noreferrer"}},[e._v("120735f"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" update exported types PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/e06608ccb49e40c8ec0df686838c8ded370c2d2a",target:"_blank",rel:"noopener noreferrer"}},[e._v("e06608c"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-10-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-1"}},[e._v("#")]),e._v(" 1.10.1")]),e._v(" "),t("p",[e._v("(2024-08-23)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("expose "),t("code",[e._v("token")]),e._v(" on unauthenticated turbo factory PE-6569 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/7f0c44cfc319d0f303d252d0aa73f0d42a635e03",target:"_blank",rel:"noopener noreferrer"}},[e._v("7f0c44c"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-10-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-0"}},[e._v("#")]),e._v(" 1.10.0")]),e._v(" "),t("p",[e._v("(2024-08-15)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("build:")]),e._v(" update build outputs for web and README ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/74cce094393672b1c96b795f6d1ab642d89b1bc9",target:"_blank",rel:"noopener noreferrer"}},[e._v("74cce09"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("logger:")]),e._v(" fix winston setImmediate issue in web export for logger ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/481cbe6bbe05b542f498f2d68333854259e98497",target:"_blank",rel:"noopener noreferrer"}},[e._v("481cbe6"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" improve node exports PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a6c073bb8b8e8bebf818f08b2ae4b4613ae28c9f",target:"_blank",rel:"noopener noreferrer"}},[e._v("a6c073b"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" improve web exports PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/4b50778707cc74b03058eddd98cf1b8818ec39c4",target:"_blank",rel:"noopener noreferrer"}},[e._v("4b50778"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload folder:")]),e._v(" add manifest content type PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/af35d7bb4841822b62bc892e7dcca451b436117c",target:"_blank",rel:"noopener noreferrer"}},[e._v("af35d7b"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add manifestOptions with disable, index, and fallback parameters PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/708ea157c17450921de2a4d64989508f52ac6a2c",target:"_blank",rel:"noopener noreferrer"}},[e._v("708ea15"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add mime types for content type PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/44d124006089b21f0cc7649f822e16a3c0a259e9",target:"_blank",rel:"noopener noreferrer"}},[e._v("44d1240"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add throw on failure option PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a258aa6d97573233ef44a7e68c5696d19468b55c",target:"_blank",rel:"noopener noreferrer"}},[e._v("a258aa6"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" defer to use user defined content type on files when provided PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/5d5ef899686a23adcfffcf196824bb00684ceb88",target:"_blank",rel:"noopener noreferrer"}},[e._v("5d5ef89"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init web and node upload folder with manifest implementations PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/70d313538cbe522995d742b923459ed39aecc84c",target:"_blank",rel:"noopener noreferrer"}},[e._v("70d3135"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" slice leading "),t("code",[e._v("/")]),e._v(" from relative manifest paths PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/c6e3b7c961699a57a5b43626f10283dbe9d4b12e",target:"_blank",rel:"noopener noreferrer"}},[e._v("c6e3b7c"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" use concurrency with plimit-lit PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/110a424db68cfca985303187b318e5a4b1c43b30",target:"_blank",rel:"noopener noreferrer"}},[e._v("110a424"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-9-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-0"}},[e._v("#")]),e._v(" 1.9.0")]),e._v(" "),t("p",[e._v("(2024-05-06)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("eth payments")]),e._v(": setup ETH in default constructor, remove default wait()")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("eth payments")]),e._v(": init eth tx payments")])]),e._v(" "),t("h3",{attrs:{id:"_1-8-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-0"}},[e._v("#")]),e._v(" 1.8.0")]),e._v(" "),t("p",[e._v("(2024-05-02)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("solana payments")]),e._v(": init solana token tools for sol payment")])]),e._v(" "),t("h3",{attrs:{id:"_1-7-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-0"}},[e._v("#")]),e._v(" 1.7.0")]),e._v(" "),t("p",[e._v("(2024-04-25)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": allow eth and sol signing for upload")]),e._v(" "),t("li",[t("strong",[e._v("upload")]),e._v(": allow eth/sol signer types")])]),e._v(" "),t("h3",{attrs:{id:"_1-6-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-0"}},[e._v("#")]),e._v(" 1.6.0")]),e._v(" "),t("p",[e._v("(2024-04-24)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("top up")]),e._v(": allow eth/sol destination for fiat top up")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": allow eth/sol destination for fiat top up")])]),e._v(" "),t("h3",{attrs:{id:"_1-5-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-0"}},[e._v("#")]),e._v(" 1.5.0")]),e._v(" "),t("p",[e._v("(2024-04-16)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("fund with AR")]),e._v(": add web esm compatible arweave export")]),e._v(" "),t("li",[e._v("export Arconnect and ArweaveSigner from env specific signers")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("crypto payments")]),e._v(": Init fund methods")]),e._v(" "),t("li",[t("strong",[e._v("crypto payments")]),e._v(": Refactor arweave-js out of signer")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Add ToTokenAmount helper utils")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Catch polling error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Continue polling on request error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Throw no wallet found as error")]),e._v(" "),t("li",[t("strong",[e._v("signers")]),e._v(": Exports arbundles ArconnectSigner and ArweaveSigner")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-2"}},[e._v("#")]),e._v(" 1.4.2")]),e._v(" "),t("p",[e._v("(2024-03-15)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("arbundles")]),e._v(": pin arbundles to v0.9.9 and run tests locally")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-1"}},[e._v("#")]),e._v(" 1.4.1")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("checkout session")]),e._v(": correct query param, change type, add coverage")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-0"}},[e._v("#")]),e._v(" 1.4.0")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("ui mode")]),e._v(": support query param for checkout session ui mode")])]),e._v(" "),t("h3",{attrs:{id:"_1-3-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-0"}},[e._v("#")]),e._v(" 1.3.0")]),e._v(" "),t("p",[e._v("(2024-01-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("web")]),e._v(": ensure we have the public key for arconnect wallets when signing data")]),e._v(" "),t("li",[t("strong",[e._v("web")]),e._v(": remove reference to "),t("code",[e._v("node:crypto")]),e._v(" in websigner, use signer to signer to sign header")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("signer")]),e._v(": allow an optional signer to be passed instead of JWK for signing data items")])]),e._v(" "),t("h3",{attrs:{id:"_1-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-0"}},[e._v("#")]),e._v(" 1.2.0")]),e._v(" "),t("p",[e._v("(2023-12-15)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("data item opts")]),e._v(": init tags anchor and target support PE-5035")])]),e._v(" "),t("h3",{attrs:{id:"_1-1-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1"}},[e._v("#")]),e._v(" 1.1.1")]),e._v(" "),t("p",[e._v("(2023-12-14)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("exports")]),e._v(": use bundled export to avoid issue with polyfilled features needed for web")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": web exports reference an invalid build path")]),e._v(" "),t("li",[t("strong",[e._v("polyfills")]),e._v(": update esbuild script to include crypto polyfill")])]),e._v(" "),t("h3",{attrs:{id:"_1-1-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-0"}},[e._v("#")]),e._v(" 1.1.0")]),e._v(" "),t("p",[e._v("(2023-11-10)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("axios")]),e._v(": set "),t("code",[e._v("maxRedirects")]),e._v(" to "),t("code",[e._v("0")]),e._v(" on our axios instances")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("logger")]),e._v(": add configurable global logger")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-2"}},[e._v("#")]),e._v(" 1.0.2")]),e._v(" "),t("p",[e._v("(2023-11-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": update the default upload service URL")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-1"}},[e._v("#")]),e._v(" 1.0.1")]),e._v(" "),t("p",[e._v("(2023-09-27)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("headers")]),e._v(": add default headers for all HTTP requests")]),e._v(" "),t("li",[t("strong",[e._v("release")]),e._v(": use script that updates built version.js files")]),e._v(" "),t("li",[t("strong",[e._v("version")]),e._v(": update version.js to proper version on build and commit it back to git after a release")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-0"}},[e._v("#")]),e._v(" 1.0.0")]),e._v(" "),t("p",[e._v("(2023-09-26)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add main import and allow wildcard imports")]),e._v(" "),t("li",[e._v("add module to package.json and tweak types")]),e._v(" "),t("li",[e._v("add one more step to make esm useable")]),e._v(" "),t("li",[e._v("add owner to TurboUploadDataItemResponse and remove byteCount")]),e._v(" "),t("li",[e._v("add separate folder for types, use it in named exports")]),e._v(" "),t("li",[e._v("change name of public facing clients.")]),e._v(" "),t("li",[t("strong",[e._v("cjs")]),e._v(": add separate cjs and esm outputs")]),e._v(" "),t("li",[t("strong",[e._v("content-length")]),e._v(": require content length factory for uploads")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": move turbo configurations to turbo.ts so it is available to clients")]),e._v(" "),t("li",[e._v("fix package.json")]),e._v(" "),t("li",[e._v("modify return type of signDataItem function, tweak implementation of ArweaveSigner header")]),e._v(" "),t("li",[e._v("move from getWincPriceForBytes to getUploadCosts")]),e._v(" "),t("li",[t("strong",[e._v("package.json")]),e._v(": add back module to package.json")]),e._v(" "),t("li",[e._v("remove package.json from lib directory")]),e._v(" "),t("li",[e._v("remove postinstall command")]),e._v(" "),t("li",[e._v("replace retry-axios, add additional retry logic")]),e._v(" "),t("li",[t("strong",[e._v("retry-axios")]),e._v(": pin retry-axios to 3.0.0")]),e._v(" "),t("li",[e._v("revert to single file upload/data item upload")]),e._v(" "),t("li",[e._v("swap adding package.json to esm to cjs")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": export type PE-4465")]),e._v(" "),t("li",[e._v("type imports for web and node")]),e._v(" "),t("li",[t("strong",[e._v("types")]),e._v(": finalize types, update default payment and upload URLs")]),e._v(" "),t("li",[e._v("update main and types path in package.json")]),e._v(" "),t("li",[e._v("update package.json output for esm")]),e._v(" "),t("li",[e._v("update web signer and cleanup examples")]),e._v(" "),t("li",[e._v("use .cjs as base for types to avoid reference require errors")]),e._v(" "),t("li",[e._v("use declare in sub-classes to overwrite parent class type")]),e._v(" "),t("li",[t("strong",[e._v("wildcard")]),e._v(": allow wildcard exports for older projects")]),e._v(" "),t("li",[e._v("wrong path for types!")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("abstract axios to TurboHTTPService class")]),e._v(" "),t("li",[e._v("abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService")]),e._v(" "),t("li",[e._v("add remaining unauthenticated apis for payment service, introduce some new types, add tests")]),e._v(" "),t("li",[e._v("add uploadFiles implementation for node and web")]),e._v(" "),t("li",[e._v("break services into auth vs unauth")]),e._v(" "),t("li",[e._v("initial implementation of TurboWebClient and TurboNodeClient")]),e._v(" "),t("li",[e._v("introduce AbortController")]),e._v(" "),t("li",[e._v("introduce uploadSignedDataItem interface, implement for node")]),e._v(" "),t("li",[e._v("remove TurboDataItemVerifier")]),e._v(" "),t("li",[t("strong",[e._v("sdk")]),e._v(": all uphill from here πŸš€ PE-4064")]),e._v(" "),t("li",[t("strong",[e._v("top-up")]),e._v(": init get checkout session PE-4465")]),e._v(" "),t("li",[t("strong",[e._v("winc for fiat")]),e._v(": extend AmountMapper pattern and add promoCode support PE-4465")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[45],{340:function(e,t,r){"use strict";r.r(t);var a=r(10),o=Object(a.a)({},(function(){var e=this,t=e._self._c;return t("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[t("h1",{attrs:{id:"turbo-sdk-release-notes"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#turbo-sdk-release-notes"}},[e._v("#")]),e._v(" Turbo SDK Release Notes")]),e._v(" "),t("h2",{attrs:{id:"overview"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),t("p",[e._v("Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: "),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/releases",target:"_blank",rel:"noopener noreferrer"}},[e._v("Turbo SDK Releases"),t("OutboundLink")],1),e._v(". Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.")]),e._v(" "),t("h2",{attrs:{id:"releases"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#releases"}},[e._v("#")]),e._v(" Releases")]),e._v(" "),t("h3",{attrs:{id:"_1-17-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-17-0"}},[e._v("#")]),e._v(" 1.17.0")]),e._v(" "),t("p",[e._v("(2024-09-13)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("pol:")]),e._v(" add support for matic/pol crypto fund PE-6722 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/ee523bacac0b0e3213e6e132af6b0195cbf64562",target:"_blank",rel:"noopener noreferrer"}},[e._v("ee523ba"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("pol:")]),e._v(" add support for matic/pol token uploads and top ups PE-6721 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/62ff2c881f51c492b37dc87bfb47354cdc978766",target:"_blank",rel:"noopener noreferrer"}},[e._v("62ff2c8"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("price commands:")]),e._v(" init CLI price command PE-6728 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/d737b8e7bdfc9cd3c0eab5d505f805477db16106",target:"_blank",rel:"noopener noreferrer"}},[e._v("d737b8e"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-16-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-1"}},[e._v("#")]),e._v(" 1.16.1")]),e._v(" "),t("p",[e._v("(2024-09-13)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("bump kyvejs to resolve downstream errors PE-6664 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/3ccc0bf06daad6e6c182f4a13d955fc24a9097d7",target:"_blank",rel:"noopener noreferrer"}},[e._v("3ccc0bf"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-16-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-16-0"}},[e._v("#")]),e._v(" 1.16.0")]),e._v(" "),t("p",[e._v("(2024-09-12)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" assign token to config PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/d6444b27fd3dd774e5ffefbda785cf5f86306f91",target:"_blank",rel:"noopener noreferrer"}},[e._v("d6444b2"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("crypto fund:")]),e._v(" add --tx-id parameter with submitFundTransaction compatibility and docs PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/23b6035d3e8edbd9b16864930266880056231c9b",target:"_blank",rel:"noopener noreferrer"}},[e._v("23b6035"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("crypto fund:")]),e._v(" init confirmation promot PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/3714599bd3fc050e0d97299972de0e8343b6b4ea",target:"_blank",rel:"noopener noreferrer"}},[e._v("3714599"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("crypto fund:")]),e._v(" show target wallet in confirmation prompt PE-6732 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/06f1c9a2a153ec8d5e8103f87617617e3854157d",target:"_blank",rel:"noopener noreferrer"}},[e._v("06f1c9a"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("winc for token:")]),e._v(" init getWincForToken PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/143cb398aa9d13437a34877003a68fc4ecdf6059",target:"_blank",rel:"noopener noreferrer"}},[e._v("143cb39"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-15-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-15-0"}},[e._v("#")]),e._v(" 1.15.0")]),e._v(" "),t("p",[e._v("(2024-09-12)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("repair types returned from payment service PE-6718 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/f97dfcb4bc042ad4755b7e3fe2bb39ceab8c21bf",target:"_blank",rel:"noopener noreferrer"}},[e._v("f97dfcb"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("enable unauthenticated winc for fiat promo code PE-6716 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/b2ade37b67444f4b0e63041746a39e6385c27d2c",target:"_blank",rel:"noopener noreferrer"}},[e._v("b2ade37"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-14-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-1"}},[e._v("#")]),e._v(" 1.14.1")]),e._v(" "),t("p",[e._v("(2024-09-11)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" assign token to config PE-6632 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/5a0e837853888cb3536ea69a45fe6245b6a8d108",target:"_blank",rel:"noopener noreferrer"}},[e._v("5a0e837"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-14-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-14-0"}},[e._v("#")]),e._v(" 1.14.0")]),e._v(" "),t("p",[e._v("(2024-09-11)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("repair dependency errors; upgrade arweave; upgrade to "),t("a",{attrs:{href:"https://github.com/ar",target:"_blank",rel:"noopener noreferrer"}},[e._v("@ar"),t("OutboundLink")],1),e._v(".io/arbundles PE-6664 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a2e421f593abe9e37fa52a93e212445ea96bd17e",target:"_blank",rel:"noopener noreferrer"}},[e._v("a2e421f"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload file:")]),e._v(" init cli upload file command PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/f802fc5208ef574853f134e8ca3197fc1e6941c0",target:"_blank",rel:"noopener noreferrer"}},[e._v("f802fc5"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init CLI command PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/17af9f36ff9d826ae92664691d557eb198582ccb",target:"_blank",rel:"noopener noreferrer"}},[e._v("17af9f3"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init manifest options PE-6636 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/305bd5a6b49ab9b326954548ab22e75807c9e080",target:"_blank",rel:"noopener noreferrer"}},[e._v("305bd5a"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-13-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-13-0"}},[e._v("#")]),e._v(" 1.13.0")]),e._v(" "),t("p",[e._v("(2024-09-06)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("balance:")]),e._v(" init CLI balance command PE-6635 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/18de65605d985a901b9211f94ce68fd305c0d8e6",target:"_blank",rel:"noopener noreferrer"}},[e._v("18de656"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("top-up:")]),e._v(" init top-up with stripe checkout command PE-6635 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/c43e11bc82f63f9b99e061848787fd1458c71a21",target:"_blank",rel:"noopener noreferrer"}},[e._v("c43e11b"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-12-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-12-0"}},[e._v("#")]),e._v(" 1.12.0")]),e._v(" "),t("p",[e._v("(2024-08-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("balance:")]),e._v(" add an unauthenticated getBalance method PE-6630 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/63bb4f8b05560848a67016d08f6bbe4d3724cf74",target:"_blank",rel:"noopener noreferrer"}},[e._v("63bb4f8"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("native address:")]),e._v(" get native address from connected signer PE-6629 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/7432156311811e921eff99254c4c44dfb97ca353",target:"_blank",rel:"noopener noreferrer"}},[e._v("7432156"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-11-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-11-0"}},[e._v("#")]),e._v(" 1.11.0")]),e._v(" "),t("p",[e._v("(2024-08-29)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" include bin/turbo in argv check PE-6449 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/cf575154a679ea846ff049d3390ca0cea6989a7a",target:"_blank",rel:"noopener noreferrer"}},[e._v("cf57515"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("cli:")]),e._v(" init a turbo cli tool featuring KYVE crypto fund PE-6449 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/2eff402a7d759a91930d898343a0a97f1c2e9cb2",target:"_blank",rel:"noopener noreferrer"}},[e._v("2eff402"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" add exported isTokenType helper PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/bf70d596e9f3f4e31b63525ae533a166206ad736",target:"_blank",rel:"noopener noreferrer"}},[e._v("bf70d59"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" add tokenAmountToBase map PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/b2864b3ccad2b0488868b1740fbbf3bb55f1e8d0",target:"_blank",rel:"noopener noreferrer"}},[e._v("b2864b3"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" allow kyve token type for uploads and top ups PE-6447 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/861d542a7198620e94c1e5210e8c18420953749e",target:"_blank",rel:"noopener noreferrer"}},[e._v("861d542"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" init KYVE crypto fund PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/120735f8f0d342d6ebbeb16c05cabcdef2ec20f9",target:"_blank",rel:"noopener noreferrer"}},[e._v("120735f"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("kyve:")]),e._v(" update exported types PE-6448 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/e06608ccb49e40c8ec0df686838c8ded370c2d2a",target:"_blank",rel:"noopener noreferrer"}},[e._v("e06608c"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-10-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-1"}},[e._v("#")]),e._v(" 1.10.1")]),e._v(" "),t("p",[e._v("(2024-08-23)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("expose "),t("code",[e._v("token")]),e._v(" on unauthenticated turbo factory PE-6569 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/7f0c44cfc319d0f303d252d0aa73f0d42a635e03",target:"_blank",rel:"noopener noreferrer"}},[e._v("7f0c44c"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-10-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-10-0"}},[e._v("#")]),e._v(" 1.10.0")]),e._v(" "),t("p",[e._v("(2024-08-15)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("build:")]),e._v(" update build outputs for web and README ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/74cce094393672b1c96b795f6d1ab642d89b1bc9",target:"_blank",rel:"noopener noreferrer"}},[e._v("74cce09"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("logger:")]),e._v(" fix winston setImmediate issue in web export for logger ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/481cbe6bbe05b542f498f2d68333854259e98497",target:"_blank",rel:"noopener noreferrer"}},[e._v("481cbe6"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" improve node exports PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a6c073bb8b8e8bebf818f08b2ae4b4613ae28c9f",target:"_blank",rel:"noopener noreferrer"}},[e._v("a6c073b"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" improve web exports PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/4b50778707cc74b03058eddd98cf1b8818ec39c4",target:"_blank",rel:"noopener noreferrer"}},[e._v("4b50778"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload folder:")]),e._v(" add manifest content type PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/af35d7bb4841822b62bc892e7dcca451b436117c",target:"_blank",rel:"noopener noreferrer"}},[e._v("af35d7b"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add manifestOptions with disable, index, and fallback parameters PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/708ea157c17450921de2a4d64989508f52ac6a2c",target:"_blank",rel:"noopener noreferrer"}},[e._v("708ea15"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add mime types for content type PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/44d124006089b21f0cc7649f822e16a3c0a259e9",target:"_blank",rel:"noopener noreferrer"}},[e._v("44d1240"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" add throw on failure option PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/a258aa6d97573233ef44a7e68c5696d19468b55c",target:"_blank",rel:"noopener noreferrer"}},[e._v("a258aa6"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" defer to use user defined content type on files when provided PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/5d5ef899686a23adcfffcf196824bb00684ceb88",target:"_blank",rel:"noopener noreferrer"}},[e._v("5d5ef89"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" init web and node upload folder with manifest implementations PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/70d313538cbe522995d742b923459ed39aecc84c",target:"_blank",rel:"noopener noreferrer"}},[e._v("70d3135"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" slice leading "),t("code",[e._v("/")]),e._v(" from relative manifest paths PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/c6e3b7c961699a57a5b43626f10283dbe9d4b12e",target:"_blank",rel:"noopener noreferrer"}},[e._v("c6e3b7c"),t("OutboundLink")],1),e._v(")")]),e._v(" "),t("li",[t("strong",[e._v("upload folder:")]),e._v(" use concurrency with plimit-lit PE-4643 ("),t("a",{attrs:{href:"https://github.com/ardriveapp/turbo-sdk/commit/110a424db68cfca985303187b318e5a4b1c43b30",target:"_blank",rel:"noopener noreferrer"}},[e._v("110a424"),t("OutboundLink")],1),e._v(")")])]),e._v(" "),t("h3",{attrs:{id:"_1-9-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-9-0"}},[e._v("#")]),e._v(" 1.9.0")]),e._v(" "),t("p",[e._v("(2024-05-06)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("eth payments")]),e._v(": setup ETH in default constructor, remove default wait()")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("eth payments")]),e._v(": init eth tx payments")])]),e._v(" "),t("h3",{attrs:{id:"_1-8-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-8-0"}},[e._v("#")]),e._v(" 1.8.0")]),e._v(" "),t("p",[e._v("(2024-05-02)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("solana payments")]),e._v(": init solana token tools for sol payment")])]),e._v(" "),t("h3",{attrs:{id:"_1-7-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-7-0"}},[e._v("#")]),e._v(" 1.7.0")]),e._v(" "),t("p",[e._v("(2024-04-25)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": allow eth and sol signing for upload")]),e._v(" "),t("li",[t("strong",[e._v("upload")]),e._v(": allow eth/sol signer types")])]),e._v(" "),t("h3",{attrs:{id:"_1-6-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-6-0"}},[e._v("#")]),e._v(" 1.6.0")]),e._v(" "),t("p",[e._v("(2024-04-24)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("top up")]),e._v(": allow eth/sol destination for fiat top up")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": allow eth/sol destination for fiat top up")])]),e._v(" "),t("h3",{attrs:{id:"_1-5-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-5-0"}},[e._v("#")]),e._v(" 1.5.0")]),e._v(" "),t("p",[e._v("(2024-04-16)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("fund with AR")]),e._v(": add web esm compatible arweave export")]),e._v(" "),t("li",[e._v("export Arconnect and ArweaveSigner from env specific signers")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("crypto payments")]),e._v(": Init fund methods")]),e._v(" "),t("li",[t("strong",[e._v("crypto payments")]),e._v(": Refactor arweave-js out of signer")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Add ToTokenAmount helper utils")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Catch polling error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Continue polling on request error")]),e._v(" "),t("li",[t("strong",[e._v("fund with AR")]),e._v(": Throw no wallet found as error")]),e._v(" "),t("li",[t("strong",[e._v("signers")]),e._v(": Exports arbundles ArconnectSigner and ArweaveSigner")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-2"}},[e._v("#")]),e._v(" 1.4.2")]),e._v(" "),t("p",[e._v("(2024-03-15)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("arbundles")]),e._v(": pin arbundles to v0.9.9 and run tests locally")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-1"}},[e._v("#")]),e._v(" 1.4.1")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("checkout session")]),e._v(": correct query param, change type, add coverage")])]),e._v(" "),t("h3",{attrs:{id:"_1-4-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-4-0"}},[e._v("#")]),e._v(" 1.4.0")]),e._v(" "),t("p",[e._v("(2024-01-30)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("ui mode")]),e._v(": support query param for checkout session ui mode")])]),e._v(" "),t("h3",{attrs:{id:"_1-3-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-3-0"}},[e._v("#")]),e._v(" 1.3.0")]),e._v(" "),t("p",[e._v("(2024-01-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("web")]),e._v(": ensure we have the public key for arconnect wallets when signing data")]),e._v(" "),t("li",[t("strong",[e._v("web")]),e._v(": remove reference to "),t("code",[e._v("node:crypto")]),e._v(" in websigner, use signer to signer to sign header")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("signer")]),e._v(": allow an optional signer to be passed instead of JWK for signing data items")])]),e._v(" "),t("h3",{attrs:{id:"_1-2-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-2-0"}},[e._v("#")]),e._v(" 1.2.0")]),e._v(" "),t("p",[e._v("(2023-12-15)")]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("data item opts")]),e._v(": init tags anchor and target support PE-5035")])]),e._v(" "),t("h3",{attrs:{id:"_1-1-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-1"}},[e._v("#")]),e._v(" 1.1.1")]),e._v(" "),t("p",[e._v("(2023-12-14)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("exports")]),e._v(": use bundled export to avoid issue with polyfilled features needed for web")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": web exports reference an invalid build path")]),e._v(" "),t("li",[t("strong",[e._v("polyfills")]),e._v(": update esbuild script to include crypto polyfill")])]),e._v(" "),t("h3",{attrs:{id:"_1-1-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-1-0"}},[e._v("#")]),e._v(" 1.1.0")]),e._v(" "),t("p",[e._v("(2023-11-10)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("axios")]),e._v(": set "),t("code",[e._v("maxRedirects")]),e._v(" to "),t("code",[e._v("0")]),e._v(" on our axios instances")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("logger")]),e._v(": add configurable global logger")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-2"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-2"}},[e._v("#")]),e._v(" 1.0.2")]),e._v(" "),t("p",[e._v("(2023-11-03)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("upload")]),e._v(": update the default upload service URL")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-1"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-1"}},[e._v("#")]),e._v(" 1.0.1")]),e._v(" "),t("p",[e._v("(2023-09-27)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[t("strong",[e._v("headers")]),e._v(": add default headers for all HTTP requests")]),e._v(" "),t("li",[t("strong",[e._v("release")]),e._v(": use script that updates built version.js files")]),e._v(" "),t("li",[t("strong",[e._v("version")]),e._v(": update version.js to proper version on build and commit it back to git after a release")])]),e._v(" "),t("h3",{attrs:{id:"_1-0-0"}},[t("a",{staticClass:"header-anchor",attrs:{href:"#_1-0-0"}},[e._v("#")]),e._v(" 1.0.0")]),e._v(" "),t("p",[e._v("(2023-09-26)")]),e._v(" "),t("p",[e._v("Bug Fixes")]),e._v(" "),t("ul",[t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add command that removes type module from package.json")]),e._v(" "),t("li",[e._v("add main import and allow wildcard imports")]),e._v(" "),t("li",[e._v("add module to package.json and tweak types")]),e._v(" "),t("li",[e._v("add one more step to make esm useable")]),e._v(" "),t("li",[e._v("add owner to TurboUploadDataItemResponse and remove byteCount")]),e._v(" "),t("li",[e._v("add separate folder for types, use it in named exports")]),e._v(" "),t("li",[e._v("change name of public facing clients.")]),e._v(" "),t("li",[t("strong",[e._v("cjs")]),e._v(": add separate cjs and esm outputs")]),e._v(" "),t("li",[t("strong",[e._v("content-length")]),e._v(": require content length factory for uploads")]),e._v(" "),t("li",[t("strong",[e._v("exports")]),e._v(": move turbo configurations to turbo.ts so it is available to clients")]),e._v(" "),t("li",[e._v("fix package.json")]),e._v(" "),t("li",[e._v("modify return type of signDataItem function, tweak implementation of ArweaveSigner header")]),e._v(" "),t("li",[e._v("move from getWincPriceForBytes to getUploadCosts")]),e._v(" "),t("li",[t("strong",[e._v("package.json")]),e._v(": add back module to package.json")]),e._v(" "),t("li",[e._v("remove package.json from lib directory")]),e._v(" "),t("li",[e._v("remove postinstall command")]),e._v(" "),t("li",[e._v("replace retry-axios, add additional retry logic")]),e._v(" "),t("li",[t("strong",[e._v("retry-axios")]),e._v(": pin retry-axios to 3.0.0")]),e._v(" "),t("li",[e._v("revert to single file upload/data item upload")]),e._v(" "),t("li",[e._v("swap adding package.json to esm to cjs")]),e._v(" "),t("li",[t("strong",[e._v("top up")]),e._v(": export type PE-4465")]),e._v(" "),t("li",[e._v("type imports for web and node")]),e._v(" "),t("li",[t("strong",[e._v("types")]),e._v(": finalize types, update default payment and upload URLs")]),e._v(" "),t("li",[e._v("update main and types path in package.json")]),e._v(" "),t("li",[e._v("update package.json output for esm")]),e._v(" "),t("li",[e._v("update web signer and cleanup examples")]),e._v(" "),t("li",[e._v("use .cjs as base for types to avoid reference require errors")]),e._v(" "),t("li",[e._v("use declare in sub-classes to overwrite parent class type")]),e._v(" "),t("li",[t("strong",[e._v("wildcard")]),e._v(": allow wildcard exports for older projects")]),e._v(" "),t("li",[e._v("wrong path for types!")])]),e._v(" "),t("p",[e._v("Features")]),e._v(" "),t("ul",[t("li",[e._v("abstract axios to TurboHTTPService class")]),e._v(" "),t("li",[e._v("abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService")]),e._v(" "),t("li",[e._v("add remaining unauthenticated apis for payment service, introduce some new types, add tests")]),e._v(" "),t("li",[e._v("add uploadFiles implementation for node and web")]),e._v(" "),t("li",[e._v("break services into auth vs unauth")]),e._v(" "),t("li",[e._v("initial implementation of TurboWebClient and TurboNodeClient")]),e._v(" "),t("li",[e._v("introduce AbortController")]),e._v(" "),t("li",[e._v("introduce uploadSignedDataItem interface, implement for node")]),e._v(" "),t("li",[e._v("remove TurboDataItemVerifier")]),e._v(" "),t("li",[t("strong",[e._v("sdk")]),e._v(": all uphill from here πŸš€ PE-4064")]),e._v(" "),t("li",[t("strong",[e._v("top-up")]),e._v(": init get checkout session PE-4465")]),e._v(" "),t("li",[t("strong",[e._v("winc for fiat")]),e._v(": extend AmountMapper pattern and add promoCode support PE-4465")])])])}),[],!1,null,null,null);t.default=o.exports}}]); \ No newline at end of file diff --git a/assets/js/46.d5e96936.js b/assets/js/46.f61a71a1.js similarity index 94% rename from assets/js/46.d5e96936.js rename to assets/js/46.f61a71a1.js index 4850c4c..a88e74d 100644 --- a/assets/js/46.d5e96936.js +++ b/assets/js/46.f61a71a1.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{340:function(e,r,t){"use strict";t.r(r);var n=t(10),s=Object(n.a)({},(function(){var e=this,r=e._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"using-turbo-sdk-in-a-browser-environment"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#using-turbo-sdk-in-a-browser-environment"}},[e._v("#")]),e._v(" Using Turbo SDK in a Browser Environment")]),e._v(" "),r("h2",{attrs:{id:"overview"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),r("p",[e._v("With Turbo-SDK "),r("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/release-notes.html#v130"}},[e._v("v1.3.0")]),e._v(", You can authenticate a Turbo instance by passing in an arweave signer instance instead of JWK. This supports the "),r("code",[e._v("ArweaveSigner")]),e._v(" or "),r("code",[e._v("ArconnectSigner")]),e._v(" classes from "),r("a",{attrs:{href:"https://github.com/Irys-xyz/arbundles",target:"_blank",rel:"noopener noreferrer"}},[e._v("arbundles"),r("OutboundLink")],1),e._v(".")],1)])}),[],!1,null,null,null);r.default=s.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[46],{341:function(e,r,t){"use strict";t.r(r);var n=t(10),s=Object(n.a)({},(function(){var e=this,r=e._self._c;return r("ContentSlotsDistributor",{attrs:{"slot-key":e.$parent.slotKey}},[r("h1",{attrs:{id:"using-turbo-sdk-in-a-browser-environment"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#using-turbo-sdk-in-a-browser-environment"}},[e._v("#")]),e._v(" Using Turbo SDK in a Browser Environment")]),e._v(" "),r("h2",{attrs:{id:"overview"}},[r("a",{staticClass:"header-anchor",attrs:{href:"#overview"}},[e._v("#")]),e._v(" Overview")]),e._v(" "),r("p",[e._v("With Turbo-SDK "),r("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/release-notes.html#v130"}},[e._v("v1.3.0")]),e._v(", You can authenticate a Turbo instance by passing in an arweave signer instance instead of JWK. This supports the "),r("code",[e._v("ArweaveSigner")]),e._v(" or "),r("code",[e._v("ArconnectSigner")]),e._v(" classes from "),r("a",{attrs:{href:"https://github.com/Irys-xyz/arbundles",target:"_blank",rel:"noopener noreferrer"}},[e._v("arbundles"),r("OutboundLink")],1),e._v(".")],1)])}),[],!1,null,null,null);r.default=s.exports}}]); \ No newline at end of file diff --git a/assets/js/47.0808c333.js b/assets/js/47.d96a831e.js similarity index 98% rename from assets/js/47.0808c333.js rename to assets/js/47.d96a831e.js index dabbbe0..488acf3 100644 --- a/assets/js/47.0808c333.js +++ b/assets/js/47.d96a831e.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{341:function(t,e,a){"use strict";a.r(e);var r=a(10),i=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"what-is-turbo"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-turbo"}},[t._v("#")]),t._v(" What Is Turbo?")]),t._v(" "),e("p",[t._v("Turbo is a ultrahigh-throughput Permaweb service that streamlines the funding, indexing, and transmission of data to and from Arweave. It provides graphical and programmatic interfaces for payment options in fiat currency with credit or debit cards as well as cryptocurrencies such as ETH, SOL, and AR. It integrates two key components: a service that bundles uploads for efficiency and ease, and a payment system designed for straightforward transactions. Turbo Credits, which users can purchase within the ArDrive web app, the "),e("a",{attrs:{href:"https://turbo-topup.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Turbo Top Up App"),e("OutboundLink")],1),t._v(", or by using the "),e("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/"}},[t._v("Turbo SDK/CLI")]),t._v(", have the same storage purchasing power of AR tokens, along with the additional benefits provided by Turbo. These credits are meticulously calibrated, with the Winston Credit (winc) representing the smallest unit, ensuring users have precise control over their storage needs. As an open-source technology, Turbo encourages community engagement, allowing developers to contribute to its continuous enhancement.")],1),t._v(" "),e("div",{staticStyle:{"text-align":"center"}},[e("table",{staticClass:"inline-table"},[e("tr",[e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Feature")])]),t._v(" "),e("tr",[e("th",[t._v("Access")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Optimistic, instant data caching, using arweave.net.")]),t._v(" "),e("li",[t._v("Optimistic, near instant GraphQL indexing including cross-chain token address indexing, using arweave.net.")]),t._v(" "),e("li",[t._v("Transaction status endpoint for checking transaction finality. (Irys compatible)")])])])]),t._v(" "),e("tr",[e("th",[t._v("Development and Integration")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Rich documentation for developer integrations, SDK and Turbo APIs. "),e("ul",[e("li",[e("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank"}},[t._v("Swagger UI")]),t._v(" Upload Service API docs.")]),e("li",[e("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank"}},[t._v("Swagger UI")]),t._v(" Payment Service API docs.")])])]),t._v(" "),e("li",[t._v("Deploy your own upload and payment service for bundling data and sending it to Arweave. "),e("ul",[e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-upload-service"}},[t._v("GitHub - ardriveapp/turbo-upload-service: Turbo Upload service that allows users to upload data items using fiat currencies.")])]),e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-payment-service"}},[t._v("GitHub - ardriveapp/turbo-payment-service: ArDrive Turbo Payment Service that manages Turbo balances.")])])])]),e("li",[t._v("Flexible typescript SDK for seamless web and NodeJS integration.")]),t._v(" "),e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-sdk"}},[t._v("GitHub - ardriveapp/turbo-sdk: The first SDK on Arweave to bring you programmable fiat top ups, Turbo-powered upload reliability, and fast data and indexing finality for Typescript based Web and Node projects.")])])])])]),t._v(" "),e("tr",[e("th",[t._v("Enterprise")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Built for scale and trusted by enterprises")])]),t._v(" "),e("tr",[e("th",[t._v("Identity")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Cryptographic identity management using Arweave, Ethereum, Solana, Polygon or other Irys-compatible keys.")]),t._v(" "),e("li",[t._v("Arweave ecosystem supported web wallets and providers: "),e("ul",[e("li",[t._v("βœ… Arconnect")]),e("li",[t._v("βœ… arweave.app")]),e("li",[t._v("βœ… ArweaveWalletAdapter")])])])])])]),t._v(" "),e("tr",[e("th",[t._v("Maturity")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Run by PDS, the same team that has been operating arweave.net since March 2022, with over 9B transactions indexed and accessible.")]),t._v(" "),e("li",[t._v("First bundling services launched in October 2022, with as ArDrive Turbo launching in July 2023. \n "),e("ul",[e("li",[e("a",{attrs:{target:"_blank",href:"https://viewblock.io/arweave/address/yCxjLRyXjzHJ4gMZK8HFYiW146dykI9QgP6CSsVXFwk"}},[t._v("ar.io Meta Bundler | Arweave Explorer | ViewBlock")])]),t._v(" "),e("li",[e("a",{attrs:{target:"_blank",href:"https://viewblock.io/arweave/address/JNC6vBhjHY1EPwV3pEeNmrsgFMxH5d38_LHsZ7jful8"}},[t._v("ArDrive Turbo | Arweave Explorer | ViewBlock")])])])])])])]),t._v(" "),e("tr",[e("th",[t._v("Payments")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Instantly fund your Turbo account with your credit card or popular crypto tokens.")]),t._v(" "),e("li",[t._v("ETH, SOL, POL, and AR are supported for funding your Turbo account.")]),t._v(" "),e("li",[t._v("Leverage other Turbo benefits like Gifting and Coupon Codes.")])])])]),t._v(" "),e("tr",[e("th",[t._v("Performance")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Cryptographic upload receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)")]),t._v(" "),e("li",[t._v("Proven, high layer 2 transactional throughput with 860/sec sustained on 12/18 and 12/19")])])])]),t._v(" "),e("tr",[e("th",[t._v("Provenance")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)")])]),t._v(" "),e("tr",[e("th",[t._v("Transparency")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Open source infrastructure with AGPL3.0 licensing, as well as software development kit with Apache2.0 licensing.")])])])])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{342:function(t,e,a){"use strict";a.r(e);var r=a(10),i=Object(r.a)({},(function(){var t=this,e=t._self._c;return e("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[e("h1",{attrs:{id:"what-is-turbo"}},[e("a",{staticClass:"header-anchor",attrs:{href:"#what-is-turbo"}},[t._v("#")]),t._v(" What Is Turbo?")]),t._v(" "),e("p",[t._v("Turbo is a ultrahigh-throughput Permaweb service that streamlines the funding, indexing, and transmission of data to and from Arweave. It provides graphical and programmatic interfaces for payment options in fiat currency with credit or debit cards as well as cryptocurrencies such as ETH, SOL, and AR. It integrates two key components: a service that bundles uploads for efficiency and ease, and a payment system designed for straightforward transactions. Turbo Credits, which users can purchase within the ArDrive web app, the "),e("a",{attrs:{href:"https://turbo-topup.com/",target:"_blank",rel:"noopener noreferrer"}},[t._v("Turbo Top Up App"),e("OutboundLink")],1),t._v(", or by using the "),e("RouterLink",{attrs:{to:"/docs/turbo/turbo-sdk/"}},[t._v("Turbo SDK/CLI")]),t._v(", have the same storage purchasing power of AR tokens, along with the additional benefits provided by Turbo. These credits are meticulously calibrated, with the Winston Credit (winc) representing the smallest unit, ensuring users have precise control over their storage needs. As an open-source technology, Turbo encourages community engagement, allowing developers to contribute to its continuous enhancement.")],1),t._v(" "),e("div",{staticStyle:{"text-align":"center"}},[e("table",{staticClass:"inline-table"},[e("tr",[e("th",[t._v("Type")]),t._v(" "),e("th",[t._v("Feature")])]),t._v(" "),e("tr",[e("th",[t._v("Access")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Optimistic, instant data caching, using arweave.net.")]),t._v(" "),e("li",[t._v("Optimistic, near instant GraphQL indexing including cross-chain token address indexing, using arweave.net.")]),t._v(" "),e("li",[t._v("Transaction status endpoint for checking transaction finality. (Irys compatible)")])])])]),t._v(" "),e("tr",[e("th",[t._v("Development and Integration")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Rich documentation for developer integrations, SDK and Turbo APIs. "),e("ul",[e("li",[e("a",{attrs:{href:"https://upload.ardrive.io/api-docs",target:"_blank"}},[t._v("Swagger UI")]),t._v(" Upload Service API docs.")]),e("li",[e("a",{attrs:{href:"https://payment.ardrive.io/api-docs",target:"_blank"}},[t._v("Swagger UI")]),t._v(" Payment Service API docs.")])])]),t._v(" "),e("li",[t._v("Deploy your own upload and payment service for bundling data and sending it to Arweave. "),e("ul",[e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-upload-service"}},[t._v("GitHub - ardriveapp/turbo-upload-service: Turbo Upload service that allows users to upload data items using fiat currencies.")])]),e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-payment-service"}},[t._v("GitHub - ardriveapp/turbo-payment-service: ArDrive Turbo Payment Service that manages Turbo balances.")])])])]),e("li",[t._v("Flexible typescript SDK for seamless web and NodeJS integration.")]),t._v(" "),e("li",[e("a",{attrs:{target:"_blank",href:"https://github.com/ardriveapp/turbo-sdk"}},[t._v("GitHub - ardriveapp/turbo-sdk: The first SDK on Arweave to bring you programmable fiat top ups, Turbo-powered upload reliability, and fast data and indexing finality for Typescript based Web and Node projects.")])])])])]),t._v(" "),e("tr",[e("th",[t._v("Enterprise")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Built for scale and trusted by enterprises")])]),t._v(" "),e("tr",[e("th",[t._v("Identity")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Cryptographic identity management using Arweave, Ethereum, Solana, Polygon or other Irys-compatible keys.")]),t._v(" "),e("li",[t._v("Arweave ecosystem supported web wallets and providers: "),e("ul",[e("li",[t._v("βœ… Arconnect")]),e("li",[t._v("βœ… arweave.app")]),e("li",[t._v("βœ… ArweaveWalletAdapter")])])])])])]),t._v(" "),e("tr",[e("th",[t._v("Maturity")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Run by PDS, the same team that has been operating arweave.net since March 2022, with over 9B transactions indexed and accessible.")]),t._v(" "),e("li",[t._v("First bundling services launched in October 2022, with as ArDrive Turbo launching in July 2023. \n "),e("ul",[e("li",[e("a",{attrs:{target:"_blank",href:"https://viewblock.io/arweave/address/yCxjLRyXjzHJ4gMZK8HFYiW146dykI9QgP6CSsVXFwk"}},[t._v("ar.io Meta Bundler | Arweave Explorer | ViewBlock")])]),t._v(" "),e("li",[e("a",{attrs:{target:"_blank",href:"https://viewblock.io/arweave/address/JNC6vBhjHY1EPwV3pEeNmrsgFMxH5d38_LHsZ7jful8"}},[t._v("ArDrive Turbo | Arweave Explorer | ViewBlock")])])])])])])]),t._v(" "),e("tr",[e("th",[t._v("Payments")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Instantly fund your Turbo account with your credit card or popular crypto tokens.")]),t._v(" "),e("li",[t._v("ETH, SOL, POL, and AR are supported for funding your Turbo account.")]),t._v(" "),e("li",[t._v("Leverage other Turbo benefits like Gifting and Coupon Codes.")])])])]),t._v(" "),e("tr",[e("th",[t._v("Performance")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[e("ul",[e("li",[t._v("Cryptographic upload receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)")]),t._v(" "),e("li",[t._v("Proven, high layer 2 transactional throughput with 860/sec sustained on 12/18 and 12/19")])])])]),t._v(" "),e("tr",[e("th",[t._v("Provenance")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)")])]),t._v(" "),e("tr",[e("th",[t._v("Transparency")]),t._v(" "),e("td",{staticStyle:{"text-align":"left"}},[t._v("Open source infrastructure with AGPL3.0 licensing, as well as software development kit with Apache2.0 licensing.")])])])])])}),[],!1,null,null,null);e.default=i.exports}}]); \ No newline at end of file diff --git a/assets/js/9.798ea9e2.js b/assets/js/9.c10323af.js similarity index 99% rename from assets/js/9.798ea9e2.js rename to assets/js/9.c10323af.js index 021878a..9570c81 100644 --- a/assets/js/9.798ea9e2.js +++ b/assets/js/9.c10323af.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{305:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"data-model"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-model"}},[t._v("#")]),t._v(" Data Model")]),t._v(" "),a("p",[t._v("Because of Arweave's permanent and immutable nature, traditional file structure operations such as renaming and moving files or folders cannot be accomplished by simply updating on-chain data. ArFS works around this by defining an append-only transaction data model based on the metadata tags found in the Arweave "),a("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[t._v("Transaction Headers."),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("This model uses a bottom-up reference method, which avoids race conditions in file system updates. Each file contains metadata that refers to the parent folder, and each folder contains metadata that refers to its parent drive. A top-down data model would require the parent model (i.e. a folder) to store references to its children.")]),t._v(" "),a("p",[t._v("These defined entities allow the state of the drive to be constructed by a client to look and feel like a file system")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities contain both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all files and folder metadata within a drive")])]),t._v(" "),a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities contain both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all files and folder metadata within a drive")])]),t._v(" "),a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities are composed by both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all entities' (such as drive, folder, file and snapshot) metadata within a drive")])])]),t._v(" "),a("h2",{attrs:{id:"entity-relationships"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-relationships"}},[t._v("#")]),t._v(" Entity relationships")]),t._v(" "),a("p",[t._v("The following diagram shows the high level relationships between drive, folder, and file entities, and their associated data. More detailed information about each Entity Type can be found "),a("RouterLink",{attrs:{to:"/docs/arfs/entity-types.html"}},[t._v("here")]),t._v(".")],1),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/entity-relationship-diagram.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Entity Relationship Diagram")]),t._v(" "),a("p",[t._v("As you can see, each file and folder contains metadata which points to both the parent folder and the parent drive. The drive entity contains metadata about itself, but not the child contents. So clients must build drive states from the lowest level and work their way up.")]),t._v(" "),a("h2",{attrs:{id:"metadata-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#metadata-format"}},[t._v("#")]),t._v(" Metadata Format")]),t._v(" "),a("p",[t._v("Metadata stored in any Arweave transaction tag will be defined in the following manner:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Example-Tag"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"example-data"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Metadata stored in the Transaction Data Payload will follow JSON formatting like below:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exampleField"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exampleData"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("fields with a "),a("code",[t._v("?")]),t._v(" suffix are optional.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Project"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"This is a sample project."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version?"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"author?"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"John Doe"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v('Enumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".')]),t._v(" "),a("p",[t._v("All UUIDs used for Entity-Ids are based on the "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[t._v("Universally Unique Identifier"),a("OutboundLink")],1),t._v(" standard.")]),t._v(" "),a("p",[t._v("There are no requirements to list ArFS tags in any specific order.")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[9],{304:function(t,a,e){"use strict";e.r(a);var s=e(10),n=Object(s.a)({},(function(){var t=this,a=t._self._c;return a("ContentSlotsDistributor",{attrs:{"slot-key":t.$parent.slotKey}},[a("h1",{attrs:{id:"data-model"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#data-model"}},[t._v("#")]),t._v(" Data Model")]),t._v(" "),a("p",[t._v("Because of Arweave's permanent and immutable nature, traditional file structure operations such as renaming and moving files or folders cannot be accomplished by simply updating on-chain data. ArFS works around this by defining an append-only transaction data model based on the metadata tags found in the Arweave "),a("a",{attrs:{href:"https://docs.arweave.org/developers/server/http-api#transaction-format",target:"_blank",rel:"noopener noreferrer"}},[t._v("Transaction Headers."),a("OutboundLink")],1)]),t._v(" "),a("p",[t._v("This model uses a bottom-up reference method, which avoids race conditions in file system updates. Each file contains metadata that refers to the parent folder, and each folder contains metadata that refers to its parent drive. A top-down data model would require the parent model (i.e. a folder) to store references to its children.")]),t._v(" "),a("p",[t._v("These defined entities allow the state of the drive to be constructed by a client to look and feel like a file system")]),t._v(" "),a("ul",[a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities contain both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all files and folder metadata within a drive")])]),t._v(" "),a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities contain both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all files and folder metadata within a drive")])]),t._v(" "),a("li",[a("p",[t._v("Drive Entities contain folders and files")])]),t._v(" "),a("li",[a("p",[t._v("Folder Entities contain other folders or files")])]),t._v(" "),a("li",[a("p",[t._v("File Entities are composed by both the file data and metadata")])]),t._v(" "),a("li",[a("p",[t._v("Snapshot entities contain a state rollups of all entities' (such as drive, folder, file and snapshot) metadata within a drive")])])]),t._v(" "),a("h2",{attrs:{id:"entity-relationships"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#entity-relationships"}},[t._v("#")]),t._v(" Entity relationships")]),t._v(" "),a("p",[t._v("The following diagram shows the high level relationships between drive, folder, and file entities, and their associated data. More detailed information about each Entity Type can be found "),a("RouterLink",{attrs:{to:"/docs/arfs/entity-types.html"}},[t._v("here")]),t._v(".")],1),t._v(" "),a("img",{staticClass:"amazingdiagram",staticStyle:{width:"75%"},attrs:{src:t.$withBase("/images/entity-relationship-diagram.png")}}),t._v(" "),a("div",{staticClass:"caption"},[t._v("Entity Relationship Diagram")]),t._v(" "),a("p",[t._v("As you can see, each file and folder contains metadata which points to both the parent folder and the parent drive. The drive entity contains metadata about itself, but not the child contents. So clients must build drive states from the lowest level and work their way up.")]),t._v(" "),a("h2",{attrs:{id:"metadata-format"}},[a("a",{staticClass:"header-anchor",attrs:{href:"#metadata-format"}},[t._v("#")]),t._v(" Metadata Format")]),t._v(" "),a("p",[t._v("Metadata stored in any Arweave transaction tag will be defined in the following manner:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"Example-Tag"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"value"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"example-data"')]),t._v(" "),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("Metadata stored in the Transaction Data Payload will follow JSON formatting like below:")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"exampleField"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"exampleData"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v("fields with a "),a("code",[t._v("?")]),t._v(" suffix are optional.")]),t._v(" "),a("div",{staticClass:"language-json extra-class"},[a("pre",{pre:!0,attrs:{class:"language-json"}},[a("code",[a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("{")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"name"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"My Project"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"description"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"This is a sample project."')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"version?"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"1.0.0"')]),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v(",")]),t._v("\n "),a("span",{pre:!0,attrs:{class:"token property"}},[t._v('"author?"')]),a("span",{pre:!0,attrs:{class:"token operator"}},[t._v(":")]),t._v(" "),a("span",{pre:!0,attrs:{class:"token string"}},[t._v('"John Doe"')]),t._v("\n"),a("span",{pre:!0,attrs:{class:"token punctuation"}},[t._v("}")]),t._v("\n")])])]),a("p",[t._v('Enumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".')]),t._v(" "),a("p",[t._v("All UUIDs used for Entity-Ids are based on the "),a("a",{attrs:{href:"https://en.wikipedia.org/wiki/Universally_unique_identifier",target:"_blank",rel:"noopener noreferrer"}},[t._v("Universally Unique Identifier"),a("OutboundLink")],1),t._v(" standard.")]),t._v(" "),a("p",[t._v("There are no requirements to list ArFS tags in any specific order.")])])}),[],!1,null,null,null);a.default=n.exports}}]); \ No newline at end of file diff --git a/assets/js/app.27c5a0ae.js b/assets/js/app.982c6917.js similarity index 53% rename from assets/js/app.27c5a0ae.js rename to assets/js/app.982c6917.js index 7cd56a8..ff66125 100644 --- a/assets/js/app.27c5a0ae.js +++ b/assets/js/app.982c6917.js @@ -1,4 +1,4 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],[]]);!function(e){function t(t){for(var a,i,s=t[0],l=t[1],d=t[2],u=0,p=[];u
'};function r(e,t,n){return en?n:e}function o(e){return 100*(-1+e)}n.configure=function(e){var t,n;for(t in e)void 0!==(n=e[t])&&e.hasOwnProperty(t)&&(a[t]=n);return this},n.status=null,n.set=function(e){var t=n.isStarted();e=r(e,a.minimum,1),n.status=1===e?null:e;var l=n.render(!t),d=l.querySelector(a.barSelector),c=a.speed,u=a.easing;return l.offsetWidth,i((function(t){""===a.positionUsing&&(a.positionUsing=n.getPositioningCSS()),s(d,function(e,t,n){var r;return(r="translate3d"===a.positionUsing?{transform:"translate3d("+o(e)+"%,0,0)"}:"translate"===a.positionUsing?{transform:"translate("+o(e)+"%,0)"}:{"margin-left":o(e)+"%"}).transition="all "+t+"ms "+n,r}(e,c,u)),1===e?(s(l,{transition:"none",opacity:1}),l.offsetWidth,setTimeout((function(){s(l,{transition:"all "+c+"ms linear",opacity:0}),setTimeout((function(){n.remove(),t()}),c)}),c)):setTimeout(t,c)})),this},n.isStarted=function(){return"number"==typeof n.status},n.start=function(){n.status||n.set(0);var e=function(){setTimeout((function(){n.status&&(n.trickle(),e())}),a.trickleSpeed)};return a.trickle&&e(),this},n.done=function(e){return e||n.status?n.inc(.3+.5*Math.random()).set(1):this},n.inc=function(e){var t=n.status;return t?("number"!=typeof e&&(e=(1-t)*r(Math.random()*t,.1,.95)),t=r(t+e,0,.994),n.set(t)):n.start()},n.trickle=function(){return n.inc(Math.random()*a.trickleRate)},e=0,t=0,n.promise=function(a){return a&&"resolved"!==a.state()?(0===t&&n.start(),e++,t++,a.always((function(){0==--t?(e=0,n.done()):n.set((e-t)/e)})),this):this},n.render=function(e){if(n.isRendered())return document.getElementById("nprogress");d(document.documentElement,"nprogress-busy");var t=document.createElement("div");t.id="nprogress",t.innerHTML=a.template;var r,i=t.querySelector(a.barSelector),l=e?"-100":o(n.status||0),c=document.querySelector(a.parent);return s(i,{transition:"all 0 linear",transform:"translate3d("+l+"%,0,0)"}),a.showSpinner||(r=t.querySelector(a.spinnerSelector))&&p(r),c!=document.body&&d(c,"nprogress-custom-parent"),c.appendChild(t),t},n.remove=function(){c(document.documentElement,"nprogress-busy"),c(document.querySelector(a.parent),"nprogress-custom-parent");var e=document.getElementById("nprogress");e&&p(e)},n.isRendered=function(){return!!document.getElementById("nprogress")},n.getPositioningCSS=function(){var e=document.body.style,t="WebkitTransform"in e?"Webkit":"MozTransform"in e?"Moz":"msTransform"in e?"ms":"OTransform"in e?"O":"";return t+"Perspective"in e?"translate3d":t+"Transform"in e?"translate":"margin"};var i=function(){var e=[];function t(){var n=e.shift();n&&n(t)}return function(n){e.push(n),1==e.length&&t()}}(),s=function(){var e=["Webkit","O","Moz","ms"],t={};function n(n){return n=n.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,(function(e,t){return t.toUpperCase()})),t[n]||(t[n]=function(t){var n=document.body.style;if(t in n)return t;for(var a,r=e.length,o=t.charAt(0).toUpperCase()+t.slice(1);r--;)if((a=e[r]+o)in n)return a;return t}(n))}function a(e,t,a){t=n(t),e.style[t]=a}return function(e,t){var n,r,o=arguments;if(2==o.length)for(n in t)void 0!==(r=t[n])&&t.hasOwnProperty(n)&&a(e,n,r);else a(e,o[1],o[2])}}();function l(e,t){return("string"==typeof e?e:u(e)).indexOf(" "+t+" ")>=0}function d(e,t){var n=u(e),a=n+t;l(n,t)||(e.className=a.substring(1))}function c(e,t){var n,a=u(e);l(e,t)&&(n=a.replace(" "+t+" "," "),e.className=n.substring(1,n.length-1))}function u(e){return(" "+(e.className||"")+" ").replace(/\s+/gi," ")}function p(e){e&&e.parentNode&&e.parentNode.removeChild(e)}return n})?a.call(t,n,t,e):a)||(e.exports=r)},function(e,t,n){var a=n(8),r=String,o=TypeError;e.exports=function(e){if(a(e))return e;throw o(r(e)+" is not an object")}},function(e,t,n){var a=n(3),r=n(48).f,o=n(13),i=n(109),s=n(35),l=n(62),d=n(122);e.exports=function(e,t){var n,c,u,p,h,f=e.target,m=e.global,v=e.stat;if(n=m?a:v?a[f]||s(f,{}):(a[f]||{}).prototype)for(c in t){if(p=t[c],u=e.dontCallGetSet?(h=r(n,c))&&h.value:n[c],!d(m?c:f+(v?".":"#")+c,e.forced)&&void 0!==u){if(typeof p==typeof u)continue;l(p,u)}(e.sham||u&&u.sham)&&o(p,"sham",!0),i(n,c,p,e)}}},function(e,t,n){var a=n(2);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},function(e,t,n){var a=n(45),r=n(49);e.exports=function(e){return a(r(e))}},function(e,t,n){var a=n(3),r=n(0),o=function(e){return r(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(a[e]):a[e]&&a[e][t]}},function(e,t,n){var a=n(0),r=n(107),o=TypeError;e.exports=function(e){if(a(e))return e;throw o(r(e)+" is not a function")}},function(e,t,n){var a=n(3),r=n(58),o=n(7),i=n(60),s=n(56),l=n(55),d=a.Symbol,c=r("wks"),u=l?d.for||d:d&&d.withoutSetter||i;e.exports=function(e){return o(c,e)||(c[e]=s&&o(d,e)?d[e]:u("Symbol."+e)),c[e]}},function(e,t,n){var a=n(49),r=Object;e.exports=function(e){return r(a(e))}},function(e,t,n){var a=n(120);e.exports=function(e){return a(e.length)}},function(e,t,n){var a=n(25),r=Function.prototype.call;e.exports=a?r.bind(r):function(){return r.apply(r,arguments)}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var a=n(3),r=n(35),o=a["__core-js_shared__"]||r("__core-js_shared__",{});e.exports=o},function(e,t,n){var a=n(3),r=Object.defineProperty;e.exports=function(e,t){try{r(a,e,{value:t,configurable:!0,writable:!0})}catch(n){a[e]=t}return t}},function(e,t,n){var a=n(146),r=n(11),o=Object.prototype,i=o.hasOwnProperty,s=o.propertyIsEnumerable,l=a(function(){return arguments}())?a:function(e){return r(e)&&i.call(e,"callee")&&!s.call(e,"callee")};e.exports=l},function(e,t,n){var a=n(9)(n(6),"Map");e.exports=a},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,n){var a=n(166),r=n(173),o=n(175),i=n(176),s=n(177);function l(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e<=9007199254740991}},function(e,t,n){var a=n(5),r=n(43),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,i=/^\w*$/;e.exports=function(e,t){if(a(e))return!1;var n=typeof e;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=e&&!r(e))||(i.test(e)||!o.test(e)||null!=t&&e in Object(t))}},function(e,t,n){var a=n(12),r=n(11);e.exports=function(e){return"symbol"==typeof e||r(e)&&"[object Symbol]"==a(e)}},function(e,t){e.exports=function(e){return e}},function(e,t,n){var a=n(1),r=n(2),o=n(16),i=Object,s=a("".split);e.exports=r((function(){return!i("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?s(e,""):i(e)}:i},function(e,t){e.exports={}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t,n){var a=n(4),r=n(32),o=n(103),i=n(33),s=n(26),l=n(51),d=n(7),c=n(61),u=Object.getOwnPropertyDescriptor;t.f=a?u:function(e,t){if(e=s(e),t=l(t),c)try{return u(e,t)}catch(e){}if(d(e,t))return i(!r(o.f,e,t),e[t])}},function(e,t,n){var a=n(50),r=TypeError;e.exports=function(e){if(a(e))throw r("Can't call method on "+e);return e}},function(e,t){e.exports=function(e){return null==e}},function(e,t,n){var a=n(104),r=n(53);e.exports=function(e){var t=a(e,"string");return r(t)?t:t+""}},function(e,t){var n="object"==typeof document&&document.all,a=void 0===n&&void 0!==n;e.exports={all:n,IS_HTMLDDA:a}},function(e,t,n){var a=n(27),r=n(0),o=n(54),i=n(55),s=Object;e.exports=i?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return r(t)&&o(t.prototype,s(e))}},function(e,t,n){var a=n(1);e.exports=a({}.isPrototypeOf)},function(e,t,n){var a=n(56);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(e,t,n){var a=n(57),r=n(2);e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},function(e,t,n){var a,r,o=n(3),i=n(105),s=o.process,l=o.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(r=(a=c.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!r&&i&&(!(a=i.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=i.match(/Chrome\/(\d+)/))&&(r=+a[1]),e.exports=r},function(e,t,n){var a=n(59),r=n(34);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.30.1",mode:a?"pure":"global",copyright:"Β© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.30.1/LICENSE",source:"https://github.com/zloirock/core-js"})},function(e,t){e.exports=!1},function(e,t,n){var a=n(1),r=0,o=Math.random(),i=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+i(++r+o,36)}},function(e,t,n){var a=n(4),r=n(2),o=n(93);e.exports=!a&&!r((function(){return 7!=Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},function(e,t,n){var a=n(7),r=n(115),o=n(48),i=n(15);e.exports=function(e,t,n){for(var s=r(t),l=i.f,d=o.f,c=0;cc))return!1;var p=l.get(e),h=l.get(t);if(p&&h)return p==t&&h==e;var f=-1,m=!0,v=2&n?new a:void 0;for(l.set(e,t),l.set(t,e);++f-1&&e%1==0&&e=0&&Math.floor(t)===t&&isFinite(e)}function m(e){return i(e)&&"function"==typeof e.then&&"function"==typeof e.catch}function v(e){return null==e?"":Array.isArray(e)||p(e)&&e.toString===u?JSON.stringify(e,null,2):String(e)}function y(e){var t=parseFloat(e);return isNaN(t)?e:t}function g(e,t){for(var n=Object.create(null),a=e.split(","),r=0;r-1)return e.splice(a,1)}}var k=Object.prototype.hasOwnProperty;function x(e,t){return k.call(e,t)}function T(e){var t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}var A=/-(\w)/g,_=T((function(e){return e.replace(A,(function(e,t){return t?t.toUpperCase():""}))})),S=T((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),j=/\B([A-Z])/g,C=T((function(e){return e.replace(j,"-$1").toLowerCase()}));var I=Function.prototype.bind?function(e,t){return e.bind(t)}:function(e,t){function n(n){var a=arguments.length;return a?a>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n};function D(e,t){t=t||0;for(var n=e.length-t,a=new Array(n);n--;)a[n]=e[n+t];return a}function F(e,t){for(var n in t)e[n]=t[n];return e}function P(e){for(var t={},n=0;n0,Z=J&&J.indexOf("edge/")>0;J&&J.indexOf("android");var X=J&&/iphone|ipad|ipod|ios/.test(J);J&&/chrome\/\d+/.test(J),J&&/phantomjs/.test(J);var ee,te=J&&J.match(/firefox\/(\d+)/),ne={}.watch,ae=!1;if(K)try{var re={};Object.defineProperty(re,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,re)}catch(e){}var oe=function(){return void 0===ee&&(ee=!K&&"undefined"!=typeof global&&(global.process&&"server"===global.process.env.VUE_ENV)),ee},ie=K&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function se(e){return"function"==typeof e&&/native code/.test(e.toString())}var le,de="undefined"!=typeof Symbol&&se(Symbol)&&"undefined"!=typeof Reflect&&se(Reflect.ownKeys);le="undefined"!=typeof Set&&se(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var ce=null;function ue(e){void 0===e&&(e=null),e||ce&&ce._scope.off(),ce=e,e&&e._scope.on()}var pe=function(){function e(e,t,n,a,r,o,i,s){this.tag=e,this.data=t,this.children=n,this.text=a,this.elm=r,this.ns=void 0,this.context=o,this.fnContext=void 0,this.fnOptions=void 0,this.fnScopeId=void 0,this.key=t&&t.key,this.componentOptions=i,this.componentInstance=void 0,this.parent=void 0,this.raw=!1,this.isStatic=!1,this.isRootInsert=!0,this.isComment=!1,this.isCloned=!1,this.isOnce=!1,this.asyncFactory=s,this.asyncMeta=void 0,this.isAsyncPlaceholder=!1}return Object.defineProperty(e.prototype,"child",{get:function(){return this.componentInstance},enumerable:!1,configurable:!0}),e}(),he=function(e){void 0===e&&(e="");var t=new pe;return t.text=e,t.isComment=!0,t};function fe(e){return new pe(void 0,void 0,void 0,String(e))}function me(e){var t=new pe(e.tag,e.data,e.children&&e.children.slice(),e.text,e.elm,e.context,e.componentOptions,e.asyncFactory);return t.ns=e.ns,t.isStatic=e.isStatic,t.key=e.key,t.isComment=e.isComment,t.fnContext=e.fnContext,t.fnOptions=e.fnOptions,t.fnScopeId=e.fnScopeId,t.asyncMeta=e.asyncMeta,t.isCloned=!0,t}var ve=0,ye=[],ge=function(){function e(){this._pending=!1,this.id=ve++,this.subs=[]}return e.prototype.addSub=function(e){this.subs.push(e)},e.prototype.removeSub=function(e){this.subs[this.subs.indexOf(e)]=null,this._pending||(this._pending=!0,ye.push(this))},e.prototype.depend=function(t){e.target&&e.target.addDep(this)},e.prototype.notify=function(e){var t=this.subs.filter((function(e){return e}));for(var n=0,a=t.length;n0&&(at((d=e(d,"".concat(n||"","_").concat(a)))[0])&&at(u)&&(p[c]=fe(u.text+d[0].text),d.shift()),p.push.apply(p,d)):l(d)?at(u)?p[c]=fe(u.text+d):""!==d&&p.push(fe(d)):at(d)&&at(u)?p[c]=fe(u.text+d.text):(s(t._isVList)&&i(d.tag)&&o(d.key)&&i(n)&&(d.key="__vlist".concat(n,"_").concat(a,"__")),p.push(d)));return p}(e):void 0}function at(e){return i(e)&&i(e.text)&&!1===e.isComment}function rt(e,t){var n,a,o,s,l=null;if(r(e)||"string"==typeof e)for(l=new Array(e.length),n=0,a=e.length;n0,s=t?!!t.$stable:!i,l=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(s&&r&&r!==a&&l===r.$key&&!i&&!r.$hasNormal)return r;for(var d in o={},t)t[d]&&"$"!==d[0]&&(o[d]=Tt(e,n,d,t[d]))}else o={};for(var c in n)c in o||(o[c]=At(n,c));return t&&Object.isExtensible(t)&&(t._normalized=o),V(o,"$stable",s),V(o,"$key",l),V(o,"$hasNormal",i),o}function Tt(e,t,n,a){var o=function(){var t=ce;ue(e);var n=arguments.length?a.apply(null,arguments):a({}),o=(n=n&&"object"==typeof n&&!r(n)?[n]:nt(n))&&n[0];return ue(t),n&&(!o||1===n.length&&o.isComment&&!kt(o))?void 0:n};return a.proxy&&Object.defineProperty(t,n,{get:o,enumerable:!0,configurable:!0}),o}function At(e,t){return function(){return e[t]}}function _t(e){return{get attrs(){if(!e._attrsProxy){var t=e._attrsProxy={};V(t,"_v_attr_proxy",!0),St(t,e.$attrs,a,e,"$attrs")}return e._attrsProxy},get listeners(){e._listenersProxy||St(e._listenersProxy={},e.$listeners,a,e,"$listeners");return e._listenersProxy},get slots(){return function(e){e._slotsProxy||Ct(e._slotsProxy={},e.$scopedSlots);return e._slotsProxy}(e)},emit:I(e.$emit,e),expose:function(t){t&&Object.keys(t).forEach((function(n){return Ne(e,t,n)}))}}}function St(e,t,n,a,r){var o=!1;for(var i in t)i in e?t[i]!==n[i]&&(o=!0):(o=!0,jt(e,i,a,r));for(var i in e)i in t||(o=!0,delete e[i]);return o}function jt(e,t,n,a){Object.defineProperty(e,t,{enumerable:!0,configurable:!0,get:function(){return n[a][t]}})}function Ct(e,t){for(var n in t)e[n]=t[n];for(var n in e)n in t||delete e[n]}var It=null;function Dt(e,t){return(e.__esModule||de&&"Module"===e[Symbol.toStringTag])&&(e=e.default),c(e)?t.extend(e):e}function Ft(e){if(r(e))for(var t=0;tdocument.createEvent("Event").timeStamp&&(vn=function(){return yn.now()})}var gn=function(e,t){if(e.post){if(!t.post)return 1}else if(t.post)return-1;return e.id-t.id};function bn(){var e,t;for(mn=vn(),hn=!0,dn.sort(gn),fn=0;fnfn&&dn[n].id>e.id;)n--;dn.splice(n+1,0,e)}else dn.push(e);pn||(pn=!0,Gt(bn))}}function kn(e,t){if(e){for(var n=Object.create(null),a=de?Reflect.ownKeys(e):Object.keys(e),r=0;r-1)if(o&&!x(r,"default"))i=!1;else if(""===i||i===C(e)){var l=Wn(String,r.type);(l<0||s-1:"string"==typeof e?e.split(",").indexOf(t)>-1:!!h(e)&&e.test(t)}function ra(e,t){var n=e.cache,a=e.keys,r=e._vnode;for(var o in n){var i=n[o];if(i){var s=i.name;s&&!t(s)&&oa(n,o,a,r)}}}function oa(e,t,n,a){var r=e[t];!r||a&&r.tag===a.tag||r.componentInstance.$destroy(),e[t]=null,w(n,t)}ea.prototype._init=function(e){var t=this;t._uid=Zn++,t._isVue=!0,t.__v_skip=!0,t._scope=new Je(!0),t._scope._vm=!0,e&&e._isComponent?function(e,t){var n=e.$options=Object.create(e.constructor.options),a=t._parentVnode;n.parent=t.parent,n._parentVnode=a;var r=a.componentOptions;n.propsData=r.propsData,n._parentListeners=r.listeners,n._renderChildren=r.children,n._componentTag=r.tag,t.render&&(n.render=t.render,n.staticRenderFns=t.staticRenderFns)}(t,e):t.$options=Rn(Xn(t.constructor),e||{},t),t._renderProxy=t,t._self=t,function(e){var t=e.$options,n=t.parent;if(n&&!t.abstract){for(;n.$options.abstract&&n.$parent;)n=n.$parent;n.$children.push(e)}e.$parent=n,e.$root=n?n.$root:e,e.$children=[],e.$refs={},e._provided=n?n._provided:Object.create(null),e._watcher=null,e._inactive=null,e._directInactive=!1,e._isMounted=!1,e._isDestroyed=!1,e._isBeingDestroyed=!1}(t),function(e){e._events=Object.create(null),e._hasHookEvent=!1;var t=e.$options._parentListeners;t&&nn(e,t)}(t),function(e){e._vnode=null,e._staticTrees=null;var t=e.$options,n=e.$vnode=t._parentVnode,r=n&&n.context;e.$slots=bt(t._renderChildren,r),e.$scopedSlots=n?xt(e.$parent,n.data.scopedSlots,e.$slots):a,e._c=function(t,n,a,r){return Pt(e,t,n,a,r,!1)},e.$createElement=function(t,n,a,r){return Pt(e,t,n,a,r,!0)};var o=n&&n.data;Fe(e,"$attrs",o&&o.attrs||a,null,!0),Fe(e,"$listeners",t._parentListeners||a,null,!0)}(t),ln(t,"beforeCreate",void 0,!1),function(e){var t=kn(e.$options.inject,e);t&&(je(!1),Object.keys(t).forEach((function(n){Fe(e,n,t[n])})),je(!0))}(t),Gn(t),function(e){var t=e.$options.provide;if(t){var n=d(t)?t.call(e):t;if(!c(n))return;for(var a=Ye(e),r=de?Reflect.ownKeys(n):Object.keys(n),o=0;o1?D(n):n;for(var a=D(arguments,1),r='event handler for "'.concat(e,'"'),o=0,i=n.length;oparseInt(this.max)&&oa(e,t[0],t,this._vnode),this.vnodeToCache=null}}},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var e in this.cache)oa(this.cache,e,this.keys)},mounted:function(){var e=this;this.cacheVNode(),this.$watch("include",(function(t){ra(e,(function(e){return aa(t,e)}))})),this.$watch("exclude",(function(t){ra(e,(function(e){return!aa(t,e)}))}))},updated:function(){this.cacheVNode()},render:function(){var e=this.$slots.default,t=Ft(e),n=t&&t.componentOptions;if(n){var a=na(n),r=this.include,o=this.exclude;if(r&&(!a||!aa(r,a))||o&&a&&aa(o,a))return t;var i=this.cache,s=this.keys,l=null==t.key?n.Ctor.cid+(n.tag?"::".concat(n.tag):""):t.key;i[l]?(t.componentInstance=i[l].componentInstance,w(s,l),s.push(l)):(this.vnodeToCache=t,this.keyToCache=l),t.data.keepAlive=!0}return t||e&&e[0]}}};!function(e){var t={get:function(){return $}};Object.defineProperty(e,"config",t),e.util={warn:Dn,extend:F,mergeOptions:Rn,defineReactive:Fe},e.set=Pe,e.delete=Ee,e.nextTick=Gt,e.observable=function(e){return De(e),e},e.options=Object.create(null),M.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,F(e.options.components,sa),function(e){e.use=function(e){var t=this._installedPlugins||(this._installedPlugins=[]);if(t.indexOf(e)>-1)return this;var n=D(arguments,1);return n.unshift(this),d(e.install)?e.install.apply(e,n):d(e)&&e.apply(null,n),t.push(e),this}}(e),function(e){e.mixin=function(e){return this.options=Rn(this.options,e),this}}(e),ta(e),function(e){M.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&p(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&d(n)&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}(e)}(ea),Object.defineProperty(ea.prototype,"$isServer",{get:oe}),Object.defineProperty(ea.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(ea,"FunctionalRenderContext",{value:xn}),ea.version="2.7.14";var la=g("style,class"),da=g("input,textarea,option,select,progress"),ca=g("contenteditable,draggable,spellcheck"),ua=g("events,caret,typing,plaintext-only"),pa=g("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,truespeed,typemustmatch,visible"),ha="http://www.w3.org/1999/xlink",fa=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},ma=function(e){return fa(e)?e.slice(6,e.length):""},va=function(e){return null==e||!1===e};function ya(e){for(var t=e.data,n=e,a=e;i(a.componentInstance);)(a=a.componentInstance._vnode)&&a.data&&(t=ga(a.data,t));for(;i(n=n.parent);)n&&n.data&&(t=ga(t,n.data));return function(e,t){if(i(e)||i(t))return ba(e,wa(t));return""}(t.staticClass,t.class)}function ga(e,t){return{staticClass:ba(e.staticClass,t.staticClass),class:i(e.class)?[e.class,t.class]:t.class}}function ba(e,t){return e?t?e+" "+t:e:t||""}function wa(e){return Array.isArray(e)?function(e){for(var t,n="",a=0,r=e.length;a-1?Ba(e,t,n):pa(t)?va(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):ca(t)?e.setAttribute(t,function(e,t){return va(t)||"false"===t?"false":"contenteditable"===e&&ua(t)?t:"true"}(t,n)):fa(t)?va(n)?e.removeAttributeNS(ha,ma(t)):e.setAttributeNS(ha,t,n):Ba(e,t,n)}function Ba(e,t,n){if(va(n))e.removeAttribute(t);else{if(Y&&!Q&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var a=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",a)};e.addEventListener("input",a),e.__ieph=!0}e.setAttribute(t,n)}}var Va={create:$a,update:$a};function Ga(e,t){var n=t.elm,a=t.data,r=e.data;if(!(o(a.staticClass)&&o(a.class)&&(o(r)||o(r.staticClass)&&o(r.class)))){var s=ya(t),l=n._transitionClasses;i(l)&&(s=ba(s,wa(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Ha,Ka={create:Ga,update:Ga};function Ja(e,t,n){var a=Ha;return function r(){var o=t.apply(null,arguments);null!==o&&Za(e,r,n,a)}}var Ya=Lt&&!(te&&Number(te[1])<=53);function Qa(e,t,n,a){if(Ya){var r=mn,o=t;t=o._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=r||e.timeStamp<=0||e.target.ownerDocument!==document)return o.apply(this,arguments)}}Ha.addEventListener(e,t,ae?{capture:n,passive:a}:n)}function Za(e,t,n,a){(a||Ha).removeEventListener(e,t._wrapper||t,n)}function Xa(e,t){if(!o(e.data.on)||!o(t.data.on)){var n=t.data.on||{},a=e.data.on||{};Ha=t.elm||e.elm,function(e){if(i(e.__r)){var t=Y?"change":"input";e[t]=[].concat(e.__r,e[t]||[]),delete e.__r}i(e.__c)&&(e.change=[].concat(e.__c,e.change||[]),delete e.__c)}(n),Xe(n,a,Qa,Za,Ja,t.context),Ha=void 0}}var er,tr={create:Xa,update:Xa,destroy:function(e){return Xa(e,Fa)}};function nr(e,t){if(!o(e.data.domProps)||!o(t.data.domProps)){var n,a,r=t.elm,l=e.data.domProps||{},d=t.data.domProps||{};for(n in(i(d.__ob__)||s(d._v_attr_proxy))&&(d=t.data.domProps=F({},d)),l)n in d||(r[n]="");for(n in d){if(a=d[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.children.length=0),a===l[n])continue;1===r.childNodes.length&&r.removeChild(r.childNodes[0])}if("value"===n&&"PROGRESS"!==r.tagName){r._value=a;var c=o(a)?"":String(a);ar(r,c)&&(r.value=c)}else if("innerHTML"===n&&Ta(r.tagName)&&o(r.innerHTML)){(er=er||document.createElement("div")).innerHTML="".concat(a,"");for(var u=er.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;u.firstChild;)r.appendChild(u.firstChild)}else if(a!==l[n])try{r[n]=a}catch(e){}}}}function ar(e,t){return!e.composing&&("OPTION"===e.tagName||function(e,t){var n=!0;try{n=document.activeElement!==e}catch(e){}return n&&e.value!==t}(e,t)||function(e,t){var n=e.value,a=e._vModifiers;if(i(a)){if(a.number)return y(n)!==y(t);if(a.trim)return n.trim()!==t.trim()}return n!==t}(e,t))}var rr={create:nr,update:nr},or=T((function(e){var t={},n=/:(.+)/;return e.split(/;(?![^(]*\))/g).forEach((function(e){if(e){var a=e.split(n);a.length>1&&(t[a[0].trim()]=a[1].trim())}})),t}));function ir(e){var t=sr(e.style);return e.staticStyle?F(e.staticStyle,t):t}function sr(e){return Array.isArray(e)?P(e):"string"==typeof e?or(e):e}var lr,dr=/^--/,cr=/\s*!important$/,ur=function(e,t,n){if(dr.test(t))e.style.setProperty(t,n);else if(cr.test(n))e.style.setProperty(C(t),n.replace(cr,""),"important");else{var a=hr(t);if(Array.isArray(n))for(var r=0,o=n.length;r-1?t.split(vr).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" ".concat(e.getAttribute("class")||""," ");n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function gr(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(vr).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{for(var n=" ".concat(e.getAttribute("class")||""," "),a=" "+t+" ";n.indexOf(a)>=0;)n=n.replace(a," ");(n=n.trim())?e.setAttribute("class",n):e.removeAttribute("class")}}function br(e){if(e){if("object"==typeof e){var t={};return!1!==e.css&&F(t,wr(e.name||"v")),F(t,e),t}return"string"==typeof e?wr(e):void 0}}var wr=T((function(e){return{enterClass:"".concat(e,"-enter"),enterToClass:"".concat(e,"-enter-to"),enterActiveClass:"".concat(e,"-enter-active"),leaveClass:"".concat(e,"-leave"),leaveToClass:"".concat(e,"-leave-to"),leaveActiveClass:"".concat(e,"-leave-active")}})),kr=K&&!Q,xr="transition",Tr="transitionend",Ar="animation",_r="animationend";kr&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(xr="WebkitTransition",Tr="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ar="WebkitAnimation",_r="webkitAnimationEnd"));var Sr=K?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function jr(e){Sr((function(){Sr(e)}))}function Cr(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),yr(e,t))}function Ir(e,t){e._transitionClasses&&w(e._transitionClasses,t),gr(e,t)}function Dr(e,t,n){var a=Pr(e,t),r=a.type,o=a.timeout,i=a.propCount;if(!r)return n();var s="transition"===r?Tr:_r,l=0,d=function(){e.removeEventListener(s,c),n()},c=function(t){t.target===e&&++l>=i&&d()};setTimeout((function(){l0&&(n="transition",c=i,u=o.length):"animation"===t?d>0&&(n="animation",c=d,u=l.length):u=(n=(c=Math.max(i,d))>0?i>d?"transition":"animation":null)?"transition"===n?o.length:l.length:0,{type:n,timeout:c,propCount:u,hasTransform:"transition"===n&&Fr.test(a[xr+"Property"])}}function Er(e,t){for(;e.length1}function Ur(e,t){!0!==t.data.show&&Or(t)}var Mr=function(e){var t,n,a={},d=e.modules,c=e.nodeOps;for(t=0;tf?w(e,o(n[y+1])?null:n[y+1].elm,n,h,y,a):h>y&&x(t,u,f)}(u,m,y,n,d):i(y)?(i(e.text)&&c.setTextContent(u,""),w(u,null,y,0,y.length-1,n)):i(m)?x(m,0,m.length-1):i(e.text)&&c.setTextContent(u,""):e.text!==t.text&&c.setTextContent(u,t.text),i(f)&&i(h=f.hook)&&i(h=h.postpatch)&&h(e,t)}}}function S(e,t,n){if(s(n)&&i(e.parent))e.parent.data.pendingInsert=t;else for(var a=0;a-1,i.selected!==o&&(i.selected=o);else if(q(Vr(i),a))return void(e.selectedIndex!==s&&(e.selectedIndex=s));r||(e.selectedIndex=-1)}}function Br(e,t){return t.every((function(t){return!q(t,e)}))}function Vr(e){return"_value"in e?e._value:e.value}function Gr(e){e.target.composing=!0}function Hr(e){e.target.composing&&(e.target.composing=!1,Kr(e.target,"input"))}function Kr(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function Jr(e){return!e.componentInstance||e.data&&e.data.transition?e:Jr(e.componentInstance._vnode)}var Yr={model:Nr,show:{bind:function(e,t,n){var a=t.value,r=(n=Jr(n)).data&&n.data.transition,o=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;a&&r?(n.data.show=!0,Or(n,(function(){e.style.display=o}))):e.style.display=a?o:"none"},update:function(e,t,n){var a=t.value;!a!=!t.oldValue&&((n=Jr(n)).data&&n.data.transition?(n.data.show=!0,a?Or(n,(function(){e.style.display=e.__vOriginalDisplay})):qr(n,(function(){e.style.display="none"}))):e.style.display=a?e.__vOriginalDisplay:"none")},unbind:function(e,t,n,a,r){r||(e.style.display=e.__vOriginalDisplay)}}},Qr={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function Zr(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?Zr(Ft(t.children)):e}function Xr(e){var t={},n=e.$options;for(var a in n.propsData)t[a]=e[a];var r=n._parentListeners;for(var a in r)t[_(a)]=r[a];return t}function eo(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}var to=function(e){return e.tag||kt(e)},no=function(e){return"show"===e.name},ao={name:"transition",props:Qr,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(to)).length){0;var a=this.mode;0;var r=n[0];if(function(e){for(;e=e.parent;)if(e.data.transition)return!0}(this.$vnode))return r;var o=Zr(r);if(!o)return r;if(this._leaving)return eo(e,r);var i="__transition-".concat(this._uid,"-");o.key=null==o.key?o.isComment?i+"comment":i+o.tag:l(o.key)?0===String(o.key).indexOf(i)?o.key:i+o.key:o.key;var s=(o.data||(o.data={})).transition=Xr(this),d=this._vnode,c=Zr(d);if(o.data.directives&&o.data.directives.some(no)&&(o.data.show=!0),c&&c.data&&!function(e,t){return t.key===e.key&&t.tag===e.tag}(o,c)&&!kt(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var u=c.data.transition=F({},s);if("out-in"===a)return this._leaving=!0,et(u,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),eo(e,r);if("in-out"===a){if(kt(o))return d;var p,h=function(){p()};et(s,"afterEnter",h),et(s,"enterCancelled",h),et(u,"delayLeave",(function(e){p=e}))}}return r}}},ro=F({tag:String,moveClass:String},Qr);function oo(e){e.elm._moveCb&&e.elm._moveCb(),e.elm._enterCb&&e.elm._enterCb()}function io(e){e.data.newPos=e.elm.getBoundingClientRect()}function so(e){var t=e.data.pos,n=e.data.newPos,a=t.left-n.left,r=t.top-n.top;if(a||r){e.data.moved=!0;var o=e.elm.style;o.transform=o.WebkitTransform="translate(".concat(a,"px,").concat(r,"px)"),o.transitionDuration="0s"}}delete ro.mode;var lo={Transition:ao,TransitionGroup:{props:ro,beforeMount:function(){var e=this,t=this._update;this._update=function(n,a){var r=rn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,r(),t.call(e,n,a)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),a=this.prevChildren=this.children,r=this.$slots.default||[],o=this.children=[],i=Xr(this),s=0;s-1?_a[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:_a[e]=/HTMLUnknownElement/.test(t.toString())},F(ea.options.directives,Yr),F(ea.options.components,lo),ea.prototype.__patch__=K?Mr:E,ea.prototype.$mount=function(e,t){return function(e,t,n){var a;e.$el=t,e.$options.render||(e.$options.render=he),ln(e,"beforeMount"),a=function(){e._update(e._render(),n)},new Zt(e,a,E,{before:function(){e._isMounted&&!e._isDestroyed&&ln(e,"beforeUpdate")}},!0),n=!1;var r=e._preWatchers;if(r)for(var o=0;o=0&&(t=e.slice(a),e=e.slice(0,a));var r=e.indexOf("?");return r>=0&&(n=e.slice(r+1),e=e.slice(0,r)),{path:e,query:n,hash:t}}(r.path||""),d=t&&t.path||"/",c=l.path?Do(l.path,d,n||r.append):d,u=function(e,t,n){void 0===t&&(t={});var a,r=n||yo;try{a=r(e||"")}catch(e){a={}}for(var o in t){var i=t[o];a[o]=Array.isArray(i)?i.map(vo):vo(i)}return a}(l.query,r.query,a&&a.options.parseQuery),p=r.hash||l.hash;return p&&"#"!==p.charAt(0)&&(p="#"+p),{_normalized:!0,path:c,query:u,hash:p}}var Qo,Zo=function(){},Xo={name:"RouterLink",props:{to:{type:[String,Object],required:!0},tag:{type:String,default:"a"},custom:Boolean,exact:Boolean,exactPath:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,ariaCurrentValue:{type:String,default:"page"},event:{type:[String,Array],default:"click"}},render:function(e){var t=this,n=this.$router,a=this.$route,r=n.resolve(this.to,a,this.append),o=r.location,i=r.route,s=r.href,l={},d=n.options.linkActiveClass,c=n.options.linkExactActiveClass,u=null==d?"router-link-active":d,p=null==c?"router-link-exact-active":c,h=null==this.activeClass?u:this.activeClass,f=null==this.exactActiveClass?p:this.exactActiveClass,m=i.redirectedFrom?wo(null,Yo(i.redirectedFrom),null,n):i;l[f]=_o(a,m,this.exactPath),l[h]=this.exact||this.exactPath?l[f]:function(e,t){return 0===e.path.replace(bo,"/").indexOf(t.path.replace(bo,"/"))&&(!t.hash||e.hash===t.hash)&&function(e,t){for(var n in t)if(!(n in e))return!1;return!0}(e.query,t.query)}(a,m);var v=l[f]?this.ariaCurrentValue:null,y=function(e){ei(e)&&(t.replace?n.replace(o,Zo):n.push(o,Zo))},g={click:ei};Array.isArray(this.event)?this.event.forEach((function(e){g[e]=y})):g[this.event]=y;var b={class:l},w=!this.$scopedSlots.$hasNormal&&this.$scopedSlots.default&&this.$scopedSlots.default({href:s,route:i,navigate:y,isActive:l[h],isExactActive:l[f]});if(w){if(1===w.length)return w[0];if(w.length>1||!w.length)return 0===w.length?e():e("span",{},w)}if("a"===this.tag)b.on=g,b.attrs={href:s,"aria-current":v};else{var k=function e(t){var n;if(t)for(var a=0;a-1&&(s.params[p]=n.params[p]);return s.path=Jo(c.path,s.params),l(c,s,i)}if(s.path){s.params={};for(var h=0;h-1}function Fi(e,t){return Di(e)&&e._isRouter&&(null==t||e.type===t)}function Pi(e,t,n){var a=function(r){r>=e.length?n():e[r]?t(e[r],(function(){a(r+1)})):a(r+1)};a(0)}function Ei(e){return function(t,n,a){var r=!1,o=0,i=null;zi(e,(function(e,t,n,s){if("function"==typeof e&&void 0===e.cid){r=!0,o++;var l,d=Ri((function(t){var r;((r=t).__esModule||qi&&"Module"===r[Symbol.toStringTag])&&(t=t.default),e.resolved="function"==typeof t?t:Qo.extend(t),n.components[s]=t,--o<=0&&a()})),c=Ri((function(e){var t="Failed to resolve async component "+s+": "+e;i||(i=Di(e)?e:new Error(t),a(i))}));try{l=e(d,c)}catch(e){c(e)}if(l)if("function"==typeof l.then)l.then(d,c);else{var u=l.component;u&&"function"==typeof u.then&&u.then(d,c)}}})),r||a()}}function zi(e,t){return Oi(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function Oi(e){return Array.prototype.concat.apply([],e)}var qi="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag;function Ri(e){var t=!1;return function(){for(var n=[],a=arguments.length;a--;)n[a]=arguments[a];if(!t)return t=!0,e.apply(this,n)}}var Li=function(e,t){this.router=e,this.base=function(e){if(!e)if(ti){var t=document.querySelector("base");e=(e=t&&t.getAttribute("href")||"/").replace(/^https?:\/\/[^\/]+/,"")}else e="/";"/"!==e.charAt(0)&&(e="/"+e);return e.replace(/\/$/,"")}(t),this.current=xo,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[],this.listeners=[]};function Ui(e,t,n,a){var r=zi(e,(function(e,a,r,o){var i=function(e,t){"function"!=typeof e&&(e=Qo.extend(e));return e.options[t]}(e,t);if(i)return Array.isArray(i)?i.map((function(e){return n(e,a,r,o)})):n(i,a,r,o)}));return Oi(a?r.reverse():r)}function Mi(e,t){if(t)return function(){return e.apply(t,arguments)}}Li.prototype.listen=function(e){this.cb=e},Li.prototype.onReady=function(e,t){this.ready?e():(this.readyCbs.push(e),t&&this.readyErrorCbs.push(t))},Li.prototype.onError=function(e){this.errorCbs.push(e)},Li.prototype.transitionTo=function(e,t,n){var a,r=this;try{a=this.router.match(e,this.current)}catch(e){throw this.errorCbs.forEach((function(t){t(e)})),e}var o=this.current;this.confirmTransition(a,(function(){r.updateRoute(a),t&&t(a),r.ensureURL(),r.router.afterHooks.forEach((function(e){e&&e(a,o)})),r.ready||(r.ready=!0,r.readyCbs.forEach((function(e){e(a)})))}),(function(e){n&&n(e),e&&!r.ready&&(Fi(e,_i.redirected)&&o===xo||(r.ready=!0,r.readyErrorCbs.forEach((function(t){t(e)}))))}))},Li.prototype.confirmTransition=function(e,t,n){var a=this,r=this.current;this.pending=e;var o,i,s=function(e){!Fi(e)&&Di(e)&&(a.errorCbs.length?a.errorCbs.forEach((function(t){t(e)})):console.error(e)),n&&n(e)},l=e.matched.length-1,d=r.matched.length-1;if(_o(e,r)&&l===d&&e.matched[l]===r.matched[d])return this.ensureURL(),e.hash&&hi(this.router,r,e,!1),s(((i=Ci(o=r,e,_i.duplicated,'Avoided redundant navigation to current location: "'+o.fullPath+'".')).name="NavigationDuplicated",i));var c=function(e,t){var n,a=Math.max(e.length,t.length);for(n=0;n0)){var t=this.router,n=t.options.scrollBehavior,a=xi&&n;a&&this.listeners.push(pi());var r=function(){var n=e.current,r=$i(e.base);e.current===xo&&r===e._startLocation||e.transitionTo(r,(function(e){a&&hi(t,e,n,!0)}))};window.addEventListener("popstate",r),this.listeners.push((function(){window.removeEventListener("popstate",r)}))}},t.prototype.go=function(e){window.history.go(e)},t.prototype.push=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Ti(Fo(a.base+e.fullPath)),hi(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Ai(Fo(a.base+e.fullPath)),hi(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.ensureURL=function(e){if($i(this.base)!==this.current.fullPath){var t=Fo(this.base+this.current.fullPath);e?Ti(t):Ai(t)}},t.prototype.getCurrentLocation=function(){return $i(this.base)},t}(Li);function $i(e){var t=window.location.pathname,n=t.toLowerCase(),a=e.toLowerCase();return!e||n!==a&&0!==n.indexOf(Fo(a+"/"))||(t=t.slice(e.length)),(t||"/")+window.location.search+window.location.hash}var Wi=function(e){function t(t,n,a){e.call(this,t,n),a&&function(e){var t=$i(e);if(!/^\/#/.test(t))return window.location.replace(Fo(e+"/#"+t)),!0}(this.base)||Bi()}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.setupListeners=function(){var e=this;if(!(this.listeners.length>0)){var t=this.router.options.scrollBehavior,n=xi&&t;n&&this.listeners.push(pi());var a=function(){var t=e.current;Bi()&&e.transitionTo(Vi(),(function(a){n&&hi(e.router,a,t,!0),xi||Ki(a.fullPath)}))},r=xi?"popstate":"hashchange";window.addEventListener(r,a),this.listeners.push((function(){window.removeEventListener(r,a)}))}},t.prototype.push=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Hi(e.fullPath),hi(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this,r=this.current;this.transitionTo(e,(function(e){Ki(e.fullPath),hi(a.router,e,r,!1),t&&t(e)}),n)},t.prototype.go=function(e){window.history.go(e)},t.prototype.ensureURL=function(e){var t=this.current.fullPath;Vi()!==t&&(e?Hi(t):Ki(t))},t.prototype.getCurrentLocation=function(){return Vi()},t}(Li);function Bi(){var e=Vi();return"/"===e.charAt(0)||(Ki("/"+e),!1)}function Vi(){var e=window.location.href,t=e.indexOf("#");return t<0?"":e=e.slice(t+1)}function Gi(e){var t=window.location.href,n=t.indexOf("#");return(n>=0?t.slice(0,n):t)+"#"+e}function Hi(e){xi?Ti(Gi(e)):window.location.hash=e}function Ki(e){xi?Ai(Gi(e)):window.location.replace(Gi(e))}var Ji=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var a=this;this.transitionTo(e,(function(e){a.stack=a.stack.slice(0,a.index+1).concat(e),a.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var a=this;this.transitionTo(e,(function(e){a.stack=a.stack.slice(0,a.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var a=this.stack[n];this.confirmTransition(a,(function(){var e=t.current;t.index=n,t.updateRoute(a),t.router.afterHooks.forEach((function(t){t&&t(a,e)}))}),(function(e){Fi(e,_i.duplicated)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Li),Yi=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=ri(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!xi&&!1!==e.fallback,this.fallback&&(t="hash"),ti||(t="abstract"),this.mode=t,t){case"history":this.history=new Ni(this,e.base);break;case"hash":this.history=new Wi(this,e.base,this.fallback);break;case"abstract":this.history=new Ji(this,e.base);break;default:0}},Qi={currentRoute:{configurable:!0}};Yi.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},Qi.currentRoute.get=function(){return this.history&&this.history.current},Yi.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null),t.app||t.history.teardown()})),!this.app){this.app=e;var n=this.history;if(n instanceof Ni||n instanceof Wi){var a=function(e){n.setupListeners(),function(e){var a=n.current,r=t.options.scrollBehavior;xi&&r&&"fullPath"in e&&hi(t,e,a,!1)}(e)};n.transitionTo(n.getCurrentLocation(),a,a)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},Yi.prototype.beforeEach=function(e){return Xi(this.beforeHooks,e)},Yi.prototype.beforeResolve=function(e){return Xi(this.resolveHooks,e)},Yi.prototype.afterEach=function(e){return Xi(this.afterHooks,e)},Yi.prototype.onReady=function(e,t){this.history.onReady(e,t)},Yi.prototype.onError=function(e){this.history.onError(e)},Yi.prototype.push=function(e,t,n){var a=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){a.history.push(e,t,n)}));this.history.push(e,t,n)},Yi.prototype.replace=function(e,t,n){var a=this;if(!t&&!n&&"undefined"!=typeof Promise)return new Promise((function(t,n){a.history.replace(e,t,n)}));this.history.replace(e,t,n)},Yi.prototype.go=function(e){this.history.go(e)},Yi.prototype.back=function(){this.go(-1)},Yi.prototype.forward=function(){this.go(1)},Yi.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},Yi.prototype.resolve=function(e,t,n){var a=Yo(e,t=t||this.history.current,n,this),r=this.match(a,t),o=r.redirectedFrom||r.fullPath;return{location:a,route:r,href:function(e,t,n){var a="hash"===n?"#"+t:t;return e?Fo(e+"/"+a):a}(this.history.base,o,this.mode),normalizedTo:a,resolved:r}},Yi.prototype.getRoutes=function(){return this.matcher.getRoutes()},Yi.prototype.addRoute=function(e,t){this.matcher.addRoute(e,t),this.history.current!==xo&&this.history.transitionTo(this.history.getCurrentLocation())},Yi.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==xo&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(Yi.prototype,Qi);var Zi=Yi;function Xi(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}Yi.install=function e(t){if(!e.installed||Qo!==t){e.installed=!0,Qo=t;var n=function(e){return void 0!==e},a=function(e,t){var a=e.$options._parentVnode;n(a)&&n(a=a.data)&&n(a=a.registerRouteInstance)&&a(e,t)};t.mixin({beforeCreate:function(){n(this.$options.router)?(this._routerRoot=this,this._router=this.$options.router,this._router.init(this),t.util.defineReactive(this,"_route",this._router.history.current)):this._routerRoot=this.$parent&&this.$parent._routerRoot||this,a(this,this)},destroyed:function(){a(this)}}),Object.defineProperty(t.prototype,"$router",{get:function(){return this._routerRoot._router}}),Object.defineProperty(t.prototype,"$route",{get:function(){return this._routerRoot._route}}),t.component("RouterView",Co),t.component("RouterLink",Xo);var r=t.config.optionMergeStrategies;r.beforeRouteEnter=r.beforeRouteLeave=r.beforeRouteUpdate=r.created}},Yi.version="3.6.5",Yi.isNavigationFailure=Fi,Yi.NavigationFailureType=_i,Yi.START_LOCATION=xo,ti&&window.Vue&&window.Vue.use(Yi);n(102);n(91),n(129);var es={NotFound:()=>n.e(7).then(n.bind(null,300)),Layout:()=>Promise.all([n.e(0),n.e(3),n.e(2)]).then(n.bind(null,299))},ts={"v-5e1e685a":()=>n.e(8).then(n.bind(null,303)),"v-0d609624":()=>n.e(10).then(n.bind(null,304)),"v-c97ca880":()=>n.e(9).then(n.bind(null,305)),"v-4f037d1a":()=>n.e(11).then(n.bind(null,306)),"v-18d0587a":()=>n.e(12).then(n.bind(null,307)),"v-3120da0c":()=>n.e(13).then(n.bind(null,308)),"v-2f7f848c":()=>n.e(14).then(n.bind(null,309)),"v-2eaf1140":()=>n.e(15).then(n.bind(null,310)),"v-18c2b964":()=>n.e(16).then(n.bind(null,311)),"v-09d6f550":()=>n.e(17).then(n.bind(null,312)),"v-9356a30c":()=>n.e(18).then(n.bind(null,313)),"v-690a4650":()=>n.e(20).then(n.bind(null,314)),"v-7cc0117c":()=>n.e(19).then(n.bind(null,315)),"v-58f7366c":()=>n.e(21).then(n.bind(null,316)),"v-0877efcc":()=>n.e(22).then(n.bind(null,317)),"v-950c4d48":()=>n.e(23).then(n.bind(null,318)),"v-47c1f97a":()=>n.e(24).then(n.bind(null,319)),"v-4fad50ba":()=>n.e(25).then(n.bind(null,320)),"v-4fc0d1c8":()=>n.e(26).then(n.bind(null,321)),"v-31657474":()=>n.e(27).then(n.bind(null,322)),"v-e2784654":()=>n.e(28).then(n.bind(null,323)),"v-0c3bd15a":()=>n.e(29).then(n.bind(null,324)),"v-84e0b14c":()=>n.e(30).then(n.bind(null,325)),"v-074d53cc":()=>n.e(31).then(n.bind(null,326)),"v-0d650648":()=>n.e(32).then(n.bind(null,327)),"v-6dd912ec":()=>n.e(34).then(n.bind(null,328)),"v-3258450c":()=>n.e(36).then(n.bind(null,329)),"v-52bf2fcc":()=>n.e(35).then(n.bind(null,330)),"v-35b0f3b1":()=>n.e(38).then(n.bind(null,331)),"v-a6e64848":()=>n.e(37).then(n.bind(null,332)),"v-e65ea9a4":()=>n.e(39).then(n.bind(null,333)),"v-57c590fa":()=>n.e(40).then(n.bind(null,334)),"v-3e6ef1ac":()=>n.e(33).then(n.bind(null,335)),"v-41412a3a":()=>n.e(41).then(n.bind(null,336)),"v-131d811c":()=>n.e(42).then(n.bind(null,337)),"v-45095440":()=>n.e(43).then(n.bind(null,338)),"v-f81e553c":()=>n.e(45).then(n.bind(null,339)),"v-7cc2c9e4":()=>n.e(46).then(n.bind(null,340)),"v-5d3101c8":()=>n.e(47).then(n.bind(null,341)),"v-d297eaa6":()=>n.e(44).then(n.bind(null,342)),"v-501d8193":()=>n.e(48).then(n.bind(null,343))};function ns(e){const t=Object.create(null);return function(n){return t[n]||(t[n]=e(n))}}const as=/-(\w)/g,rs=ns(e=>e.replace(as,(e,t)=>t?t.toUpperCase():"")),os=/\B([A-Z])/g,is=ns(e=>e.replace(os,"-$1").toLowerCase()),ss=ns(e=>e.charAt(0).toUpperCase()+e.slice(1));function ls(e,t){if(!t)return;if(e(t))return e(t);return t.includes("-")?e(ss(rs(t))):e(ss(t))||e(is(t))}const ds=Object.assign({},es,ts),cs=e=>ds[e],us=e=>ts[e],ps=e=>es[e],hs=e=>ea.component(e);function fs(e){return ls(us,e)}function ms(e){return ls(ps,e)}function vs(e){return ls(cs,e)}function ys(e){return ls(hs,e)}function gs(...e){return Promise.all(e.filter(e=>e).map(async e=>{if(!ys(e)&&vs(e)){const t=await vs(e)();ea.component(e,t.default)}}))}function bs(e,t){"undefined"!=typeof window&&window.__VUEPRESS__&&(window.__VUEPRESS__[e]=t)}var ws=n(88),ks=n.n(ws),xs=n(89),Ts=n.n(xs),As={created(){if(this.siteMeta=this.$site.headTags.filter(([e])=>"meta"===e).map(([e,t])=>t),this.$ssrContext){const t=this.getMergedMetaTags();this.$ssrContext.title=this.$title,this.$ssrContext.lang=this.$lang,this.$ssrContext.pageMeta=(e=t)?e.map(e=>{let t="{t+=` ${n}="${Ts()(e[n])}"`}),t+">"}).join("\n "):"",this.$ssrContext.canonicalLink=Ss(this.$canonicalUrl)}var e},mounted(){this.currentMetaTags=[...document.querySelectorAll("meta")],this.updateMeta(),this.updateCanonicalLink()},methods:{updateMeta(){document.title=this.$title,document.documentElement.lang=this.$lang;const e=this.getMergedMetaTags();this.currentMetaTags=js(e,this.currentMetaTags)},getMergedMetaTags(){const e=this.$page.frontmatter.meta||[];return ks()([{name:"description",content:this.$description}],e,this.siteMeta,Cs)},updateCanonicalLink(){_s(),this.$canonicalUrl&&document.head.insertAdjacentHTML("beforeend",Ss(this.$canonicalUrl))}},watch:{$page(){this.updateMeta(),this.updateCanonicalLink()}},beforeDestroy(){js(null,this.currentMetaTags),_s()}};function _s(){const e=document.querySelector("link[rel='canonical']");e&&e.remove()}function Ss(e=""){return e?``:""}function js(e,t){if(t&&[...t].filter(e=>e.parentNode===document.head).forEach(e=>document.head.removeChild(e)),e)return e.map(e=>{const t=document.createElement("meta");return Object.keys(e).forEach(n=>{t.setAttribute(n,e[n])}),document.head.appendChild(t),t})}function Cs(e){for(const t of["name","property","itemprop"])if(e.hasOwnProperty(t))return e[t]+t;return JSON.stringify(e)}var Is=n(90),Ds={mounted(){window.addEventListener("scroll",this.onScroll)},methods:{onScroll:n.n(Is)()((function(){this.setActiveHash()}),300),setActiveHash(){const e=[].slice.call(document.querySelectorAll(".sidebar-link")),t=[].slice.call(document.querySelectorAll(".header-anchor")).filter(t=>e.some(e=>e.hash===t.hash)),n=Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop),a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight),r=window.innerHeight+n;for(let e=0;e=o.parentElement.offsetTop+10&&(!i||n{this.$nextTick(()=>{this.$vuepress.$set("disableScrollBehavior",!1)})})}}}},beforeDestroy(){window.removeEventListener("scroll",this.onScroll)}},Fs=n(22),Ps=n.n(Fs),Es={mounted(){Ps.a.configure({showSpinner:!1}),this.$router.beforeEach((e,t,n)=>{e.path===t.path||ea.component(e.name)||Ps.a.start(),n()}),this.$router.afterEach(()=>{Ps.a.done(),this.isSidebarOpen=!1})}},zs={props:{parent:Object,code:String,options:{align:String,color:String,backgroundTransition:Boolean,backgroundColor:String,successText:String,staticIcon:Boolean}},data:()=>({success:!1,originalBackground:null,originalTransition:null}),computed:{alignStyle(){let e={};return e[this.options.align]="7.5px",e},iconClass(){return this.options.staticIcon?"":"hover"}},mounted(){this.originalTransition=this.parent.style.transition,this.originalBackground=this.parent.style.background},beforeDestroy(){this.parent.style.transition=this.originalTransition,this.parent.style.background=this.originalBackground},methods:{hexToRgb(e){let t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},copyToClipboard(e){if(navigator.clipboard)navigator.clipboard.writeText(this.code).then(()=>{this.setSuccessTransitions()},()=>{});else{let e=document.createElement("textarea");document.body.appendChild(e),e.value=this.code,e.select(),document.execCommand("Copy"),e.remove(),this.setSuccessTransitions()}},setSuccessTransitions(){if(clearTimeout(this.successTimeout),this.options.backgroundTransition){this.parent.style.transition="background 350ms";let e=this.hexToRgb(this.options.backgroundColor);this.parent.style.background=`rgba(${e.r}, ${e.g}, ${e.b}, 0.1)`}this.success=!0,this.successTimeout=setTimeout(()=>{this.options.backgroundTransition&&(this.parent.style.background=this.originalBackground,this.parent.style.transition=this.originalTransition),this.success=!1},500)}}},Os=(n(237),n(10)),qs=Object(Os.a)(zs,(function(){var e=this,t=e._self._c;return t("div",{staticClass:"code-copy"},[t("svg",{class:e.iconClass,style:e.alignStyle,attrs:{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},on:{click:e.copyToClipboard}},[t("path",{attrs:{fill:"none",d:"M0 0h24v24H0z"}}),e._v(" "),t("path",{attrs:{fill:e.options.color,d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm-1 4l6 6v10c0 1.1-.9 2-2 2H7.99C6.89 23 6 22.1 6 21l.01-14c0-1.1.89-2 1.99-2h7zm-1 7h5.5L14 6.5V12z"}})]),e._v(" "),t("span",{class:e.success?"success":"",style:e.alignStyle},[e._v("\n "+e._s(e.options.successText)+"\n ")])])}),[],!1,null,"49140617",null).exports,Rs=(n(238),[As,Ds,Es,{updated(){this.update()},methods:{update(){setTimeout(()=>{document.querySelectorAll('div[class*="language-"] pre').forEach(e=>{if(e.classList.contains("code-copy-added"))return;let t=new(ea.extend(qs));t.options={align:"bottom",color:"#27b1ff",backgroundTransition:!0,backgroundColor:"#0075b8",successText:"Copied!",staticIcon:!1},t.code=e.innerText,t.parent=e,t.$mount(),e.classList.add("code-copy-added"),e.appendChild(t.$el)})},100)}}}]),Ls={name:"GlobalLayout",computed:{layout(){const e=this.getLayout();return bs("layout",e),ea.component(e)}},methods:{getLayout(){if(this.$page.path){const e=this.$page.frontmatter.layout;return e&&(this.$vuepress.getLayoutAsyncComponent(e)||this.$vuepress.getVueComponent(e))?e:"Layout"}return"NotFound"}}},Us=Object(Os.a)(Ls,(function(){return(0,this._self._c)(this.layout,{tag:"component"})}),[],!1,null,null,null).exports;!function(e,t,n){switch(t){case"components":e[t]||(e[t]={}),Object.assign(e[t],n);break;case"mixins":e[t]||(e[t]=[]),e[t].push(...n);break;default:throw new Error("Unknown option name.")}}(Us,"mixins",Rs);const Ms=[{name:"v-5e1e685a",path:"/docs/arfs/content-types.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-5e1e685a").then(n)}},{name:"v-0d609624",path:"/docs/arfs/entity-types.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-0d609624").then(n)}},{name:"v-c97ca880",path:"/docs/arfs/data-model.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-c97ca880").then(n)}},{name:"v-4f037d1a",path:"/docs/arfs/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-4f037d1a").then(n)}},{path:"/docs/arfs/index.html",redirect:"/docs/arfs/"},{path:"/docs/arfs/overview.html",redirect:"/docs/arfs/"},{name:"v-18d0587a",path:"/docs/arfs/privacy.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-18d0587a").then(n)}},{name:"v-3120da0c",path:"/docs/arfs/schema-diagrams.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-3120da0c").then(n)}},{name:"v-2f7f848c",path:"/docs/arfs/usage/change/drives.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-2f7f848c").then(n)}},{name:"v-2eaf1140",path:"/docs/arfs/usage/change/files.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-2eaf1140").then(n)}},{name:"v-18c2b964",path:"/docs/arfs/usage/change/folders.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-18c2b964").then(n)}},{name:"v-09d6f550",path:"/docs/arfs/usage/change/snapshots.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-09d6f550").then(n)}},{name:"v-9356a30c",path:"/docs/arfs/usage/create/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-9356a30c").then(n)}},{path:"/docs/arfs/usage/create/index.html",redirect:"/docs/arfs/usage/create/"},{path:"/docs/arfs/usage/create/create-drive.html",redirect:"/docs/arfs/usage/create/"},{name:"v-690a4650",path:"/docs/arfs/usage/create/create-folder.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-690a4650").then(n)}},{name:"v-7cc0117c",path:"/docs/arfs/usage/create/create-file.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-7cc0117c").then(n)}},{name:"v-58f7366c",path:"/docs/arfs/usage/create/create-snapshot.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-58f7366c").then(n)}},{name:"v-0877efcc",path:"/docs/arfs/usage/extending-schemas.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-0877efcc").then(n)}},{name:"v-950c4d48",path:"/docs/arfs/usage/read/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-950c4d48").then(n)}},{path:"/docs/arfs/usage/read/index.html",redirect:"/docs/arfs/usage/read/"},{path:"/docs/arfs/usage/read/read-operations.html",redirect:"/docs/arfs/usage/read/"},{name:"v-47c1f97a",path:"/docs/cli/all-commands.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-47c1f97a").then(n)}},{name:"v-4fad50ba",path:"/docs/cli/getting-help.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-4fad50ba").then(n)}},{name:"v-4fc0d1c8",path:"/docs/cli/getting-started.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-4fc0d1c8").then(n)}},{name:"v-31657474",path:"/docs/cli/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-31657474").then(n)}},{path:"/docs/cli/index.html",redirect:"/docs/cli/"},{path:"/docs/cli/intro.html",redirect:"/docs/cli/"},{name:"v-e2784654",path:"/docs/cli/using-the-cli.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-e2784654").then(n)}},{name:"v-0c3bd15a",path:"/docs/core-sdk.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-0c3bd15a").then(n)}},{name:"v-84e0b14c",path:"/docs/misc/deploy/deploy.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-84e0b14c").then(n)}},{name:"v-074d53cc",path:"/docs/misc/deploy/examples.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-074d53cc").then(n)}},{name:"v-0d650648",path:"/docs/misc/deploy/paths.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-0d650648").then(n)}},{name:"v-6dd912ec",path:"/docs/misc/deploy/routing.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-6dd912ec").then(n)}},{name:"v-3258450c",path:"/docs/misc/permasite.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-3258450c").then(n)}},{name:"v-52bf2fcc",path:"/docs/misc/ethareum/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-52bf2fcc").then(n)}},{path:"/docs/misc/ethareum/index.html",redirect:"/docs/misc/ethareum/"},{path:"/docs/misc/eth.html",redirect:"/docs/misc/ethareum/"},{name:"v-35b0f3b1",path:"/docs/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-35b0f3b1").then(n)}},{path:"/docs/index.html",redirect:"/docs/"},{name:"v-a6e64848",path:"/docs/misc/price-calculator.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-a6e64848").then(n)}},{name:"v-e65ea9a4",path:"/docs/turbo/api/payment.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-e65ea9a4").then(n)}},{name:"v-57c590fa",path:"/docs/turbo/api/upload.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-57c590fa").then(n)}},{name:"v-3e6ef1ac",path:"/docs/misc/deploy/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-3e6ef1ac").then(n)}},{path:"/docs/misc/deploy/index.html",redirect:"/docs/misc/deploy/"},{path:"/docs/misc/deploy/prepare.html",redirect:"/docs/misc/deploy/"},{name:"v-41412a3a",path:"/docs/turbo/credit-sharing.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-41412a3a").then(n)}},{name:"v-131d811c",path:"/docs/turbo/credits/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-131d811c").then(n)}},{path:"/docs/turbo/credits/index.html",redirect:"/docs/turbo/credits/"},{path:"/docs/turbo/credits.html",redirect:"/docs/turbo/credits/"},{name:"v-45095440",path:"/docs/turbo/migrating.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-45095440").then(n)}},{name:"v-f81e553c",path:"/docs/turbo/turbo-sdk/release-notes.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-f81e553c").then(n)}},{name:"v-7cc2c9e4",path:"/docs/turbo/turbo-sdk/turbo-web.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-7cc2c9e4").then(n)}},{name:"v-5d3101c8",path:"/docs/turbo/what-is-turbo.html",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-5d3101c8").then(n)}},{name:"v-d297eaa6",path:"/docs/turbo/turbo-sdk/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-d297eaa6").then(n)}},{path:"/docs/turbo/turbo-sdk/index.html",redirect:"/docs/turbo/turbo-sdk/"},{name:"v-501d8193",path:"/",component:Us,beforeEnter:(e,t,n)=>{gs("Layout","v-501d8193").then(n)}},{path:"/index.html",redirect:"/"},{path:"*",component:Us}],Ns={title:"ArDrive Docs",description:"ArDrive documentation",base:"/",headTags:[["link",{rel:"icon",href:"/images/ArDrive-Logo.png"}],["meta",{property:"og:title",content:"ArDrive Docs Portal"}],["meta",{name:"twitter:title",content:"ArDrive Docs Portal"}],["meta",{name:"twitter:card",content:"summary_large_image"}],["meta",{name:"twitter:image",content:"https://docs.ardrive.io/images/card-image.png"}],["meta",{name:"twitter:site",content:"@ardriveapp"}],["meta",{property:"og:image",content:"https://docs.ardrive.io/images/card-image.png"}],["meta",{name:"theme-color",content:"#3eaf7c"}],["meta",{name:"apple-mobile-web-app-capable",content:"yes"}],["meta",{name:"apple-mobile-web-app-status-bar-style",content:"black"}],["script",{src:"https://plausible.io/js/script.js",defer:!0,"data-domain":"docs.ardrive.io"}]],pages:[{title:"Content Types",frontmatter:{},regularPath:"/docs/arfs/content-types.html",relativePath:"docs/arfs/content-types.md",key:"v-5e1e685a",path:"/docs/arfs/content-types.html",headers:[{level:2,title:"Other Tags",slug:"other-tags",normalizedTitle:"other tags",charIndex:1007}],headersStr:"Other Tags",content:"# Content Types\n\nAll transaction types in ArFS leverage a specific metadata tag for the Content-Type (also known as mime-type) of the data that is included in the transaction. ArFS clients must determine what the mime-type of the data is, in order for Arweave gateways and browsers to render this content appropriately.\n\nAll public drive, folder, and file (metadata only) entity transactions all use a JSON standard, therefore they must have the following content type tag:\n\nContent-Type: ''\n\n\nHowever, a file's data transaction must have its mime-type determined. This is stored in the file's corresponding metadata transaction JSON's dataContentType as well as the content type tag in the data transaction itself.\n\nContent-Type: \"\"\n\n\nAll private drive, folder, and file entity transactions must have the following content type, since they are encrypted:\n\nContent-Type: ''\n\n\nArDrive-Core includes methods to determine a file's content type\n\n\n# Other Tags\n\nArFS enabled clients should include the following tags on their transactions to identify their application\n\nApp-Name: \"'\n\n\nhowever, a file's data transaction must have its mime-type determined. this is stored in the file's corresponding metadata transaction json's datacontenttype as well as the content type tag in the data transaction itself.\n\ncontent-type: \"\"\n\n\nall private drive, folder, and file entity transactions must have the following content type, since they are encrypted:\n\ncontent-type: ''\n\n\nardrive-core includes methods to determine a file's content type\n\n\n# other tags\n\narfs enabled clients should include the following tags on their transactions to identify their application\n\napp-name: \"

Enumerated field values (those which must adhere to certain values) are defined in the format "value 1 | value 2".

All UUIDs used for Entity-Ids are based on the Universally Unique Identifier (opens new window) standard.

There are no requirements to list ArFS tags in any specific order.

- + diff --git a/docs/arfs/entity-types.html b/docs/arfs/entity-types.html index 574d353..7612ad6 100644 --- a/docs/arfs/entity-types.html +++ b/docs/arfs/entity-types.html @@ -18,7 +18,7 @@ - + @@ -153,6 +153,6 @@ ] }
Snapshot Transaction JSON data example

# Schema Diagrams

The following diagrams show complete examples of Drive, Folder, and File entity Schemas.

# Public Drive

Public Drive Schema

# Private Drive

Private Drive Schema
- + diff --git a/docs/arfs/index.html b/docs/arfs/index.html index ac91438..21f0c78 100644 --- a/docs/arfs/index.html +++ b/docs/arfs/index.html @@ -18,11 +18,11 @@ - +

# ArFS Protocol: A Decentralized File System on Arweave

Arweave File System, or β€œArFS” is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on Arweave (opens new window)'s otherwise permanent, immutable data storage blockweave.

Due to Arweave's permanent, immutable and public nature traditional file system operations such as permissions, file/folder renaming and moving, and file updates cannot be done by simply updating the on-chain data model.

ArFS works around this by implementing a privacy and encryption pattern and defining an append-only transaction data model using tags within Arweave Transaction headers (opens new window).

# Key Features

# File Structure

ArFS organizes files and folders using a hierarchical structure. Files are stored as individual transactions on the Arweave blockchain, while folders are metadata that reference these file transactions.

# Metadata

Each file and folder has associated metadata, such as the name, type, size, and modification timestamp. ArFS leverages Arweave's tagging system to store this metadata in a standardized format, which allows for easy querying and organization.

# File Permissions

ArFS supports public and private file permissions. Public files can be accessed by anyone on the network, while private files are encrypted using the owner's private key, ensuring only they can decrypt and access the content.

# File Versioning

ArFS supports versioning of files, allowing users to store multiple versions of a file and access previous versions at any time. This is achieved by linking new file transactions to previous versions through the use of metadata tags.

# Data Deduplication

To minimize storage redundancy and costs, ArFS employs data deduplication techniques. If a user tries to store a file that already exists on the network, the protocol will simply create a new reference to the existing file instead of storing a duplicate copy.

# Search and Discovery

ArFS enables users to search and discover files based on their metadata, such as file names, types, and tags. This is made possible by indexing the metadata stored within the Arweave blockchain.

# Interoperability

ArFS is designed to be interoperable with other decentralized applications and services built on the Arweave network. This allows for seamless integration and collaboration between different applications and users.

# Getting Started

To start using ArFS, you'll need to familiarize yourself with the Arweave ecosystem, acquire AR tokens to cover storage costs, and choose a compatible client or library to interact with the ArFS protocol.

# ArFS Version History

Version Date Release Notes
0.10 August 2020 The brief, beta version that was in use during initial testing of ArDrive across Web (Dart) and legacy CLI (Typescript).
0.11 September 2020 Includes all of the major functionality supporting file systems on Arweave including new drives, folders, files, renames, moves and privacy.
0.12 December 2022 Added Snapshot entities to support quick synchronization of drive state.
0.13 August 2023 Added pins
0.14 January 2024 Added isHidden property to file and folder metadata to enable clients to "hide" content from end users.

# Resources

For more information, documentation, and community support, refer to the following resources:

- + diff --git a/docs/arfs/privacy.html b/docs/arfs/privacy.html index c6ef510..9325aa7 100644 --- a/docs/arfs/privacy.html +++ b/docs/arfs/privacy.html @@ -18,7 +18,7 @@ - + @@ -30,6 +30,6 @@ Cipher-IV?: "<12 byte initialization vector as Base64>"

Just like drives, private files must have the Content-Type tag set as application/octet-stream in both its metadata and data transactions:

Content-Type: "application/octet-stream"
 
- + diff --git a/docs/arfs/schema-diagrams.html b/docs/arfs/schema-diagrams.html index bc50652..a2148ff 100644 --- a/docs/arfs/schema-diagrams.html +++ b/docs/arfs/schema-diagrams.html @@ -18,11 +18,11 @@ - +

# Schema Diagrams

The following diagrams show complete examples of Drive, Folder, and File entity Schemas.

# Public Drive

Public Drive Schema

# Private Drive

Private Drive Schema

Arweave GQL Tag Byte Limit is restricted to 2048. There is no determined limit on Data JSON custom metadata, though more data results in a higher upload cost.

- + diff --git a/docs/arfs/usage/change/drives.html b/docs/arfs/usage/change/drives.html index 2feabf7..c6f9c91 100644 --- a/docs/arfs/usage/change/drives.html +++ b/docs/arfs/usage/change/drives.html @@ -18,12 +18,12 @@ - +

# Drive Write Operations

# Rename Drives

  • A new root folder metadata transaction is created when a user wants to rename an existing drive.
  • The new root folder metadata transaction reuses the existing drive's Drive-Id and Folder-Id, and copies all of its old metadata values, except the drive's and folder's name field must be updated in its data JSON to the new drive name.
    • For private drives, new ciphers are generated for this new root folder metadata transaction.
  • The new root folder transaction must not have any Parent-Folder-Id since it is a root folder.
- + diff --git a/docs/arfs/usage/change/files.html b/docs/arfs/usage/change/files.html index e9a83c1..0ec71c6 100644 --- a/docs/arfs/usage/change/files.html +++ b/docs/arfs/usage/change/files.html @@ -18,7 +18,7 @@ - + @@ -26,6 +26,6 @@
  • File’s must not be allowed to be moved into a folder if a file exists in that folder with the same file name.
  • # Rename File

    Files can be renamed from one name to another.

    # Update File Version

    When a user adds a new file to a folder, and there is a file in that folder with the same name, then a new file version is created.

    # Hide or Unhide File

    Changing the value of isHidden in a file's metadata will change whether or not a client should display that file.

    - + diff --git a/docs/arfs/usage/change/folders.html b/docs/arfs/usage/change/folders.html index 241ad57..61d2d6e 100644 --- a/docs/arfs/usage/change/folders.html +++ b/docs/arfs/usage/change/folders.html @@ -18,13 +18,13 @@ - +

    # Folder Write Operations

    # Move Folder

    Folders can be moved from one folder to another within the same Drive.

    • A new file metadata transaction is created when a user wants to move a folder into a different folder.
    • The new file metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the file’s Parent-Folder-Id must be updated to the Folder-Id of the folder is was just moved to.
      • For private folders, new ciphers are generated for this new metadata transaction.
    • Folder’s must not be allowed to be moved into a folder if another folder exists in that folder with the same folder name.

    # Rename Folder

    Folders can be renamed from one name to another.

    • A new folder metadata transaction is created when a user wants to rename an existing folder.
    • The new folder metadata transaction reuses the existing folder’s Folder-Id and copies all of it’s old metadata values, but the folder’s name field in its Data JSON must be updated to the new folder name.
      • For private folders, new ciphers are generated for this new metadata transaction.
    • Folders must not be allowed to be renamed to the name of another folder with that same name in that same folder.
    - + diff --git a/docs/arfs/usage/change/snapshots.html b/docs/arfs/usage/change/snapshots.html index 3e0b051..0f8897f 100644 --- a/docs/arfs/usage/change/snapshots.html +++ b/docs/arfs/usage/change/snapshots.html @@ -18,11 +18,11 @@ - +
    - + diff --git a/docs/arfs/usage/create/create-file.html b/docs/arfs/usage/create/create-file.html index 02df44f..51b6916 100644 --- a/docs/arfs/usage/create/create-file.html +++ b/docs/arfs/usage/create/create-file.html @@ -18,13 +18,13 @@ - +

    # Create File

    # New File Entity

    • A new file metadata transaction and a separate data transaction are created when a user wants to create a new file.
    • Files can only be created in existing drives, and must have a valid Drive-Id.
    • Files can only be created in existing parent folders, and must have a valid Parent-Folder-Id.
    • The new File Entity Data transaction must only specify the file’s mime type aka Content-Type.
    • The new file metadata transaction must generate a new UUIDv4 for the File-Id.
    • File metadata transactions must have Entity-Type: "file".
    • The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.
      • The client populates the File Entity Metadata Transaction Data JSON after creating the data transaction.
      • name The name of the file including extension.
      • size The size of the file on disk, in bytes as an integer.
      • lastModifiedDate The file’s last time of modification as reported by the user’s operating system, in milliseconds since Unix epoch.
      • dataTxId The Arweave transaction id of this File Entity’s Data Transaction.
      • dataContentType The mime time of this File Entity’s data must be determined by the client.
      • isHidden A boolean telling clients if they should display the file or not.
    • If the File is private:
      • Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM) for both the Metadata and Data transactions.
      • Its Cipher-IV tag must be filled out with the generated Initialization Vector for both the Metadata and Data transactions. Each one has its own unique IV.
      • It must have the content type Content-Type: "application/octet-stream" for both the Metadata and Data transactions.
      • The ArFS client must encrypt the File Entity’s Data and Metadata JSON using their assigned Cipher and Cipher-IV
    - + diff --git a/docs/arfs/usage/create/create-folder.html b/docs/arfs/usage/create/create-folder.html index a976f66..2521608 100644 --- a/docs/arfs/usage/create/create-folder.html +++ b/docs/arfs/usage/create/create-folder.html @@ -18,12 +18,12 @@ - +

    # Create Folder

    # New Folder Entity

    Folders can be created to organize files.

    • A new Folder Entity Metadata is created when a user wants to create a new folder.
    • Folders can only be created in existing drives, and must have a valid Drive-Id.
    • Folders can only be created in existing parent folders, and must have a valid Parent-Folder-Id.
    • The new folder metadata transaction must generate a new UUIDv4 for the Folder-Id.
    • Folder Entity Metadata transactions must have Entity-Type: "folder".
    • The client gets the user’s local time for the Unix-Time tag, represented as Seconds Since Unix Epoch.
    • The user defined folder name is added to the name property in the folder’s metadata transaction Data JSON.
    • Public folders must have the content type Content-Type: "<application/json>".
    • If the folder is private:
      • Its Cipher tag must be filled out with the respective encryption algorithm (currently AES256-GCM).
      • Its Cipher-IV tag must be filled out with the generated Initialization Vector for the private folder.
      • It must have the content type Content-Type: "application/octet-stream".
      • The ArFS client must encrypt the Folder entity’s metadata JSON using the assigned Cipher and Cipher-IV.
    - + diff --git a/docs/arfs/usage/create/create-snapshot.html b/docs/arfs/usage/create/create-snapshot.html index e887439..c4a2151 100644 --- a/docs/arfs/usage/create/create-snapshot.html +++ b/docs/arfs/usage/create/create-snapshot.html @@ -18,11 +18,11 @@ - +
    - + diff --git a/docs/arfs/usage/create/index.html b/docs/arfs/usage/create/index.html index 062a427..824e490 100644 --- a/docs/arfs/usage/create/index.html +++ b/docs/arfs/usage/create/index.html @@ -18,7 +18,7 @@ - + @@ -28,6 +28,6 @@
  • The Folder Entity's Folder-Id must match the rootFolderId previously created for the Drive Entity.
  • The Folder Entity's Drive-Id must match the Drive-Id previously created for the Drive Entity.
  • The Folder Entity must not include a Parent-Folder-Id tag.
  • Folder Entity metadata transactions must have Entity-Type: 'folder'.
  • The client gets the user's local time for the Unix-Time tag, represented as seconds since Unix Epoch.
  • Public folders must have the content type Content-Type: "application/json".
  • If the folder is private
  • - + diff --git a/docs/arfs/usage/extending-schemas.html b/docs/arfs/usage/extending-schemas.html index cfd084c..255282c 100644 --- a/docs/arfs/usage/extending-schemas.html +++ b/docs/arfs/usage/extending-schemas.html @@ -18,7 +18,7 @@ - + @@ -33,6 +33,6 @@ "albumSong": "<the title of the song>" }

    Additionally, the above extended Metadata fields could be added directly as a transaction tag as well, in order to support GraphQL queries.

    Arweave Transaction Headers can only fit a maximum of 2048 bytes total, so this must be taken into account by clients writing custom GQL tags.

    - + diff --git a/docs/arfs/usage/read/index.html b/docs/arfs/usage/read/index.html index 88128cf..40776cd 100644 --- a/docs/arfs/usage/read/index.html +++ b/docs/arfs/usage/read/index.html @@ -18,11 +18,11 @@ - +

    # Read ArFS Data

    Clients can perform read operations to create a timeline of entity write transactions which can then be replayed to construct the Drive state. This is done by querying an Arweave GraphQL index for the user’s respective transactions. Arweave GraphQL Guide (opens new window) can provide more information on how to use Arweave GraphQL. If no GraphQL index is available, drive state can only be generated by downloading and inspecting all transactions made by the user’s wallet

    This timeline of transactions should be grouped by the block number of each transaction. At every step of the timeline, the client can check if the entity was written by an authorized user. This also conveniently enables the client to surface a trusted entity version history to the user.

    To determine the owner of a Drive, clients must check for who created the first Drive Entity transaction using that Drive-Id. Until a trusted permissions or ACL system is put in place, any transaction in a drive created by any wallet other than the one who created the first Drive Entity transaction could be considered spam.

    The Unix-Time defined on each transaction should be reserved for tie-breaking same entity updates in the same block and should not be trusted as the source of truth for entity write ordering. This is unimportant for single owner drives but is crucial for multi-owner drives with updateable permissions (currently undefined in this spec) as a malicious user could fake the Unix-Time to modify the drive timeline for other users.

    • Drives that have been updated many times can have a long entity timeline which can be a performance bottleneck. To avoid this, clients can cache the drive state locally and sync updates to the file system by only querying for entities in blocks higher than the last time they checked.
    • Not checking for Drive Ownership could result in seeing incorrect drive state and GraphQL queries.

    # Folder/File Paths

    ArweaveFS does not store folder or file paths along with entities as these paths will need to be updated whenever the parent folder name changes which can require many updates for deeply nested file systems. Instead, folder/file paths are left for the client to generate from the folder/file names.

    # Folder View Queries

    Clients that want to provide users with a quick view of a single folder can simply query for an entity timeline for a particular folder by its id. Clients with multi-owner permissions will additionally have to query for the folder's parent drive entity for permission based filtering of the timeline.

    - + diff --git a/docs/cli/all-commands.html b/docs/cli/all-commands.html index 4ce4e5d..8221d2c 100644 --- a/docs/cli/all-commands.html +++ b/docs/cli/all-commands.html @@ -18,7 +18,7 @@ - + @@ -89,6 +89,6 @@ # Learn more about a command: ardrive <command> --help
    - + diff --git a/docs/cli/getting-help.html b/docs/cli/getting-help.html index d5358ff..6ff62be 100644 --- a/docs/cli/getting-help.html +++ b/docs/cli/getting-help.html @@ -18,11 +18,11 @@ - +
    - + diff --git a/docs/cli/getting-started.html b/docs/cli/getting-started.html index de391de..64b7895 100644 --- a/docs/cli/getting-started.html +++ b/docs/cli/getting-started.html @@ -18,7 +18,7 @@ - + @@ -45,6 +45,6 @@ # then invoke the CLI from anywhere on your system: ardrive

    To ensure your environment is compatible, we also recommend the following VSCode extensions:

    # Limitations

    Number of files in a bulk upload: Theoretically unlimited
    Max individual file size: 2GB (Node.js limitation)
    Max file name length: 255 bytes
    Max ANS-104 bundled transaction size: 500 MiB per bundle. App will handle creating multiple bundles.
    Max ANS-104 data item counts per bundled transaction: 250 Files per bundle (500 Data Items).

    - + diff --git a/docs/cli/index.html b/docs/cli/index.html index 9e8a2eb..40d36d7 100644 --- a/docs/cli/index.html +++ b/docs/cli/index.html @@ -18,7 +18,7 @@ - + @@ -81,6 +81,6 @@ } }

    This project is in a state of active development. Use at your own risk!

    # ArDrive

    ArDrive (opens new window) is a permanent storage platform whose applications and core libraries (opens new window) offer hierarchical organization, privacy via complete end-to-end encryption, flexibility, extensibility, and access control over your most valuable data, all made possible by its innovative core technology, the Arweave File System (ArFS) Protocol (opens new window).

    # ArFS

    ArFS (opens new window) is a data modeling, storage, and retrieval protocol designed to emulate common file system operations and to provide aspects of mutability to your data hierarchy on Arweave (opens new window)'s otherwise permanent, immutable data storage blockweave.

    # Data Portability

    Data uploaded via the ArDrive CLI, once indexed by Arweave's Gateways and sufficiently seeded across enough nodes on the network, can be accessed via all other ArDrive applications including the ArDrive Web application (opens new window) at https://app.ardrive.io.

    All transactions successfully executed by ArDrive can always be inspected in the Viewblock blockchain explorer (opens new window).

    # Intended Audience

    This tool is intended for use by:

    For deeper integrations with the ArDrive (opens new window) platform, consider using the ArDrive Core (opens new window) (Node) library's configurable and intuitive class interfaces directly within your application.

    - + diff --git a/docs/cli/using-the-cli.html b/docs/cli/using-the-cli.html index d0b4321..8398291 100644 --- a/docs/cli/using-the-cli.html +++ b/docs/cli/using-the-cli.html @@ -18,7 +18,7 @@ - + @@ -474,6 +474,6 @@

    # Persistent Caching of ArFS Entity Metadata

    To avoid redundant requests to the Arweave network for immutable ArFS entity metadata, a persistent file cache is created and maintained at:

    Windows: <os.homedir()>/ardrive-caches/metadata
     Non-Windows: <os.homedir()>/.ardrive/caches/metadata
     

    The XDG_CACHE_HOME environment variable is honored, where applicable, and will be used in place of os.homedir() in the scenarios described above.

    Metadata cache logging to stderr can be enabled by setting the ARDRIVE_CACHE_LOG environment variable to 1.

    Cache performance is UNDEFINED for multi-process scenarios, but is presumed to be generally usable.

    The cache can be manually cleared safely at any time that any integrating app is not in operation.

    - + diff --git a/docs/core-sdk.html b/docs/core-sdk.html index 1a4f1e0..e99d1a0 100644 --- a/docs/core-sdk.html +++ b/docs/core-sdk.html @@ -18,7 +18,7 @@ - + @@ -141,6 +141,6 @@ } );
    - + diff --git a/docs/index.html b/docs/index.html index b8cf186..3ab72c3 100644 --- a/docs/index.html +++ b/docs/index.html @@ -18,11 +18,11 @@ - +

    # placeholder

    Exercitation proident duis qui est veniam duis ullamco proident et veniam.

    - + diff --git a/docs/misc/deploy/deploy.html b/docs/misc/deploy/deploy.html index b41b3f7..cc98541 100644 --- a/docs/misc/deploy/deploy.html +++ b/docs/misc/deploy/deploy.html @@ -18,11 +18,11 @@ - +

    # Deploying your dApp

    # Overview

    This guide will outline the steps needed to deploy your dApp onto the Arweave blockchain using the ArDrive web app. It assumes you have already prepared your dApp to use hash routing and relative file paths, and built static files for any dApp in a language or framework that requires it (like React).

    # Deploying

    # Step 1: Log into ArDrive

    Go to the ArDrive web app (opens new window) and log in using the method of your choosing. If you don't already have an account, you will need to follow the instructions to set one up.

    # Step 2: Select or Create a Drive

    Once logged in, navigate to the drive where you want your project to be hosted. If you haven't created a drive yet, or if you want a new one specifically for this project, click the big red "New" button at the top left and create a new drive. Remember, the drive needs to be set to public for your dApp to be accessible to others.

    # Step 3: Upload your project

    With your drive selected, click the big red "New" button again, but this time, select "Upload Folder". Navigate to your project's root directory, or the built directory if required, and select it. This will upload the entire directory, maintaining your project's file structure.

    # Step 4: Confirm Upload

    You'll be given a chance to review the upload and the associated cost. If everything looks right, click "Confirm". Remember, uploading to Arweave isnt free, but the cost is usually quite small and the benefits of having your dApp hosted on the permaweb are significant.

    # Step 5: Create the Manifest

    While ArDrive displays your uploaded files as a traditional file structure, with files and folders inside other folders, thats not how they actually exist on Arweave. The manifest acts as a map to all the files your dApp needs to function. After you confirm your upload, navigate into your newly created folder by double clicking on it. Click the big red "New" button again and select "Create manifest". You'll be prompted to name the manifest and choose where to save it. Be sure to save it inside the folder you just created.

    # Step 6: Get the Data TX ID

    Once the manifest is created, click on it to expand its details. On the bottom right, there's a line labeled "Data TX ID". This is the unique identifier for your uploaded dApp on Arweave. Copy this value.

    # Step 7: View and Share your dApp

    Your dApp is now available on the permaweb forever! Append the Data TX ID you just copied to the end of an Arweave gateway URL, like https://arweave.net/ . It might take a few minutes for all of your files to finish propagating through the network, but once they do your dApp will be accessible to anyone, anywhere, at any time.

    # Updating your dApp

    Files uploaded to Arweave are permanent and immutable. They cannot be changed. However, the Arweave File System (ArFS) protocol used (and created) by ArDrive lets you "replace" them with new versions while still being able to access the old ones. You can do this with entire dApps as well. The old files won't be displayed in the ArDrive web app unless you click on a file to view its history.

    Once you have made changes to your dApp, and built the static directory for it, you can upload the entire folder again to the same location where you uploaded the original. Follow all the same steps listed above for uploading your dApp. You will need to create a new manifest to correctly point to the updated files. Give it the same name as the old manifest in order to "replace" it. Creating the new manifest will generate a new TX ID used to view the updated dApp.

    The old version of the dApp will always be available to anyone who has the correct TX ID

    - + diff --git a/docs/misc/deploy/examples.html b/docs/misc/deploy/examples.html index 1e50ad7..dc1d5f9 100644 --- a/docs/misc/deploy/examples.html +++ b/docs/misc/deploy/examples.html @@ -18,11 +18,11 @@ - +

    # Examples

    Below are some basic websites built with different languages or frameworks that provide more detailed information on how to configure your dApp for that framework. Each one has been deployed to Arweave itself to show that it functions correctly, and can be accessed through any Arweave gateway by using its TX ID. These are all very basic examples, but if you follow the principles explained, your dApp will function correctly when deployed to the permaweb no matter how big or complex it becomes.

    # Basic HTML

    A basic HTML website with a javascript script to facilitate hash routing:

    GPOX8dgUpFpt8IVUyyfBMiPpfWZ9eXHZjNi42W4-_50 (opens new window)

    # React

    A React dApp created using Create-React-App:

    BTjZhINTpCtWiE0PcfpAQ8a3QhL-1AwXfNJ9lhbaJj0 (opens new window)

    # Next

    A Nextjs dApp created using Create-Next-App:

    01hMcPNA_TEXh1S7p4f6jop7r4lrElF1mIlAwkzhJ_s (opens new window)

    # WordPress

    ilP8KEFm0jGAhjEP6e7ZlS7s6BV1NgGJnlw7OfiD5kU (opens new window)

    - + diff --git a/docs/misc/deploy/index.html b/docs/misc/deploy/index.html index b68d9e0..17bb9bf 100644 --- a/docs/misc/deploy/index.html +++ b/docs/misc/deploy/index.html @@ -18,11 +18,11 @@ - +

    # Preparing Your dApp

    To make sure dApps work correctly on the Arweave blockchain, they need to be set up in a specific manner. This is because, unlike traditional web hosting, there are no centralized servers for browsers to request files from. Your dApp needs to be able to handle navigation inside the client's browser instead of relying on communication between the client and a server, and not rely on a server as a point of origin for file paths. This is done by ensuring the following:

    Failure to properly implement either will result in your dApp not working the way it should once it is deployed onto Arweave.

    - + diff --git a/docs/misc/deploy/paths.html b/docs/misc/deploy/paths.html index 6c0ab09..65b0731 100644 --- a/docs/misc/deploy/paths.html +++ b/docs/misc/deploy/paths.html @@ -18,11 +18,11 @@ - +

    # File Paths

    # Overview

    File paths are needed to locate resources in your file system or on a server. There are two types of file paths: absolute and relative. Because there is no way to know exactly from where a user will access a dApp deployed on Arweave, all file paths used need to be relative.

    # Absolute Vs. Relative

    An absolute path is the full URL to a resource, starting from the root. For example, http://www.example.com/images/myImage.jpg is an absolute path. It points directly to the image no matter where the code referencing it is located.

    A relative path is a path relative to the current location. If you have an HTML file in the root directory (folder) and an image in a subdirectory called 'images', you could use the relative path images/myImage.jpg to reference the image.

    # Why Relative Paths

    When deploying dApps on Arweave, relative paths are essential because:

    • Domain agnostic: Arweave permaweb dApps can be accessed from various gateways, not just one domain. Absolute paths tied to a specific domain will not work.
    • Decentralized: Arweave is a decentralized network. There is no root directory or server configuration to reference. All file paths must be relative to the file trying to find an asset, or your dApp wont be able to find it.

    # Identifying Relative and Absolute Paths

    The key difference between relative and absolute file paths is where they start from:

    • Absolute Paths start with a slash (/) or a full URL (including the protocol, such as http://). For example, /images/myImage.jpg or http://www.example.com/images/myImage.jpg are absolute paths.
    • Relative Paths do not start with a slash. They are relative to the current directory. For example, images/myImage.jpg or ../myImage.jpg are relative paths.

    You can navigate around the files of your project with relative paths by following these principles:

    • Same Directory: If the file you're trying to reference is in the same directory as the current file, you can just use the filename. For example, if index.html and about.html are in the same directory, you can link to about.html just using about.html.

    • Subdirectory: If the file is in a subdirectory, you can use the directory name followed by the filename. For example, images/myImage.jpg will point to the myImage.jpg file in the images subdirectory.

    • Parent Directory: If the file is in a parent directory, you can use ../ to go up one level. For example, ../index.html will point to index.html in the parent directory. You can use multiple ../ to go up multiple levels, like ../../index.html.

    - + diff --git a/docs/misc/deploy/routing.html b/docs/misc/deploy/routing.html index 6813af8..984dbca 100644 --- a/docs/misc/deploy/routing.html +++ b/docs/misc/deploy/routing.html @@ -18,11 +18,11 @@ - +

    # Hash Routing

    # Overview

    Hash routing is a popular technique in single page applications (SPAs) where the site navigation is handled using JavaScript. The "hash" in hash routing refers to the hash symbol (#) inserted into the URL. The part of the URL after the hash symbol is used to determine which "page" to show.

    For example, if your URL is "http://www.example.com/#about", the part after the hash (about) would be used to show an app's "about" page.

    # Hash Routing Vs. History Routing

    Traditional web apps use history routing, where each unique URL represents a different source or asset contained in a server. The URL "http://www.example.com/about" would fetch the "about" page from the app's server and display it for a user. History routing requires a server be available to provide the correct files every time a user navigates around an app.

    In contrast, with hash routing, all navigation is handled by the client's browser, so no server is needed for navigation.

    # Why Hash Routing for dApps

    Hash routing is particularly useful for apps deployed on Arweave for several reasons:

    • Serverless: Arweave is a decentralized storage network. There's no server to process requests, so routing cannot be handled by a server.
    • Persistence: Once data is stored on Arweave, it can't be changed. Hash routing allows you to have "dynamic" content within this immutable structure.
    • Performance: With hash routing, all the necessary code is loaded once, reducing the number of network requests and improving performance.
    - + diff --git a/docs/misc/ethareum/index.html b/docs/misc/ethareum/index.html index af5dd3e..e75f2a9 100644 --- a/docs/misc/ethareum/index.html +++ b/docs/misc/ethareum/index.html @@ -18,11 +18,11 @@ - +

    # EthAReum

    # Overview

    EthAReum is a new key derivation protocol that enables the generation of private keys for an Arweave wallet using a signature from an Ethereum wallet. This allows users to create an Arweave wallet directly through an Ethereum wallet provider like MetaMask (opens new window).

    These generated private keys provide a fully functional Arweave wallet, equipped to perform all standard operations, including holding AR tokens and Turbo Credits, and uploading data to the Arweave network.

    Recommended Browser

    For optimal performance, it is recommended MetaMask users access ArDrive using the Chrome browser. While EthAReum functions correctly in most browsers, there are ongoing efforts to resolve some edge case compatibility issues in other environments.

    # Password

    The EthAReum protocol incorporates a user-generated password in the process of deriving an Arweave wallet from an Ethereum wallet. This password provides an extra layer of security by contributing additional entropy to the wallet's derivation. It also serves as a critical verification step for wallet access.

    For instance, when creating a new account with ArDrive, users are required to set a password for their wallet. This password is then used for subsequent logins and for encrypting private uploads. The password established during the wallet derivation process on ArDrive will be the same password used for future logins.

    NOTE: The password used during the derivation of private keys is permanent and CAN NOT be changed or recovered by an administrator (ArDrive is a decentralized platform and has no account administration). It is crucial to keep this password secure.

    # Public Address

    The Public address of the generated Arweave wallet is derived from its public key. The public address of the generated wallet will be different from the public address of the Ethereum wallet used to generate it.

    The exact steps needed to obtain the public address of the generated wallet will differ depending on the user interface of the dApp you use for interacting with the protocol. With ArDrive, the information can be viewed at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.

    # Keyfile and Seed Phrase

    The primary method used in the Arweave ecosystem for accessing or importing a wallet is through the use of a keyfile, rather than a seed phrase like is commonplace in Ethereum wallet providers. Seed phrases are supported though, so you will be able to obtain a seed phrase for your generated Arweave wallet and use it to import the wallet into other dApps or wallet providers in the Arweave ecosystem. Just be aware that not every dApp in the ecosystem has an interface that can facilitate this.

    A keyfile is a json file that contains a Json Web Key (JWK) which act as the private keys for a wallet. Always be sure to treat your keyfile with the same care as you would the private keys for an Ethereum wallet. Find out more about keyfiles from the Arweave Cookbook (opens new window).

    Similar to the public address of your generated wallet, the method used to access your new keyfile or seed phrase will differ based on the dApp you used to generate your wallet. With ArDrive, both are available for download at any time you are logged in to the app by clicking on the user profile icon at the top right of the screen.

    # Security

    EthAReum generates the private keys of an Arweave wallet using a signature from your Ethereum wallet, ensuring that control only extends in one direction. The EthAReum protocol does not access or control the Ethereum wallet used for generation, thereby safeguarding your Ethereum assets.

    However, it's important to be vigilant as some malicious dApps or websites may disguise a high-risk authorization transaction as a simple signature request. Always ensure that you only provide signatures to reputable and trusted dApps like ArDrive (opens new window).

    - + diff --git a/docs/misc/permasite.html b/docs/misc/permasite.html index f23b727..a56b914 100644 --- a/docs/misc/permasite.html +++ b/docs/misc/permasite.html @@ -18,11 +18,11 @@ - +

    # How to Save a Website Permanently

    # Overview

    ArDrive offers the ability to save working copies of static websites permanently on Arweave (opens new window). This means that websites made on WordPress, Wix, SquareSpace and other CMS platforms can now be archived for hundreds of years without the need to pay for ongoing data storage.

    Resources like the Wayback Machine (opens new window) are useful to research the past life of old websites. But the Wayback Machine’s archives are not comprehensive and often only capture partial copies of historic sites. By leveraging the utility of Arweave manifests, ArDrive offers the ability to save full working copies of websites in an unchanging, permanent state without needing to code.

    The process to make a β€˜permasite’ takes 10 steps which are outlined below. Advanced users can accomplish similar results by using manifests within the ArDrive CLI.

    You can view a permasite version of this information at permasite.arweave.dev (opens new window)

    # 1. Download Static Site Files

    ArDrive allows you to preserve full working copies of the static content of existing websites but there are a few limitations to be aware of:

    • Permanent sites will not enable backend interaction with your website’s CMS,
    • nor allow you to make further changes to the content of your site,
    • nor support dynamic functionality like contact forms and eCommerce.

    To generate your static site files, we recommend:

    # Windows Users

    WebCopy (opens new window) and HtTrack (opens new window) enable Windows users to download static copies of entire websites.

    # Mac Users

    Offline Pages Pro (opens new window) (Mac users only), which creates files that work well with this process. After saving your site with Offline Pages Pro, go to File > Export > Local Website to download the local static files.
    SiteSucker (opens new window) is another option for Mac users.

    # Command Line Utility

    Wget (opens new window) is a free tool that helps capture static versions of websites. While Wget isn't a traditional static site generator, it's great for downloading whole websites for offline use. It offers a simple way to save your site's current look and feel as static files at no cost.

    # WordPress

    Simply Static (opens new window) is a plugin that generates static files for WordPress websites. Some users note that Simply Static fails to properly associate CSS and JS files with your static site, but others have had success with this free WordPress plugin.

    # 2. Create an Account on ArDrive

    Account creation is free as are uploads of small files (currently up to 500 KB). Remember that ArDrive empowers you to be in control of your data; no one else has your password but you. Therefore, it is very important that you safely record your password and seed phrase as they cannot be recovered later.

    # 3. Create a New Public Drive

    Click on the red +New button and create a Drive. Name your Drive and set it as β€œPublic”. ArDrive also offers β€œPrivate” file storage; however, permanent websites must be public in order to maintain functionality.

    # 4. Top Up

    To pay for permanent storage on the Arweave network you must either purchase ArDrive Turbo credits with a credit card or (or the advanced option) ensure your wallet has $AR, the native token of the Arweave ecosystem. Most websites will cost less than $1 to save permanently. See current prices (opens new window)

    # 5. Upload Static Files

    Upload the static files to your new Public Drive. Offline Pages Pro will generate an index.html file that is separate from a large folder of assets (images, css, fonts, etc). Simply Static will add the index.html file to the rest of your assets. Either way, upload all the files you receive from your static site generator to your new Public Drive.

    # 6. Wait

    Permanence takes patience. Once static files have been uploaded, they need to be sent to the Arweave network before being assembled together. This process can take as little as 5 seconds (when using Turbo credits) or up to 30 minutes or more (when using $AR). Make sure to keep your browser tab open and do not refresh your browser while you wait.

    To check on the status of your files, you can click the refresh icon in the top right of ArDrive. You’ll know your file is ready when the light on the icon turns from yellow to green. (Pro Tip: some files uploaded with Turbo are ready before they are green.)

    # 7. Create a Manifest

    Manifests (opens new window) are specialΒ .jsonΒ files that instruct Arweave Gateways to map file data associated with specific, unique transaction IDs to customized, hosted paths relative to that of the manifest file itself. In other words, they are the secret sauce that brings a permasite together.

    Click on the red +New button and select Advanced > New Manifest. Select the location for your manifest, ensuring it is in the same place as your index.html file.

    Give your Manifest a name like β€œpermasite”, it will be the main way you access your permanent website from ArDrive.

    # 8. Wait Again

    Now the manifest needs to be sent to the Arweave network. Again, this process can take just a few seconds or up to 30 minutes or more.

    After a bit, you can refresh your Drive by clicking on the icon in the upper right – and see if your manifest icon turns from yellow to green.

    # 9. Preview the Manifest

    Got a green light? You’re ready to go. Click on your manifest file and you will see a panel of options appear on the right side of your screen. Click on the Preview icon in the top right and it will open a new tab with your permasite.

    If a website appears with a long, random-looking URL in the browser bar, then congrats, you made a permasite!

    Try clicking around and make sure all your pages are preserved. If they are not it could be a limitation of your static site generator or an issue with the manifest (see Notes below).

    # 10. Add a Redirect or Domain Masking

    You’ll notice that your permasite has a long, random-looking URL generated by Arweave. These long URLs are designed to remain for decades, but they also are not very memorable.

    Try redirecting another domain to your permasite, or mask your permasite domain with a domain of your choosing. You can also acquire an ArNS name (opens new window) that enables you to create a custom, permanent name for your permasite.

    # Notes

    • There’s no delete button with Arweave. Once your permasite is up, it’s up forever. Make sure your content is something you want future humanity to have.

    • Only static sites can become permasites through the ArDrive web app. Advanced functionality is available for developers who use the ArDrive CLI (opens new window).

    • Links to content on external websites will not be permanent (unless they are also permasites) and if that external content becomes inaccessible or moves, you will not be able to update the links within your permasite.

    • Non-English characters in the URLs of your permasite can be problematic for ArDrive manifests, but non-English characters should work well on the permasite itself.

    # Other Use Cases

    Permasites can be used to archive web content before it disappears from the internet. Or they can be used to create working copies of websites before it a particular site is replaced by new versions.

    Manifests can also be used to make reliable perma-backups. Many web hosts offer good daily backups and some offer reliable offsite backups as well. Permasites enable you to have decentralized, highly-redundant backups of your website’s content for a very low cost.

    # Example

    You can view a permasite version of this information at permasite.arweave.dev (opens new window)

    - + diff --git a/docs/misc/price-calculator.html b/docs/misc/price-calculator.html index ca1cacf..9995985 100644 --- a/docs/misc/price-calculator.html +++ b/docs/misc/price-calculator.html @@ -18,7 +18,7 @@ - + @@ -35,6 +35,6 @@ Run with the --watch flag (yarn test -- --watch) to run in interactive watch mode.

    # yarn run:prod

    Builds a fresh snowpack production build to the build/ folder Then launches that copy with http-server-spa for local testing The build will be available for preview at: http://localhost:8080 (opens new window)

    - + diff --git a/docs/turbo/api/payment.html b/docs/turbo/api/payment.html index 800dbbf..3033173 100644 --- a/docs/turbo/api/payment.html +++ b/docs/turbo/api/payment.html @@ -18,7 +18,7 @@ - + @@ -463,6 +463,6 @@ ] }

    * required

    - + diff --git a/docs/turbo/api/upload.html b/docs/turbo/api/upload.html index abbe6f8..9c7692c 100644 --- a/docs/turbo/api/upload.html +++ b/docs/turbo/api/upload.html @@ -18,7 +18,7 @@ - + @@ -66,6 +66,6 @@ } ```

    * required

    - + diff --git a/docs/turbo/credit-sharing.html b/docs/turbo/credit-sharing.html index d2c8ed7..4d9c102 100644 --- a/docs/turbo/credit-sharing.html +++ b/docs/turbo/credit-sharing.html @@ -18,11 +18,11 @@ - + -

    # Turbo Credit Sharing

    # Overview

    Turbo Credits are the payment medium used by the Turbo Upload Service to facilitate uploading data to the Arweave Blockweave. While they exist as assets accessible on Arweave, they are not a cryptocurrency token in the traditional sense. They cannot be transferred, traded, exchanged, or otherwise interacted with in a way that you typically could with a cryptocurrency token. A purchase of Turbo Credits also cannot be refunded, whether obtained via fiat or through exchanging supported cryptocurrency tokens like Ethereum or Kyve.

    Recently, however, the Turbo Upload Service has been upgraded to allow holders of Turbo Credits to share the upload power of those Credits with other users. This means holders of Turbo Credits can authorize other users to use some of their Credits for uploading data to Arweave without those Credits ever leaving their own wallet.

    # How it Works

    A holder of Turbo Credits may explicitly authorize another wallet to use some of their Turbo Credits for uploading to Arweave. The shared Credits become "locked", meaning that ONLY the authorized user is able to access those Credits to pay for uploading data. This happens without the Credits ever leaving the wallet of the original holder.

    Authorizations, or "Approvals" are data items that are uploaded to Arweave that the Turbo Upload Service is able to see when processing transactions. The uploaded data item states the address of the user being approved, the amount of Turbo Credits (in winc) being approved for that user, and an optional time limit at which point the approval will expire and the user will lose access to those Credits. While processing upload transactions, Turbo will automatically find these approvals for the uploading user and pull funds from shared Credits before Credits held by the user directly. Approvals that are closest to expiring will be pulled from first, unless a different criteria is provided.

    Uploading users have several options for specifying which approval should be prioritized to pay for uploads in the case where they have more than one:

    • paidBy: Uploading users can specify the order of wallet addresses that funds should be pulled from to pay for their current upload by supplying a paidBy value. This is an ordered list of wallet addresses or native addresses, and can include the uploader's own address.
    • ignore-approvals: When using the Turbo CLI to upload data, the --ignore-approvals flag will ignore any approved Credits and only attempt to pay for an upload from the user's own balance of Credits.
    • use-signer-balance-first: When using the Turbo CLI to upload data, the --use-signer-balance-first flag will attempt to pay for an upload using the user's own balance of credits first. If the user does not have enough Credits to cover the entire upload, only after their balance is exhausted will approved Credits be accessed to cover the remaining cost.

    Holders of Turbo Credits can create approvals for users via the Turbo SDK or the Turbo CLI, with the specific methods used to do so being outlined, with examples, in the Turbo SDK/CLI docs. Holders can also revoke approvals at any time to regain access to their Credits, even if an approval has an explicit expiry time.

    # Use Cases

    # Organizational Funds

    For companies or organizations that routinely upload data to Arweave, it can be challenging to keep individual user wallets funded sufficiently to complete their work. There is also a risk of over funding users who only have an occasional need to upload data. Given that Turbo Credits are non-refundable, this can be a significant waste of limited resources. One possible solution is to give all employees access to the core organizational wallet. This is usually a very bad idea though. Anyone who has keys to access a crypto wallet has complete control of that wallet. Any other assets held by the wallet could be transferred out, or an employee could take those keys with them when they leave to retain access to the Turbo Credits held.

    Turbo Credit Sharing solves this issue by allowing a central organizational wallet to keep only itself funded with Turbo Credits that can then be shared with wallets for any partners or employees as needed, and easily recovered if they are not needed by a particular user.

    # Onboarding Periods

    Any product or service that has users upload data to Arweave can use Turbo Credit Sharing to give new users uploading power for a certain period of time as an introduction to what they have to offer. Having to make a purchase, especially of a third-party product, can be a major blocker for onboarding new users, but a period of controlled free-for-them access can give the company a chance to showcase why what they have to offer is worth the cost.

    # Collaboration

    When multiple devolopers or contributor are working on a joint project that requires uploading data to Arweave, managing the funding for each participant can be cumbersome. By sharing Turbo Credits, the project leader or funding entity can grant each collaborator access to upload without directly handling individual wallets. This facilitates seamless cooperation without the risk of losing control over funds or overfunding specific contributors.

    # Community or Open Source Initiatives

    In open source or community-driven efforts that involve uploading data to Arweave, such as the Banned Books Week (opens new window) project to protect books that are often censored, project managers can share Turbo Credits with trusted contributors. This supports collaborative efforts without having to worry about decentralized funding. By using approvals, maintainers can control how Credits are used, set expiration times, and ensure that shared resources are managed responsibly.

    # Event Based or Seasonal Promotions

    Companies and services can run promotional events or campaigns where users can upload data for free-to-them for a limited time. Turbo Credit Sharing makes it easy to share upload power with participants, allowing them to experience the service without initial investment. After the promotional period ends, the Credits remain with the original holder, ensuring that company resources are not permanently allocated.

    # Research and Development Trials

    Academic institutions or research organizations conducting studies involving data uploads to Arweave can benefit from shared Turbo Credits. A central research wallet can allocate upload power to various project teams or individual researchers. This approach helps ensure that project budgets are managed centrally while allowing flexibility in data uploads, without distributing sensitive wallet keys to team members.

    # Educational Programs

    Schools or educational platforms teaching blockchain development or data permanence could use Turbo Credit Sharing to allow students or participants to upload data as part of their learning exercises. This gives learners hands-on experience without requiring them to fund their wallets, making it more accessible and encouraging engagement with the technology.

    # Data Migration Services

    Data migration services or third-party consultants assisting with moving data onto the Arweave Blockweave can be given controlled access to an organization’s Turbo Credits for a project’s duration. This ensures that consultants can carry out the migration without needing their own funding or wallet management, streamlining project operations while maintaining security.

    - +

    # Turbo Credit Sharing

    # Overview

    Turbo Credits are the payment medium used by the Turbo Upload Service to facilitate uploading data to the Arweave Blockweave. While they exist as assets accessible on Arweave, they are not a cryptocurrency token in the traditional sense. They cannot be transferred, traded, exchanged, or otherwise interacted with in a way that you typically could with a cryptocurrency token. A purchase of Turbo Credits also cannot be refunded, whether obtained via fiat or through exchanging supported cryptocurrency tokens like Ethereum or Kyve.

    Recently, however, the Turbo Upload Service has been upgraded to allow holders of Turbo Credits to share the upload power of those Credits with other users. This means holders of Turbo Credits can authorize other users to use some of their Credits for uploading data to Arweave without giving away control of those Credits.

    # How it Works

    A holder of Turbo Credits may explicitly authorize another wallet to use some of their Turbo Credits for uploading to Arweave. The shared Credits become "locked", meaning that ONLY the authorized user is able to access those Credits to pay for uploading data. This happens without control of the Credits being lost by the wallet of the original holder.

    Authorizations, or "Approvals" are data items that are uploaded to Arweave that the Turbo Upload Service is able to see when processing transactions. The uploaded data item states the address of the user being approved, the amount of Turbo Credits (in winc) being approved for that user, and an optional time limit at which point the approval will expire and the user will lose access to those Credits. While processing upload transactions, Turbo will automatically find these approvals for the uploading user and pull funds from shared Credits before Credits held by the user directly. Approvals that are closest to expiring will be pulled from first, unless a different criteria is provided.

    Uploading users have several options for specifying which approval should be prioritized to pay for uploads in the case where they have more than one:

    • paidBy: Uploading users can specify the order of wallet addresses that funds should be pulled from to pay for their current upload by supplying a paidBy value. This is an ordered list of wallet addresses or native addresses, and can include the uploader's own address.
    • ignore-approvals: When using the Turbo CLI to upload data, the --ignore-approvals flag will ignore any approved Credits and only attempt to pay for an upload from the user's own balance of Credits.
    • use-signer-balance-first: When using the Turbo CLI to upload data, the --use-signer-balance-first flag will attempt to pay for an upload using the user's own balance of credits first. If the user does not have enough Credits to cover the entire upload, only after their balance is exhausted will approved Credits be accessed to cover the remaining cost.

    Holders of Turbo Credits can create approvals for users via the Turbo SDK or the Turbo CLI, with the specific methods used to do so being outlined, with examples, in the Turbo SDK/CLI docs. Holders can also revoke approvals at any time to regain access to their Credits, even if an approval has an explicit expiry time.

    # Use Cases

    # Organizational Funds

    For companies or organizations that routinely upload data to Arweave, it can be challenging to keep individual user wallets funded sufficiently to complete their work. There is also a risk of over funding users who only have an occasional need to upload data. Given that Turbo Credits are non-refundable, this can be a significant waste of limited resources. One possible solution is to give all employees access to the core organizational wallet. This is usually a very bad idea though. Anyone who has keys to access a crypto wallet has complete control of that wallet. Any other assets held by the wallet could be transferred out, or an employee could take those keys with them when they leave to retain access to the Turbo Credits held.

    Turbo Credit Sharing solves this issue by allowing a central organizational wallet to keep only itself funded with Turbo Credits that can then be shared with wallets for any partners or employees as needed, and easily recovered if they are not needed by a particular user.

    # Onboarding Periods

    Any product or service that has users upload data to Arweave can use Turbo Credit Sharing to give new users uploading power for a certain period of time as an introduction to what they have to offer. Having to make a purchase, especially of a third-party product, can be a major blocker for onboarding new users, but a period of controlled free-for-them access can give the company a chance to showcase why what they have to offer is worth the cost.

    # Collaboration

    When multiple devolopers or contributor are working on a joint project that requires uploading data to Arweave, managing the funding for each participant can be cumbersome. By sharing Turbo Credits, the project leader or funding entity can grant each collaborator access to upload without directly handling individual wallets. This facilitates seamless cooperation without the risk of losing control over funds or overfunding specific contributors.

    # Community or Open Source Initiatives

    In open source or community-driven efforts that involve uploading data to Arweave, such as the Banned Books Week (opens new window) project to protect books that are often censored, project managers can share Turbo Credits with trusted contributors. This supports collaborative efforts without having to worry about decentralized funding. By using approvals, maintainers can control how Credits are used, set expiration times, and ensure that shared resources are managed responsibly.

    # Event Based or Seasonal Promotions

    Companies and services can run promotional events or campaigns where users can upload data for free-to-them for a limited time. Turbo Credit Sharing makes it easy to share upload power with participants, allowing them to experience the service without initial investment. After the promotional period ends, the Credits remain with the original holder, ensuring that company resources are not permanently allocated.

    # Research and Development Trials

    Academic institutions or research organizations conducting studies involving data uploads to Arweave can benefit from shared Turbo Credits. A central research wallet can allocate upload power to various project teams or individual researchers. This approach helps ensure that project budgets are managed centrally while allowing flexibility in data uploads, without distributing sensitive wallet keys to team members.

    # Educational Programs

    Schools or educational platforms teaching blockchain development or data permanence could use Turbo Credit Sharing to allow students or participants to upload data as part of their learning exercises. This gives learners hands-on experience without requiring them to fund their wallets, making it more accessible and encouraging engagement with the technology.

    # Data Migration Services

    Data migration services or third-party consultants assisting with moving data onto the Arweave Blockweave can be given controlled access to an organization’s Turbo Credits for a project’s duration. This ensures that consultants can carry out the migration without needing their own funding or wallet management, streamlining project operations while maintaining security.

    + diff --git a/docs/turbo/credits/index.html b/docs/turbo/credits/index.html index 283db64..ccd1171 100644 --- a/docs/turbo/credits/index.html +++ b/docs/turbo/credits/index.html @@ -18,12 +18,12 @@ - +

    # Turbo Credits

    # Overview

    Turbo Credits are the payment medium used by the Turbo Upload Service. Each credit represents a 1:1 conversion from the upload power of the Arweave native token (AR), before any subsidies. Turbo Credits are divisible down to units of 1 trillionth of a credit, called a Winston Credit (winc), and can be purchased using a variety of fiat currencies or crypto tokens.

    Turbo Credits are not, themselves, a crypto token, in the sense that they cannot be traded, transferred, sold, or exchanged.

    NOTE: Turbo Credits are non-refundable and cannot be withdrawn or exchanged for other cryptocurrencies.

    # Fees and Benefits

    When purchasing Turbo Credits, using either fiat currencies or crypto tokens, there is a 23.4% fee applied to the purchase price. This fee helps to develop and maintain the infrastructure used to provide a number of benefits over direct-to-network uploads (uploads using AR directly). There is no additional fee at the time of using Turbo Credits for upload. At the time of upload, Credits having the same, or better, value per GiB of storage as AR as priced by the Arweave network regardless of fluctuations in the fiat value of AR since the time of purchase.

    • Per-Byte Pricing: Arweave requires payment for every chunk of data (256 KiB) uploaded. This means that many direct-to-network uploads have a small portion of the upload costs paying for empty space in the final chunk of the data. Turbo subsidizes this empty space, allowing users to pay only for the exact amount of data being uploaded.

    • Fast Finality: Data uploaded to Arweave nodes propagates over time to other nodes in the network so that they, and the gateways that interface with them, may serve and index that data. These retrieval and indexing latencies, lasting minutes or even hours, are eliminated by Turbo via direct integrations with leading Arweave gateways, allowing you to retrieve data immediately and query for it via GQL APIs within seconds of upload time. Additionally, Turbo uploads to gateways that seed data to various nodes on the Arweave network, facilitating more rapid and durable propagation of your data into the network. F

    • Failed Upload Protection: In rare occasions, transactions committed to the Arweave network are dropped when network nodes opt to reorganize the chain. And while AR value is restored to the transaction uploaders in this process, the dropped transactions may need to be recomposed and have to be resubmitted to the network. Turbo ensures that your data obtains the necessary number of confirmations on chain that mitigate the risk of reorganization and will retain and, if necessary, later submit your data in the unlikely event of a chain reorganization or network outage.

    • Subsidies: Data item uploads through Turbo under 100 KiB in size are currently fully subsidized, allowing users to upload small files for free. Subsidized uploads are not possible with direct-to-network transactions.

    • Easy-to-use Tooling: Turbo offers a user-friendly SDK and CLI for effortless uploading to Arweave. These tools simplify advanced workflows as well such as Arweave Path Manifest generation during folder uploads, streamlining the process of putting entire websites or dApps on the permaweb.

    • Open Source: All of the code bases for the Turbo Upload service (opens new window), Payment service (opens new window), and tooling (opens new window) are fully open source. The infrastructure uses an AGPL 3.0 license, while the SDK tooling uses an Apache 2.0 license.

    Feature Upload Method
    Turbo Direct-To-Network
    Permanent Storage βœ… βœ…
    SDK available for uploading βœ… βœ… - arweave-js
    Open Source Infrastructure βœ… βœ…
    Per-Byte Pricing βœ…
    Instant Data Availability βœ…
    Failed Upload Protection βœ…
    Subsidized Uploads βœ…
    Sign Uploads From Ethereum or Solana Wallets βœ…

    # How to Purchase Credits

    # Top Up App

    The Turbo Top Up app (opens new window) is an easy "one stop shop" for purchasing Turbo Credits. From this app, user's can purchase credits using USD or AR tokens. Credits can even be purchased "into" Ethereum or Solana wallets, as opposed to Arweave wallets, which allows users to pay for and sign upload transactions directly with their preferred wallet.

    # ArDrive App

    ArDrive (opens new window) is a web and mobile app for easily uploading data to Arweave, and organizing your uploaded files in a traditional file structure using ArFS. ArDrive allows uploads using either AR tokens or Turbo Credits, and provides a simple "add" button under your user profile (top right) to purchase Turbo Credits using United States Dollars.

    # Turbo SDK/CLI

    The Turbo SDK and included CLI offers the most flexible option for purchasing Turbo Credits. Credits can be purchased with any of the supported fiat currencies or crypto tokens. These purchases can be done on demand or programmatically, allowing you to build novel Permaweb integrations powered by simple, reliable uploads to Arweave.

    # Turbo API

    Users can also send requests for a Stripe checkout session (purchasing credits with fiat) directly to the Turbo Payment Service API. This will return a url for users to finish their purchase using Stripe and a valid credit/debit card.

    - + diff --git a/docs/turbo/migrating.html b/docs/turbo/migrating.html index cc33164..ca1a8ea 100644 --- a/docs/turbo/migrating.html +++ b/docs/turbo/migrating.html @@ -18,7 +18,7 @@ - + @@ -67,6 +67,6 @@ console.log("Error funding node ", e); }
    - + diff --git a/docs/turbo/turbo-sdk/index.html b/docs/turbo/turbo-sdk/index.html index 11eb6ee..d167c44 100644 --- a/docs/turbo/turbo-sdk/index.html +++ b/docs/turbo/turbo-sdk/index.html @@ -18,7 +18,7 @@ - + @@ -508,6 +508,6 @@

    # revoke-credits

    Revoke all credits shared from the connected wallet to the provided native address.

    Command Options:

    e.g:

    turbo revoke-credits --wallet-file ../path/to/my/wallet
     

    # list-share

    List all given and received credit share approvals from the connected wallet or the provided native address.

    Command Options:

    e.g:

    turbo list-shares --address 2cor...VUa --wallet-file ../path/to/my/wallet
     

    # Turbo Credit Sharing

    Users can share their purchased Credits with other users' wallets by creating Credit Share Approvals. These approvals are created by uploading a signed data item with tags indicating the recipient's wallet address, the amount of Credits to share, and an optional amount of seconds that the approval will expire in. The recipient can then use the shared Credits to pay for their own uploads to Turbo.

    Shared Credits cannot be re-shared by the recipient to other recipients. Only the original owner of the Credits can share or revoke Credit Share Approvals. Credits that are shared to other wallets may not be used by the original owner of the Credits for sharing or uploading unless the Credit Share Approval is revoked or expired.

    Approvals can be revoked at any time by similarly uploading a signed data item with tags indicating the recipient's wallet address. This will remove all approvals and prevent the recipient from using the shared Credits. All unused Credits from expired or revoked approvals are returned to the original owner of the Credits.

    To use the shared Credits, recipient users must provide the wallet address of the user who shared the Credits with them in the x-paid-by HTTP header when uploading data. This tells Turbo services to look for and use Credit Share Approvals to pay for the upload before using the signer's balance.

    For user convenience, during upload the Turbo CLI will use any available Credit Share Approvals found for the connected wallet before using the signing wallet's balance. To instead ignore all Credit shares and only use the signer's balance, use the --ignore-approvals flag. To use the signer's balance first before using Credit shares, use the --use-signer-balance-first flag. In contrast, the Turbo SDK layer does not provide this functionality and will only use approvals when paidBy is provided.

    The Turbo SDK provides the following methods to manage Credit Share Approvals:

    The Turbo CLI provides the following commands to manage Credit Share Approvals:

    # Developers

    # Requirements

    # Setup & Build

    # Testing

    # Linting & Formatting

    # Architecture

    # Contributions

    If you encounter any issues or have feature requests, please file an issue on our GitHub repository. Contributions, pull requests, and feedback are both welcome and encouraged.

    For more information on how to contribute, please see CONTRIBUTING.md (opens new window).

    - + diff --git a/docs/turbo/turbo-sdk/release-notes.html b/docs/turbo/turbo-sdk/release-notes.html index 6bd2ff2..2649350 100644 --- a/docs/turbo/turbo-sdk/release-notes.html +++ b/docs/turbo/turbo-sdk/release-notes.html @@ -18,11 +18,11 @@ - +

    # Turbo SDK Release Notes

    # Overview

    Welcome to the documentation page for the Turbo SDK release notes. Here, you will find detailed information about each version of the Turbo SDK, including the enhancements, bug fixes, and any other changes introduced in every release. This page serves as a comprehensive resource to keep you informed about the latest developments and updates in the Turbo SDK. For those interested in exploring the source code, each version's code is readily accessible at our GitHub repository: Turbo SDK Releases (opens new window). Stay updated with the continuous improvements and advancements in the Turbo SDK by referring to this page for all release-related information.

    # Releases

    # 1.17.0

    (2024-09-13)

    Features

    # 1.16.1

    (2024-09-13)

    Bug Fixes

    # 1.16.0

    (2024-09-12)

    Bug Fixes

    Features

    # 1.15.0

    (2024-09-12)

    Bug Fixes

    Features

    # 1.14.1

    (2024-09-11)

    Bug Fixes

    # 1.14.0

    (2024-09-11)

    Bug Fixes

    Features

    # 1.13.0

    (2024-09-06)

    Features

    # 1.12.0

    (2024-08-30)

    Features

    # 1.11.0

    (2024-08-29)

    Bug Fixes

    Features

    # 1.10.1

    (2024-08-23)

    Bug Fixes

    # 1.10.0

    (2024-08-15)

    Bug Fixes

    Features

    # 1.9.0

    (2024-05-06)

    Bug Fixes

    • eth payments: setup ETH in default constructor, remove default wait()

    Features

    • eth payments: init eth tx payments

    # 1.8.0

    (2024-05-02)

    Features

    • solana payments: init solana token tools for sol payment

    # 1.7.0

    (2024-04-25)

    Features

    • upload: allow eth and sol signing for upload
    • upload: allow eth/sol signer types

    # 1.6.0

    (2024-04-24)

    Features

    • top up: allow eth/sol destination for fiat top up
    • top up: allow eth/sol destination for fiat top up

    # 1.5.0

    (2024-04-16)

    Bug Fixes

    • fund with AR: add web esm compatible arweave export
    • export Arconnect and ArweaveSigner from env specific signers

    Features

    • crypto payments: Init fund methods
    • crypto payments: Refactor arweave-js out of signer
    • fund with AR: Add ToTokenAmount helper utils
    • fund with AR: Catch polling error
    • fund with AR: Continue polling on request error
    • fund with AR: Throw no wallet found as error
    • signers: Exports arbundles ArconnectSigner and ArweaveSigner

    # 1.4.2

    (2024-03-15)

    Bug Fixes

    • arbundles: pin arbundles to v0.9.9 and run tests locally

    # 1.4.1

    (2024-01-30)

    Bug Fixes

    • checkout session: correct query param, change type, add coverage

    # 1.4.0

    (2024-01-30)

    Features

    • ui mode: support query param for checkout session ui mode

    # 1.3.0

    (2024-01-03)

    Bug Fixes

    • web: ensure we have the public key for arconnect wallets when signing data
    • web: remove reference to node:crypto in websigner, use signer to signer to sign header

    Features

    • signer: allow an optional signer to be passed instead of JWK for signing data items

    # 1.2.0

    (2023-12-15)

    Features

    • data item opts: init tags anchor and target support PE-5035

    # 1.1.1

    (2023-12-14)

    Bug Fixes

    • exports: use bundled export to avoid issue with polyfilled features needed for web
    • exports: web exports reference an invalid build path
    • polyfills: update esbuild script to include crypto polyfill

    # 1.1.0

    (2023-11-10)

    Bug Fixes

    • axios: set maxRedirects to 0 on our axios instances

    Features

    • logger: add configurable global logger

    # 1.0.2

    (2023-11-03)

    Bug Fixes

    • upload: update the default upload service URL

    # 1.0.1

    (2023-09-27)

    Bug Fixes

    • headers: add default headers for all HTTP requests
    • release: use script that updates built version.js files
    • version: update version.js to proper version on build and commit it back to git after a release

    # 1.0.0

    (2023-09-26)

    Bug Fixes

    • add command that removes type module from package.json
    • add command that removes type module from package.json
    • add main import and allow wildcard imports
    • add module to package.json and tweak types
    • add one more step to make esm useable
    • add owner to TurboUploadDataItemResponse and remove byteCount
    • add separate folder for types, use it in named exports
    • change name of public facing clients.
    • cjs: add separate cjs and esm outputs
    • content-length: require content length factory for uploads
    • exports: move turbo configurations to turbo.ts so it is available to clients
    • fix package.json
    • modify return type of signDataItem function, tweak implementation of ArweaveSigner header
    • move from getWincPriceForBytes to getUploadCosts
    • package.json: add back module to package.json
    • remove package.json from lib directory
    • remove postinstall command
    • replace retry-axios, add additional retry logic
    • retry-axios: pin retry-axios to 3.0.0
    • revert to single file upload/data item upload
    • swap adding package.json to esm to cjs
    • top up: export type PE-4465
    • type imports for web and node
    • types: finalize types, update default payment and upload URLs
    • update main and types path in package.json
    • update package.json output for esm
    • update web signer and cleanup examples
    • use .cjs as base for types to avoid reference require errors
    • use declare in sub-classes to overwrite parent class type
    • wildcard: allow wildcard exports for older projects
    • wrong path for types!

    Features

    • abstract axios to TurboHTTPService class
    • abstract JWKInterface used in AuthenticatedPayment and AuthenticatedUploadService
    • add remaining unauthenticated apis for payment service, introduce some new types, add tests
    • add uploadFiles implementation for node and web
    • break services into auth vs unauth
    • initial implementation of TurboWebClient and TurboNodeClient
    • introduce AbortController
    • introduce uploadSignedDataItem interface, implement for node
    • remove TurboDataItemVerifier
    • sdk: all uphill from here πŸš€ PE-4064
    • top-up: init get checkout session PE-4465
    • winc for fiat: extend AmountMapper pattern and add promoCode support PE-4465
    - + diff --git a/docs/turbo/turbo-sdk/turbo-web.html b/docs/turbo/turbo-sdk/turbo-web.html index 69d2111..0136626 100644 --- a/docs/turbo/turbo-sdk/turbo-web.html +++ b/docs/turbo/turbo-sdk/turbo-web.html @@ -18,11 +18,11 @@ - +

    # Using Turbo SDK in a Browser Environment

    # Overview

    With Turbo-SDK v1.3.0, You can authenticate a Turbo instance by passing in an arweave signer instance instead of JWK. This supports the ArweaveSigner or ArconnectSigner classes from arbundles (opens new window).

    - + diff --git a/docs/turbo/what-is-turbo.html b/docs/turbo/what-is-turbo.html index c2da9e3..afa57aa 100644 --- a/docs/turbo/what-is-turbo.html +++ b/docs/turbo/what-is-turbo.html @@ -18,12 +18,12 @@ - +

    # What Is Turbo?

    Turbo is a ultrahigh-throughput Permaweb service that streamlines the funding, indexing, and transmission of data to and from Arweave. It provides graphical and programmatic interfaces for payment options in fiat currency with credit or debit cards as well as cryptocurrencies such as ETH, SOL, and AR. It integrates two key components: a service that bundles uploads for efficiency and ease, and a payment system designed for straightforward transactions. Turbo Credits, which users can purchase within the ArDrive web app, the Turbo Top Up App (opens new window), or by using the Turbo SDK/CLI, have the same storage purchasing power of AR tokens, along with the additional benefits provided by Turbo. These credits are meticulously calibrated, with the Winston Credit (winc) representing the smallest unit, ensuring users have precise control over their storage needs. As an open-source technology, Turbo encourages community engagement, allowing developers to contribute to its continuous enhancement.

    Type Feature
    Access
    • Optimistic, instant data caching, using arweave.net.
    • Optimistic, near instant GraphQL indexing including cross-chain token address indexing, using arweave.net.
    • Transaction status endpoint for checking transaction finality. (Irys compatible)
    Development and Integration
    Enterprise Built for scale and trusted by enterprises
    Identity
    • Cryptographic identity management using Arweave, Ethereum, Solana, Polygon or other Irys-compatible keys.
    • Arweave ecosystem supported web wallets and providers:
      • βœ… Arconnect
      • βœ… arweave.app
      • βœ… ArweaveWalletAdapter
    Maturity
    Payments
    • Instantly fund your Turbo account with your credit card or popular crypto tokens.
    • ETH, SOL, POL, and AR are supported for funding your Turbo account.
    • Leverage other Turbo benefits like Gifting and Coupon Codes.
    Performance
    • Cryptographic upload receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)
    • Proven, high layer 2 transactional throughput with 860/sec sustained on 12/18 and 12/19
    Provenance Receipts with transaction id, high resolution timestamp, upload price and cryptographic signature. (Irys compatible)
    Transparency Open source infrastructure with AGPL3.0 licensing, as well as software development kit with Apache2.0 licensing.
    - + diff --git a/index.html b/index.html index b48978e..8979049 100644 --- a/index.html +++ b/index.html @@ -18,11 +18,11 @@ - +

    # About ArDrive

    ArDrive offers never-ending storage of your most valuable files. Pay once and save your memories forever.

    Feature ArDrive Traditional Cloud Storage
    One time payments for file storage βœ“ βœ—
    No monthly subscriptions βœ“ βœ—
    200+ years of file storage βœ“ βœ—
    Data available even if company disappears βœ“ βœ—
    Decentralized and open source βœ“ βœ—
    Inactive accounts never deleted βœ“ βœ—

    # Control Your Own Data

    # True Data Ownership

    With pay-once pricing you no longer have to add another subscription fee to your monthly budget. Save big when you only have to pay for what you use.

    # No More Lost Data

    Feel safe about the longevity of your files and avoid the horror stories of broken hard drives, deleted accounts, or lost files.

    # Decentralized Network

    Break free from Big Tech and leverage the power of the decentralized Arweave blockchain network that puts you back in control. Own your data instead of renting it.

    # Community Owned

    You're the boss. As a Web3 organization, ArDrive is owned collectively so you can have a say in our governance and share in our rewards.

    # How can Ardrive Help You?

    # Store Family Memories Forever

    Never lose a cherished photo or video again. Keep and pass along all of your most important photos and documents to the present or future generations. Learn more (opens new window)

    # Permanence

    In a digital world, how do you guarantee information is kept for long-periods of time? Just as the web connects data and people over vast distances, your data can now be kept over vast periods of time. Learn more (opens new window)

    # Totally Private or Totally Public

    It’s your choice in how you want to manage your data. Keep it private, share with select individuals, or make it public to the world. ArDrive is optimized for photography, digital art and NFT storage. Learn more (opens new window)

    # Eliminate Subscription Fees

    If you are paying monthly for cloud storage you are renting out your data. Get a digital wallet and move to full ownership of your data with our innovative pay once per file pricing. Learn more (opens new window)

    # Control Your Data

    Break free from the whims of centralized big tech and ever-changing terms of service. Enjoy the benefits of total privacy, security, and extreme data redundancy on a decentralized network. Learn more (opens new window)

    # Perfect Record Keeping

    Data integrity, accuracy and consistency for your most important files! Achieve regulatory compliance in any industry or your personal life by having an immutable (unchanging) and time-stamped record of all your files. Learn more (opens new window)

    # Durable NFTs

    NFTs make the internet ownable. But when you buy an NFT how do you know it is going to be around in 20 years? Who is paying to store it? And what if they stop? Learn more (opens new window)

    # Archive the Web

    Save a copy of any webpage you create or find! Each page will be given a unique url and saved on to Arweave’s permaweb (just like the web, but forever!). Learn more (opens new window)

    - +