Getting Started

A few things to get you started

Connect your wallet to ORB

The first step is to connect to ORB using your wallet. If you are connecting as a developer, the wallet with which you will connect to the platform, is the wallet which will be used to manage your projects and assets.

ORB supports all Tezos supported wallets. In this documentation we will be using Temple wallet, throughout all of our examples. Before moving ahead, make sure you have Temple wallet, or the wallet of your preference, installed in your mobile device.

Generating a QR code

Use the following mutation to generate a QR code and connect your wallet to ORB.

CreateWalletSyncQRCodeSession
mutation CreateWalletSyncQRCodeSession() {
  CreateWalletSyncQRCodeSession() {
    base64Image
    sessionId
  }
}
Response
{
  "data": {
    "CreateWalletSyncQRCodeSession": {
      "base64Image": "iVBORw0KGgoAAAANSUhEUgAAAVQAAAFUCAYAAAB7ksS1AAAcE0lEQVR4AezBQY4YybLgQDJR978yR0tfBRDILLXefDezP1hrrfXaw1prrU88rLXW+sTDWmutTzystdb6xMNaa61PPKy11vrEw1prrU88rLXW+sTDWmutTzystdb6xMNaa61PPKy11vrEw1prrU88rLXW+sTDWmutT/zwksrfVHGiclJxonJSMancqDhRmSpOVE4qTlTeqJhUTipuqHypYlK5UfGGyknFDZWp4kRlqjhRmSomlZOKN1T+poo3HtZaa33iYa211ice1lprfeKHj1V8SeVGxaQyqXyp4obKVDFVnKi8oTJV/KaKSWWqmFSmiknlRsWNihOVqWJSmSpuqEwVJxWTylRxojJV3Kg4UZkqJpWp4qTiSypfelhrrfWJh7XWWp94WGut9YkffpnKjYr/UsWkMqm8UTGpTBWTylTxRsWk8qWKk4qTiknlpGJSuVFxo+KkYlI5qbihckNlqphUJpUvVfwmlRsVv+lhrbXWJx7WWmt94mGttdYnfvj/jMpUcaIyqUwVk8qNipOKGyq/qeJEZao4UTmpmFSmihsVv0llqnhD5aTipGJSmSomlZOKE5WpYlKZKv4veVhrrfWJh7XWWp94WGut9Ykf/o9RmSomlUllqjhROVG5UXGi8iWVk4oTlaliUplUpopJZao4UblRMancULlRMalMFW9UnFScqEwVU8UNlf9LHtZaa33iYa211ice1lprfeKHX1bxm1RuVLyhclI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omlRsVJypTxaTymypuqEwVJyo3Kt5QmSpOVP5lFW88rLXW+sTDWmutTzystdb6hP3B/zCVk4oTlaliUpkqTlSmiknlpOJE5aTihspUMamcVPyXVKaKE5WTikllqrihclIxqdyomFROKk5UTipOVE4qJpWp4obKVHGiclLxxsNaa61PPKy11vrEw1prrU/88JLK31QxVUwqk8oNlROVqWKqmFROKiaVk4pJ5URlqrhRMancUJkqJpWTipOKL6ncUJkqTiomlRsVk8pUMancqDhRmSpOKt5QmSpOVKaKk4ovPay11vrEw1prrU88rLXW+sQPH6v4ksqJylQxqZxUTCpTxQ2VGyonFW9U3FCZKm6oTBWTylQxqUwqJxVvVJyonFTcUJkqTlQmlaliUrmhclIxVUwqN1RuVNyomFROVKaKNx7WWmt94mGttdYnHtZaa33ih1+mcqPiRsWNii+p3Kg4UXlD5Y2KGyo3KiaVN1TeUJkqTlTeqHijYlKZKiaV/5LKVDGpTCpfqphUpoovPay11vrEw1prrU88rLXW+sQP/+NUpoqp4kRlqrhR8S+pmFTeUJkqTlQmlaliqphUpoobKlPFicqkcqNiUjlRuVExqUwVk8pUcaNiUnmjYlKZKr6kMlWcqEwVbzystdb6xMNaa61PPKy11vrED//jKiaVqeKkYlKZKk5UpopJZaqYVN6omFSmikllqphUTlSmipOKSeWGyknFVDGpnFRMKlPFicpUcUPlDZWpYlK5oXJSMancqLihMlVMKjcqJpUvPay11vrEw1prrU88rLXW+sQPv6zib6o4UZkqpoobFTdU3lCZKv5LKjcqJpWp4n+ZyhsVJxWTyqTym1RuqEwVk8pUcaPihspU8aWHtdZan3hYa631iYe11lqfsD94QeVvqphUpooTlf9SxaQyVZyovFFxQ2WqmFR+U8WkMlW8oTJVTCpTxYnKScUNlRsVk8pUMalMFTdUpoobKm9UnKicVHzpYa211ice1lprfeJhrbXWJ+wP1lprvfaw1lrrEw9rrbU+8bDWWusTD2uttT7xsNZa6xMPa621PvHw/8MZcd0AAAAuSURBVNqDYxoAAAAEQM7+oS3hCQBw0QBw0QBw0QBw0QBw0QBw0QBw0QBw0QBwMdVY/lOueXlWAAAAAElFTkSuQmCC",
      "sessionId": "KODgCta87Utwb3LqjBDHXX"
    }
  }
}

Using any base64 string to image decoder, you can output the QR image generated above. Scanning the QR with your wallet you will receive a transaction. Signing it will automatically connect your wallet to the ORB platform.

Once you receive your response from the CreateWalletSyncQRCodeSession mutation, keep the sessionId noted somewhere, as you will need it in the next steps.

Retrieving an Active session

An active sessionId can always be retrieved. This is the sessionId with which the developer wallet connected to the ORB platform for the first time.

RetrieveActiveSession
query RetrieveActiveSession($address: String!) {
  RetrieveActiveSession(address: $address) {
    previousSessionId
  }
}
Input Variables
"address": "tz1Sd5ceMABaiPU4qQvvrVJQYbE6X2gJBmf8"
Response
{
  "data": {
    "RetrieveActiveSession": {
      "previousSessionId": "QqLb0obD7F3Tiu4JNdX0r"
    }
  }
}

Acquiring your Access Token

Once you have successfully connected your wallet to ORB, it is now time to retrieve your access token. This token enables you to fully interact with the API as well as the smart contracts. The access token allows you to create NFTs, projects or collections, send or burn tokens and more. Think of it as a verification token, it allows ORB to know that you are indeed a developer and you need full access to the API.

ORB's Access Token has a lifetime of 7 days. Once you generate an access token, it will be valid for that period, after which it will expire and you will no longer be able to use it. Once expired you can Refresh your Access Token in order to acquire a new one. There can only be only one valid active access token each time.

Use the following mutation to generate your Access Token

GetTokenForSession
mutation GetTokenForSession($address: String!, $sessionId: String!, $gameId:String!){
  GetTokenForSession(address: $address, sessionId: $sessionId, gameId: $gameId){
    accessToken
  }
}
Input Variables
"address": "tz1aWZmdKqKvGP331yWJjqgCZakGci3VAGmj",
"sessionId": "6u296Lbxbj8gBhylyiZPU",
"gameId" : "game:dGzLJYWJtkF8kdC4iVlb-"
Response
{
  "data": {
    "GetTokenForSession": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoidHoxYVdabWRLcUt2R1AzMzF5V0pqcWdDWmFrR2NpM1ZBR21qIiwiZ2FtZUlkIjoiZ2FtZTpkR3pMSllXSnRrRjhrZEM0aVZsYi0iLCJzZXNzaW9uSWQiOiI2dTI5NkxieGJqOGdCaHlseWlaUFUiLCJpc3MiOjE2OTQwMDA0MjMsImV4cCI6MTY5NDA4NjgyMzY4MSwid2FsbGV0VHlwZSI6InBsYXllciIsImlhdCI6MTY5NDAwMDQyM30.grlHmc09c1MLEFZtsTJNuc7G7NZXLoNmhhDs-Hzzzmk"
    }
  }
}

Once you have your access token, you can add it to the Authorization headers, each time you call a mutation using the ORB3 API. If you do not include the access token in your calls, they will fail and you will not receive any transaction to sign in your wallet.

Access Token Operations

Once your access token loses its validity, and eventually expires, you will need to refresh it and acquire a new one in order to continue to have access to the ORB3 API.

The advanced version of the UnityORB SDK has a build in function which will automatically renew the developer's access token. You can learn more about the UnityORB SDK here.

Use the following mutation to refresh your Access Token.

RefreshTokenForSession
mutation RefreshTokenForSession($sessionId: String!, $address: String!) {
  RefreshTokenForSession(sessionId: $sessionId, address: $address) {
    accessToken
  }
}
Input Variables
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhZGRyZXNzIjoidHoxYVdabWRLcUt2R1AzMzF5V0pqcWdDWmFrR2NpM1ZBR21qIiwiZ2FtZUlkIjoiZ2FtZTpkR3pMSllXSnRrRjhrZEM0aVZsYi0iLCJzZXNzaW9uSWQiOiI2dTI5NkxieGJqOGdCaHlseWlaUFUiLCJpc3MiOjE2OTQ1OTE5MDMsImV4cCI6MTY5NDY3ODMwMzA3MCwid2FsbGV0VHlwZSI6InBsYXllciIsImlhdCI6MTY5NDU5MTkwM30.QQL7Xvsnc-iRPUWVIKsaVCUAwrq_BEdIoZ6xqIt2XL4"
Response
{
  "data": {
    "RefreshTokenForSession": {
      "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZXNzaW9uaWQiOiJRcUxiMG9iRDdGM1RpdTRKTmRYMHIiLCJhZGRyZXNzIjoidHoxU2Q1Y2VNQUJhaVBVNHFRdnZyVkpRWWJFNlgyZ0pCbWY4Iiwid2FsbGV0dHlwZSI6InBsYXllciIsImlzcyI6MTY5NjQ5MTk5MCwiZXhwIjoxNjk2NTc4MzkwMDk4LCJpYXQiOjE2OTY0OTE5OTB9.YhBKNZheSIPOdNceJjAbH3r7EXrgByXPj_00lIUmx4w"
    }
  }
}

In order to refresh your access token, you will need to provide your wallet address and the sessionId you were provided when first syncing to the platform. In case you do not have this at hand, you can always retrieve it via the RetrieveActiveSession Query. Once the mutation is called, a transaction will pop-up in the wallet, in order for the developer to sign a payload. This verifies that the developer is the party asking for the access token refresh.

Retrieving an Active Access Token

An active and still valid access token can always be retrieved, together with information such as its expiration date and issued date.

RetrieveAccessToken
query RetrieveAccessToken {
  retrieveAccessToken {
    AccessToken
    ExpiryDate
    IssuedDate
  }
}

In order retrieve an active access token, the developer will need to sign an incoming payload.

Now that we have everything set up, it's time to jump into the fun! Let's go ahead and create our first project in ORB.

Last updated