Skip to content

Instantly share code, notes, and snippets.

@kctam
kctam / asa_checkBoth.js
Created Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_checkBoth.js
const algosdk=require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
var aliceAddress = '5SL7MUMPYFNDBHUD4L7J4LJRQCQWXQUD3RDK7SBGIDWPH3ZFK47BTH43HE'; // change to yours
var bobAddress = 'BDGUP3RKI3DJVM327B3R4SYT6PQUJBMDMQWHQICKSEQQT6PWCMNAYWEY4M'; // change to yours
@kctam
kctam / asa_bobRemoveOptIn.js
Created Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_bobRemoveOptIn.js
const algosdk = require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY"
};
var bob_mnemonic = "truth erase *** above magic"; // fill in yours
@kctam
kctam / asa_aliceDestroy.js
Last active Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_aliceDestroy.js
const algosdk = require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
var alice_mnemonic = "cash riot *** able can"; // fill in yours
var aliceAccount = algosdk.mnemonicToSecretKey(alice_mnemonic);
@kctam
kctam / asa_bobOptIn.js
Created Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_bobOptIn.js
const algosdk = require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
var bob_mnemonic = "truth erase *** above magic"; // fill in yours
var bobAccount = algosdk.mnemonicToSecretKey(bob_mnemonic);
@kctam
kctam / asa_aliceSendToBob.js
Created Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_aliceSendToBob.js
const algosdk = require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
var alice_mnemonic = "cash riot *** able can"; // fill in yours
var aliceAccount = algosdk.mnemonicToSecretKey(alice_mnemonic);
@kctam
kctam / asa_aliceCreate.js
Created Dec 18, 2020
Algorand ASA demo in JavaScript SDK
View asa_aliceCreate.js
const algosdk = require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
var alice_mnemonic = "cash riot *** able can"; // fill in yours
var aliceAccount = algosdk.mnemonicToSecretKey(alice_mnemonic);
@kctam
kctam / main.go
Created Nov 25, 2020
Sample chaincode (adapted from SACC) for BSN TestNet
View main.go
/*
* Copyright IBM Corp All Rights Reserved
*
* SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"fmt"
@kctam
kctam / ccctest.go
Created Nov 21, 2020
Testing chaincode for InvokeChaincode()
View ccctest.go
/*
* Copyright IBM Corp All Rights Reserved
*
* SPDX-License-Identifier: Apache-2.0
*/
package main
import (
"fmt"
@kctam
kctam / send_algos.js
Created Nov 9, 2020
Algorand demonstration with JS SDK
View send_algos.js
const algosdk=require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY"
};
let client=new algosdk.Algodv2(token,server,port);
let mnemonic1='attract unit *** above trip'; // 25-word mnemonic
@kctam
kctam / check_balance.js
Created Nov 9, 2020
Algorand demonstration with JS SDK
View check_balance.js
const algosdk=require('algosdk');
const server="https://testnet-algorand.api.purestake.io/ps2";
const port="";
const token={
"x-api-key": "mV *** BY" // fill in yours
};
let client=new algosdk.Algodv2(token,server,port);