Skip to content

Commit

Permalink
chore: removing vite compatibility workaround (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
aorumbayev authored Sep 4, 2023
1 parent f7bfe07 commit 873dcd7
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 88 deletions.
22 changes: 0 additions & 22 deletions template_content/README.md.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -94,25 +94,3 @@ It has also been configured to have a productive dev experience out of the box i

Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit.

# Vite compatibility with `js-algorand-sdk` and `algokit clients`

If you are receiving `address malformed` errors when sending direct calls to abi methods on AlgoKit typed clients where ABI parameters expect ABI transactions to be passed, this is a known edge case and a bug that occurs on [Vite in dev mode](https://github.com/vitejs/vite/issues/9528). A fix is in the works on [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk/issues/740) side (which is used as a main low-level dependency by AlgoKit to generate typed clients), but in the meantime you can use a simple workaround described below:

```ts
Instead of:

const response = await myAlgoKitTypedClient
.someExternalMethod({
some_txn_param: someTxnObject,
})

use:

const response = await appClient
.compose()
.someExternalMethod({
some_txn_param: someTxnObject,
})
.execute()
```

22 changes: 0 additions & 22 deletions tests_generated/test_all_default_parameters_off/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,3 @@ This project makes use of React and Tailwind to provider a base project configur

Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit.

# Vite compatibility with `js-algorand-sdk` and `algokit clients`

If you are receiving `address malformed` errors when sending direct calls to abi methods on AlgoKit typed clients where ABI parameters expect ABI transactions to be passed, this is a known edge case and a bug that occurs on [Vite in dev mode](https://github.com/vitejs/vite/issues/9528). A fix is in the works on [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk/issues/740) side (which is used as a main low-level dependency by AlgoKit to generate typed clients), but in the meantime you can use a simple workaround described below:

```ts
Instead of:

const response = await myAlgoKitTypedClient
.someExternalMethod({
some_txn_param: someTxnObject,
})

use:

const response = await appClient
.compose()
.someExternalMethod({
some_txn_param: someTxnObject,
})
.execute()
```

22 changes: 0 additions & 22 deletions tests_generated/test_all_default_parameters_on_netlify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,3 @@ It has also been configured to have a productive dev experience out of the box i

Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit.

# Vite compatibility with `js-algorand-sdk` and `algokit clients`

If you are receiving `address malformed` errors when sending direct calls to abi methods on AlgoKit typed clients where ABI parameters expect ABI transactions to be passed, this is a known edge case and a bug that occurs on [Vite in dev mode](https://github.com/vitejs/vite/issues/9528). A fix is in the works on [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk/issues/740) side (which is used as a main low-level dependency by AlgoKit to generate typed clients), but in the meantime you can use a simple workaround described below:

```ts
Instead of:

const response = await myAlgoKitTypedClient
.someExternalMethod({
some_txn_param: someTxnObject,
})

use:

const response = await appClient
.compose()
.someExternalMethod({
some_txn_param: someTxnObject,
})
.execute()
```

22 changes: 0 additions & 22 deletions tests_generated/test_all_default_parameters_on_vercel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,25 +77,3 @@ It has also been configured to have a productive dev experience out of the box i

Refer to the detailed guidance on [integrating with smart contracts and application clients](./src/contracts/README.md). In essence, for any smart contract codebase generated with AlgoKit or other tools that produce compile contracts into ARC34 compliant app specifications, you can use the `algokit generate` command to generate TypeScript or Python typed client. Once generated simply drag and drop the generated client into `./src/contracts` and import it into your React components as you see fit.

# Vite compatibility with `js-algorand-sdk` and `algokit clients`

If you are receiving `address malformed` errors when sending direct calls to abi methods on AlgoKit typed clients where ABI parameters expect ABI transactions to be passed, this is a known edge case and a bug that occurs on [Vite in dev mode](https://github.com/vitejs/vite/issues/9528). A fix is in the works on [js-algorand-sdk](https://github.com/algorand/js-algorand-sdk/issues/740) side (which is used as a main low-level dependency by AlgoKit to generate typed clients), but in the meantime you can use a simple workaround described below:

```ts
Instead of:

const response = await myAlgoKitTypedClient
.someExternalMethod({
some_txn_param: someTxnObject,
})

use:

const response = await appClient
.compose()
.someExternalMethod({
some_txn_param: someTxnObject,
})
.execute()
```

0 comments on commit 873dcd7

Please sign in to comment.