Start document upload of mask, and instantiate

This commit is contained in:
Ethan Frey
2020-03-20 22:35:40 +01:00
parent e9aaa60e82
commit e5d89f1fad
5 changed files with 79 additions and 1 deletions
+11
View File
@@ -93,3 +93,14 @@ const randomAddress = async (prefix: string): Promise<string> => {
const pubkey = encodeSecp256k1Pubkey(pen.pubkey);
return pubkeyToAddress(pubkey, prefix);
}
const downloadWasm = async (url: string): Promise<Uint8Array> => {
const r = await axios.get(url, { responseType: "arraybuffer"});
if (r.status !== 200) {
throw new Error(`Download error: ${r.status}`);
}
return r.data;
}
const getAttibute = (logs: readonly logs.Log[], key: string): string|undefined =>
logs[0].events[0].attributes.find(x => x.key == key)?.value