#representative?: Account\r
#weight?: bigint\r
\r
- get address () { return `${PREFIX}${this.#address}` }\r
- get index () { return this.#index }\r
- get publicKey () { return bytes.toHex(this.#publicKey) }\r
+ get address (): string { return `${PREFIX}${this.#address}` }\r
+ get index (): number | undefined { return this.#index }\r
+ get publicKey (): string { return bytes.toHex(this.#publicKey) }\r
\r
- get balance () { return this.#balance }\r
- get frontier () { return this.#frontier }\r
- get receivable () { return this.#receivable }\r
- get representative () { return this.#representative }\r
- get weight () { return this.#weight }\r
+ get balance (): bigint | undefined { return this.#balance }\r
+ get frontier (): string | undefined { return this.#frontier }\r
+ get receivable (): bigint | undefined { return this.#receivable }\r
+ get representative (): Account | undefined { return this.#representative }\r
+ get weight (): bigint | undefined { return this.#weight }\r
\r
- set balance (v) { this.#balance = v ? BigInt(v) : undefined }\r
- set frontier (v) { this.#frontier = v }\r
- set receivable (v) { this.#receivable = v ? BigInt(v) : undefined }\r
- set representative (v) {\r
+ set balance (v: bigint | number | string) { this.#balance = BigInt(v) }\r
+ set frontier (v: string | undefined) { this.#frontier = v }\r
+ set receivable (v: bigint | number | string) { this.#receivable = BigInt(v) }\r
+ set representative (v: unknown) {\r
if (v instanceof Account) {\r
this.#representative = v\r
} else if (typeof v === 'string') {\r
throw new TypeError(`Invalid argument for account representative: ${v}`)\r
}\r
}\r
- set weight (v) { this.#weight = v ? BigInt(v) : undefined }\r
+ set weight (v: bigint | number | string) { this.#weight = BigInt(v) }\r
\r
private constructor (address: string, publicKey: Key, index?: number) {\r
if (!Account.#isInternal) {\r