Giter Site home page Giter Site logo

TypeChain about angular-truffle-box HOT 10 CLOSED

quintor avatar quintor commented on June 25, 2024
TypeChain

from angular-truffle-box.

Comments (10)

pimotte avatar pimotte commented on June 25, 2024

Generating the code and refactoring the existing code starting around here: https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L31 should be doable. The type of the MetaCoin would then be the specific contract, rather than any. I also tend to do the calls with .sendTransaction or .call explicitly, which I don't think the TypeChain library supports?

I'd be happy to accept a PR that does this cleanly. If I were to start working on it myself, I'll post it here.

from angular-truffle-box.

meherett avatar meherett commented on June 25, 2024

OK @pimotte,

Please!

I didn't understand meta-sender.component.ts, If i would like to give you sample smart contract so that give me an example of angular-truffle.

"pragma solidity ^0.4.8;
contract Storage {
uint256 storedData;
function set(uint256 data) {
storedData = data;
}
function get() constant returns (uint256) {
return storedData;
}
}"

Please! @pimotte

from angular-truffle-box.

pimotte avatar pimotte commented on June 25, 2024

https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L63 and https://github.com/Quintor/angular-truffle-box/blob/master/src/app/meta/meta-sender/meta-sender.component.ts#L81 are the lines where the contract interaction happens. If you want to do that with TypeChain, you should end up with the needed object around those lines.

In general, using TypeChain with angular shouldn't be that different from using other libraries from angular, except maybe that the code is generated.

from angular-truffle-box.

meherett avatar meherett commented on June 25, 2024

I am ok in typechain but i need this please

"pragma solidity ^0.4.8;
contract Storage {
uint256 storedData;
function set(uint256 data) {
storedData = data;
}
function get() constant returns (uint256) {
return storedData;
}
}"

web3.services.ts alwys contant i think

from angular-truffle-box.

pimotte avatar pimotte commented on June 25, 2024

If you want to implement an application that uses that contract, I recommend forking this repo and throwing away meta-sender.component.ts, and implement a new component that interacts with it.

This Truffle box already has the MetaCoin contract as an example, so an additional contract is not needed.

from angular-truffle-box.

meherett avatar meherett commented on June 25, 2024

Error

Constructor: [object Object]
meta-sender.component.ts:28 OnInit: [object Object]
meta-sender.component.ts:29 MetaSenderComponent {web3Service: Web3Service, model: Object, status: ""}model: Objectstatus: ""web3Service: Web3Service__proto__: Object
core.js:3675 Angular is running in the development mode. Call enableProdMode() to enable the production mode.
core.js:1440 # ERROR TypeError: web3_1.default is not a constructor
at Web3Service.bootstrapWeb3 (web3.service.ts:26)
at eval (web3.service.ts:18)
at ZoneDelegate.invokeTask (zone.js:421)
at Object.onInvokeTask (core.js:4724)
at ZoneDelegate.invokeTask (zone.js:420)
at Zone.runTask (zone.js:188)
at ZoneTask.invokeTask [as invoke] (zone.js:496)
at invokeTask (zone.js:1517)
at globalZoneAwareCallback (zone.js:1543)
defaultErrorLogger @ core.js:1440
ErrorHandler.handleError @ core.js:1501
next @ core.js:5491
schedulerFn @ core.js:4319
SafeSubscriber.__tryOrUnsub @ Subscriber.js:240
SafeSubscriber.next @ Subscriber.js:187
Subscriber._next @ Subscriber.js:128
Subscriber.next @ Subscriber.js:92
Subject.next @ Subject.js:56
EventEmitter.emit @ core.js:4299
(anonymous) @ core.js:4755
ZoneDelegate.invoke @ zone.js:388
Zone.run @ zone.js:138
NgZone.runOutsideAngular @ core.js:4681
onHandleError @ core.js:4755
ZoneDelegate.handleError @ zone.js:392
Zone.runTask @ zone.js:191
ZoneTask.invokeTask @ zone.js:496
invokeTask @ zone.js:1517
globalZoneAwareCallback @ zone.js:1543

from angular-truffle-box.

pimotte avatar pimotte commented on June 25, 2024

Did you get any errors when installing dependencies?

from angular-truffle-box.

meherett avatar meherett commented on June 25, 2024

"web3": "^1.0.0-beta.26"

it is not work for me then i install "web3": "^0.20.4" and this is work
but i get error https://github.com/Quintor/angular-truffle-box/blob/master/src/app/util/web3.service.ts#26

from angular-truffle-box.

meherett avatar meherett commented on June 25, 2024

I like your video in youtue

Error
https://github.com/Quintor/angular-truffle-box/blob/master/src/app/util/web3.service.ts#26

from angular-truffle-box.

pimotte avatar pimotte commented on June 25, 2024

If any of these issues still exist, feel free to create a new issue with a description how to reproduce them.

from angular-truffle-box.

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.