gamechanger.wallet

GCScript DSL / Overview

Introduction

An innovative Blockchain such as Cardano needs it’s own wallet API specification.

Usually when a dapp communicates with a web3 wallet, it calls a set of functions known as the wallet’s API.

Since 2021 GameChanger Wallet API specification has taken a different approach from Nami derivatives:

For these and other reasons the wallet has a Universal Dapp Connector, and such versatile connector needs a versatile API, so in 2022 our dapp connector API turned slightly into a fully featured, flexible and universal programming language called GCScript.

The GCScript DSL

Communication to GameChanger Wallet is done through scripts coded in a JSON based programming language, a language full of native Cardano-related functions.

This domain specific language is called GCScript DSL.

Dapps and other entities (agents) send GCScript (JSON) to the user wallet and receives a JSON response.

The wallet has a GCScript language interpreter that validates, executes, and returns JSON results to dapps or other calling agents.

The way GCScripts and their JSON results are packed and shared between agents and wallets is called transport.

Benefits

Basic Properties

Hello World

A simple “Hello World” example in GCScript:

{
    "type": "script",
    "title": "Example",
    "description": "This dapp connection once executed on a wallet will return 'Hello World!' ",
    "exportAs": "myResults",
    "run": {
        "myVariable":{
            "type":"data",
            "value":"Hello World!"
        }
    }
}

Run on Cardano Mainnet Run on Cardano Pre-Production Testnet

🔍 See also: script, data

and the isomorphic results:

{
  "exports": {
    "myResults": {
      "myVariable": "Hello World!"
    }
  }
}
Do you know Javascript? Here is a free interpretation on how the code would look like in Javascript: ```js let exports={} function data(value){ return value; } function script(title,description,exportAs){ let cache={}; cache["myVariable"]=data("Hello World!"); exports[exportAs]=cache; return cache; } script( "Example", "This dapp connection once executed on a wallet will return 'Hello World!'", "myResults"); ```
Previous: GCScript DSL Next: Quick Start