Skip to content

Commit

Permalink
refactor: support client gen from ARC-56
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-makerx committed Nov 1, 2024
1 parent 310a47b commit f6551fb
Show file tree
Hide file tree
Showing 66 changed files with 936 additions and 839 deletions.
36 changes: 18 additions & 18 deletions examples/amm/out/ConstantProductAMM.arc56.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"arcs": [
22,
28
],
"name": "ConstantProductAMM",
"structs": {},
"methods": [
Expand All @@ -24,9 +20,9 @@
]
},
"readonly": false,
"desc": "sets the governor of the contract, may only be called by the current governor",
"events": [],
"recommendations": {},
"desc": "sets the governor of the contract, may only be called by the current governor"
"recommendations": {}
},
{
"name": "bootstrap",
Expand Down Expand Up @@ -58,9 +54,9 @@
]
},
"readonly": false,
"desc": "bootstraps the contract by opting into the assets and creating the pool token.\nNote this method will fail if it is attempted more than once on the same contract since the assets and pool token application state values are marked as static and cannot be overridden.",
"events": [],
"recommendations": {},
"desc": "bootstraps the contract by opting into the assets and creating the pool token.\nNote this method will fail if it is attempted more than once on the same contract since the assets and pool token application state values are marked as static and cannot be overridden."
"recommendations": {}
},
{
"name": "mint",
Expand Down Expand Up @@ -116,9 +112,9 @@
]
},
"readonly": false,
"desc": "mint pool tokens given some amount of asset A and asset B.\nGiven some amount of Asset A and Asset B in the transfers, mint some number of pool tokens commensurate with the pools current balance and circulating supply of pool tokens.",
"events": [],
"recommendations": {},
"desc": "mint pool tokens given some amount of asset A and asset B.\nGiven some amount of Asset A and Asset B in the transfers, mint some number of pool tokens commensurate with the pools current balance and circulating supply of pool tokens."
"recommendations": {}
},
{
"name": "burn",
Expand Down Expand Up @@ -169,9 +165,9 @@
]
},
"readonly": false,
"desc": "burn pool tokens to get back some amount of asset A and asset B",
"events": [],
"recommendations": {},
"desc": "burn pool tokens to get back some amount of asset A and asset B"
"recommendations": {}
},
{
"name": "swap",
Expand Down Expand Up @@ -212,11 +208,16 @@
]
},
"readonly": false,
"desc": "Swap some amount of either asset A or asset B for the other",
"events": [],
"recommendations": {},
"desc": "Swap some amount of either asset A or asset B for the other"
"recommendations": {}
}
],
"arcs": [
22,
28
],
"networks": {},
"state": {
"schema": {
"global": {
Expand Down Expand Up @@ -271,9 +272,6 @@
],
"call": []
},
"events": [],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
Expand Down Expand Up @@ -502,5 +500,7 @@
"minor": 99,
"patch": 99
}
}
},
"events": [],
"templateVariables": {}
}
6 changes: 3 additions & 3 deletions examples/amm/out/client_ConstantProductAMM.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def bootstrap(
b_asset: algopy.Asset,
) -> algopy.arc4.UIntN[typing.Literal[64]]: ...

@algopy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'})
@algopy.arc4.abimethod
def mint(
self,
a_xfer: algopy.gtxn.AssetTransferTransaction,
Expand All @@ -31,7 +31,7 @@ def mint(
b_asset: algopy.Asset,
) -> None: ...

@algopy.arc4.abimethod(default_args={'pool_asset': 'pool_token', 'a_asset': 'asset_a', 'b_asset': 'asset_b'})
@algopy.arc4.abimethod
def burn(
self,
pool_xfer: algopy.gtxn.AssetTransferTransaction,
Expand All @@ -40,7 +40,7 @@ def burn(
b_asset: algopy.Asset,
) -> None: ...

@algopy.arc4.abimethod(default_args={'a_asset': 'asset_a', 'b_asset': 'asset_b'})
@algopy.arc4.abimethod
def swap(
self,
swap_xfer: algopy.gtxn.AssetTransferTransaction,
Expand Down
96 changes: 48 additions & 48 deletions examples/arc_28/out/EventEmitter.arc56.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"arcs": [
22,
28
],
"name": "EventEmitter",
"structs": {},
"methods": [
Expand Down Expand Up @@ -98,6 +94,11 @@
"recommendations": {}
}
],
"arcs": [
22,
28
],
"networks": {},
"state": {
"schema": {
"global": {
Expand Down Expand Up @@ -126,49 +127,6 @@
],
"call": []
},
"events": [
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "a"
},
{
"type": "uint64",
"name": "b"
}
]
},
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "field1"
},
{
"type": "uint64",
"name": "field2"
}
]
},
{
"name": "AnEvent",
"args": [
{
"type": "ufixed256x16",
"name": "field1"
},
{
"type": "ufixed64x2",
"name": "field2"
}
]
}
],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
Expand Down Expand Up @@ -215,5 +173,47 @@
"minor": 99,
"patch": 99
}
}
},
"events": [
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "a"
},
{
"type": "uint64",
"name": "b"
}
]
},
{
"name": "Swapped",
"args": [
{
"type": "uint64",
"name": "field1"
},
{
"type": "uint64",
"name": "field2"
}
]
},
{
"name": "AnEvent",
"args": [
{
"type": "ufixed256x16",
"name": "field1"
},
{
"type": "ufixed64x2",
"name": "field2"
}
]
}
],
"templateVariables": {}
}
16 changes: 8 additions & 8 deletions examples/auction/out/Auction.arc56.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"arcs": [
22,
28
],
"name": "Auction",
"structs": {},
"methods": [
Expand Down Expand Up @@ -131,6 +127,11 @@
"recommendations": {}
}
],
"arcs": [
22,
28
],
"networks": {},
"state": {
"schema": {
"global": {
Expand Down Expand Up @@ -192,9 +193,6 @@
],
"call": []
},
"events": [],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
Expand Down Expand Up @@ -356,5 +354,7 @@
"minor": 99,
"patch": 99
}
}
},
"events": [],
"templateVariables": {}
}
16 changes: 8 additions & 8 deletions examples/box_storage/out/BoxContract.arc56.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"arcs": [
22,
28
],
"name": "BoxContract",
"structs": {},
"methods": [
Expand Down Expand Up @@ -252,6 +248,11 @@
"recommendations": {}
}
],
"arcs": [
22,
28
],
"networks": {},
"state": {
"schema": {
"global": {
Expand Down Expand Up @@ -312,9 +313,6 @@
],
"call": []
},
"events": [],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
Expand Down Expand Up @@ -471,5 +469,7 @@
"minor": 99,
"patch": 99
}
}
},
"events": [],
"templateVariables": {}
}
16 changes: 8 additions & 8 deletions examples/hello_world_arc4/out/HelloWorldContract.arc56.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
{
"arcs": [
22,
28
],
"name": "HelloWorldContract",
"structs": {},
"methods": [
Expand All @@ -28,6 +24,11 @@
"recommendations": {}
}
],
"arcs": [
22,
28
],
"networks": {},
"state": {
"schema": {
"global": {
Expand Down Expand Up @@ -56,9 +57,6 @@
],
"call": []
},
"events": [],
"templateVariables": {},
"networks": {},
"sourceInfo": {
"approval": {
"sourceInfo": [
Expand Down Expand Up @@ -103,5 +101,7 @@
"minor": 99,
"patch": 99
}
}
},
"events": [],
"templateVariables": {}
}
Loading

0 comments on commit f6551fb

Please sign in to comment.