mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-06 17:27:59 +00:00
feat: alias wallet.classicAddress as wallet.address (#1686)
* feat: alias wallet.classicAddress as wallet.address
This commit is contained in:
@@ -48,6 +48,15 @@ class Wallet {
|
||||
public readonly classicAddress: string
|
||||
public readonly seed?: string
|
||||
|
||||
/**
|
||||
* Alias for wallet.classicAddress.
|
||||
*
|
||||
* @returns The wallet's classic address.
|
||||
*/
|
||||
public get address(): string {
|
||||
return this.classicAddress
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new Wallet.
|
||||
*
|
||||
|
||||
@@ -28,6 +28,8 @@ describe('Wallet', function () {
|
||||
assert.isString(wallet.publicKey)
|
||||
assert.isString(wallet.privateKey)
|
||||
assert.isString(wallet.classicAddress)
|
||||
assert.isString(wallet.address)
|
||||
assert.equal(wallet.classicAddress, wallet.address)
|
||||
assert.isString(wallet.seed)
|
||||
assert.isTrue(wallet.publicKey.startsWith(ed25519KeyPrefix))
|
||||
assert.isTrue(wallet.privateKey.startsWith(ed25519KeyPrefix))
|
||||
@@ -41,6 +43,8 @@ describe('Wallet', function () {
|
||||
assert.isString(wallet.publicKey)
|
||||
assert.isString(wallet.privateKey)
|
||||
assert.isString(wallet.classicAddress)
|
||||
assert.isString(wallet.address)
|
||||
assert.equal(wallet.classicAddress, wallet.address)
|
||||
assert.isString(wallet.seed)
|
||||
assert.isTrue(wallet.privateKey.startsWith(secp256k1PrivateKeyPrefix))
|
||||
assert.isTrue(wallet.classicAddress.startsWith(classicAddressPrefix))
|
||||
@@ -53,6 +57,8 @@ describe('Wallet', function () {
|
||||
assert.isString(wallet.publicKey)
|
||||
assert.isString(wallet.privateKey)
|
||||
assert.isString(wallet.classicAddress)
|
||||
assert.isString(wallet.address)
|
||||
assert.equal(wallet.classicAddress, wallet.address)
|
||||
assert.isString(wallet.seed)
|
||||
assert.isTrue(wallet.publicKey.startsWith(ed25519KeyPrefix))
|
||||
assert.isTrue(wallet.privateKey.startsWith(ed25519KeyPrefix))
|
||||
|
||||
Reference in New Issue
Block a user