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
0
votes
1 answer

Validate Aptos account address in javascript

I made an app that returns user assets from the Aptos blockchain. In the app, I have a form for the user's address. My goal is to validate that address using RegExp or something like that. I have this code: const address =…
Cosmin Ciolacu
  • 406
  • 9
  • 29
0
votes
1 answer

Aptos Move conflicting dependencies of imported dependencies

I have two dependencies that I need, they both created a module called U256 with different addresses. is there a way to fix this dependency conflict? Unable to resolve package dependency 'U256': Conflicting dependencies found: package 'U256'…
Bob Sfog
  • 105
  • 8
0
votes
1 answer

Aptos SDK - multiple payloads in one transaction

Sending one payload is easy, for example: let payload1 = txBuilder.buildTransactionPayload("0x1::aptos_account::transfer",[],[to.address(),100000]) let raw = await client.generateRawTransaction(acc.address(),payload1) let signed = await…
Bob Sfog
  • 105
  • 8
0
votes
2 answers

how to pass an Option to arguments when submitting an aptos transaction from TypeScript

In TypeScript, an aptos transaction payload is like this: const payload = { type: "entry_function_payload", function: `xxx`, type_arguments: [], arguments: [str1, str2], }; In order to call the below entry function from TypeScript: public…
0xbe1
  • 15
  • 4
0
votes
1 answer

How do I get all the keys in a table?

Assume I have a table deployed on chain. I know if I have a key, I can lookup the value like this: Given a key, how do I read the value from a table via the API? But what if I don't know the key? How do I lookup all the keys in a table via the API?
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
0
votes
2 answers

How do I transfer APT to an account that doesn't exist on-chain yet?

As I understand it, if you transfer APT to an account that doesn't exist on-chain yet, doing so will create the account on-chain. I've been trying to use 0x1::coin::transfer, but that doesn't seem to work. Move abort in 0x1::coin:…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
0
votes
1 answer

How do I use a dependency just for tests?

Move is generally pretty Rust-like, the syntax for using dependencies looks very similar: use aptos_framework::aptos_account; As such, I'd expect that if I want to use something only in tests, I'd do this: #[cfg(test)] use…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
0
votes
1 answer

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

Imagine I have a move module that looks like this. Move.toml [package] name = 'friends' version = '1.0.0' [dependencies.AptosFramework] git = 'https://github.com/aptos-labs/aptos-core.git' rev = 'testnet' subdir =…
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
0
votes
1 answer

Checking if a parameter is a literal string in sui move

I want to check if a field: string::String in a struct is the exact string. struct A has key, store { id: UID, field: string::String, } public entry fun is_field_hello(a: &A): bool { a.field == 'hello' } This is the compiler error I…
Jim
  • 450
  • 2
  • 10
-1
votes
1 answer

How to send a transaction to Aptos using Petra Wallet?

This is the code I am testing which I got from petra docs. const wallet = getAptosWallet(); // see "Connecting" // Example Transaction, following an…
JohnVersus
  • 123
  • 1
  • 10
-1
votes
1 answer

How to sign transaction on the client side and then submit it on the server side on the Aptos

I am writing a app, where user can deposit APT coins and receive points in the app. So, I have to be 100% sure that the user has transferred APT to the escrow, in order to give him points. What I want to do is to sign transfer transaction on the…
johames
  • 13
  • 1
-2
votes
1 answer

get nfts owned by an account in aptos

i have been trying to get the nfts of an account on aptos testnet but i couldn't figure out how to do so. i tried using https://fullnode.testnet.aptoslabs.com/v1/accounts/:ACCOUNT_ADDRESS/resources but i can not understand the output it is…
-2
votes
1 answer

What is different between Aptos devnet and testnet?

I'm starting to build a dapp on Aptos and I notice that there are two development networks, devnet and testnet. What are the differences between these two?
Daniel Porteous
  • 5,536
  • 3
  • 25
  • 44
-4
votes
1 answer

I want to know about Is chainlink supports aptos blockchain? If yes then please provide relevant developer docs

I want to know about Is chainlink supports aptos blockchain? If yes then please provide relevant developer docs. If not supported then is there any plans adopt aptos blockchain? Developer resources regarding chainlink support for aptos blockchain.…
1 2
3