wip: fix wasm
This commit is contained in:
parent
e66e072871
commit
d2a81173ee
3 changed files with 13 additions and 11 deletions
|
@ -25,12 +25,11 @@ const dbg = debug("upend:api");
|
||||||
|
|
||||||
export { AddressComponents };
|
export { AddressComponents };
|
||||||
|
|
||||||
const addressConstants = new AddressTypeConstants();
|
|
||||||
|
|
||||||
export class UpEndApi {
|
export class UpEndApi {
|
||||||
private instanceUrl = "";
|
private instanceUrl = "";
|
||||||
private wasmPath: string | undefined;
|
private wasmPath: string | undefined;
|
||||||
private wasmInitialized = false;
|
private wasmInitialized = false;
|
||||||
|
private addressTypeConstants: AddressTypeConstants | undefined = undefined;
|
||||||
|
|
||||||
private queryOnceLRU = new LRU<string, UpListing>({ max: 128 });
|
private queryOnceLRU = new LRU<string, UpListing>({ max: 128 });
|
||||||
private inFlightRequests: { [key: string]: Promise<UpListing> | null } = {};
|
private inFlightRequests: { [key: string]: Promise<UpListing> | null } = {};
|
||||||
|
@ -211,8 +210,11 @@ export class UpEndApi {
|
||||||
let response;
|
let response;
|
||||||
if (typeof input === "string") {
|
if (typeof input === "string") {
|
||||||
try {
|
try {
|
||||||
|
if (!this.addressTypeConstants) {
|
||||||
await this.initWasm();
|
await this.initWasm();
|
||||||
return addressConstants[input];
|
this.addressTypeConstants = new AddressTypeConstants();
|
||||||
|
}
|
||||||
|
return this.addressTypeConstants[input];
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.warn(err);
|
console.warn(err);
|
||||||
}
|
}
|
||||||
|
|
|
@ -3638,8 +3638,8 @@ __metadata:
|
||||||
|
|
||||||
"upend_wasm@file:../upend_wasm/pkg::locator=upend%40workspace%3A.":
|
"upend_wasm@file:../upend_wasm/pkg::locator=upend%40workspace%3A.":
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
resolution: "upend_wasm@file:../upend_wasm/pkg#../upend_wasm/pkg::hash=aca1db&locator=upend%40workspace%3A."
|
resolution: "upend_wasm@file:../upend_wasm/pkg#../upend_wasm/pkg::hash=e06eb3&locator=upend%40workspace%3A."
|
||||||
checksum: 16eccf41a8d884154d2170602da4ffa44cf3f601c8f6a9cd26637864183bba003f9bb38ecdab93306dd6f6d22a3893946676f211a3e14581bc249f0ce1dd0b1c
|
checksum: 77a4c5daa46c42340ac1d1121c60aba6c0d6aad9bc6b0462dea799b2fbc052770dcfb34eff00198e0ca6c7b20207b954f8c2ca18679d14750030a5ca1b96b8a9
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|
|
@ -12585,19 +12585,19 @@ __metadata:
|
||||||
|
|
||||||
"upend@file:../tools/upend_js::locator=upend-kestrel%40workspace%3A.":
|
"upend@file:../tools/upend_js::locator=upend-kestrel%40workspace%3A.":
|
||||||
version: 0.0.1
|
version: 0.0.1
|
||||||
resolution: "upend@file:../tools/upend_js#../tools/upend_js::hash=6a0172&locator=upend-kestrel%40workspace%3A."
|
resolution: "upend@file:../tools/upend_js#../tools/upend_js::hash=6a123a&locator=upend-kestrel%40workspace%3A."
|
||||||
dependencies:
|
dependencies:
|
||||||
debug: ^4.3.4
|
debug: ^4.3.4
|
||||||
lru-cache: ^7.0.0
|
lru-cache: ^7.0.0
|
||||||
upend_wasm: ../upend_wasm/pkg
|
upend_wasm: ../upend_wasm/pkg
|
||||||
checksum: 81c95fd057a8bdfc65039041b33e9e37de13b3f1323a1409d9487d75cefc87127794bf4b14b0329b4c0fa198913d02c3a388233f4e047f4b93efec182d79715b
|
checksum: 61eecbea5cc93d202de54e0d9d52daa0636b9ce7f4000f5f61de4913627ee0dc8689dc45bcc1e98184a8e44862036c130ec0b6d34c1e82316f0857010d735a80
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
"upend_wasm@file:../upend_wasm/pkg::locator=upend%40file%3A..%2Ftools%2Fupend_js%23..%2Ftools%2Fupend_js%3A%3Ahash%3D6a0172%26locator%3Dupend-kestrel%2540workspace%253A.":
|
"upend_wasm@file:../upend_wasm/pkg::locator=upend%40file%3A..%2Ftools%2Fupend_js%23..%2Ftools%2Fupend_js%3A%3Ahash%3D6a123a%26locator%3Dupend-kestrel%2540workspace%253A.":
|
||||||
version: 0.1.0
|
version: 0.1.0
|
||||||
resolution: "upend_wasm@file:../upend_wasm/pkg#../upend_wasm/pkg::hash=aca1db&locator=upend%40file%3A..%2Ftools%2Fupend_js%23..%2Ftools%2Fupend_js%3A%3Ahash%3D6a0172%26locator%3Dupend-kestrel%2540workspace%253A."
|
resolution: "upend_wasm@file:../upend_wasm/pkg#../upend_wasm/pkg::hash=e06eb3&locator=upend%40file%3A..%2Ftools%2Fupend_js%23..%2Ftools%2Fupend_js%3A%3Ahash%3D6a123a%26locator%3Dupend-kestrel%2540workspace%253A."
|
||||||
checksum: 16eccf41a8d884154d2170602da4ffa44cf3f601c8f6a9cd26637864183bba003f9bb38ecdab93306dd6f6d22a3893946676f211a3e14581bc249f0ce1dd0b1c
|
checksum: 77a4c5daa46c42340ac1d1121c60aba6c0d6aad9bc6b0462dea799b2fbc052770dcfb34eff00198e0ca6c7b20207b954f8c2ca18679d14750030a5ca1b96b8a9
|
||||||
languageName: node
|
languageName: node
|
||||||
linkType: hard
|
linkType: hard
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue