diff --git a/src/agent/javascript/src/principal.ts b/src/agent/javascript/src/principal.ts index 79ab3907ee..14568c0f26 100644 --- a/src/agent/javascript/src/principal.ts +++ b/src/agent/javascript/src/principal.ts @@ -61,4 +61,8 @@ export class Principal { const matches = result.match(/.{1,5}/g); return matches ? matches.join('-') : ''; } + + public toString() { + return this.toText(); + } } diff --git a/src/bootstrap/types/base32.d.ts b/src/bootstrap/types/base32.d.ts new file mode 100644 index 0000000000..9ac4d2dd40 --- /dev/null +++ b/src/bootstrap/types/base32.d.ts @@ -0,0 +1,23 @@ +declare module 'base32.js' { + type Ret = { + finalize: () => any; + }; + + interface DecoderConfig { + type?: 'rfc4648' | 'crockford' | 'base32hex'; + alphabet?: string; + lc?: boolean; + } + class Decoder { + constructor(options?: DecoderConfig); + write(str: string): this; + finalize(str?: string): ArrayBuffer; + } + class Encoder { + private buf: ArrayBuffer; + private charmap: { [key: number]: number }; + constructor(options?: DecoderConfig); + write(buf: ArrayBuffer): this; + finalize(str?: ArrayBuffer): string; + } +}