Skip to content

Instantly share code, notes, and snippets.

@dmdeklerk
Created April 19, 2018 10:14
Show Gist options
  • Save dmdeklerk/e225ac81b16e64a17d4a592b4c626926 to your computer and use it in GitHub Desktop.
Save dmdeklerk/e225ac81b16e64a17d4a592b4c626926 to your computer and use it in GitHub Desktop.
heat-sdk transactions
public placeBidOrder(
currencyId: string,
assetId: string,
quantity: string,
price: string,
expiration: number
) {
let builder = new Builder()
.isTestnet(this.config.isTestnet)
.attachment(
new ColoredCoinsBidOrderPlacement().init(currencyId, assetId, quantity, price, expiration)
)
.amountHQT("0")
.feeHQT("1000000")
return new Transaction(this, "0", builder)
}
public cancelAskOrder(
orderId: string
) {
let builder = new Builder()
.isTestnet(this.config.isTestnet)
.attachment(
new ColoredCoinsAskOrderCancellation().init(orderId)
)
.amountHQT("0")
.feeHQT("1000000")
return new Transaction(this, "0", builder)
}
public cancelBidOrder(
orderId: string
) {
let builder = new Builder()
.isTestnet(this.config.isTestnet)
.attachment(
new ColoredCoinsBidOrderCancellation().init(orderId)
)
.amountHQT("0")
.feeHQT("1000000")
return new Transaction(this, "0", builder)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment