You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: using singleton style, call contract init shows error as below - MethodNotFound: export CONTRACT=dev-1639401101891-95375974097216 near call $CONTRACT init --accountId $CONTRACT Scheduling a call: dev-1639401101891-95375974097216.init() Doing account.functionCall() Receipt: FdvybMRSR6NfqxaTftEXJ4y5GEsb9dcLD7tXomixd22f Failure [dev-1639401101891-95375974097216]: Error: Contract method is not found ServerTransactionError: Contract method is not found at Object.parseResultError (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29) at Account.signAndSendTransactionV2 (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async scheduleFunctionCall (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/commands/call.js:57:38) at async Object.handler (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) { type: 'MethodNotFound', context: undefined, index: 0, transaction_outcome: { proof: [ [Object] ], block_hash: 'L1J7izqs99Sd352j6gRJKRzKqpzqLzJ4eeDg97KJFbn', id: 'Ca5wtTBasYSPCKqDsSCWbFiQpJUAaXbsvPu8Y7ToG92o', outcome: { logs: [], receipt_ids: [Array], gas_burnt: 2427934415604, tokens_burnt: '242793441560400000000', executor_id: 'dev-1639401101891-95375974097216', status: [Object], metadata: [Object] } } }
Expect: can initialize the singleton contract.
Solution: I've tried to add init function to Contract class, it worked: near call $CONTRACT init --accountId $CONTRACT Scheduling a call: dev-1639401861183-56323128751619.init() Doing account.functionCall() Transaction Id 6zKb6yWnETT5ZVkdatPMceDNDq19x1Wz3V3QZu7MAUh5 To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/6zKb6yWnETT5ZVkdatPMceDNDq19x1Wz3V3QZu7MAUh5 ''
Thanks team!
The text was updated successfully, but these errors were encountered:
I'm not completely sure what this issue is about, but I don't think it's related to this project missing the init function. If you are using the singleton pattern, try to call init on a deployed contract, you are actually trying to call the constructor.
Hi team,
Error: using singleton style, call contract init shows error as below - MethodNotFound:
export CONTRACT=dev-1639401101891-95375974097216
near call $CONTRACT init --accountId $CONTRACT
Scheduling a call: dev-1639401101891-95375974097216.init() Doing account.functionCall() Receipt: FdvybMRSR6NfqxaTftEXJ4y5GEsb9dcLD7tXomixd22f Failure [dev-1639401101891-95375974097216]: Error: Contract method is not found ServerTransactionError: Contract method is not found at Object.parseResultError (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/utils/rpc_errors.js:31:29) at Account.signAndSendTransactionV2 (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/node_modules/near-api-js/lib/account.js:160:36) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async scheduleFunctionCall (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/commands/call.js:57:38) at async Object.handler (/home/quantranse/.nvm/versions/node/v16.2.0/lib/node_modules/near-cli/utils/exit-on-error.js:52:9) { type: 'MethodNotFound', context: undefined, index: 0, transaction_outcome: { proof: [ [Object] ], block_hash: 'L1J7izqs99Sd352j6gRJKRzKqpzqLzJ4eeDg97KJFbn', id: 'Ca5wtTBasYSPCKqDsSCWbFiQpJUAaXbsvPu8Y7ToG92o', outcome: { logs: [], receipt_ids: [Array], gas_burnt: 2427934415604, tokens_burnt: '242793441560400000000', executor_id: 'dev-1639401101891-95375974097216', status: [Object], metadata: [Object] } } }
Expect: can initialize the singleton contract.
Solution: I've tried to add init function to Contract class, it worked:
near call $CONTRACT init --accountId $CONTRACT
Scheduling a call: dev-1639401861183-56323128751619.init() Doing account.functionCall() Transaction Id 6zKb6yWnETT5ZVkdatPMceDNDq19x1Wz3V3QZu7MAUh5 To see the transaction in the transaction explorer, please open this url in your browser https://explorer.testnet.near.org/transactions/6zKb6yWnETT5ZVkdatPMceDNDq19x1Wz3V3QZu7MAUh5 ''
Thanks team!
The text was updated successfully, but these errors were encountered: