]> zoso.dev Git - libnemo.git/commitdiff
Rename Account properties to current Nano terminology, that is, pending is now receiv...
authorChris Duncan <chris@zoso.dev>
Tue, 8 Oct 2024 06:37:13 +0000 (23:37 -0700)
committerChris Duncan <chris@zoso.dev>
Tue, 8 Oct 2024 06:37:13 +0000 (23:37 -0700)
src/lib/account.ts

index cf977ca591a3f5756598ab9725e73739d9d4ce55..a4e23e6942ea3f099e1a041f60bd477a4f634c7c 100644 (file)
@@ -21,8 +21,8 @@ export class Account {
        #i?: number\r
        #f?: string\r
        #b?: bigint\r
-       #p?: bigint\r
-       #r?: Account\r
+       #r?: bigint\r
+       #rep?: Account\r
        #w?: bigint\r
        #s: Safe\r
 \r
@@ -32,18 +32,18 @@ export class Account {
        get index () { return this.#i }\r
        get frontier () { return this.#f }\r
        get balance () { return this.#b?.toString() }\r
-       get pending () { return this.#p?.toString() }\r
-       get representative () { return this.#r }\r
+       get receivable () { return this.#r?.toString() }\r
+       get representative () { return this.#rep }\r
        get weight () { return this.#w?.toString() }\r
 \r
        set frontier (v) { this.#f = v }\r
        set balance (v) { this.#b = v ? BigInt(v) : undefined }\r
-       set pending (v) { this.#p = v ? BigInt(v) : undefined }\r
+       set receivable (v) { this.#r = v ? BigInt(v) : undefined }\r
        set representative (v) {\r
                if (v?.constructor === Account) {\r
-                       this.#r = v\r
+                       this.#rep = v\r
                } else if (typeof v === 'string') {\r
-                       this.#r = new Account(v)\r
+                       this.#rep = new Account(v)\r
                } else {\r
                        throw new TypeError(`Invalid argument for account representative: ${v}`)\r
                }\r
@@ -178,8 +178,8 @@ export class Account {
                }\r
                this.#b = BigInt(balance)\r
                this.#f = frontier\r
-               this.#p = BigInt(pending)\r
-               this.#r = new Account(representative)\r
+               this.#r = BigInt(pending)\r
+               this.#rep = new Account(representative)\r
                this.#w = BigInt(weight)\r
        }\r
 \r