GithubHelp home page GithubHelp logo

Comments (10)

tbfleming avatar tbfleming commented on June 17, 2024 2

It automatically fetches ABIs

from eosjs.

jcalfee avatar jcalfee commented on June 17, 2024
eos.contract('hello').then(hello => {
  hello.hi(..)
})

from eosjs.

topnotch-itdev avatar topnotch-itdev commented on June 17, 2024

eos.contract('hello').then(hello => {
hello.hi(..)
})

Hi jclafee, Please explain the about eos. I'd like to have the details code. I am using the [email protected] but I can't find action processing function. How can i call the action function of eos smart contract in new eosjs version?

from eosjs.

jecombe avatar jecombe commented on June 17, 2024

eos.contract('hello').then(hello => {
hello.hi(..)
})

do you have this, with version eosjs@20

from eosjs.

wujunchuan avatar wujunchuan commented on June 17, 2024

eos.contract('hello').then(hello => {
hello.hi(..)
})

do you have this, with version eosjs@20

There is only a function name called getContract in Api Object with version eosjs@20+.

ref : https://eosio.github.io/eosjs/latest/classes/api.api-1/#getcontract

I don't understand how can you call the eos.contract function

from eosjs.

jcalfee avatar jcalfee commented on June 17, 2024

That is not in 2.0 .. You need to create the json just like a transaction and pass it to eos.transact.. You need to figure out how to get your contract's ABI into the library. @tbfleming do you have an example somewhere that does this?

from eosjs.

rahul1083 avatar rahul1083 commented on June 17, 2024

It automatically fetches ABIs

Can you please give me an example , how to call contract functions using eos.transact method?

from eosjs.

jcalfee avatar jcalfee commented on June 17, 2024

Just a random search ..

const transactWithConfig = async () => await api.transact({

I see they did put an example in the readme too. The account is where you deployed your smart contract.

from eosjs.

rahul1083 avatar rahul1083 commented on June 17, 2024

I am doing same thing see the example
await api.transact(
{
actions: [
{
account: 'addressbook',
name: 'upsert',
type: 'upsert',
authorization: [
{
actor: 'me',
permission: 'active'
},
],
data: {
key: 'me',
first_name:'dasfasd',
last_name: 'jhjkjk',
street: 'jdkljd',
city: "1",
state: 'sdjs'
},
},
]
},
{
blocksBehind: 3,
expireSeconds: 30,
}
)

but I am getting error

Error: missing upsert.user (type=name)

from eosjs.

bradlhart avatar bradlhart commented on June 17, 2024

Looks like you might need to change key: 'me' in your data to user: 'me'. Depends on what you called the variable as an argument in your upsert function.

from eosjs.

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.