-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to set a objectid ("Mutable", bool), Mutable = False? #104
Comments
@FrankC01 Thank you very much if you can help me |
What network What is the signature of function you are calling? I verified that both the Clock and your second argument and they are marked "mutable" true in mainnet |
here is the soucre code
here is the error
I want to use this code to buy token. |
To start with, explicitly setting/using
Instead of Use this and then put the results in a comment below: inspect_result: TxInspectionResult = txn.inspect_all()
if inspect_result:
print(f"Gas total: {inspect_result.effects.gas_used.total}", end="")
print(f" after rebate: {inspect_result.effects.gas_used.total_after_rebate}")
print(inspect_result.to_json(indent=2))
else:
print("Inspection failed!") |
Here is the output.
It seems the code can work but I cant sent it out. |
Sorry, could you also add this before the inspect and add in comment below?
|
Ok,here is the output.
|
Right so notice that Input 0 has no value because that We are working on an enhancement to be able to do something like So, in the short term, you could specify an exact coin ID as in: swap_tx = txn.move_call(
target="0xec38920815116f74c344f3e0497e9073f9f88b9f2bd2505284bb5f9d46cea200::interface::swap_with_point",
arguments=[
ObjectID("0x0000000000000000000000000000000000000000000000000000000000000006"),
ObjectID("0x3083e3d751360c9084ba33f6d9e1ad38fb2a11cffc151f2ee4a5c03da61fb1e2"),
ObjectID("0xSOME_COIN_ID"), # <- Specify and actual Coin id here
SuiU64("0"),
],
type_arguments=[
"0x2::sui::SUI",
"0x83e6571118eaca12d7d428ae06341a8063711bc9983e0d6cefb3790a26b9d62c::SDOGE::SDOGE",
],
)
|
Sorry that I can not understand how to fix it...
And my code can work when I usding another swap by similar code. https://suiscan.xyz/mainnet/tx/773CJYEHwRYDcCQgmATJVUDh27bX4tHGCGxsCCzRtehr
The different between this two swap is that the second one dont need to sent Object(0x64) |
Again, doing this net = Argument("NestedResult",(0,0))
txn.split_coin(coin=Argument("GasCoin"), amounts=[100]) In your code is the issue... |
Ok, I am sorry that I still dont konw how to input a NestedResult and how to split_coin. |
Try this instead: coin = txn.split_coin(coin=Argument("GasCoin"), amounts=[100])
swap_tx = txn.move_call(
target="0xec38920815116f74c344f3e0497e9073f9f88b9f2bd2505284bb5f9d46cea200::interface::swap_with_point",
arguments=[
ObjectID("0x0000000000000000000000000000000000000000000000000000000000000006"),
ObjectID("0x3083e3d751360c9084ba33f6d9e1ad38fb2a11cffc151f2ee4a5c03da61fb1e2"),
coin,
SuiU64("0"),
],
type_arguments=[
"0x2::sui::SUI",
"0x83e6571118eaca12d7d428ae06341a8063711bc9983e0d6cefb3790a26b9d62c::SDOGE::SDOGE",
],
)
``` |
I try it and also get this error.
|
Ok, this issue is not with the gas but with the Clock argument. The I need to take this up with MystenLab and should resolve hopefully today. |
I did a local change in the SDK and seems to be working. Just waiting for Mysten (Sui) to confirm the logic. Thank you for your patience. |
Thanks a lot for your help! |
Pushed update 0.20.2 (to PyPi as well) |
I get ImmutableParameterExpectedError when I am execute a move_call.
arguments=[
# SuiU64("100"),
ObjectID("0x0000000000000000000000000000000000000000000000000000000000000006"),
ObjectID("0x3083e3d751360c9084ba33f6d9e1ad38fb2a11cffc151f2ee4a5c03da61fb1e2"),
net,
SuiU64("0"),
],
And I run print(txn.builder.finish_for_inspect()).
But Mutable should be False, how can I change it?
The text was updated successfully, but these errors were encountered: