-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
puyapy.arc4.call_abi
for typed contract to contract cal…
…ls (#112) * improved API for `puyapy.arg4.DynamicBytes` * fixed `puyapy.arg4.UFixedNxM` parsing of decimal strings * support generating a client for use with `puyapy.arc4.call_abi` from ARC32 specifications or puya contracts BREAKING CHANGE: renamed `global_num_byte_slices` -> `global_num_bytes` and `local_num_byte_slices` -> `local_num_bytes` members on transaction types restrict `puyapy.arc4.String` operators to only be with other String compatible types --------- Co-authored-by: Adam Chidlow <achidlow@users.noreply.github.com>
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
Hide the first element of attribute like items as puyapy stubs are more like interfaces and as such | ||
should not indicate a specific "value" for variables | ||
*/ | ||
.py.data,.py.attribute { | ||
dd p:first-child { | ||
display: none; | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# This file is auto-generated, do not modify | ||
# flake8: noqa | ||
# fmt: off | ||
import typing | ||
|
||
import puyapy | ||
|
||
|
||
class ConstantProductAMM(puyapy.arc4.ARC4Client, typing.Protocol): | ||
@puyapy.arc4.abimethod | ||
def set_governor( | ||
self, | ||
new_governor: puyapy.Account, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def bootstrap( | ||
self, | ||
seed: puyapy.gtxn.PaymentTransaction, | ||
a_asset: puyapy.Asset, | ||
b_asset: puyapy.Asset, | ||
) -> puyapy.arc4.UInt64: ... | ||
|
||
@puyapy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'}) | ||
def mint( | ||
self, | ||
a_xfer: puyapy.gtxn.AssetTransferTransaction, | ||
b_xfer: puyapy.gtxn.AssetTransferTransaction, | ||
pool_asset: puyapy.Asset, | ||
a_asset: puyapy.Asset, | ||
b_asset: puyapy.Asset, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'}) | ||
def burn( | ||
self, | ||
pool_xfer: puyapy.gtxn.AssetTransferTransaction, | ||
pool_asset: puyapy.Asset, | ||
a_asset: puyapy.Asset, | ||
b_asset: puyapy.Asset, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod(default_args={'a_asset': 'asset_a', 'b_asset': 'asset_b'}) | ||
def swap( | ||
self, | ||
swap_xfer: puyapy.gtxn.AssetTransferTransaction, | ||
a_asset: puyapy.Asset, | ||
b_asset: puyapy.Asset, | ||
) -> None: ... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# This file is auto-generated, do not modify | ||
# flake8: noqa | ||
# fmt: off | ||
import typing | ||
|
||
import puyapy | ||
|
||
|
||
class Auction(puyapy.arc4.ARC4Client, typing.Protocol): | ||
@puyapy.arc4.abimethod | ||
def opt_into_asset( | ||
self, | ||
asset: puyapy.Asset, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def start_auction( | ||
self, | ||
starting_price: puyapy.arc4.UInt64, | ||
length: puyapy.arc4.UInt64, | ||
axfer: puyapy.gtxn.AssetTransferTransaction, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def opt_in( | ||
self, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def bid( | ||
self, | ||
pay: puyapy.gtxn.PaymentTransaction, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def claim_bids( | ||
self, | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def claim_asset( | ||
self, | ||
asset: puyapy.Asset, | ||
) -> None: ... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is auto-generated, do not modify | ||
# flake8: noqa | ||
# fmt: off | ||
import typing | ||
|
||
import puyapy | ||
|
||
|
||
class HelloWorldContract(puyapy.arc4.ARC4Client, typing.Protocol): | ||
@puyapy.arc4.abimethod | ||
def hello( | ||
self, | ||
name: puyapy.arc4.String, | ||
) -> puyapy.arc4.String: ... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# This file is auto-generated, do not modify | ||
# flake8: noqa | ||
# fmt: off | ||
import typing | ||
|
||
import puyapy | ||
|
||
|
||
class MerkleTree(puyapy.arc4.ARC4Client, typing.Protocol): | ||
@puyapy.arc4.abimethod(create=True) | ||
def create( | ||
self, | ||
root: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]], | ||
) -> None: ... | ||
|
||
@puyapy.arc4.abimethod | ||
def verify( | ||
self, | ||
proof: puyapy.arc4.DynamicArray[puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]]], | ||
leaf: puyapy.arc4.StaticArray[puyapy.arc4.Byte, typing.Literal[32]], | ||
) -> puyapy.arc4.Bool: ... |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.