* Inject properties from an address. * @private * @param {Address|AddressString} address
(address)
| 1620 | */ |
| 1621 | |
| 1622 | fromAddress(address) { |
| 1623 | if (typeof address === 'string') |
| 1624 | address = Address.fromString(address); |
| 1625 | |
| 1626 | assert(address instanceof Address, 'Not an address.'); |
| 1627 | |
| 1628 | if (address.isPubkeyhash()) |
| 1629 | return this.fromPubkeyhash(address.hash); |
| 1630 | |
| 1631 | if (address.isScripthash()) |
| 1632 | return this.fromScripthash(address.hash); |
| 1633 | |
| 1634 | if (address.isProgram()) |
| 1635 | return this.fromProgram(address.version, address.hash); |
| 1636 | |
| 1637 | throw new Error('Unknown address type.'); |
| 1638 | } |
| 1639 | |
| 1640 | /** |
| 1641 | * Create an output script from an address. |
nothing calls this directly
no test coverage detected