Add JS browser example to download file
@@ -93,9 +93,25 @@ This file may be msgpack or json and can be created using goal or the SDKs
]
})
+ # If you're running the code in nodejs you can save the file to disk.
const filename = 'dryrun.msgp'
fs.writeFileSync(filename, algosdk.encodeObj(drr.get_obj_for_encoding(true)))
+ # If you're doing this in the browser you'll need to present the file as a download.
+ const msgp = algosdk.encodeObj(drr.get_obj_for_encoding(true));
+
+ const msgp_bin = new Blob(
+ [msgp],
+ {type: "application/octet-stream"}
+ );
+
+ const filename = 'dryrun.msgp'
+ var link = document.createElement('a');
+ link.href = window.URL.createObjectURL(msgp_bin);
+ link.download = filename;
+ link.click();
+ link.remove();
+
```
=== "Go"
@@ -151,6 +167,7 @@ This file may be msgpack or json and can be created using goal or the SDKs
```
+### Creating
## Calling the debugger with context
```
