Generative
  • Art on Bitcoin
  • LAUNCH YOUR GENERATIVE ART ON BITCOIN
    • Start a new project
    • Select creative libraries
    • Add traits
    • Add generative code
    • Publish the project!
  • LAUNCH YOUR ART ON BITCOIN
    • Submit your collection
    • Collection information
    • Pricing and publishing
    • Publish and share the project!
  • GENERATIVE WALLET
    • Install Generative Wallet
    • FAQs
  • Generative Ordinal Services
    • Step-by-step instructions
Powered by GitBook
On this page
  • Step 1: Generate your API Key by going to the Generative Developers page.
  • Step 2: Get the payment address
  • Step 3: Check the status of a particular inscribing request
  1. Generative Ordinal Services

Step-by-step instructions

PreviousFAQs

Last updated 2 years ago

Generative Inscription as a Service (IaaS) is an API set for inscribing, tracking inscribing statuses, and browsing Bitcoin inscriptions.

At Generative, we've built an infrastructure for 3rd developers to save engineering time and maintenance effort when working with Bitcoin Ordinals. In this document, we'll walk you through step-by-step how to use our APIs so you can integrate them into your applications.

Step 1: Generate your API Key by going to the Generative Developers page.

Step 2: Get the payment address

Once you'd like to inscribe a file, you needs to request a payment address and then send the required BTC to the address to cover inscription fees. The Generative platform will check the balance of the address regularly and inscribe an inscription for the uploaded file to the your address when the funds land arrive.

To get the payment address, call the following api with payload:

- fileName: uploading file name

- file: file content in base64 format

- feeRate: fee rate that is used for the inscription transaction

- walletAddress: the address that you'll receive inscription

curl 'https://generative.xyz/generative/api/developer/inscribe?api-key={{apiKey}}' \ 
-H 'Content-Type: application/json' \ 
-H 'Accept: application/json' \ 
--data-raw '{
      "walletAddress": "bc1pcm9fczt...y4taq4va6gr",
      "fileName": "photo.jpeg",
      "file": "data:image/jpeg;base64,/9j/4AAvh//Z",
      "feeRate": 20,
    }'

A sample response is seen below. There are three fields you should use to display on your application:

- id: inscribing request id

- segwitAddress: payment address that you need to send BTC to for covering the inscription fees

- amount: payment amount

- ordAddress: your address that will receive inscription

{
      "error": null,
      "status": true,
      "data": {
          "id": "123abc",
          "userAddress": "USER_bc1pvd...2213",
          "amount": "36480",
          "mintFee": "20480",
          "sentTokenFee": "16000",
          "ordAddress": "bc1pcm9fczt...y4taq4va6gr",
          "segwitAddress": "bc1qy4ak2r2z4w5f....yw5v25k6ydyxdm8",
          "isConfirm": false,
          "isMint": false,
          "status": 0,
          "inscriptionID": "",
          "balance": "",
          "timeoutAt": "1677845815"
      }
}

Step 3: Check the status of a particular inscribing request

To check status of a particular inscribing request, call the following api. Here, {{id}} the parameter is an inscribing request id taken from step 2.

curl --location --request GET 'https://generative.xyz/generative/api/developer/inscribe/{{id}}'

A sample of The response payload is below:

{
      "error": null,
      "status": true,
      "data": {
          "id": "dfsdfsd3dsfsdfwr34ff",
          "userAddress": "USER_bc1pvd...2213",
          "amount": "36480",
          "mintFee": "20480",
          "sentTokenFee": "16000",
          "ordAddress": "bc1pcm9fczt...y4taq4va6gr",
          "segwitAddress": "bc1qy4ak2r2z4w5f....yw5v25k6ydyxdm8",
          "isConfirm": true,
          "isMint": false,
          "inscriptionID": "",
          "balance": "",
          "status": 1,
          "timeout_at": "1677845815"
      }
}

You can use `isConfirm` and `isMint` fields for checking the status of the inscribing request:

- isConfirm is true if the payment address (generated in step 2) receives sufficient funds to cover the inscription fees.

- isMint is true if the requesting inscription is successfully inscribed to the user's address.