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