AddInput adds an Input to the template.
(quorum int, keyHashes [][]byte, path [][]byte, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, anchor, inputRefdata []byte, version int)
| 242 | |
| 243 | // AddInput adds an Input to the template. |
| 244 | func (tpl *Template) AddInput(quorum int, keyHashes [][]byte, path [][]byte, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, anchor, inputRefdata []byte, version int) *Input { |
| 245 | if version == 0 { |
| 246 | version = latestOutputVersion |
| 247 | } |
| 248 | inp := &Input{ |
| 249 | Quorum: quorum, |
| 250 | KeyHashes: asHexBytes(keyHashes), |
| 251 | Path: asHexBytes(path), |
| 252 | Pubkeys: pubkeys, |
| 253 | Amount: amount, |
| 254 | AssetID: assetID, |
| 255 | Anchor: anchor, |
| 256 | InputRefdata: i10rjson.HexBytes(inputRefdata), |
| 257 | Index: tpl.index, |
| 258 | OutputVersion: version, |
| 259 | } |
| 260 | tpl.index++ |
| 261 | tpl.Inputs = append(tpl.Inputs, inp) |
| 262 | return inp |
| 263 | } |
| 264 | |
| 265 | // AddOutput adds an Output to the template. |
| 266 | func (tpl *Template) AddOutput(quorum int, pubkeys []ed25519.PublicKey, amount int64, assetID bc.Hash, refData, tags []byte) *Output { |