File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ const (
4343 AddressTypeNoneScript = 0b1111
4444)
4545
46+ type AddrKeyHash Blake2b224
47+
4648type Address struct {
4749 addressType uint8
4850 networkId uint8
@@ -191,6 +193,11 @@ func (a Address) PaymentAddress() *Address {
191193 return newAddr
192194}
193195
196+ // PaymentKeyHash returns a new Blake2b224 hash of the payment key
197+ func (a * Address ) PaymentKeyHash () Blake2b224 {
198+ return Blake2b224 (a .paymentAddress [:])
199+ }
200+
194201// StakeAddress returns a new Address with only the stake key portion. This will return nil if the address is not a payment/staking key pair
195202func (a Address ) StakeAddress () * Address {
196203 var addrType uint8
@@ -212,6 +219,11 @@ func (a Address) StakeAddress() *Address {
212219 return newAddr
213220}
214221
222+ // StakeKeyHash returns a new Blake2b224 hash of the stake key
223+ func (a * Address ) StakeKeyHash () Blake2b224 {
224+ return Blake2b224 (a .stakingAddress [:])
225+ }
226+
215227func (a Address ) generateHRP () string {
216228 var ret string
217229 if a .addressType == AddressTypeNoneKey ||
Original file line number Diff line number Diff line change @@ -221,7 +221,6 @@ func (c *StakeDelegationCertificate) Utxorpc() *utxorpc.Certificate {
221221 }
222222}
223223
224- type AddrKeyHash Blake2b224
225224type PoolKeyHash Blake2b224
226225type PoolMetadataHash Blake2b256
227226type VrfKeyHash Blake2b256
You can’t perform that action at this time.
0 commit comments