Search code examples
typescriptsolanametaplex

How to use Solana Wallet Key to sign TX for ArweaveJS


Is there any way to use a Solana wallet keypair and load it into the JWKInterface as per the node_modules/arweave/node/lib/wallet.d.ts and then create an Arweave TX with await arweave.createTransaction({ data }, jwk);?

Given metaplex uses an API call for their Arweave uploader and it's a hidden piece of code would be nice to crack this in native JS/TS if it's possible.


Solution

  • Are you referring to https://github.com/ArweaveTeam/arweave-js ?

    That requires a arweave and not a solana wallet. You can use e.g. arkb for the upload

    If you want to build something yourself in JS have a look at the cookbook. https://solanacookbook.com/references/nfts.html#upload-to-arweave