Questions tagged [aptos]

Aptos is a community-focused Layer 1 blockchain with a public ledger. Questions should relate exclusively to programming on the Aptos blockchain. For other support, please go to the Aptos Discord: https://discord.com/invite/aptoslabs.

Aptos is an open source, public, permissionless blockchain. Aptos follows the key principles of scalability, safety, reliability, and upgradeability. Aptos supports the Move programming language for creation of easy-to-use smart contracts and enables high throughout of transactions on-chain. The Aptos blockchain is now in mainnet and handling public transactions. Find the technical docs at: https://aptos.dev/.

44 questions
1
vote
1 answer

How do I execute a Move script on Aptos using the Rust SDK?

I want to execute this Move script, e.g. at sources/top_up.move: script { use std::signer; use aptos_framework::aptos_account; use aptos_framework::aptos_coin; use aptos_framework::coin; fun main(src: &signer, dest: address,…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
1
vote
1 answer

why do `coin::initialize` enforce `coin_address == account_addr`?

In coin.move: assert!( coin_address() == account_addr, error::invalid_argument(ECOIN_INFO_ADDRESS_MISMATCH), ); My guess is it prevents account A from initializing coins on behalf of account B to avoid scam? But look forward to…
0xbe1
  • 15
  • 4
1
vote
1 answer

Getting error MODULE_ADDRESS_DOES_NOT_MATCH_SENDER when publishing Move (language) module

I have published a module. It has a function which publishes another module. When I try to call this function the transaction commits with error MODULE_ADDRESS_DOES_NOT_MATCH_SENDER. My code uses account::create_resource_account to create the future…
1
vote
1 answer

Aptos sdk transaction_argument

I have made a bot in python for minting, but there is one problem. When I'm sending args in payload for contract, It's sending this: But when I do a manual mint, arguments are in string and not bytes¨ I'm using aptos_sdk
1
vote
3 answers

Aptos: All transactions are giving errors

I'm new to Aptos network. I'm gettin error on any kind of operation via any kind of wallet. I've tried same actions via my friends pc and his wallet and everything was working correctly. Tried to change browser and new account.
magnagag
  • 94
  • 8
0
votes
1 answer

Aptos: Get address from privateKey

I need a code for 'aptos' js npm module to get the address from a privatekey. I have the next code to get the address from a PublicKey: const { HexString, TxnBuilderTypes } = require("aptos") let pubKey =…
Udbdjfj
  • 27
  • 2
0
votes
1 answer

How to calculate the Voting Power of any validator address?

I am confused in how to calculate the voting power for any validator address. I am thinking and it also seems like we have to add the active and pending_inactive value. For ex: for address:…
0
votes
1 answer

Could not infer this type. Try adding an annotation

This is the code fragment from here. public fun publish_balance(account: &signer) { let empty_coin = Coin { value: 0 }; assert!(!exists>(signer::address_of(account)), EALREADY_HAS_BALANCE); …
MikhilMC
  • 949
  • 3
  • 8
  • 14
0
votes
1 answer

is there constructor function in move programming language?

Is there any kind of a constructor like function, which will run at the time of deployment in move programming language?
MikhilMC
  • 949
  • 3
  • 8
  • 14
0
votes
0 answers

Aptos move compilation error: Duplicate definition for module

I set up an Aptos local testnet and try to publish a module using Aptos move CLI, but it always fail on compilation with an error: duplicate declaration, item, or annotation. Duplicate definition for module. However, the move source code only…
0
votes
1 answer

How are events ordered within a transaction

I've got a question regarding events. More specifically I've been reading this https://aptos.dev/concepts/events/ and came across the following sentence. These represent event streams, or a list of events with each entry containing a sequentially…
ppoliani
  • 4,792
  • 3
  • 34
  • 62
0
votes
1 answer

Get signer of a contract inside a function

I need to somehow transfer APT coins to another account from smart contract itself. Here is an issue, because transfer function needs &signer of an sender and that's why I can not send it from contract. Is there any chance that I can send APT…
AndRockSYS
  • 11
  • 2
0
votes
0 answers

Given a key, how do I read the value from a iterable table via the API?

I have a struct like this: struct MarketData { markets: IterableTable\ , whitelist: IterableTable\, isOpenForAll: u64 } Given a key, how do I read the value from an iterable table via the API? I tried but got this…
0
votes
1 answer

How can I get json format ABI from aptos module compiled?

After deploy aptos contract , I want to get the contract json format abi. I found that the transaction payload , changes field can get json format abi. Such as…
莫海江
  • 11
  • 1
0
votes
0 answers

Aptos event types and the Pool address

There are few events involved in a transaction of Aptos and I am confused of the values that are involved in the events also the addresses that we have. This transaction event is for the block 31875281 and the version 85199827 Also what does a pool…