kin-labs / kinetic

MIT License
40 stars 24 forks source link

refactor: use getAccountInfo to fetch token accounts on makeTransfer #547

Closed beeman closed 1 year ago

beeman commented 1 year ago

This PR changes how makeTransfer fetches the addresses of the token accounts for both the owner and destination.

Previously, it used getAssociatedTokenAddress combined with the mint and public key, but this does not work with token accounts that are created using and older method (eg. Agora wallets).

In this setup, we fetch the account info for both the owner and destination and it will give back and array of token accounts, regardless of how they were created.

The logic goes like this:

Part of #507.

nx-cloud[bot] commented 1 year ago

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 998c291d91049158ba16d6133687186a5939f08e. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 6 targets - [`nx affected --target=build --parallel --max-parallel=3`](https://cloud.nx.app/runs/EXuqIK9ivk) - [`nx affected --target=lint --parallel --max-parallel=3`](https://cloud.nx.app/runs/Wq2GtnSCqj) - [`nx affected --target=test --parallel --max-parallel=3`](https://cloud.nx.app/runs/KrwZ27y4j8) - [`nx e2e api-e2e --skip-nx-cache`](https://cloud.nx.app/runs/KIzczmuQ45) - [`nx e2e sdk-e2e --skip-nx-cache`](https://cloud.nx.app/runs/T6H5yW0fIx) - [`nx e2e web-e2e --skip-nx-cache`](https://cloud.nx.app/runs/yH12f4IbPs)

Sent with 💌 from NxCloud.