Skip to content

Instantly share code, notes, and snippets.

@saltyskip
Created November 25, 2020 07:32
Show Gist options
  • Save saltyskip/7655007cbe7a4228eff546502f8a327e to your computer and use it in GitHub Desktop.
Save saltyskip/7655007cbe7a4228eff546502f8a327e to your computer and use it in GitHub Desktop.
class BcomBlockchainTransaction {
var wallet: BcomWallet
var chainAssetProtocol: ChainAssetProtocol
var amount: Decimal
var assetId: String
//bitcoin specific
var utxo: [UTXO]?
var satsPerByteFee: Int
//slp specific
var slp: [SLPUTXO]?
//eth specific
var gasLimit: Int
var gwei: Int
init(signingWallet: BcomWallet, chainAssetProtocol: ChainAssetProtocol, amount: Decimal, assetId: String) {
self.wallet = signingWallet
self.chainAssetProtocol = chainAssetProtocol
self.amount = amount
self.assetId = assetId
}
//bitcoinSpecific shit
func buildBitcoin(utxos: [UTXO], satsPerByteFee: Int) {
}
//slp shit
func buildSLP(slpUtxos: [SLPUTXO]) {
}
//eth shit
func buildEth(gasLimit: Int) {
}
func buildERC20() {
}
}
BcomBlockchainTransaction(signingWallet: BcomWallet(strength: 128, passphrase: "", chain: .bitcoinCash), chainAssetProtocol: .bch, amount: 0, assetId: "BCH")
.buildBitcoin(utxos: [], satsPerByteFee: [10])
.buildSlp(slpUtxos: [])
.build()
public func createTransaction(_ tx: BlockchainTransaction) -> Data {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment