Uncaught (in promise) Error: Required: There must be spendTx in this stamp methods

index.js:31 Uncaught (in promise) Error: Required: There must be spendTx in this stamp methods
at checkDescriptorHaveThese (index.js:31)
at Object.push…/node_modules/@stamp/required/index.js.compose.initializers (index.js:43)
at Stamp (index.js:34)
at App.componentDidMount (App.js:28)
checkDescriptorHaveThese

I’m using reactjs and aerternity’s node sdk
async componentDidMount() {
// console.log(await Ae)
// console.log(MemoryAccount)
// console.log(Node)
const keypair = Crypto.generateKeyPair()

console.log(`Secret key: ${keypair.secretKey}`)
console.log(`Public key: ${keypair.publicKey}`)
const node1 = await Node({ url: 'https://sdk-testnet.aepps.com', internalUrl: 'https://sdk-testnet.aepps.com' })
const acc1 = MemoryAccount({ keypair: { 
                            secretKey: keypair.secretKey, 
                            publicKey: keypair.publicKey } })
const client = await Ae({
    nodes:[
      {name: 'someNode', instance: node1},
    ],
    compilerUrl: 'https://compiler.aepps.com',
    accounts: [
      acc1,
      // acc2
    ],
    address: keypair.publicKey ,
    onTx:this.confirmDialog
})
const height = await client.height()
console.log('Current Block', height)

}

@emin.chain @erik.chain @marco.chain @martingrigorov.chain

Hey,

Not sure where the error is. Maybe @nduchak.chain can help here if it is something related to the sdk.
I haven’t seen such an error until now, and not familiar with the stamp methods in the sdk.

Best,
Martin

Hey @Goodness,
Looks like you are importing the wrong stamp.
Please make sure that your Ae import looks like

// tree-shaking
import Ae from '@aeternity/aepp-sdk/es/ae/universal'
import Node from '@aeternity/aepp-sdk/es/node'
import MemoryAccount from '@aeternity/aepp-sdk/es/account/memory'
// or
import { Universal: Ae, MemoryAccount, Node } from '@aeternity/aepp-sdk'

2 Likes

ok thanks @nduchak.chain and @martingrigorov.chain
will try that and get back to u guys