Irys-xyz / arweave-js-sdk

JS SDK for Irys on Arweave
111 stars 96 forks source link

Feat arweave wallet web support revamp #95

Closed l-silvestre closed 8 months ago

l-silvestre commented 1 year ago

Allows for arconnect and arweave.app support using web bundlr

Usage


// requires you to have an arweave initialisation beforehand
const arweave = Arweave.init({
  host: NET_ARWEAVE_URL.split('//')[1],
  port: 443,
  protocol: 'https',
});

// arweave.app
 const arweaveApp = new ArweaveWebWallet({
  // optionally provide information about your app that will be displayed in the wallet provider interface
  name: 'Your app Name',
  logo: 'https://7kekrsiqzdrmjh222sx5xohduoemsoosicy33nqic4q5rbdcqybq.arweave.net/-oioyRDI4sSfWtSv27jjo4jJOdJAsb22CBch2IRihgM',
});

const arConnect = window.arweaveWallet;

const walletInstance = arweaveApp || arConnect;

const bundlr = new WebBundlr(node, 'arweave', walletInstance, { providerInstance: arweave });
try {
    await bundlr.ready();
  } catch (error) {
    console.log(error);
  }
JesseTheRobot commented 1 year ago

Hey @l-silvestre , thanks for the PR and apologies for the lack of response - I should be able to take a look at this sometime this week.

JesseTheRobot commented 8 months ago

Closing as we don't have a signer/sigType that works with arconnect v2 signatures - I will reevaluate support once/if we decide to create the required sigType.