Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function_call the call function generate two transactions? #13

Open
Yx8080 opened this issue Dec 1, 2023 · 0 comments
Open

function_call the call function generate two transactions? #13

Yx8080 opened this issue Dec 1, 2023 · 0 comments

Comments

@Yx8080
Copy link

Yx8080 commented Dec 1, 2023

async def call_report_prices():
    try:
        accountId = ""
        privateKey = ""
        rpc = "https://rpc.mainnet.near.org"

        account = Account(accountId, privateKey, rpc)

        sender = "inscription.near"
        method_name = "inscribe"
        method_args = {
            "p": "nrc-20",
            "op": "mint",
            "tick": "neat",
            "amt": "100000000"
        }

        result = await account.function_call(sender, method_name, method_args)
        
        print("Transaction Hash:", result.transaction.hash)
        print("Transaction Hash url",result.transaction.url)
    except Exception as e:
        print(f"Error in call_report_prices: {e}")

async def main():
    for _ in range(2):
        await call_report_prices()
        await asyncio.sleep(1)

if __name__ == "__main__":
    asyncio.run(main())

Hey, I would like to ask if I can use the function_ When using the call function to execute the contract method, two identical hash transactions will appear. Firstly, the first transaction is sent to me by the system, and then I send it to the method I call, Inscribe. It will continue to throw rpc timeout errors. I want to know if the transaction sent to me by the system was generated by SDK?
https://nearblocks.io/zh-cn/address/0e82f1241097f1ffefb99a1a167cc91470700b0ac4b6a9870200514ef2dd43a7

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

No branches or pull requests

1 participant