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)
}
- Params
- Type
Field | Description |
---|---|
arseedingUrl | arseedUrl 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. |
data | The data data that needs to be uploaded. |
apikey | To request an apiKey, please contact the permadao Team. |
tag | The 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. |
tags | configure your Arweave Tags, Arweave Tags refer to: here |
Content-Type | Content-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. |
(
arseedingUrl: string
apikey: string
tag: string
data: Buffer
contentType: string
tags:{
[key: string]: string
}
)
Return Data
{
itemId: 'tSB2-PS3Qr-POmBgjIoi4wRYhhGq3UZ9uPO8dUf2LhM',
size: 123
}