Socket
Socket
Sign inDemoInstall

arweave-uploader

Package Overview
Dependencies
12
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    arweave-uploader

Arweave Uploader - detect and handle arweave upload failures. It attempts high fault tolerance, so not really suitable for non-automated systems (very long timeouts).


Version published
Weekly downloads
9
Maintainers
1
Install size
1.79 MB
Created
Weekly downloads
 

Readme

Source

arweave-uploader (work in progress)

Arweave Uploader - detect and handle arweave upload failures. It attempts high fault tolerance, so not really suitable for non-automated systems (very long timeouts).

  • ** N.B. this only works for value transfer or very small data txs
  • ** N.B. Warning! Tx retry may create multiple txs during periods of unusually high network/gateway load

Installation

npm install arweave-uploader

Example Usage - N.B. API subject to constant change ;-)

import Arweave from 'arweave'

const arweave = ...

const main = async () => {

	/* create your transaction as normal */

	const tx = await arweave.createTransaction({ data: "123" }, wallet)
	tx.addTag('App-Name', 'my-app-name')
	tx.addTag('Content-Type', 'application/json')

	try {

		/* no need to sign or post, just call "uploadTx" with your wallet */

		const txid = await uploadTx(tx, wallet) // this will take a long time!
		
		console.log('tx upload success with id ' + txid)

	}catch(e){
		
		/* bad tx found (e.g. wallet does not enough AR for tx fee) */

		console.error(e.name + ': ' + e.message)
	}
}

Options

setDebugOutput(false) to turn off console messages - not advised, but possible.

FAQs

Last updated on 10 Mar 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc