How to use the @taquito/taquito.MANAGER_LAMBDA.transferToContract function in @taquito/taquito

To help you get started, we’ve selected a few @taquito/taquito examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ecadlabs / taquito / integration-tests / manager-contract-scenario.spec.ts View on Github external
await opTransfer.confirmation();
      expect(opTransfer.status).toEqual('applied')
      // Set delegate on contract kt1_alice by passing a lambda function to kt1_alice's `do` entrypoint
      const opSetDelegate = await contract.methods.do(MANAGER_LAMBDA.setDelegate("tz1eY5Aqa1kXDFoiebL28emyXFoneAoVg1zh")).send({ amount: 0 })
      await opSetDelegate.confirmation();
      expect(opSetDelegate.status).toEqual('applied')
      // Remove delegate on contract kt1_alice by passing a lambda function to kt1_alice's `do` entrypoint
      const removeDelegateOp = await contract.methods.do(MANAGER_LAMBDA.removeDelegate()).send({ amount: 0 })
      await removeDelegateOp.confirmation();
      expect(removeDelegateOp.status).toEqual('applied')
      // Transfer from contract (kt1_alice) to contract (kt1 bob)
      // Notice that we are instructing the kt1_alice contract to send 1 token to kt1_bob. The transfer value is passed to the
      // lambda helper function. The transfer amount in the actual transfer operation is 0. We are not transferring the token
      // in the transfer operation, we are instructing the contract to transfer the token using the `do` entrypoint of the kt1_alice
      // contract.
      const transferToContractOp = await contract.methods.do(MANAGER_LAMBDA.transferToContract("KT1EM2LvxxFGB3Svh9p9HCP2jEEYyHjABMbK", 1)).send({ amount: 0 })
      await transferToContractOp.confirmation();
      expect(transferToContractOp.status).toEqual('applied')
      done();
    })
  })