From 7deb58f55083626ae2c80703c8f00090cdb8cfdc Mon Sep 17 00:00:00 2001 From: Chris Duncan Date: Mon, 7 Oct 2024 23:37:13 -0700 Subject: [PATCH] Rename Account properties to current Nano terminology, that is, pending is now receivable. --- src/lib/account.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/lib/account.ts b/src/lib/account.ts index cf977ca..a4e23e6 100644 --- a/src/lib/account.ts +++ b/src/lib/account.ts @@ -21,8 +21,8 @@ export class Account { #i?: number #f?: string #b?: bigint - #p?: bigint - #r?: Account + #r?: bigint + #rep?: Account #w?: bigint #s: Safe @@ -32,18 +32,18 @@ export class Account { get index () { return this.#i } get frontier () { return this.#f } get balance () { return this.#b?.toString() } - get pending () { return this.#p?.toString() } - get representative () { return this.#r } + get receivable () { return this.#r?.toString() } + get representative () { return this.#rep } get weight () { return this.#w?.toString() } set frontier (v) { this.#f = v } set balance (v) { this.#b = v ? BigInt(v) : undefined } - set pending (v) { this.#p = v ? BigInt(v) : undefined } + set receivable (v) { this.#r = v ? BigInt(v) : undefined } set representative (v) { if (v?.constructor === Account) { - this.#r = v + this.#rep = v } else if (typeof v === 'string') { - this.#r = new Account(v) + this.#rep = new Account(v) } else { throw new TypeError(`Invalid argument for account representative: ${v}`) } @@ -178,8 +178,8 @@ export class Account { } this.#b = BigInt(balance) this.#f = frontier - this.#p = BigInt(pending) - this.#r = new Account(representative) + this.#r = BigInt(pending) + this.#rep = new Account(representative) this.#w = BigInt(weight) } -- 2.34.1