From c681dca8294495e9bbe4deaedeb4924b0ad74247 Mon Sep 17 00:00:00 2001 From: Barin Britva Date: Mon, 12 Feb 2024 13:12:34 +0700 Subject: [PATCH] Add toAddress method. --- src/address/Address.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/address/Address.ts b/src/address/Address.ts index 62f75e9..55621c0 100644 --- a/src/address/Address.ts +++ b/src/address/Address.ts @@ -112,6 +112,14 @@ export class Address { } } + static toAddress(source: Address | string): Address { + if (typeof source === 'string') { + return Address.parse(source); + } + + return source; + } + static parse(source: string) { if (Address.isFriendly(source)) { return this.parseFriendly(source).address;