|
@@ -54,7 +54,7 @@ async function handle_wallet(wallet_connection: WalletConnection, near_connectio
|
54
|
54
|
let accessKeys = await account.getAccessKeys();
|
55
|
55
|
let found = accessKeys.find(key => key.public_key.toString() == keypair.getPublicKey().toString());
|
56
|
56
|
|
57
|
|
- let config = new ProvisionerConfig("contract2.demoacc.testnet", "https://rpc.testnet.near.org", "http://127.0.0.1:3000");
|
|
57
|
+ let config = new ProvisionerConfig("contract2.demoacc.testnet", "https://rpc.testnet.near.org", "http://servtest.relayz.io:3000");
|
58
|
58
|
let provisioner = new KeyProvisioner(keypair.toString(), BigInt(found.access_key.nonce), account_id.toString(), config);
|
59
|
59
|
|
60
|
60
|
console.log("KeyPair: ", keypair.getPublicKey().toString());
|
|
@@ -65,8 +65,10 @@ async function handle_wallet(wallet_connection: WalletConnection, near_connectio
|
65
|
65
|
if (participants.length > 0) {
|
66
|
66
|
console.log("Participants: " + participants);
|
67
|
67
|
provisioner.init(new Set(participants.split(","))).then((id) => {
|
|
68
|
+ (document.getElementById("meeting_id_label") as HTMLSpanElement).textContent = id;
|
68
|
69
|
console.log("Meeting Id:", id);
|
69
|
70
|
provisioner.send_keys(id).then((secret_key) => {
|
|
71
|
+ (document.getElementById("secret_id_label") as HTMLSpanElement).textContent = secret_key;
|
70
|
72
|
console.log("Secret Key" + secret_key);
|
71
|
73
|
}).catch((err) => {
|
72
|
74
|
console.log("Error: " + err.err_msg());
|
|
@@ -83,6 +85,7 @@ async function handle_wallet(wallet_connection: WalletConnection, near_connectio
|
83
|
85
|
if (meeting_id.length > 0) {
|
84
|
86
|
provisioner.push_to_near(meeting_id).then((id) => {
|
85
|
87
|
provisioner.get_key(meeting_id).then((secret_key) => {
|
|
88
|
+ (document.getElementById("secret_id_label") as HTMLSpanElement).textContent = secret_key;
|
86
|
89
|
console.log("Secret Key" + secret_key);
|
87
|
90
|
}).catch((err) => {
|
88
|
91
|
console.log("ErrorType: " + ErrorType[err.err_type()]);
|