This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const _ = require('lodash'); | |
const BigNumber = require('bignumber.js'); | |
const { normalizeNodes } = require('./xrpl-utils'); | |
const { dropsToXRP } = require('./xrpl-utils'); | |
const debug = require('debug')('ms-xrpl-order:util:xrpl-balance-change'); | |
function groupByAddress(balanceChanges) { | |
var grouped = _.groupBy(balanceChanges, function(node) { | |
return node.address | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.trackerResolver = async function trackerResolver(msg) { | |
debug('Starting order trackerResolver'); | |
const opportunity = JSON.parse(msg.content.toString()); | |
debug('opportunity is %j', opportunity); | |
const side = (opportunity.sell.exchange === this.config.exchange.shortName) ? 'sell' : 'buy'; | |
const { trxhash } = opportunity[side]; | |
let balanceChanges; | |
const api = await this.apiConnection(); | |
const results = await api.getLedger({ | |
includeAllData: true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
import "@openzeppelin/contracts/token/ERC721/ERC721Full.sol"; | |
import "@openzeppelin/contracts/drafts/Counters.sol"; | |
contract GameItem is ERC721Full { | |
using Counters for Counters.Counter; | |
Counters.Counter private _tokenIds; | |
constructor() ERC721Full("GameItem", "ITM") public { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1KMwK6yv29jm8p1AvH56pdTiCPLU8T85uo https://explorer.blockstack.org/address/1KMwK6yv29jm8p1AvH56pdTiCPLU8T85uo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying my Blockstack ID is secured with the address 1Jr2RF2u1XZNpNdSAKaMfJHBpbNgiXPD4j https://explorer.blockstack.org/address/1Jr2RF2u1XZNpNdSAKaMfJHBpbNgiXPD4j |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createWithSubcondition (pubKey, message) { | |
const sender_fulfillment = new cc.Ed25519() | |
// Set public_key | |
sender_fulfillment.setPublicKey(new Buffer(pubKey, 'hex')) | |
// Prefix | |
const prefix = new cc.PrefixSha256() | |
prefix.setPrefix(message) |