1

I'm working on a contract now and specifically I'd like to call a SmartPy API like sp.transfer(address, amount)? Is there a function like this?

I can't find API docs for SmartPy and digging into the SmartPy module didn't get me very far.

Where should I be looking for more info?

4

I believe what you are looking for is this: sp.send(sp.address("tz1"), sp.tez(420))

I can't find much documentation for sp.send but I have seen many SmartPy examples with sp.send and sp.amount

  • 1
    perfect. thanks! – lostdorje Sep 30 at 7:35
1

SmartPy is still early stage and under development with new features being added regularly. The main links to documentation can be found on their website https://smartpy.io/ -- these all mostly point to the various medium articles that describe the components that make up the SmartPy language and tools. The best resources for how to use SmartPy to develop contracts are the examples found in the medium articles.

Additionally, the online editor has some of the basics documented at https://smartpy.io/demo/smartpy_help.html

  • Thank you and understood. Regarding transfer() specifically, does it exist? Where is it? I dig into the smartpy module and find only from .smart import SMART from . import objfunctions from .version import __version__. I dig further into those and can't find this method. Thanks! – lostdorje Sep 29 at 3:53
  • That sounds like a different question. Stackexchange works best when you ask a very specific question with as much detail as possible I suggest you ask how to transfer using smartpy with all the details of exactly what it is you are trying to accomplish. That way it is easy for someone very familiar with that area of smartpy to find and answer your question. The question was specifically about where to get the docs, please add a new question. – cousinit Sep 29 at 21:34
  • Thanks for the pointers. I've seen them as well, yet hadn't seen an example transferring money. – lostdorje Sep 30 at 3:43
  • My first sentence was my actual question. I provided a sample code call of what I wanted to do. The second question about docs was only because I was looking for an answer to my first question. – lostdorje Sep 30 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.