wormhole/staging/algorand/lib/pricecaster.js

588 lines
21 KiB
JavaScript
Raw Normal View History

/**
*
* Pricecaster Service Utility Library.
*
* Copyright 2022 Wormhole Project Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
2021-10-01 07:00:20 -07:00
const algosdk = require('algosdk')
const fs = require('fs')
2021-10-04 13:12:25 -07:00
// eslint-disable-next-line camelcase
const tools = require('../tools/app-tools')
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
const crypto = require('crypto')
const ContractInfo = {
pricekeeper: {
approvalProgramFile: 'teal/wormhole/build/pricekeeper-v2-approval.teal',
clearStateProgramFile: 'teal/wormhole/build/pricekeeper-v2-clear.teal',
compiledApproval: {
bytes: undefined,
hash: undefined
},
compiledClearState: {
bytes: undefined,
hash: undefined
},
appId: 0
},
vaaProcessor: {
approvalProgramFile: 'teal/wormhole/build/vaa-processor-approval.teal',
clearStateProgramFile: 'teal/wormhole/build/vaa-processor-clear.teal',
approvalProgramHash: '',
compiledApproval: {
bytes: undefined,
hash: undefined
},
compiledClearState: {
bytes: undefined,
hash: undefined
},
appId: 0
}
}
2021-10-01 07:00:20 -07:00
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
// --------------------------------------------------------------------------------------
2021-10-01 07:00:20 -07:00
class PricecasterLib {
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
constructor(algodClient, ownerAddr = undefined) {
2021-10-01 07:00:20 -07:00
this.algodClient = algodClient
this.ownerAddr = ownerAddr
this.minFee = 1000
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.groupTxSet = {}
this.lsigs = {}
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.dumpFailedTx = false
this.dumpFailedTxDirectory = './'
/** Set the file dumping feature on failed group transactions
* @param {boolean} f Set to true to enable function, false to disable.
*/
this.enableDumpFailedTx = function (f) {
this.dumpFailedTx = f
}
2021-10-01 07:00:20 -07:00
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
/** Set the file dumping feature output directory
* @param {string} dir The output directory.
*/
this.setDumpFailedTxDirectory = function (dir) {
this.dumpFailedTxDirectory = dir
}
/** Sets a contract approval program filename
2021-11-09 18:51:29 -08:00
* @param {string} filename New file name to use.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.setApprovalProgramFile = function (contract, filename) {
ContractInfo[contract].approvalProgramFile = filename
2021-11-09 18:51:29 -08:00
}
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
/** Sets a contract clear state program filename
2021-11-09 18:51:29 -08:00
* @param {string} filename New file name to use.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.setClearStateProgramFile = function (contract, filename) {
ContractInfo[contract].clearStateProgramFile = filename
}
/**
* Set Application Id for a contract.
* @param {number} applicationId application id
* @returns {void}
*/
this.setAppId = function (contract, applicationId) {
ContractInfo[contract].appId = applicationId
2021-11-09 18:51:29 -08:00
}
2021-10-01 07:00:20 -07:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Get the Application id for a specific contract
* @returns The requested application Id
*/
this.getAppId = function (contract) {
return ContractInfo[contract].appId
2021-10-01 07:00:20 -07:00
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Get minimum fee to pay for transactions.
* @return {Number} minimum transaction fee
*/
2021-10-01 07:00:20 -07:00
this.minTransactionFee = function () {
return this.minFee
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Internal function.
* Read application local state related to the account.
* @param {String} accountAddr account to retrieve local state
* @return {Array} an array containing all the {key: value} pairs of the local state
*/
2021-10-01 07:00:20 -07:00
this.readLocalState = function (accountAddr) {
return tools.readAppLocalState(this.algodClient, this.appId, accountAddr)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Internal function.
* Read application global state.
* @return {Array} an array containing all the {key: value} pairs of the global state
* @returns {void}
*/
2021-10-01 07:00:20 -07:00
this.readGlobalState = function () {
return tools.readAppGlobalState(this.algodClient, this.appId, this.ownerAddr)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Print local state of accountAddr on stdout.
* @param {String} accountAddr account to retrieve local state
* @returns {void}
*/
2021-10-01 07:00:20 -07:00
this.printLocalState = async function (accountAddr) {
await tools.printAppLocalState(this.algodClient, this.appId, accountAddr)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Print application global state on stdout.
* @returns {void}
*/
2021-10-01 07:00:20 -07:00
this.printGlobalState = async function () {
await tools.printAppGlobalState(this.algodClient, this.appId, this.ownerAddr)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Internal function.
* Read application local state variable related to accountAddr.
* @param {String} accountAddr account to retrieve local state
* @param {String} key variable key to get the value associated
* @return {String/Number} it returns the value associated to the key that could be an address, a number or a
* base64 string containing a ByteArray
*/
2021-10-01 07:00:20 -07:00
this.readLocalStateByKey = function (accountAddr, key) {
return tools.readAppLocalStateByKey(this.algodClient, this.appId, accountAddr, key)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Internal function.
* Read application global state variable.
* @param {String} key variable key to get the value associated
* @return {String/Number} it returns the value associated to the key that could be an address,
* a number or a base64 string containing a ByteArray
*/
2021-10-01 07:00:20 -07:00
this.readGlobalStateByKey = function (key) {
return tools.readAppGlobalStateByKey(this.algodClient, this.appId, this.ownerAddr, key)
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Compile program that programFilename contains.
* @param {String} programFilename filepath to the program to compile
* @return {String} base64 string containing the compiled program
*/
2021-10-01 07:00:20 -07:00
this.compileProgram = async function (programBytes) {
const compileResponse = await this.algodClient.compile(programBytes).do()
const compiledBytes = new Uint8Array(Buffer.from(compileResponse.result, 'base64'))
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
return { bytes: compiledBytes, hash: compileResponse.hash }
2021-11-08 14:42:02 -08:00
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Compile clear state program.
*/
this.compileClearProgram = async function (contract) {
const program = fs.readFileSync(ContractInfo[contract].clearStateProgramFile, 'utf8')
ContractInfo[contract].compiledClearState = await this.compileProgram(program)
2021-10-01 07:00:20 -07:00
}
2021-11-08 14:42:02 -08:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Compile approval program.
2021-11-08 14:42:02 -08:00
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.compileApprovalProgram = async function (contract) {
const program = fs.readFileSync(ContractInfo[contract].approvalProgramFile, 'utf8')
ContractInfo[contract].compiledApproval = await this.compileProgram(program)
2021-11-08 14:42:02 -08:00
}
2021-10-01 07:00:20 -07:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Helper function to retrieve the application id from a createApp transaction response.
* @param {Object} txResponse object containig the transactionResponse of the createApp call
* @return {Number} application id of the created application
*/
2021-10-01 07:00:20 -07:00
this.appIdFromCreateAppResponse = function (txResponse) {
return txResponse['application-index']
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Create an application based on the default approval and clearState programs or based on the specified files.
* @param {String} sender account used to sign the createApp transaction
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @return {String} transaction id of the created application
*/
this.createApp = async function (sender, contract, localInts, localBytes, globalInts, globalBytes, appArgs, signCallback) {
2021-10-01 07:00:20 -07:00
const onComplete = algosdk.OnApplicationComplete.NoOpOC
// get node suggested parameters
const params = await algodClient.getTransactionParams().do()
params.fee = this.minFee
params.flatFee = true
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
await this.compileApprovalProgram(contract)
await this.compileClearProgram(contract)
2021-10-01 07:00:20 -07:00
// create unsigned transaction
const txApp = algosdk.makeApplicationCreateTxn(
2021-11-08 14:42:02 -08:00
sender, params, onComplete,
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
ContractInfo[contract].compiledApproval.bytes,
ContractInfo[contract].compiledClearState.bytes,
2021-11-08 14:42:02 -08:00
localInts, localBytes, globalInts, globalBytes, appArgs
)
const txId = txApp.txID().toString()
// Sign the transaction
const txAppSigned = signCallback(sender, txApp)
// Submit the transaction
await algodClient.sendRawTransaction(txAppSigned).do()
return txId
}
/**
* Create the VAA Processor application based on the default approval and clearState programs or based on the specified files.
* @param {String} sender account used to sign the createApp transaction
* @param {String} gexpTime Guardian key set expiration time
* @param {String} gsindex Index of the guardian key set
2021-11-08 14:42:02 -08:00
* @param {String} gkeys Guardian keys listed as a single array
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @return {String} transaction id of the created application
*/
this.createVaaProcessorApp = async function (sender, gexpTime, gsindex, gkeys, signCallback) {
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
return await this.createApp(sender, 'vaaProcessor', 0, 0, 5, 20,
[new Uint8Array(Buffer.from(gkeys, 'hex')),
algosdk.encodeUint64(parseInt(gexpTime)),
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
algosdk.encodeUint64(parseInt(gsindex))], signCallback)
2021-10-01 07:00:20 -07:00
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Create the Pricekeeper application based on the default approval and clearState programs or based on the specified files.
* @param {String} sender account used to sign the createApp transaction
* @param {String} vaaProcessorAppId The application id of the VAA Processor program associated.
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @return {String} transaction id of the created application
*/
this.createPricekeeperApp = async function (sender, vaaProcessorAppId, signCallback) {
return await this.createApp(sender, 'pricekeeper', 0, 0, 1, 63,
[algosdk.encodeUint64(parseInt(vaaProcessorAppId))], signCallback)
2021-10-01 07:00:20 -07:00
}
/**
* Internal function.
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Call application specifying args and accounts.
* @param {String} sender caller address
* @param {Array} appArgs array of arguments to pass to application call
* @param {Array} appAccounts array of accounts to pass to application call
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @return {String} transaction id of the transaction
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.callApp = async function (sender, contract, appArgs, appAccounts, signCallback) {
// get node suggested parameters
const params = await this.algodClient.getTransactionParams().do()
params.fee = this.minFee
params.flatFee = true
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
// create unsigned transaction
const txApp = algosdk.makeApplicationNoOpTxn(sender, params, ContractInfo[contract].appId, appArgs, appAccounts.length === 0 ? undefined : appAccounts)
const txId = txApp.txID().toString()
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
// Sign the transaction
const txAppSigned = signCallback(sender, txApp)
// Submit the transaction
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
await this.algodClient.sendRawTransaction(txAppSigned).do()
return txId
}
2021-10-01 07:00:20 -07:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* ClearState sender. Remove all the sender associated local data.
* @param {String} sender account to ClearState
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @return {[String]} transaction id of one of the transactions of the group
*/
2021-10-01 07:00:20 -07:00
this.clearApp = async function (sender, signCallback, forcedAppId) {
// get node suggested parameters
const params = await this.algodClient.getTransactionParams().do()
params.fee = this.minFee
params.flatFee = true
let appId = this.appId
if (forcedAppId) {
appId = forcedAppId
}
// create unsigned transaction
const txApp = algosdk.makeApplicationClearStateTxn(sender, params, appId)
const txId = txApp.txID().toString()
// Sign the transaction
const txAppSigned = signCallback(sender, txApp)
// Submit the transaction
await this.algodClient.sendRawTransaction(txAppSigned).do()
return txId
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Permanent delete the application.
* @param {String} sender owner account
* @param {Function} signCallback callback with prototype signCallback(sender, tx) used to sign transactions
* @param {Function} applicationId use this application id instead of the one set
* @return {String} transaction id of one of the transactions of the group
*/
this.deleteApp = async function (sender, signCallback, applicationId) {
// get node suggested parameters
const params = await this.algodClient.getTransactionParams().do()
params.fee = this.minFee
params.flatFee = true
if (!applicationId) {
applicationId = this.appId
}
// create unsigned transaction
const txApp = algosdk.makeApplicationDeleteTxn(sender, params, applicationId)
const txId = txApp.txID().toString()
// Sign the transaction
const txAppSigned = signCallback(sender, txApp)
// Submit the transaction
await this.algodClient.sendRawTransaction(txAppSigned).do()
return txId
}
2021-10-01 07:00:20 -07:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Helper function to wait until transaction txId is included in a block/round.
* @param {String} txId transaction id to wait for
* @return {VOID} VOID
*/
2021-10-01 07:00:20 -07:00
this.waitForConfirmation = async function (txId) {
const status = (await this.algodClient.status().do())
let lastRound = status['last-round']
// eslint-disable-next-line no-constant-condition
while (true) {
const pendingInfo = await this.algodClient.pendingTransactionInformation(txId).do()
if (pendingInfo['confirmed-round'] !== null && pendingInfo['confirmed-round'] > 0) {
// Got the completed Transaction
return pendingInfo['confirmed-round']
}
lastRound += 1
await this.algodClient.statusAfterBlock(lastRound).do()
}
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Helper function to wait until transaction txId is included in a block/round
* and returns the transaction response associated to the transaction.
* @param {String} txId transaction id to get transaction response
* @return {Object} returns an object containing response information
*/
2021-10-01 07:00:20 -07:00
this.waitForTransactionResponse = async function (txId) {
// Wait for confirmation
await this.waitForConfirmation(txId)
// display results
return this.algodClient.pendingTransactionInformation(txId).do()
}
2021-10-01 13:30:45 -07:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* VAA Processor: Sets the stateless logic program hash
2021-10-01 13:30:45 -07:00
* @param {*} sender Sender account
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* @param {*} hash The stateless logic program hash
* @returns Transaction identifier.
2021-10-01 13:30:45 -07:00
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.setVAAVerifyProgramHash = async function (sender, hash, signCallback) {
if (!algosdk.isValidAddress(sender)) {
throw new Error('Invalid sender address: ' + sender)
}
const appArgs = []
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
appArgs.push(new Uint8Array(Buffer.from('setvphash')),
algosdk.decodeAddress(hash).publicKey)
return await this.callApp(sender, 'vaaProcessor', appArgs, [], signCallback)
2021-10-01 13:30:45 -07:00
}
2021-11-09 18:51:29 -08:00
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* VAA Processor: Sets the authorized application id for last call
2021-11-09 18:51:29 -08:00
* @param {*} sender Sender account
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* @param {*} appId The assigned appId
2021-11-09 18:51:29 -08:00
* @returns Transaction identifier.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.setAuthorizedAppId = async function (sender, appId, signCallback) {
2021-11-09 18:51:29 -08:00
if (!algosdk.isValidAddress(sender)) {
throw new Error('Invalid sender address: ' + sender)
}
const appArgs = []
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
appArgs.push(new Uint8Array(Buffer.from('setauthid')),
algosdk.encodeUint64(appId))
return await this.callApp(sender, 'vaaProcessor', appArgs, [], signCallback)
2021-11-09 18:51:29 -08:00
}
/**
* Starts a begin...commit section for commiting grouped transactions.
*/
2021-11-15 05:57:42 -08:00
this.beginTxGroup = function () {
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
const gid = crypto.randomBytes(16).toString('hex')
this.groupTxSet[gid] = []
return gid
}
/**
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* Adds a transaction to the group.
* @param {} tx Transaction to add.
*/
this.addTxToGroup = function (gid, tx) {
if (this.groupTxSet[gid] === undefined) {
throw new Error('unknown tx group id')
}
this.groupTxSet[gid].push(tx)
2021-11-15 05:57:42 -08:00
}
/**
* @param {*} sender The sender account.
* @param {function} signCallback The sign callback routine.
* @returns Transaction id.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.commitTxGroup = async function (gid, sender, signCallback) {
if (this.groupTxSet[gid] === undefined) {
throw new Error('unknown tx group id')
}
algosdk.assignGroupID(this.groupTxSet[gid])
// Sign the transactions
const signedTxns = []
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
for (const tx of this.groupTxSet[gid]) {
signedTxns.push(signCallback(sender, tx))
}
// Submit the transaction
const tx = await this.algodClient.sendRawTransaction(signedTxns).do()
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
delete this.groupTxSet[gid]
return tx.txId
}
/**
* @param {*} sender The sender account.
* @param {*} programBytes Compiled program bytes.
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
* @param {*} totalSignatureCount Total signatures present in the VAA.
* @param {*} sigSubsets An hex string with the signature subsets i..j for logicsig arguments.
* @param {*} lastTxSender The sender of the last TX in the group.
* @param {*} signCallback The signing callback function to use in the last TX of the group.
* @returns Transaction id.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.commitVerifyTxGroup = async function (gid, programBytes, totalSignatureCount, sigSubsets, lastTxSender, signCallback) {
if (this.groupTxSet[gid] === undefined) {
throw new Error('unknown group id')
}
algosdk.assignGroupID(this.groupTxSet[gid])
const signedGroup = []
let i = 0
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
for (const tx of this.groupTxSet[gid]) {
// All transactions except last must be signed by stateless code.
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
// console.log(`sigSubsets[${i}]: ${sigSubsets[i])
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
if (i === this.groupTxSet[gid].length - 1) {
signedGroup.push(signCallback(lastTxSender, tx))
} else {
const lsig = new algosdk.LogicSigAccount(programBytes, [Buffer.from(sigSubsets[i], 'hex'), algosdk.encodeUint64(totalSignatureCount)])
const stxn = algosdk.signLogicSigTransaction(tx, lsig)
signedGroup.push(stxn.blob)
}
i++
}
// Submit the transaction
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
let tx
try {
tx = await this.algodClient.sendRawTransaction(signedGroup).do()
} catch (e) {
if (this.dumpFailedTx) {
const id = tx ? tx.txId : Date.now().toString()
const filename = `${this.dumpFailedTxDirectory}/failed-${id}.stxn`
if (fs.existsSync(filename)) {
fs.unlinkSync(filename)
}
for (let i = 0; i < signedGroup.length; ++i) {
fs.appendFileSync(filename, signedGroup[i])
}
}
throw e
}
delete this.groupTxSet[gid]
return tx.txId
}
/**
* VAA Processor: Add a verification step to a transaction group.
* @param {*} sender The sender account (typically the VAA verification stateless program)
* @param {*} payload The VAA payload.
* @param {*} gksubset An hex string containing the keys for the guardian subset in this step.
* @param {*} totalguardians The total number of known guardians.
*/
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.addVerifyTx = function (gid, sender, params, payload, gksubset, totalguardians) {
if (this.groupTxSet[gid] === undefined) {
throw new Error('unknown group id')
}
const appArgs = []
appArgs.push(new Uint8Array(Buffer.from('verify')),
new Uint8Array(Buffer.from(gksubset.join(''), 'hex')),
algosdk.encodeUint64(parseInt(totalguardians)))
const tx = algosdk.makeApplicationNoOpTxn(sender,
params,
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
ContractInfo.vaaProcessor.appId,
appArgs, undefined, undefined, undefined,
new Uint8Array(payload))
Pricecaster V2-alpha (#716) * Removed unnecessary file. Change-Id: Ic85cb42fef37028bc99d266148fae35107d2cf5f * Update sample pyth VAA information on README Change-Id: I2a4d3b23bfbc525d25f3f0360605aece0c104f4b * Test and lib fixes. Change-Id: I4af5e0313ba04b322f428a15a19bc7b30c6ae027 * Check owner balance + Feed ALGOs to stateless account address. Change-Id: Ibf57c66b24153b917f5d33febff97a002c163b59 * Working VAA verification test. Change-Id: Ib44e96ce8979161cdf703b1c4c92742cdc3e9cae * Lot of new tests and a little refactoring. Change-Id: Ic1da9be0a91fc3ace136c80cc5b2329cb3bf2e77 * Removed parts of old Pricekeeper logic Change-Id: Id77f4366d30dac2b89d039cea9b115a46a189e2d * Proper fetching, parsing and unpacking of Pyth-Wormhole data Change-Id: Id3b5002f072873d8161fa619f387171483a3e66c * Pricekeeper V2 PyTEAL contract. Change-Id: Idc1771e1ade371f51befdfd36ab6add55b3081fc * Streamlined and refac support library. Removed old code. Change-Id: I1f9633700527b1e0ca5ea9a38d24d3960e3e2341 * Changes to successfully publish price in target contract. Change-Id: Ie346648cec5b7b0b70786c2a99373df9bf71633d * pclib: Concurrent internal group TXs supported. Change-Id: I78e16d0dbf71c86fbb6be61e956aa370a4c48130 * Fetching and publishing from Wormhole/Spy. Removed most of old Pricekeeper V1 functionality. Simplified code. Change-Id: I197436c52460c04143501a60e3db9609159e9f25 * README + Deployment tool updated Change-Id: Iaf1f76ce69ea303f734c2a79f529f60ebf55a4ca * Modifications to use compiled stateless program. Change-Id: Ibc294412728052c1e29c7df929b3d9e481d714be * Removed old settings file. Change-Id: I1b8ca64426983b0a56f55f99a69304aaca702fee * Implements Randlabs Logger (C3PROT-92) Change-Id: Ia527169dc56bb2622fcde2fcfad53ed2efb5f399 * STEPS updated to 8. Change-Id: I9b092bb321231cde003e12b5a68cf90404f670f8 * Fixed handling double-hashing Change-Id: I5695e2783d439a85a61af44cab03ba99898cb16b * Added option to dump failed TX and diagnostic information in README Change-Id: If3d7b068d8d408851bcaae443ff412dc9cc30c69 * Fixed chainId handling. Change-Id: Id798a2e7afc0d646a179e3bd682204ba738fa53a * Successfully push prices to priceKeeper V2. Change-Id: Ib04da78b819e17579677e0187c9f5bd6bb1e2feb * Fixed price output log Change-Id: I99df39a05c667b5eb1af6cda988326cd768f89ee * Update WIP Tests. Change-Id: I4c2f94306dcaab578c30e487ceb6c140ea902ac3 * Support for VAAs with minimal quorum (> 2/3+1 signers ) Change-Id: I65dc52f6ef531cd24f7d080108451c5302e08524 * Remove old files. Change-Id: I9fd2127d9374617f53cb1cc6f721a2a655b79385 * Removed unnecessary entries in gitignore file Change-Id: I498ee2e192eb87d090767d8a12fd59ac679c8579 Co-authored-by: Josh Siegel <[email protected]> Co-authored-by: jumpsiegel <83408952+[email protected]>
2022-01-21 06:37:49 -08:00
this.groupTxSet[gid].push(tx)
return tx.txID()
}
/**
* Pricekeeper-V2: Add store price transaction to TX Group.
* @param {*} sender The sender account (typically the VAA verification stateless program)
* @param {*} sym The symbol identifying the product to store price for.
* @param {*} payload The VAA payload.
*/
this.addPriceStoreTx = function (gid, sender, params, sym, payload) {
if (this.groupTxSet[gid] === undefined) {
throw new Error('unknown group id')
}
const appArgs = []
appArgs.push(new Uint8Array(Buffer.from('store')),
new Uint8Array(Buffer.from(sym)),
new Uint8Array(payload))
const tx = algosdk.makeApplicationNoOpTxn(sender,
params,
ContractInfo.pricekeeper.appId,
appArgs)
this.groupTxSet[gid].push(tx)
return tx.txID()
}
2021-10-01 07:00:20 -07:00
}
}
module.exports = {
PricecasterLib
}