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

Name
Description

Example

Query

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

Variables

{"messageId": "abc123"}

Response

{
  "data": {
    "getExecution": {
      "id": 987.65,
      "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

getOrCheckSmartWallet

Description

🔒 JWT Token

Returns record of the smart wallet or false if does not exist.

Response

Returns a GetOrCheckSmartWalletDto!

Example

Query

query GetOrCheckSmartWallet {
  getOrCheckSmartWallet {
    smartWalletAddress
  }
}

Response

{
  "data": {
    "getOrCheckSmartWallet": {
      "smartWalletAddress": "abc123"
    }
  }
}

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

Name
Description

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": "xyz789"}

Response

{
  "data": {
    "getSmartWalletRecord": {
      "ownerUri": "xyz789",
      "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": "xyz789",
"ownerUri": "xyz789"
}

Response

{
"data": {
"deploySmartWallet": {
"id": 123.45,
"networkName": "ropsten",
"smartWalletId": 987.65,
"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

Name
Description

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.

Example

true

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 Name
Description

Unique identifier for the object.

Name of the blockchain network

Unique identifier for the smart wallet object.

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

Name of the blockchain network

Time at which the object was created.

Time at which the object was last updated.

Example

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

Types

DeployedSmartWalletStatus

Values

Enum Value
Description

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

123.45

Types

GetOrCheckSmartWalletDto

Description

smart wallet address

Fields

Field Name
Description

Example

{"smartWalletAddress": "xyz789"}

Types

NetworkName

Values

Enum Value
Description

ropsten

kovan

ownet

mainnet

binance

bnbtest

sepolia

local

test

polygon

goerli

mumbai

ethereum

shibuya

amoy

base

baseSepolia

Example

"ropsten"

Types

SmartWalletDto

Description

Smart wallet object

Fields

Field Name
Description

Unique identifier for the enterprise.

Ethereum wallet address.

Type of the smart wallet

Time at which the object was created.

Time at which the object was last updated.

Example

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

Types

SmartWalletType

Values

Enum Value
Description

ENTERPRISE

RETAIL

Example

"ENTERPRISE"

Types

StartExecutionListResDto

Description

List of started executions on the chain for the given user

Fields

Field Name
Description

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 Field
Description

Receiver's Ethereum address

Ethereum coins amount

Unique identifier for the network.

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

Encoded data of transaction to be executed.

Example

{
"to": "xyz789",
"value": "xyz789",
"chainId": 987.65,
"messageId": "xyz789",
"data": "xyz789"
}

Types

StartExecutionResDto

Description

Object of initiated chain transaction.

Fields

Field Name
Description

Unique identifier for the object.

Unique identifier for the deployment of the smart wallet.

Name of the blockchain network

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

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

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

Time at which the object was created.

Time at which the object was last updated.

Example

{
"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"
}

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

"xyz789"

Documentation by Anvil SpectaQL

Last updated