-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: custom error support. * refactor: example nodejs * test: update example webpage Co-authored-by: k-matsuzawa <[email protected]>
- Loading branch information
1 parent
95d7fa2
commit 09475b9
Showing
63 changed files
with
4,107 additions
and
1,480 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,30 @@ | ||
const cfdjsWasmJson = require('./cfdjs_wasm_json.js'); | ||
|
||
const wrappedModule = {}; | ||
let hasLoaded = false; | ||
cfdjsWasmJson['onRuntimeInitialized'] = async () => { | ||
if ('onRuntimeInitialized' in wrappedModule) { | ||
wrappedModule.onRuntimeInitialized(); | ||
} | ||
hasLoaded = true; | ||
}; | ||
|
||
wrappedModule['addInitializedListener'] = function(func) { | ||
wrappedModule['onRuntimeInitialized'] = func; | ||
if (hasLoaded) { | ||
if (func) func(); | ||
} else { | ||
wrappedModule['onRuntimeInitialized'] = func; | ||
} | ||
}; | ||
|
||
wrappedModule['getCfd'] = function() { | ||
return cfdjsWasmJson; | ||
}; | ||
|
||
wrappedModule['hasLoadedWasm'] = function() { | ||
return hasLoaded; | ||
}; | ||
|
||
wrappedModule['CfdError'] = cfdjsWasmJson.CfdError; | ||
|
||
module.exports = wrappedModule; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<title>Dump Privkey</title> | ||
<style> | ||
#main { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
height: 120vh; | ||
font-family: sans-serif; | ||
} | ||
.decodeInput { | ||
width: 99%; | ||
} | ||
.decodeOutput { | ||
width: 99%; | ||
} | ||
.decodetx-output { | ||
vertical-align: top; | ||
margin-top: 13px; | ||
} | ||
h1 { | ||
font-size: 32px; | ||
} | ||
h2 { | ||
font-size: 20px; | ||
font-weight: bold; | ||
} | ||
h3 { | ||
font-size: 16px; | ||
margin-bottom: 0px; | ||
padding-bottom: 0px; | ||
} | ||
.xpubkey-label { | ||
font-size: 12px; | ||
display: inline-block; | ||
width: 8em; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="decode"> | ||
<h3 class="decode-title">Dump Privkey</h3> | ||
<div class="decode-input"> | ||
<div> | ||
<div class="decode-label">Input privkey:</div> | ||
<textarea rows="3" id="inputData" class="decodeInput"></textarea><br> | ||
<input type="button" name="decode" id="execDecode" value="Parse" /> | ||
</div> | ||
<div class="decode-output"> | ||
<div class="decode-label">Key Info:</div> | ||
<textarea rows="11" id="decoded" class="decodeOutput" readonly></textarea> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<script src="/cfd-js-wasm/dist/cfdjs_wasm.js"></script> | ||
<script src="/cfd-js-wasm/cfdjs_wasm_jsonapi.js"></script> | ||
<script src="dumpprivkey.js"></script> | ||
<p><a href="index.html">back</a></p> | ||
</body> | ||
</html> |
Oops, something went wrong.