Giter Site home page Giter Site logo

xrpl-bridge-assignment's Introduction

XRPL Bridge - Assignment

Getting Project

$ git clone https://github.com/sfurman89/xrpl-bridge-assignment.git
$ cd xrpl-bridge-assignment

Running the app

$ npm i
$ docker-compose up

Test

# Open your browser and run
$ http://localhost:3000/

GraphQL APIs

# Running on testnet. Accounts and seeds can be used for testing. Copy/paste code to graphql playground
query GetWallet {
  getWallet(seed: "sEdSz4MVw1PkgHpTVfsP28LZp5eCY9V") {
    publicKey
    privateKey
    classicAddress
  }
}

query GetXrpBalance {
  getXrpBalance(account: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd")
}

query GetBalances {
  getBalances(account: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd") {
    value
    currency
    issuer
  }
}

query GetAccountInfo {
  getAccountInfo(input: {
    account: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd"
  }) {
    result {
      account_data {
        Account
        Balance
        Flags
        LedgerEntryType
        OwnerCount
        PreviousTxnID
        PreviousTxnLgrSeq
        Sequence
        index
      }
      account_flags {
        defaultRipple
        depositAuth
        disableMasterKey
        disallowIncomingCheck
        disallowIncomingNFTokenOffer
        disallowIncomingPayChan
        disallowIncomingTrustline
        disallowIncomingXRP
        globalFreeze
        noFreeze
        passwordSpent
        requireAuthorization
        requireDestinationTag
      }
      ledger_current_index
      validated
    }
    type
  }
}

query GetAccountCurrencies {
  getAccountCurrencies(input: {
    account: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd"
  }) {
    result {
      ledger_current_index
      receive_currencies
      send_currencies
      validated
    }
    type
  }
}

query GetAccountTransactions {
  getAccountTransactions(input: {
    account: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd"
  }) {
    result {
      account
      ledger_index_max
      ledger_index_min
      limit
      transactions {
        meta {
          TransactionIndex
          TransactionResult
        }
        tx {
          Account
          Amount
          Destination
          Fee
          LastLedgerSequence
          Sequence
          SigningPubKey
          TransactionType
          TxnSignature
          date
          hash
          ledger_index
        }
      }
    }
    type
  }
}

query GetTransaction {
  getTransaction(hash: "AF0736E3C6CEE21D2193EC4EEF17CF49B36F6BA259A9BDFBD207BF723436176A") {
    id
    result {
      Account
      Amount
      Destination
      Fee
      Flags
      LastLedgerSequence
      Sequence
      SigningPubKey
      TransactionType
      TxnSignature
      date
      hash
      inLedger
      ledger_index
      meta {
        TransactionIndex
        TransactionResult
        delivered_amount
      }
      validated
    }
    status
    type
  }
}

mutation CreateAccount {
  createAccount {
    wallet {
      publicKey
      privateKey
      classicAddress
      seed
    }
    balance
  }
}

mutation UpdateAccount {
  updateAccount(input: {
    seed: "sEdTXtN4zSxcKUVvUhMizdY2onZFJpZ",
    #LastLedgerSequence: 40323381
    Domain: "www.google.com",
    EmailHash: "[email protected]",
  }) {
    id
    result {
      Account
      Fee
      Flags
      LastLedgerSequence
      Sequence
      SigningPubKey
      TransactionType
      TxnSignature
      Domain
      EmailHash
      MessageKey
      date
      hash
      inLedger
      ledger_index
      meta {
        TransactionIndex
        TransactionResult
      }
      validated
    }
    type
  }
}

mutation DeleteAccount {
  deleteAccount(input: {
    seed: "sEdTXtN4zSxcKUVvUhMizdY2onZFJpZ",
    destination: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd"
  }) {
    id
    result {
      Account
      Destination
      Fee
      LastLedgerSequence
      Sequence
      SigningPubKey
      TransactionType
      TxnSignature
      date
      hash
      inLedger
      ledger_index
      meta {
        TransactionIndex
        TransactionResult
        delivered_amount
      }
      validated
    }
    status
    type
  }
}

mutation SendXrp {
  sendXrp(input: {
    seed: "sEdSz4MVw1PkgHpTVfsP28LZp5eCY9V",
    destination: "rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd",
    amount: 10
  }) {
    id
    result{
      Account
      Amount
      Destination
      DestinationTag
      InvoiceID
      SendMax
      DeliverMin
      Fee
      Flags
      LastLedgerSequence
      Sequence
      SigningPubKey
      TransactionType
      TxnSignature
      date
      hash
      ledger_index
      meta {
        TransactionIndex
        TransactionResult
        delivered_amount
      }
    }
    type
  }
}

subscription MonitorTransactions {
  monitorTransactions(input: {
    wallets: ["rUosT8RnA1nFpcZ2PncPpr17c69tnpsCkd"]
  }) {
   transaction {
    account
    destination
    amount
    currency
    hash
    message
  }
    error
  }
}

xrpl-bridge-assignment's People

Contributors

sfurman89 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.