Skip to main content

submitByApikey

Function

Submit your raw data directly by means of an apiKey.

Example

import { submitByApikey } from 'arseeding-js'

const run = async () => {
const arseedingUrl = 'https://arseed.web3infra.dev'
const apikey = '<your arseeding apiKey>'
const tag = '<chaintype-symbol-id>' // everpay supported all token tag (chainType-symbol-id)
const data = Buffer.from('<need upload data, such as a picture>')
const contentType = 'data type'
const tags = { a: 'aa', b: 'bb' }
const res = await submitByApikey(
arseedingUrl,
apikey,
tag,
data,
contentType,
tags
)
console.log(res)
}
FieldDescription
arseedingUrlarseedUrl is the address of the Arseeding backend service that needs to be configured. Here we use the Arseed service provided by permadao at https://arseed.web3infra.dev.
dataThe data data that needs to be uploaded.
apikeyTo request an apiKey, please contact the permadao Team.
tagThe token tag that needs to be paid for, if your apiKey holds usdc, you can get the token tag by getTokenTagByEver('usdc'), see getTokenTagByEver for details.
tagsconfigure your Arweave Tags, Arweave Tags refer to: here
Content-TypeContent-Type needs to be configured based on the content you upload. For example, if you upload an image in png format, configure it as image/png. For details, refer to Content-Type.

Return Data

{
itemId: 'tSB2-PS3Qr-POmBgjIoi4wRYhhGq3UZ9uPO8dUf2LhM',
size: 123
}