Resolve "refactor(Docs): Make it so that inline sandbox does not require xolibs binding"

This commit is contained in:
2025-08-31 08:19:27 +00:00
committed by Emergent Reasons
parent f87ff5bbc5
commit 827862e229
2 changed files with 5 additions and 14 deletions
@@ -75,7 +75,7 @@ const props = withDefaults(defineProps<CodeSandboxProps>(), {
editorHeight: 'auto',
outputHeight: 'auto',
hideRunButton: false,
libs: (): Record<string, ImportedLib> => ({}),
libs: (): Record<string, ImportedLib> => useXOCashLibs(),
saveable: false,
});
+4 -13
View File
@@ -4,9 +4,6 @@ aside: false
<script lang="ts" setup>
import CodeSandbox from '@theme/components/CodeSandbox.vue'
import { useXOCashLibs } from '@theme/utils/useXOCashLibs';
const xocashLibs = useXOCashLibs();
</script>
# Sandbox
@@ -24,9 +21,7 @@ The below is Address mess.
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox
:libs="xocashLibs"
>
<CodeSandbox>
```
import { Address } from '@xocash/stack';
@@ -50,9 +45,7 @@ We can have more than one per page too. For example:
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox
:libs="xocashLibs"
>
<CodeSandbox>
```
import { BlockchainElectrum } from '@xocash/stack';
@@ -74,14 +67,12 @@ The below demonstrates instantiating a wallet.
<!-- NOTE: It is absolutely crucial you leave a blank line before and after the backticks! Otherwise, you'll end up with errors.-->
<CodeSandbox
:libs="xocashLibs"
>
<CodeSandbox>
```
import { BlockchainElectrum, WalletP2PKH } from '@xocash/stack';
const wallet = WalletP2PKH.generateRandom({
const wallet = await WalletP2PKH.generateRandom({
blockchain: new BlockchainElectrum
});