diff --git a/src/wallet/index.ts b/src/wallet/index.ts index 5e7aa328..f289d9c7 100644 --- a/src/wallet/index.ts +++ b/src/wallet/index.ts @@ -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. * diff --git a/test/wallet/index.ts b/test/wallet/index.ts index 2e95dff4..693ec9f3 100644 --- a/test/wallet/index.ts +++ b/test/wallet/index.ts @@ -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))