algo/typo: type fix, algorand tests, near tests
This commit is contained in:
parent
aac9a3b4a0
commit
1febea03b5
|
@ -6,7 +6,7 @@
|
||||||
"": {
|
"": {
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certusone/wormhole-sdk": "file:../sdk/js",
|
"@certusone/wormhole-sdk": "file:../sdk/js",
|
||||||
"algosdk": "^1.14.0",
|
"algosdk": "^1.21.0",
|
||||||
"ts-node": "^10.7.0",
|
"ts-node": "^10.7.0",
|
||||||
"typescript": "^4.6.2",
|
"typescript": "^4.6.2",
|
||||||
"varint": "^6.0.0",
|
"varint": "^6.0.0",
|
||||||
|
@ -17,22 +17,26 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"../sdk/js": {
|
"../sdk/js": {
|
||||||
"version": "0.2.4",
|
"name": "@certusone/wormhole-sdk",
|
||||||
|
"version": "0.6.3",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@improbable-eng/grpc-web": "^0.14.0",
|
"@certusone/wormhole-sdk-proto-web": "^0.0.5",
|
||||||
|
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||||
|
"@injectivelabs/sdk-ts": "^1.0.75",
|
||||||
"@solana/spl-token": "^0.1.8",
|
"@solana/spl-token": "^0.1.8",
|
||||||
"@solana/web3.js": "^1.24.0",
|
"@solana/web3.js": "^1.24.0",
|
||||||
"@terra-money/terra.js": "^3.0.7",
|
"@terra-money/terra.js": "^3.1.3",
|
||||||
"algosdk": "^1.14.0",
|
"algosdk": "^1.15.0",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"bech32": "^2.0.0",
|
"bech32": "^2.0.0",
|
||||||
"js-base64": "^3.6.1",
|
"js-base64": "^3.6.1",
|
||||||
"protobufjs": "^6.11.2",
|
"near-api-js": "^0.45.1"
|
||||||
"rxjs": "^7.3.0"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||||
|
"@injectivelabs/networks": "^1.0.12",
|
||||||
|
"@injectivelabs/tx-ts": "^1.0.22",
|
||||||
"@openzeppelin/contracts": "^4.2.0",
|
"@openzeppelin/contracts": "^4.2.0",
|
||||||
"@typechain/ethers-v5": "^7.0.1",
|
"@typechain/ethers-v5": "^7.0.1",
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
|
@ -40,7 +44,7 @@
|
||||||
"@types/node": "^16.6.1",
|
"@types/node": "^16.6.1",
|
||||||
"@types/react": "^17.0.19",
|
"@types/react": "^17.0.19",
|
||||||
"copy-dir": "^1.3.0",
|
"copy-dir": "^1.3.0",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.6.8",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.3.2",
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
|
@ -513,9 +517,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/algosdk": {
|
"node_modules/algosdk": {
|
||||||
"version": "1.14.0",
|
"version": "1.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.21.0.tgz",
|
||||||
"integrity": "sha512-IaaomouKmuCnK+xLuz27X8DQro0ZjVyw4zHvV8HJap9PPDOQKbvpm+UIIsEf0CmC0xWPXIxfFbmlJ0y5CeGlqQ==",
|
"integrity": "sha512-pgHzEExFn8hjcDphQYo+0Pi6TLWZOyXPcxjisldd6ZaaF0cNsB6C97n66OXi0gtL3mvMIgD53SLBfzy1u9YM+g==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"algo-msgpack-with-bigint": "^2.1.1",
|
"algo-msgpack-with-bigint": "^2.1.1",
|
||||||
"buffer": "^6.0.2",
|
"buffer": "^6.0.2",
|
||||||
|
@ -526,7 +530,10 @@
|
||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"url-parse": "^1.5.1"
|
"vlq": "^2.0.4"
|
||||||
|
},
|
||||||
|
"optionalDependencies": {
|
||||||
|
"fsevents": "2.1.2"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/arg": {
|
"node_modules/arg": {
|
||||||
|
@ -870,6 +877,20 @@
|
||||||
"url": "https://ko-fi.com/tunnckoCore/commissions"
|
"url": "https://ko-fi.com/tunnckoCore/commissions"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/fsevents": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
|
||||||
|
"deprecated": "\"Please update to latest v2.3 or v2.2\"",
|
||||||
|
"hasInstallScript": true,
|
||||||
|
"optional": true,
|
||||||
|
"os": [
|
||||||
|
"darwin"
|
||||||
|
],
|
||||||
|
"engines": {
|
||||||
|
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/function-bind": {
|
"node_modules/function-bind": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
|
@ -1166,11 +1187,6 @@
|
||||||
"url": "https://github.com/sponsors/ljharb"
|
"url": "https://github.com/sponsors/ljharb"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/querystringify": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
|
|
||||||
},
|
|
||||||
"node_modules/randombytes": {
|
"node_modules/randombytes": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||||
|
@ -1192,11 +1208,6 @@
|
||||||
"node": ">= 6"
|
"node": ">= 6"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/requires-port": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
|
|
||||||
},
|
|
||||||
"node_modules/ripemd160": {
|
"node_modules/ripemd160": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
||||||
|
@ -1405,15 +1416,6 @@
|
||||||
"node": ">=4.2.0"
|
"node": ">=4.2.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/url-parse": {
|
|
||||||
"version": "1.5.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
|
||||||
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
|
||||||
"dependencies": {
|
|
||||||
"querystringify": "^2.1.1",
|
|
||||||
"requires-port": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"node_modules/utf8": {
|
"node_modules/utf8": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
||||||
|
@ -1434,6 +1436,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz",
|
||||||
"integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg=="
|
"integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg=="
|
||||||
},
|
},
|
||||||
|
"node_modules/vlq": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/vlq/-/vlq-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA=="
|
||||||
|
},
|
||||||
"node_modules/web3-eth-abi": {
|
"node_modules/web3-eth-abi": {
|
||||||
"version": "1.7.1",
|
"version": "1.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz",
|
||||||
|
@ -1481,27 +1488,30 @@
|
||||||
"@certusone/wormhole-sdk": {
|
"@certusone/wormhole-sdk": {
|
||||||
"version": "file:../sdk/js",
|
"version": "file:../sdk/js",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@improbable-eng/grpc-web": "^0.14.0",
|
"@certusone/wormhole-sdk-proto-web": "^0.0.5",
|
||||||
|
"@certusone/wormhole-sdk-wasm": "^0.0.1",
|
||||||
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
"@improbable-eng/grpc-web-node-http-transport": "^0.15.0",
|
||||||
|
"@injectivelabs/networks": "^1.0.12",
|
||||||
|
"@injectivelabs/sdk-ts": "^1.0.75",
|
||||||
|
"@injectivelabs/tx-ts": "^1.0.22",
|
||||||
"@openzeppelin/contracts": "^4.2.0",
|
"@openzeppelin/contracts": "^4.2.0",
|
||||||
"@solana/spl-token": "^0.1.8",
|
"@solana/spl-token": "^0.1.8",
|
||||||
"@solana/web3.js": "^1.24.0",
|
"@solana/web3.js": "^1.24.0",
|
||||||
"@terra-money/terra.js": "^3.0.7",
|
"@terra-money/terra.js": "^3.1.3",
|
||||||
"@typechain/ethers-v5": "^7.0.1",
|
"@typechain/ethers-v5": "^7.0.1",
|
||||||
"@types/jest": "^27.0.2",
|
"@types/jest": "^27.0.2",
|
||||||
"@types/long": "^4.0.1",
|
"@types/long": "^4.0.1",
|
||||||
"@types/node": "^16.6.1",
|
"@types/node": "^16.6.1",
|
||||||
"@types/react": "^17.0.19",
|
"@types/react": "^17.0.19",
|
||||||
"algosdk": "^1.14.0",
|
"algosdk": "^1.15.0",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
"bech32": "^2.0.0",
|
"bech32": "^2.0.0",
|
||||||
"copy-dir": "^1.3.0",
|
"copy-dir": "^1.3.0",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.6.8",
|
||||||
"jest": "^27.3.1",
|
"jest": "^27.3.1",
|
||||||
"js-base64": "^3.6.1",
|
"js-base64": "^3.6.1",
|
||||||
|
"near-api-js": "^0.45.1",
|
||||||
"prettier": "^2.3.2",
|
"prettier": "^2.3.2",
|
||||||
"protobufjs": "^6.11.2",
|
|
||||||
"rxjs": "^7.3.0",
|
|
||||||
"ts-jest": "^27.0.7",
|
"ts-jest": "^27.0.7",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.18.0",
|
"tslint-config-prettier": "^1.18.0",
|
||||||
|
@ -1780,12 +1790,13 @@
|
||||||
"integrity": "sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ=="
|
"integrity": "sha512-F1tGh056XczEaEAqu7s+hlZUDWwOBT70Eq0lfMpBP2YguSQVyxRbprLq5rELXKQOyOaixTWYhMeMQMzP0U5FoQ=="
|
||||||
},
|
},
|
||||||
"algosdk": {
|
"algosdk": {
|
||||||
"version": "1.14.0",
|
"version": "1.21.0",
|
||||||
"resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.14.0.tgz",
|
"resolved": "https://registry.npmjs.org/algosdk/-/algosdk-1.21.0.tgz",
|
||||||
"integrity": "sha512-IaaomouKmuCnK+xLuz27X8DQro0ZjVyw4zHvV8HJap9PPDOQKbvpm+UIIsEf0CmC0xWPXIxfFbmlJ0y5CeGlqQ==",
|
"integrity": "sha512-pgHzEExFn8hjcDphQYo+0Pi6TLWZOyXPcxjisldd6ZaaF0cNsB6C97n66OXi0gtL3mvMIgD53SLBfzy1u9YM+g==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"algo-msgpack-with-bigint": "^2.1.1",
|
"algo-msgpack-with-bigint": "^2.1.1",
|
||||||
"buffer": "^6.0.2",
|
"buffer": "^6.0.2",
|
||||||
|
"fsevents": "2.1.2",
|
||||||
"hi-base32": "^0.5.1",
|
"hi-base32": "^0.5.1",
|
||||||
"js-sha256": "^0.9.0",
|
"js-sha256": "^0.9.0",
|
||||||
"js-sha3": "^0.8.0",
|
"js-sha3": "^0.8.0",
|
||||||
|
@ -1793,7 +1804,7 @@
|
||||||
"json-bigint": "^1.0.0",
|
"json-bigint": "^1.0.0",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"tweetnacl": "^1.0.3",
|
"tweetnacl": "^1.0.3",
|
||||||
"url-parse": "^1.5.1"
|
"vlq": "^2.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"arg": {
|
"arg": {
|
||||||
|
@ -2076,6 +2087,12 @@
|
||||||
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz",
|
"resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.6.tgz",
|
||||||
"integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ=="
|
"integrity": "sha512-KcpbcpuLNOwrEjnbpMC0gS+X8ciDoZE1kkqzat4a8vrprf+s9pKNQ/QIwWfbfs4ltgmFl3MD177SNTkve3BwGQ=="
|
||||||
},
|
},
|
||||||
|
"fsevents": {
|
||||||
|
"version": "2.1.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz",
|
||||||
|
"integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
"function-bind": {
|
"function-bind": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
|
||||||
|
@ -2298,11 +2315,6 @@
|
||||||
"side-channel": "^1.0.4"
|
"side-channel": "^1.0.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"querystringify": {
|
|
||||||
"version": "2.2.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",
|
|
||||||
"integrity": "sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ=="
|
|
||||||
},
|
|
||||||
"randombytes": {
|
"randombytes": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||||
|
@ -2321,11 +2333,6 @@
|
||||||
"util-deprecate": "^1.0.1"
|
"util-deprecate": "^1.0.1"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"requires-port": {
|
|
||||||
"version": "1.0.0",
|
|
||||||
"resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
|
|
||||||
"integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8="
|
|
||||||
},
|
|
||||||
"ripemd160": {
|
"ripemd160": {
|
||||||
"version": "2.0.2",
|
"version": "2.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz",
|
||||||
|
@ -2466,15 +2473,6 @@
|
||||||
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz",
|
"resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz",
|
||||||
"integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg=="
|
"integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg=="
|
||||||
},
|
},
|
||||||
"url-parse": {
|
|
||||||
"version": "1.5.10",
|
|
||||||
"resolved": "https://registry.npmjs.org/url-parse/-/url-parse-1.5.10.tgz",
|
|
||||||
"integrity": "sha512-WypcfiRhfeUP9vvF0j6rw0J3hrWrw6iZv3+22h6iRMJ/8z1Tj6XfLP4DsUix5MhMPnXpiHDoKyoZ/bdCkwBCiQ==",
|
|
||||||
"requires": {
|
|
||||||
"querystringify": "^2.1.1",
|
|
||||||
"requires-port": "^1.0.0"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"utf8": {
|
"utf8": {
|
||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz",
|
||||||
|
@ -2495,6 +2493,11 @@
|
||||||
"resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/varint/-/varint-6.0.0.tgz",
|
||||||
"integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg=="
|
"integrity": "sha512-cXEIW6cfr15lFv563k4GuVuW/fiwjknytD37jIOLSdSWuOI6WnO/oKwmP2FQTU2l01LP8/M5TSAJpzUaGe3uWg=="
|
||||||
},
|
},
|
||||||
|
"vlq": {
|
||||||
|
"version": "2.0.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/vlq/-/vlq-2.0.4.tgz",
|
||||||
|
"integrity": "sha512-aodjPa2wPQFkra1G8CzJBTHXhgk3EVSwxSWXNPr1fgdFLUb8kvLV1iEb6rFgasIsjP82HWI6dsb5Io26DDnasA=="
|
||||||
|
},
|
||||||
"web3-eth-abi": {
|
"web3-eth-abi": {
|
||||||
"version": "1.7.1",
|
"version": "1.7.1",
|
||||||
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz",
|
"resolved": "https://registry.npmjs.org/web3-eth-abi/-/web3-eth-abi-1.7.1.tgz",
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@certusone/wormhole-sdk": "file:../sdk/js",
|
"@certusone/wormhole-sdk": "file:../sdk/js",
|
||||||
"algosdk": "^1.14.0",
|
"algosdk": "^1.21.0",
|
||||||
"ts-node": "^10.7.0",
|
"ts-node": "^10.7.0",
|
||||||
"typescript": "^4.6.2",
|
"typescript": "^4.6.2",
|
||||||
"varint": "^6.0.0",
|
"varint": "^6.0.0",
|
||||||
|
|
|
@ -0,0 +1,121 @@
|
||||||
|
const algosdk = require("@certusone/wormhole-sdk/node_modules/algosdk");
|
||||||
|
|
||||||
|
import { calcLogicSigAccount } from "@certusone/wormhole-sdk/lib/cjs/algorand";
|
||||||
|
|
||||||
|
export async function getNativeAlgoAddress(
|
||||||
|
algoClient: any,
|
||||||
|
token_bridge: any,
|
||||||
|
assetId: any
|
||||||
|
) {
|
||||||
|
const { doesExist, lsa } = await calcLogicSigAccount(
|
||||||
|
algoClient,
|
||||||
|
BigInt(token_bridge),
|
||||||
|
BigInt(assetId),
|
||||||
|
Buffer.from("native", "binary").toString("hex")
|
||||||
|
);
|
||||||
|
return lsa.address();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function firstTransaction() {
|
||||||
|
let algodToken;
|
||||||
|
let algodServer;
|
||||||
|
let algodPort;
|
||||||
|
let server;
|
||||||
|
let port;
|
||||||
|
let token;
|
||||||
|
let appid;
|
||||||
|
|
||||||
|
const mainnet = false;
|
||||||
|
|
||||||
|
if (mainnet) {
|
||||||
|
appid = 842126029;
|
||||||
|
algodToken = "";
|
||||||
|
algodServer = "https://mainnet-api.algonode.cloud";
|
||||||
|
algodPort = 443;
|
||||||
|
server = "https://mainnet-idx.algonode.cloud";
|
||||||
|
port = 443;
|
||||||
|
token = "";
|
||||||
|
} else {
|
||||||
|
appid = 6;
|
||||||
|
algodToken =
|
||||||
|
"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||||
|
algodServer = "http://localhost";
|
||||||
|
algodPort = 4001;
|
||||||
|
server = "http://localhost";
|
||||||
|
port = 8980;
|
||||||
|
token = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
|
||||||
|
}
|
||||||
|
|
||||||
|
let algodClient = new algosdk.Algodv2(algodToken, algodServer, algodPort);
|
||||||
|
let indexerClient = new algosdk.Indexer(token, server, port);
|
||||||
|
let addr = algosdk.getApplicationAddress(appid); // mainnet token bridge account
|
||||||
|
|
||||||
|
console.log(await algodClient.status().do());
|
||||||
|
|
||||||
|
//Check your balance
|
||||||
|
let accountInfo = await algodClient.accountInformation(addr).do();
|
||||||
|
console.log(accountInfo);
|
||||||
|
|
||||||
|
let ret = await indexerClient
|
||||||
|
.searchAccounts()
|
||||||
|
.authAddr(addr)
|
||||||
|
.applicationID(appid)
|
||||||
|
.do();
|
||||||
|
|
||||||
|
let wormholeAssets: any = [];
|
||||||
|
let nativeAssets: any = [];
|
||||||
|
|
||||||
|
while (true) {
|
||||||
|
ret["accounts"].forEach((x: any) => {
|
||||||
|
let amt = x["amount"];
|
||||||
|
if (x["assets"] != undefined) {
|
||||||
|
x["assets"].forEach((a: any) => {
|
||||||
|
if (x["created-assets"] != undefined) {
|
||||||
|
wormholeAssets.push(a);
|
||||||
|
} else {
|
||||||
|
nativeAssets.push(a);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (ret["next-token"] == undefined) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
ret = await indexerClient
|
||||||
|
.searchAccounts()
|
||||||
|
.authAddr(addr)
|
||||||
|
.applicationID(appid)
|
||||||
|
.nextToken(ret["next-token"])
|
||||||
|
.do();
|
||||||
|
}
|
||||||
|
|
||||||
|
let nativeAlgoAddr = await getNativeAlgoAddress(algodClient, appid, 0);
|
||||||
|
let algoInfo = await algodClient.accountInformation(nativeAlgoAddr).do();
|
||||||
|
console.log("ALGO locked: " + (algoInfo["amount"] - 1002001));
|
||||||
|
|
||||||
|
console.log("wormhole assets");
|
||||||
|
for (let i = 0; i < wormholeAssets.length; i++) {
|
||||||
|
console.log(wormholeAssets[i]);
|
||||||
|
console.log(
|
||||||
|
await algodClient.getAssetByID(wormholeAssets[i]["asset-id"]).do()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log("native assets");
|
||||||
|
for (let i = 0; i < nativeAssets.length; i++) {
|
||||||
|
console.log(nativeAssets[i]);
|
||||||
|
console.log(
|
||||||
|
await algodClient.getAssetByID(nativeAssets[i]["asset-id"]).do()
|
||||||
|
);
|
||||||
|
|
||||||
|
let addr = await getNativeAlgoAddress(
|
||||||
|
algodClient,
|
||||||
|
appid,
|
||||||
|
nativeAssets[i]["asset-id"]
|
||||||
|
);
|
||||||
|
algoInfo = await algodClient.accountInformation(addr).do();
|
||||||
|
console.log(algoInfo);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
firstTransaction();
|
|
@ -415,7 +415,7 @@ def approve_token_bridge(seed_amt: int, tmpl_sig: TmplSig, devMode: bool):
|
||||||
TxnField.type_enum: TxnType.AssetConfig,
|
TxnField.type_enum: TxnType.AssetConfig,
|
||||||
TxnField.config_asset_name: Name.load(),
|
TxnField.config_asset_name: Name.load(),
|
||||||
TxnField.config_asset_unit_name: Symbol.load(),
|
TxnField.config_asset_unit_name: Symbol.load(),
|
||||||
TxnField.config_asset_total: Int(18446744073709551614),
|
TxnField.config_asset_total: Int(18446744073709550000),
|
||||||
TxnField.config_asset_decimals: Decimals.load(),
|
TxnField.config_asset_decimals: Decimals.load(),
|
||||||
TxnField.config_asset_manager: me,
|
TxnField.config_asset_manager: me,
|
||||||
TxnField.config_asset_reserve: Txn.accounts[3],
|
TxnField.config_asset_reserve: Txn.accounts[3],
|
||||||
|
|
192
near/test/sdk.ts
192
near/test/sdk.ts
|
@ -35,7 +35,6 @@ import algosdk, {
|
||||||
} from "@certusone/wormhole-sdk/node_modules/algosdk";
|
} from "@certusone/wormhole-sdk/node_modules/algosdk";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
createAsset,
|
|
||||||
getAlgoClient,
|
getAlgoClient,
|
||||||
getBalance,
|
getBalance,
|
||||||
getBalances,
|
getBalances,
|
||||||
|
@ -116,6 +115,73 @@ function getConfig(env: any) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function createAsset(
|
||||||
|
aClient: algosdk.Algodv2,
|
||||||
|
account: Account
|
||||||
|
): Promise<any> {
|
||||||
|
const params = await aClient.getTransactionParams().do();
|
||||||
|
const note = undefined; // arbitrary data to be stored in the transaction; here, none is stored
|
||||||
|
// Asset creation specific parameters
|
||||||
|
const addr = account.addr;
|
||||||
|
// Whether user accounts will need to be unfrozen before transacting
|
||||||
|
const defaultFrozen = false;
|
||||||
|
// integer number of decimals for asset unit calculation
|
||||||
|
const decimals = 10;
|
||||||
|
// total number of this asset available for circulation
|
||||||
|
const totalIssuance = 1000000;
|
||||||
|
// Used to display asset units to user
|
||||||
|
const unitName = "NORIUM";
|
||||||
|
// Friendly name of the asset
|
||||||
|
const assetName = "ChuckNorium";
|
||||||
|
// Optional string pointing to a URL relating to the asset
|
||||||
|
// const assetURL = "http://www.chucknorris.com";
|
||||||
|
const assetURL = "";
|
||||||
|
// Optional hash commitment of some sort relating to the asset. 32 character length.
|
||||||
|
// const assetMetadataHash = "16efaa3924a6fd9d3a4824799a4ac65d";
|
||||||
|
const assetMetadataHash = "";
|
||||||
|
// The following parameters are the only ones
|
||||||
|
// that can be changed, and they have to be changed
|
||||||
|
// by the current manager
|
||||||
|
// Specified address can change reserve, freeze, clawback, and manager
|
||||||
|
const manager = account.addr;
|
||||||
|
// Specified address is considered the asset reserve
|
||||||
|
// (it has no special privileges, this is only informational)
|
||||||
|
const reserve = account.addr;
|
||||||
|
// Specified address can freeze or unfreeze user asset holdings
|
||||||
|
const freeze = account.addr;
|
||||||
|
// Specified address can revoke user asset holdings and send
|
||||||
|
// them to other addresses
|
||||||
|
const clawback = account.addr;
|
||||||
|
|
||||||
|
// signing and sending "txn" allows "addr" to create an asset
|
||||||
|
const txn = algosdk.makeAssetCreateTxnWithSuggestedParams(
|
||||||
|
addr,
|
||||||
|
note,
|
||||||
|
totalIssuance,
|
||||||
|
decimals,
|
||||||
|
defaultFrozen,
|
||||||
|
manager,
|
||||||
|
reserve,
|
||||||
|
freeze,
|
||||||
|
clawback,
|
||||||
|
unitName,
|
||||||
|
assetName,
|
||||||
|
assetURL,
|
||||||
|
assetMetadataHash,
|
||||||
|
params
|
||||||
|
);
|
||||||
|
|
||||||
|
const rawSignedTxn = txn.signTxn(account.sk);
|
||||||
|
const tx = await aClient.sendRawTransaction(rawSignedTxn).do();
|
||||||
|
|
||||||
|
// wait for transaction to be confirmed
|
||||||
|
const ptx = await algosdk.waitForConfirmation(aClient, tx.txId, 4);
|
||||||
|
// Get the new asset's information from the creator account
|
||||||
|
const assetID: number = ptx["asset-index"];
|
||||||
|
//Get the completed Transaction
|
||||||
|
return assetID;
|
||||||
|
}
|
||||||
|
|
||||||
export function logNearGas(result: any, comment: string) {
|
export function logNearGas(result: any, comment: string) {
|
||||||
const { totalGasBurned, totalTokensBurned } = result.receipts_outcome.reduce(
|
const { totalGasBurned, totalTokensBurned } = result.receipts_outcome.reduce(
|
||||||
(acc: any, receipt: any) => {
|
(acc: any, receipt: any) => {
|
||||||
|
@ -259,6 +325,109 @@ async function testNearSDK() {
|
||||||
|
|
||||||
const algoWallet: Account = tempAccts[0];
|
const algoWallet: Account = tempAccts[0];
|
||||||
|
|
||||||
|
let norium = await createAsset(algoClient, algoWallet);
|
||||||
|
console.log("Norum asset-id on algorand", norium);
|
||||||
|
|
||||||
|
const attestTxs = await attestFromAlgorand(
|
||||||
|
algoClient,
|
||||||
|
algoToken,
|
||||||
|
algoCore,
|
||||||
|
algoWallet.addr,
|
||||||
|
BigInt(norium)
|
||||||
|
);
|
||||||
|
const attestResult = await signSendAndConfirmAlgorand(
|
||||||
|
algoClient,
|
||||||
|
attestTxs,
|
||||||
|
algoWallet
|
||||||
|
);
|
||||||
|
|
||||||
|
const attestSn = parseSequenceFromLogAlgorand(attestResult);
|
||||||
|
|
||||||
|
const emitterAddr = getEmitterAddressAlgorand(algoToken);
|
||||||
|
|
||||||
|
const { vaaBytes } = await getSignedVAAWithRetry(
|
||||||
|
["http://localhost:7071"],
|
||||||
|
CHAIN_ID_ALGORAND,
|
||||||
|
emitterAddr,
|
||||||
|
attestSn,
|
||||||
|
{ transport: NodeHttpTransport() }
|
||||||
|
);
|
||||||
|
|
||||||
|
let noriumNear = await createWrappedOnNear(
|
||||||
|
userAccount,
|
||||||
|
token_bridge,
|
||||||
|
vaaBytes
|
||||||
|
);
|
||||||
|
console.log("for norium, createWrappedOnNear returned " + noriumNear);
|
||||||
|
|
||||||
|
let account_hash = await userAccount.viewFunction(
|
||||||
|
token_bridge,
|
||||||
|
"hash_account",
|
||||||
|
{
|
||||||
|
account: userAccount.accountId,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log(account_hash);
|
||||||
|
|
||||||
|
let myAddress = account_hash[1];
|
||||||
|
|
||||||
|
// Start transfer from Algorand to Near
|
||||||
|
console.log("Lets send 12300 Norum to near");
|
||||||
|
const AmountToTransfer: number = 12300;
|
||||||
|
const Fee: number = 0;
|
||||||
|
const transferTxs = await transferFromAlgorand(
|
||||||
|
algoClient,
|
||||||
|
algoToken,
|
||||||
|
algoCore,
|
||||||
|
algoWallet.addr,
|
||||||
|
BigInt(norium),
|
||||||
|
BigInt(AmountToTransfer),
|
||||||
|
myAddress,
|
||||||
|
CHAIN_ID_NEAR,
|
||||||
|
BigInt(Fee)
|
||||||
|
);
|
||||||
|
const transferResult = await signSendAndConfirmAlgorand(
|
||||||
|
algoClient,
|
||||||
|
transferTxs,
|
||||||
|
algoWallet
|
||||||
|
);
|
||||||
|
const txSid = parseSequenceFromLogAlgorand(transferResult);
|
||||||
|
const signedVaa = await getSignedVAAWithRetry(
|
||||||
|
["http://localhost:7071"],
|
||||||
|
CHAIN_ID_ALGORAND,
|
||||||
|
emitterAddr,
|
||||||
|
txSid,
|
||||||
|
{ transport: NodeHttpTransport() }
|
||||||
|
);
|
||||||
|
|
||||||
|
console.log("Lets send 5123 ALGO to near");
|
||||||
|
|
||||||
|
const ALGOTxs = await transferFromAlgorand(
|
||||||
|
algoClient,
|
||||||
|
algoToken,
|
||||||
|
algoCore,
|
||||||
|
algoWallet.addr,
|
||||||
|
BigInt(0),
|
||||||
|
BigInt(5123),
|
||||||
|
myAddress,
|
||||||
|
CHAIN_ID_NEAR,
|
||||||
|
BigInt(Fee)
|
||||||
|
);
|
||||||
|
const ALGOResult = await signSendAndConfirmAlgorand(
|
||||||
|
algoClient,
|
||||||
|
ALGOTxs,
|
||||||
|
algoWallet
|
||||||
|
);
|
||||||
|
const ALGOSid = parseSequenceFromLogAlgorand(ALGOResult);
|
||||||
|
const ALGOVaa = await getSignedVAAWithRetry(
|
||||||
|
["http://localhost:7071"],
|
||||||
|
CHAIN_ID_ALGORAND,
|
||||||
|
emitterAddr,
|
||||||
|
ALGOSid,
|
||||||
|
{ transport: NodeHttpTransport() }
|
||||||
|
);
|
||||||
|
|
||||||
console.log("Creating USDC on Near");
|
console.log("Creating USDC on Near");
|
||||||
|
|
||||||
let ts = new TestLib();
|
let ts = new TestLib();
|
||||||
|
@ -332,18 +501,6 @@ async function testNearSDK() {
|
||||||
);
|
);
|
||||||
await signSendAndConfirmAlgorand(algoClient, tx, algoWallet);
|
await signSendAndConfirmAlgorand(algoClient, tx, algoWallet);
|
||||||
|
|
||||||
let account_hash = await userAccount.viewFunction(
|
|
||||||
token_bridge,
|
|
||||||
"hash_account",
|
|
||||||
{
|
|
||||||
account: userAccount.accountId,
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
console.log(account_hash);
|
|
||||||
|
|
||||||
let myAddress = account_hash[1];
|
|
||||||
|
|
||||||
console.log("Airdropping USDC on myself");
|
console.log("Airdropping USDC on myself");
|
||||||
{
|
{
|
||||||
let trans = ts.genTransfer(
|
let trans = ts.genTransfer(
|
||||||
|
@ -390,6 +547,9 @@ async function testNearSDK() {
|
||||||
}
|
}
|
||||||
console.log(".. created some USDC");
|
console.log(".. created some USDC");
|
||||||
|
|
||||||
|
console.log("Redeeming norium on near");
|
||||||
|
await redeemOnNear(userAccount, token_bridge, signedVaa.vaaBytes);
|
||||||
|
|
||||||
let nativeAttest;
|
let nativeAttest;
|
||||||
{
|
{
|
||||||
console.log("attesting: " + randoToken);
|
console.log("attesting: " + randoToken);
|
||||||
|
@ -680,8 +840,6 @@ async function testNearSDK() {
|
||||||
console.log("NEAR asset id: " + nearAssetId);
|
console.log("NEAR asset id: " + nearAssetId);
|
||||||
}
|
}
|
||||||
|
|
||||||
const emitterAddr = getEmitterAddressAlgorand(algoToken);
|
|
||||||
|
|
||||||
console.log("wallet addr: " + algoWallet.addr);
|
console.log("wallet addr: " + algoWallet.addr);
|
||||||
console.log("usdcAssetId: " + usdcAssetId);
|
console.log("usdcAssetId: " + usdcAssetId);
|
||||||
|
|
||||||
|
@ -877,7 +1035,9 @@ async function testNearSDK() {
|
||||||
await redeemOnNear(user2Account, token_bridge, transferAlgoToNearP3)
|
await redeemOnNear(user2Account, token_bridge, transferAlgoToNearP3)
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("YYY P3 transfering rando from Algo To Near... getting the vaa");
|
console.log(
|
||||||
|
"YYY P3 transfering rando from Algo To Near... getting the vaa"
|
||||||
|
);
|
||||||
let transferAlgoToNearRandoP3;
|
let transferAlgoToNearRandoP3;
|
||||||
{
|
{
|
||||||
const Fee: number = 0;
|
const Fee: number = 0;
|
||||||
|
|
|
@ -111,7 +111,7 @@ export function parseSequenceFromLogAlgorand(
|
||||||
class iTxn {
|
class iTxn {
|
||||||
"local-state-delta": [[Object]];
|
"local-state-delta": [[Object]];
|
||||||
logs: Buffer[] | undefined;
|
logs: Buffer[] | undefined;
|
||||||
"pool-eror": string;
|
"pool-error": string;
|
||||||
txn: { txn: [Object] } | undefined;
|
txn: { txn: [Object] } | undefined;
|
||||||
}
|
}
|
||||||
innerTxns.forEach((txn: iTxn) => {
|
innerTxns.forEach((txn: iTxn) => {
|
||||||
|
|
Loading…
Reference in New Issue