michaelhly / solana-py

Solana Python SDK
https://michaelhly.github.io/solana-py
MIT License
1.04k stars 273 forks source link

How to interact with smart contracts #94

Closed wuyi771 closed 2 years ago

wuyi771 commented 3 years ago

I can send SOL, but I don’t know how to interact with the contract. There is no ABI, and the contract address has no code.

michaelhly commented 3 years ago

@kevinheavey is working on an Anchor client for Python. He'll have something ready for you soon.

If you don't want to wait, you have to figure out how to construct instructions manually to interact with a Solana program. Example: https://github.com/michaelhly/solana-py/tree/master/spl/token

dangell7 commented 3 years ago

Is there a Solana web3.py repo? I dont need all the extra stuff.

Anchor reminds me of ganache/drizzle/truffle which is cool but a lot of us don't need all that.

kevinheavey commented 3 years ago

Is there a Solana web3.py repo? I dont need all the extra stuff.

Good news! You’re in the right place

crypt0miester commented 3 years ago

any updates on the python anchor client?

would love to be able to create candy machine.

kevinheavey commented 3 years ago

any updates on the python anchor client?

would love to be able to create candy machine.

With the caveat that I’m just some guy, I’m targeting this month for a first release

crypt0miester commented 3 years ago

With the caveat that I’m just some guy, I’m targeting this month for a first release

you already did an amazing job with the solana-py.

you can do it mate. I'm quite jealous of what is happening in the js libraries.

my platform depends on this. cheers.

kevinheavey commented 3 years ago

@crypt0miester I'm curious about what you're working on, is there a way I can contact you?

crypt0miester commented 3 years ago

hey @kevinheavey, sorry been busy lately.

hello@artz.ai we are building an open nft marketplace based on metaplex api.

I've done the minting one nft part. would be awesome if we can host drops (candy machine) on our system.

I'm currently waiting for metaplex/python-api to update their solana-py version to include Keypair instead of the Account in your recent merge. maybe I'll do it for them when I have some free time.

kevinheavey commented 3 years ago

@crypt0miester here's the first release of AnchorPy https://github.com/kevinheavey/anchorpy Just be warned that it doesn't have full test coverage yet.

jacekv commented 2 years ago

I created a repo on different topics. Still work in progress, but it covers also on how to call functions in a Solana program. Have a look here: https://github.com/jacekv/Solana-Intro The function_calls dir contains an example of a calculator program which is able to add or sub to number, and a Python client calling the functions.