Git Product home page Git Product logo

Comments (13)

teacoat avatar teacoat commented on July 2, 2024

@FrancescoGrazioso Could you provide a screenshot of the console after clicking "Approve" in the demo wallet? It should display "SUCCESS" after a few moments, or throw an error if execution failed.

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

Or - this could be happening because the token you are trying to transfer is not associated to the demo account

from hashconnect.

FrancescoGrazioso avatar FrancescoGrazioso commented on July 2, 2024

The transaction to associate the token to the wallet account has the same problem, i'll attach the console on the approving transaction.
The problem is the same, i got no response from the event handler and the console/wallet do not display any "SUCCESS" message.

The following is the code that i'm using to approve the transaction

`
export async function associateTokenWithAccount(token, accountId) {
const client = hederaClient();
let transaction = await new TokenAssociateTransaction();
transaction.setAccountId(accountId);
transaction.setTokenIds([token.tokenId]);
transaction.freezeWith(client);

await sendTransaction(transaction, accountId);

}
`

`
export async function sendTransaction(tx: Transaction, signignAccount: string) {
let transactionBytes: Uint8Array = tx.toBytes();

const transaction: MessageTypes.Transaction = {
    topic: saveData.topic,
    byteArray: transactionBytes,
    metadata: {
        accountToSign: signignAccount,
        returnTransaction: false
    }
}

await hashconnect.sendTransaction(saveData.topic, transaction)

hashconnect.transactionResponseEvent.once((data) => {
    console.log("transaction response", data)
})

}
console on approving token

`

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

Yes so the demo wallet doesn't support the token associate function yet - it's still very much a WIP but I will prioritze adding token association.

Your events are going through fine, the wallet just doesn't have the UI to handle it yet!

from hashconnect.

FrancescoGrazioso avatar FrancescoGrazioso commented on July 2, 2024

Ok thanks, i'll close the issue when you'll release the new version of the wallet

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

Sounds good - I'll tag you when its ready :)

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

@FrancescoGrazioso I've updated the demo wallet to support token associate/disassociate
image

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

Keep an eye on the console when using it - errors such as "TOKEN_ALREADY_ASSOCIATED" aren't handled by the demo wallet yet

from hashconnect.

FrancescoGrazioso avatar FrancescoGrazioso commented on July 2, 2024

Still nothing from the console, on every transaction i try.
I tried:

  • token association
  • token dissociation
  • token transfert

I'll attach some screen
dissociate
dissociate-code
dissociate-console

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

Hmmm that looks to me like it should work - can you reach out to me (pluto) on discord?

from hashconnect.

teacoat avatar teacoat commented on July 2, 2024

There was a bug in the demo where errors werent returning correctly - if you try now both the success and error transaction response events should fire - here is the log from the demo dapp, you can see both transaction responses there!

image

from hashconnect.

FrancescoGrazioso avatar FrancescoGrazioso commented on July 2, 2024

It is giving me now the following error
error_wallet

I reached you on discord

from hashconnect.

FrancescoGrazioso avatar FrancescoGrazioso commented on July 2, 2024

The problem was in the way i was freezing the transaction, with the new code it works!

image

from hashconnect.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.