smart-wallets-service-api

GraphQL API Reference

GraphQl endpoints for smart-wallets!

API Endpoints

# devel:
https://smart-wallets.devel.original.works/graphql
# staging:
https://smart-wallets.stage.original.works/graphql
# prod:
https://smart-wallets.original.works/graphql

Queries

getExecution

Description

🔒 JWT Token

Returns execution by messageId.

Response

Returns a StartExecutionResDto!

Arguments

NameDescription

messageId - String!

Example

Query

query GetExecution($messageId: String!) {
  getExecution(messageId: $messageId) {
    id
    deployedSmartWalletId
    networkName
    transactionHash
    messageId
    userId
    createdAt
    updatedAt
  }
}

Variables

{"messageId": "abc123"}

Response

{
  "data": {
    "getExecution": {
      "id": 123.45,
      "deployedSmartWalletId": 123.45,
      "networkName": "ropsten",
      "transactionHash": "abc123",
      "messageId": "xyz789",
      "userId": "abc123",
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

Queries

getExecutions

Description

🔒 JWT Token

Returns all operations on the chain for the given user.

Response

Returns a StartExecutionListResDto!

Example

Query

query GetExecutions {
  getExecutions {
    list {
      id
      deployedSmartWalletId
      networkName
      transactionHash
      messageId
      userId
      createdAt
      updatedAt
    }
  }
}

Response

{
  "data": {
    "getExecutions": {"list": [StartExecutionResDto]}
  }
}

Queries

getSmartWallet

Description

🔒 JWT Token

Returns record of the smart wallet.

Response

Returns a SmartWalletDto!

Example

Query

query GetSmartWallet {
  getSmartWallet {
    ownerUri
    walletAddress
    type
    deployedSmartWallets {
      id
      networkName
      smartWalletId
      messageId
      statusOnChain
      createdAt
      updatedAt
    }
    createdAt
    updatedAt
  }
}

Response

{
  "data": {
    "getSmartWallet": {
      "ownerUri": "xyz789",
      "walletAddress": "xyz789",
      "type": "ENTERPRISE",
      "deployedSmartWallets": [DeployedSmartWalletDto],
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

Queries

getSmartWalletRecord

Description

🔒 JWT Token

Returns record of the smart wallet.

Response

Returns a SmartWalletDto!

Arguments

NameDescription

ownerUri - String!

unique id for tenant

Example

Query

query GetSmartWalletRecord($ownerUri: String!) {
  getSmartWalletRecord(ownerUri: $ownerUri) {
    ownerUri
    walletAddress
    type
    deployedSmartWallets {
      id
      networkName
      smartWalletId
      messageId
      statusOnChain
      createdAt
      updatedAt
    }
    createdAt
    updatedAt
  }
}

Variables

{"ownerUri": "abc123"}

Response

{
  "data": {
    "getSmartWalletRecord": {
      "ownerUri": "abc123",
      "walletAddress": "xyz789",
      "type": "ENTERPRISE",
      "deployedSmartWallets": [DeployedSmartWalletDto],
      "createdAt": "2007-12-03T10:15:30Z",
      "updatedAt": "2007-12-03T10:15:30Z"
    }
  }
}

Mutations

createSmartWallet

Description

&#128274; <b><u>JWT Token</u></b>
                Creates a smart wallet and returns its data.                This is not a chain operation.                </code></pre>          </div>        </div>      </div>      <div class="doc-row">        <div class="doc-copy">          <div class="operation-response doc-copy-section">            <h5>Response</h5>            <p> Returns a <a href="#definition-SmartWalletDto"><code>SmartWalletDto!</code></a>            </p>          </div>          <div class="operation-arguments doc-copy-section">            <h5>Arguments</h5>            <table>              <thead>                <tr>                  <th>Name</th>                  <th>Description</th>                </tr>              </thead>              <tbody>                <tr>                  <td>                    <span class="property-name"><code>ownerUri</code></span> - <span class="property-type"><a href="#definition-String"><code>String!</code></a></span>                  </td>                  <td> unique id for tenant </td>                </tr>              </tbody>            </table>          </div>        </div>        <div class="doc-examples">          <h4 class="example-heading">Example</h4>          <div class="example-section example-section-is-code operation-query-example">            <h5>Query</h5>            <html>              <head></head>              <body><pre><code class="hljs language-gql"><span class="hljs-symbol"><span class="hljs-keyword">mutation</span> CreateSmartWallet<span class="hljs-tag">(<span class="hljs-code">$ownerUri</span>:<span class="hljs-type"> String!</span>)</span> <span class="hljs-tag">{
createSmartWallet(ownerUri: $ownerUri) {
ownerUri
walletAddress
type
deployedSmartWallets {
id
networkName
smartWalletId
messageId
statusOnChain
createdAt
updatedAt
}
createdAt
updatedAt
}
}

Variables

{"ownerUri": "xyz789"}

Response

{
"data": {
"createSmartWallet": {
"ownerUri": "abc123",
"walletAddress": "abc123",
"type": "ENTERPRISE",
"deployedSmartWallets": [DeployedSmartWalletDto],
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z"
}
}
}

Mutations

deploySmartWallet

Description

 JWT Token

    Deploy a smart wallet and returns its data.
This is a chain operation.
Use only for wallets with status transactionFailed
                </code></pre>          </div>        </div>      </div>      <div class="doc-row">        <div class="doc-copy">          <div class="operation-response doc-copy-section">            <h5>Response</h5>            <p> Returns a <a href="#definition-DeployedSmartWalletDto"><code>DeployedSmartWalletDto!</code></a>            </p>          </div>          <div class="operation-arguments doc-copy-section">            <h5>Arguments</h5>            <table>              <thead>                <tr>                  <th>Name</th>                  <th>Description</th>                </tr>              </thead>              <tbody>                <tr>                  <td>                    <span class="property-name"><code>networkName</code></span> - <span class="property-type"><a href="#definition-String"><code>String!</code></a></span>                  </td>                  <td> Name of the blockchain network </td>                </tr>                <tr>                  <td>                    <span class="property-name"><code>ownerUri</code></span> - <span class="property-type"><a href="#definition-String"><code>String!</code></a></span>                  </td>                  <td> unique id for tenant </td>                </tr>              </tbody>            </table>          </div>        </div>        <div class="doc-examples">          <h4 class="example-heading">Example</h4>          <div class="example-section example-section-is-code operation-query-example">            <h5>Query</h5>            <html>              <head></head>              <body><pre><code class="hljs language-gql"><span class="hljs-symbol"><span class="hljs-keyword">mutation</span> DeploySmartWallet<span class="hljs-tag">(
$networkName: String!,
$ownerUri: String!
) {
deploySmartWallet(
networkName: $networkName,
ownerUri: $ownerUri
) {
id
networkName
smartWalletId
messageId
statusOnChain
createdAt
updatedAt
}
}

Variables

{
"networkName": "abc123",
"ownerUri": "abc123"
}

Response

{
"data": {
"deploySmartWallet": {
"id": 987.65,
"networkName": "ropsten",
"smartWalletId": 123.45,
"messageId": "abc123",
"statusOnChain": "transaction_started",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z"
}
}
}

Mutations

startExecution

Description

 JWT Token

Starts transactions on the chain.

Response

Returns a String!

Arguments

NameDescription

startExecutionArgs - StartExecutionReqDto!

Example

Query

mutation StartExecution($startExecutionArgs: StartExecutionReqDto!) {
startExecution(startExecutionArgs: $startExecutionArgs)
}

Variables

{"startExecutionArgs": StartExecutionReqDto}

Response

{"data": {"startExecution": "abc123"}}

Types

Boolean

Description

The Boolean scalar type represents true or false.

Types

DateTime

Description

A date-time string at UTC, such as 2019-12-03T09:54:33Z, compliant with the date-time format.

Example

"2007-12-03T10:15:30Z"

Types

DeployedSmartWalletDto

Description

Smart wallet object

Fields

Field NameDescription

id - Float!

Unique identifier for the object.

networkName - NetworkName!

Name of the blockchain network

smartWalletId - Float!

Unique identifier for the smart wallet object.

messageId - String!

A unique value. It is used to identify messages in events.

Name of the blockchain network

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

{
"id": 987.65,
"networkName": "ropsten",
"smartWalletId": 987.65,
"messageId": "abc123",
"statusOnChain": "transaction_started",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z"
}

Types

DeployedSmartWalletStatus

Values

Enum ValueDescription

transaction_started

transaction_failed

transaction_successful

Example

"transaction_started"

Types

Float

Description

The Float scalar type represents signed double-precision fractional values as specified by IEEE 754.

Example

987.65

Types

NetworkName

Values

Enum ValueDescription

ropsten

kovan

ownet

mainnet

binance

bnbtest

sepolia

local

test

polygon

goerli

mumbai

ethereum

shibuya

amoy

base

Example

"ropsten"

Types

SmartWalletDto

Description

Smart wallet object

Fields

Field NameDescription

ownerUri - String!

Unique identifier for the enterprise.

walletAddress - String!

Ethereum wallet address.

Type of the smart wallet

deployedSmartWallets - [DeployedSmartWalletDto!]

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

{
"ownerUri": "abc123",
"walletAddress": "abc123",
"type": "ENTERPRISE",
"deployedSmartWallets": [DeployedSmartWalletDto],
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z"
}

Types

SmartWalletType

Values

Enum ValueDescription

ENTERPRISE

RETAIL

Example

"ENTERPRISE"

Types

StartExecutionListResDto

Description

List of started executions on the chain for the given user

Fields

Field NameDescription

List of started executions on the chain for the given user

Example

{"list": [StartExecutionResDto]}

Types

StartExecutionReqDto

Description

Argument required for trigger transaction on the chain

Fields

Input FieldDescription

to - String!

Receiver's Ethereum address

value - String!

Ethereum coins amount

chainId - Float!

Unique identifier for the network.

messageId - String!

A unique value generated by the client. It is used to identify messages in events.

data - String!

Encoded data of transaction to be executed.

Example

{
"to": "abc123",
"value": "xyz789",
"chainId": 123.45,
"messageId": "abc123",
"data": "xyz789"
}

Types

StartExecutionResDto

Description

Object of initiated chain transaction.

Fields

Field NameDescription

id - Float!

Unique identifier for the object.

deployedSmartWalletId - Float!

Unique identifier for the deployment of the smart wallet.

networkName - NetworkName!

Name of the blockchain network

transactionHash - String

Hash of a transaction if execution has been submitted to the blockchain

messageId - String!

A unique value generated by the client. It is used to identify messages in events.

userId - String!

Unique identifier for the user. The value comes from the auth0 token.

createdAt - DateTime!

Time at which the object was created.

updatedAt - DateTime!

Time at which the object was last updated.

Example

{
"id": 123.45,
"deployedSmartWalletId": 123.45,
"networkName": "ropsten",
"transactionHash": "abc123",
"messageId": "abc123",
"userId": "xyz789",
"createdAt": "2007-12-03T10:15:30Z",
"updatedAt": "2007-12-03T10:15:30Z"
}

Types

String

Description

The String scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.

Example

"abc123"

Documentation by Anvil SpectaQL

Last updated