@forgekit-labs/meta
v0.1.0
Published
Upload token and NFT metadata to Arweave via Turbo. One call, permanent storage.
Downloads
172
Maintainers
Readme
@forgekit-labs/meta
Upload token and NFT metadata to Arweave via Turbo. One call, permanent storage.
Install
npm install @forgekit-labs/metaUsage
import { cast } from '@forgekit-labs/meta';
const { uri } = await cast('my-token')
.image('./logo.png')
.describe({ name: 'MY TOKEN', symbol: 'MTK', description: 'Built different.' })
.attributes([{ trait_type: 'Tier', value: 'Quick' }])
.deploy();
console.log(uri); // https://arweave.net/...Error Handling
import { cast, ForgeUploadError, ForgeBalanceError } from '@forgekit-labs/meta';
try {
const { uri } = await cast('my-token').image('./logo.png').describe({...}).deploy();
} catch (err) {
if (err instanceof ForgeBalanceError) {
console.error(err.hint); // tells you exactly what to do
}
if (err.retry) {
// safe to retry
}
}License
MIT
