Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions includes/code-snippets/ca_getmyintents.md

This file was deleted.

25 changes: 0 additions & 25 deletions includes/code-snippets/ca_quick_start.md

This file was deleted.

3 changes: 0 additions & 3 deletions includes/code-snippets/import_ca.md

This file was deleted.

7 changes: 0 additions & 7 deletions includes/code-snippets/init_ca.md

This file was deleted.

54 changes: 54 additions & 0 deletions includes/code-snippets/int_ca_sdk.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
=== "EVM only"

```ts
import { CA } from '@arcana/ca-sdk';
const provider = window.ethereum;
const ca = new CA();
//Set the EVM provider
ca.setEVMProvider(provider);

//Initialize ca
await ca.init();

//Get CA enabled provider
const providerWithCA = ca.getEVMProviderWithCA();

//Use providerWithCA to issue chain enabled transactions
await providerWithCA.request({
method: "eth_sendTransaction",
params: [
{
to: "0xEa46Fb4b4Dc7755BA29D09Ef2a57C67bab383A2f",
from: "0x7f521A827Ce5e93f0C6D773525c0282a21466f8d",
value: "0x001",
},
],
});
```

=== "EVM + Fuel"

```ts
import { CA } from '@arcana/ca-sdk';
const provider = window.ethereum;
const ca = new CA();
//Set the EVM provider
ca.setEVMProvider(provider);

//Initialize ca
await ca.init();

//connector refers to https://github.com/FuelLabs/fuel-connectors/wiki
await ca.setFuelConnector(connector);
const { provider, connector: CAconnector } = await ca.getFuelWithCA();

const address = CAconnector.currentAccount()!;
const account = new Account(address, provider, CAconnector);

//chain abstraction enabled transfer
await account.transfer(
"0xE78655DfAd552fc3658c01bfb427b9EAb0c628F54e60b54fDA16c95aaAdE797A",
1000000,
"0xa0265fb5c32f6e8db3197af3c7eb05c48ae373605b8165b6f4a51c5b0ba4812e",
);
```
6 changes: 0 additions & 6 deletions includes/code-snippets/new_ca.md

This file was deleted.

1 change: 0 additions & 1 deletion includes/code-snippets/new_ca_provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,4 @@
</WagmiProvider>
</StrictMode>
);

```
2 changes: 1 addition & 1 deletion includes/text-snippets/ca_supported_chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
| Avalanche | 43114 | AVAX | ✅ |
| Sophon | 50104 | SOPH | ✅ |
| Scroll | 534351 | ETH | ✅ |
| Fuel | - | FUEL | ✅ |

<!---* ~~Linea~~--->

<!---
>>>>>>> 9ae43e19 (Fix: #AR-9538 supported chains layout similar to onebalance)
<div class="img-grid-cards">

<figure markdown="span">
Expand Down
5 changes: 2 additions & 3 deletions includes/text-snippets/quick-start-int-casdk.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{% include "./code-snippets/import_ca.md" %}
The process for integrating the SDK differs for dApps that need to support both EVM and non-EVM chains, such as Fuel.

{% include "./code-snippets/new_ca.md" %}

{% include "./code-snippets/init_ca.md" %}
{% include "./code-snippets/int_ca_sdk.md" %}

!!! an-caution "`ca.init()`"

Expand Down