docs: update examples
This commit is contained in:
parent
f20013a010
commit
64658c33ee
|
@ -9,7 +9,7 @@
|
|||
|
||||
<script src="../lib/index.iife.js"></script>
|
||||
<!--
|
||||
<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.0.6/solanaWeb3.min.js"></script>
|
||||
<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.11.10/solanaWeb3.min.js"></script>
|
||||
-->
|
||||
|
||||
<script>
|
||||
|
|
|
@ -11,6 +11,8 @@ extern bool entrypoint(const uint8_t *input) {
|
|||
const uint8_t *data;
|
||||
uint64_t data_len;
|
||||
|
||||
sol_log("Hello World");
|
||||
|
||||
if (!sol_deserialize(input, ka, SOL_ARRAY_SIZE(ka), &ka_len, &data, &data_len)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Create a new account</title>
|
||||
<title>Get account balance</title>
|
||||
</head>
|
||||
<body>
|
||||
<b>Account</b>
|
||||
|
@ -11,7 +11,7 @@
|
|||
|
||||
<script src="../lib/index.iife.js"></script>
|
||||
<!--
|
||||
<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.0.6/solanaWeb3.min.js"></script>
|
||||
<script src="https://github.com/solana-labs/solana-web3.js/releases/download/v0.11.10/solanaWeb3.min.js"></script>
|
||||
-->
|
||||
|
||||
<script>
|
||||
|
@ -23,9 +23,8 @@
|
|||
accountPublicKey.innerHTML = account.publicKey;
|
||||
|
||||
// Fetch account balance
|
||||
let url;
|
||||
url = 'http://localhost:8899';
|
||||
//url = 'http://testnet.solana.com:8899';
|
||||
let url = 'http://localhost:8899';
|
||||
//url = 'https://api.testnet.solana.com';
|
||||
const connection = new solanaWeb3.Connection(url);
|
||||
|
||||
connection.getBalance(account.publicKey)
|
||||
|
@ -34,7 +33,6 @@
|
|||
accountBalance.innerHTML = balance;
|
||||
console.log(`${account.publicKey} has a balance of ${balance}`);
|
||||
});
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -9,8 +9,8 @@ const solanaWeb3 = require('..');
|
|||
const account = new solanaWeb3.Account();
|
||||
|
||||
let url;
|
||||
url = 'http://localhost:8899';
|
||||
//url = 'http://testnet.solana.com:8899';
|
||||
url = 'https://api.testnet.solana.com';
|
||||
//url = 'http://localhost:8899';
|
||||
const connection = new solanaWeb3.Connection(url);
|
||||
|
||||
connection.getBalance(account.publicKey).then(balance => {
|
||||
|
|
Loading…
Reference in New Issue