Skip to content

Conversation

@quetool
Copy link
Member

@quetool quetool commented May 16, 2025

Installed and using "@polkadot/api" to sign and send transaction and verify that we can obtain a transaction hash.

Needs to be ran with some coins either on Polkadot mainnet or westend. I wasn't able to get them on any faucet.

@vercel
Copy link

vercel bot commented May 16, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
decentralized-relay-app ❌ Failed (Inspect) May 23, 2025 1:21pm
malicious-dapp-verify-simulation ❌ Failed (Inspect) May 23, 2025 1:21pm
react-dapp-v2 ❌ Failed (Inspect) May 23, 2025 1:21pm
8 Skipped Deployments
Name Status Preview Comments Updated (UTC)
appkit-react-wagmi-example ⬜️ Ignored (Inspect) May 23, 2025 1:21pm
appkit-solana ⬜️ Ignored (Inspect) May 23, 2025 1:21pm
chain-abstraction-demo ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 1:21pm
decentralized-relay-wallet ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 1:21pm
react-dapp-v2-cosmos-provider ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 1:21pm
react-dapp-v2-with-ethers ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 1:21pm
react-wallet-v2 ⬜️ Ignored (Inspect) Visit Preview 💬 Add feedback May 23, 2025 1:21pm
smart-sessions-demo ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 1:21pm

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented May 16, 2025

Deploying demo-ai-agents with  Cloudflare Pages  Cloudflare Pages

Latest commit: 65a0757
Status:🚫  Build failed.

View logs

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates polkadot/api into the project and rewrites the sendTransaction logic to utilize Polkadot blockchain constructs. Key changes include:

  • Adding imports and instantiation of the Polkadot API and related modules.
  • Rewriting the transaction payload derivation and extrinsic signature logic.
  • Updating package.json to include the newest "@polkadot/api" dependency.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
advanced/dapps/react-dapp-v2/src/contexts/JsonRpcContext.tsx Integrates Polkadot API calls and creates a new extrinsic signature flow for transactions.
advanced/dapps/react-dapp-v2/package.json Adds the "@polkadot/api" dependency required for new blockchain functionalities.
Comments suppressed due to low confidence (2)

advanced/dapps/react-dapp-v2/src/contexts/JsonRpcContext.tsx:978

  • [nitpick] The variable name 'call' is ambiguous; consider renaming it to 'transferCall' to better reflect its purpose.
const call = api.tx.balances.transfer(address, 1000000000000); // 1 DOT

advanced/dapps/react-dapp-v2/src/contexts/JsonRpcContext.tsx:1024

  • There is an inconsistency in the representation of 'specVersion' and 'transactionVersion'; while the transactionPayload formats these as hex strings, the addSignature call uses raw numeric values. Consider aligning these formats for consistency.
extrinsic.addSignature(address, `0x${result.signature.replaceAll('0x', '')}`, { ...transactionPayload, specVersion: api.runtimeVersion.specVersion, transactionVersion: api.runtimeVersion.transactionVersion, });

@quetool quetool marked this pull request as ready for review May 16, 2025 14:29
@ganchoradkov
Copy link
Member

@quetool could you check please why it fails to build? pnpm build

@quetool
Copy link
Member Author

quetool commented May 16, 2025

@quetool could you check please why it fails to build? pnpm build

Maybe it's this? I don't know, I'm not expert here, better you checkout that branch and check cause I didn't introduce this.

Screenshot 2025-05-16 at 17 26 49

I ran ppm build and it didn't fix

@quetool
Copy link
Member Author

quetool commented May 20, 2025

@ganchoradkov I really don't know why it fails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants