Skip to content

Instantly share code, notes, and snippets.

@bthaile
Last active October 21, 2022 17:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bthaile/bb6d57c6afcfadb7a5de33ac228bebca to your computer and use it in GitHub Desktop.
Save bthaile/bb6d57c6afcfadb7a5de33ac228bebca to your computer and use it in GitHub Desktop.
can't get Flow account balances
"0x2aef436ae96cec3"
Trying to get account informatio fails
https://flow-view-source.com/mainnet/account/0x2aef436ae96cec3/keys
```
import FungibleToken from 0xFungibleToken
pub fun main(addr: Address): UFix64 {
let cap = getAccount(addr)
.getCapability<&{FungibleToken.Balance}>(${PATH})
if let moneys = cap.borrow() {
return moneys.balance
} else {
return UFix64(0.0)
}
}
```
Error: failed to execute the script on the execution node execution
Also, `const info = await fcl.account("2aef436ae96cec3").catch(e => console.log(e));` throws error
```
HTTP Request Error:
HTTP Request Error: An error occurred when interacting with the Access API.
error=invalid address
hostname=https://rest-mainnet.onflow.org
path=/v1/accounts/2aef436ae96cec3?block_height=sealed&expand=contracts,keys
method=GET
responseBody={"code":400,"message":"invalid address"}
statusCode=400
...
```
Also flowscan fails to get the account information
https://flowscan.org/account/0x2aef436ae96cec3
No issue getting account flow balance using flow-cli
> flow accounts get 0x2aef436ae96cec3 --network mainnet
Address 0x02aef436ae96cec3
Balance 0.74146906
Keys 1
Key 0 Public Key a6766c11132fd3bd948c9ef40ed0fe4f53c2bd4440dbff200010fc827cbe611597b382b423b249f6ab0289e3e8265b44e3d09686bd7a362d0fcd4e695cef41e2
Weight 1000
Signature Algorithm ECDSA_P256
Hash Algorithm SHA2_256
Revoked false
Sequence Number 46
Index 0
Contracts Deployed: 0
Contracts (hidden, use --include contracts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment