From 317cbe61f91d3d043790ddd0dd73cd29f4e18533 Mon Sep 17 00:00:00 2001 From: Isacco Sordo Date: Fri, 19 Jul 2024 11:49:50 +0200 Subject: [PATCH] Release 0.13.28 * chore: release 0.13.28 * chore: release 0.13.28 * Feat/tezos staking * feat/tezos-staking * feat/tezos-staking * feat/tezos-staking * feat/tezos-staking * feat/tezos-staking * chore/ksm-dot-node1.13 * chore/ksm-dot-node1.13 * chore/ksm-dot-node1.13 --- lerna.json | 2 +- package-lock.json | 775 ++++++++++-------- packages/acurast/package.json | 10 +- packages/aeternity/package.json | 8 +- packages/astar/package.json | 10 +- packages/bitcoin/package.json | 10 +- packages/core/package.json | 2 +- packages/coreum/package.json | 12 +- packages/cosmos-core/package.json | 10 +- packages/cosmos/package.json | 12 +- packages/crypto/package.json | 6 +- packages/ethereum/package.json | 10 +- packages/groestlcoin/package.json | 10 +- packages/icp/package.json | 10 +- packages/mina/package.json | 10 +- packages/module-kit/package.json | 6 +- packages/moonbeam/package.json | 10 +- packages/optimism/package.json | 12 +- packages/polkadot/package.json | 8 +- packages/serializer/package.json | 4 +- packages/substrate/package.json | 10 +- packages/tezos/package.json | 13 +- .../tezos/src/v1/protocol/TezosProtocol.ts | 290 +++++-- packages/tezos/src/v1/types/protocol.ts | 10 + .../v1/types/staking/TezosDelegatorAction.ts | 5 +- .../tezos/src/v1/utils/protocol/instance.ts | 5 +- .../utils/protocol/tezos/TezosAccountant.ts | 5 +- .../v1/utils/protocol/tezos/TezosForger.ts | 5 +- packages/wallet/package.json | 6 +- 29 files changed, 780 insertions(+), 506 deletions(-) diff --git a/lerna.json b/lerna.json index bb78e536e..c917a822d 100644 --- a/lerna.json +++ b/lerna.json @@ -1,5 +1,5 @@ { - "version": "0.13.27", + "version": "0.13.28", "useWorkspaces": true, "command": { "publish": { diff --git a/package-lock.json b/package-lock.json index 0c24c8870..087e96727 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2321,6 +2321,16 @@ "@stablelib/int": "^1.0.1" } }, + "node_modules/@stablelib/blake2b": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/blake2b/-/blake2b-1.0.1.tgz", + "integrity": "sha512-B3KyKoBAjkIFeH7romcF96i+pVFYk7K2SBQ1pZvaxV+epSBXJ+n0C66esUhyz6FF+5FbdQVm77C5fzGFcEZpKA==", + "dependencies": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, "node_modules/@stablelib/constant-time": { "version": "1.0.1", "license": "MIT" @@ -2372,6 +2382,140 @@ "version": "1.0.1", "license": "MIT" }, + "node_modules/@taquito/core": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/core/-/core-20.0.1.tgz", + "integrity": "sha512-/NvTkS8Enz5zxm481h7Ld5+MTa3/q84PMqtQ+HN3Mniv4EshnX5uIGfbdXdCQoaAeVdJOCeNIZDgeP6ZnkomRA==", + "dependencies": { + "json-stringify-safe": "^5.0.1" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@taquito/http-utils": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-20.0.1.tgz", + "integrity": "sha512-belYNmWoT49IF8o51gEB5je5Wz54+C7Q5hmvh7modl7fG0qE8VD1ulSH+WjuZsFTPJdNEAfCe0O50Vb5tNzw2w==", + "dependencies": { + "@taquito/core": "^20.0.1", + "node-fetch": "^2.7.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@taquito/local-forging": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/local-forging/-/local-forging-20.0.1.tgz", + "integrity": "sha512-+XYHnoAYXpOYA4WbUvUO86F6uoUh1anaNQGD544ySaonJW1ZgwhylrGvvTVjQfFSqqP3TRWn69EqINco+hX7gA==", + "dependencies": { + "@taquito/core": "^20.0.1", + "@taquito/utils": "^20.0.1", + "bignumber.js": "^9.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@taquito/rpc": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-20.0.1.tgz", + "integrity": "sha512-Ec6fXoehjLpfILpVAHZ1NJz6cAaguEFs9McK2Ct4RRKmVhModgrVPAGXn17rb7fLXwOLP3MCzqSgFPToY7ZIFA==", + "dependencies": { + "@taquito/core": "^20.0.1", + "@taquito/http-utils": "^20.0.1", + "@taquito/utils": "^20.0.1", + "bignumber.js": "^9.1.2" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@taquito/utils": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-20.0.1.tgz", + "integrity": "sha512-aJaKukIW9thzU/WZ7p9ARRIDoXLQZ8TsB0brtbf48GqBFoGXDNAsDo72lkeTpehEcgYItSjdBuWEKH/lyTMr+w==", + "dependencies": { + "@stablelib/blake2b": "^1.0.1", + "@stablelib/ed25519": "^1.0.3", + "@taquito/core": "^20.0.1", + "@types/bs58check": "^2.1.0", + "bignumber.js": "^9.1.2", + "blakejs": "^1.2.1", + "bs58check": "^3.0.1", + "buffer": "^6.0.3", + "elliptic": "^6.5.4", + "typedarray-to-buffer": "^4.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@taquito/utils/node_modules/base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + }, + "node_modules/@taquito/utils/node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dependencies": { + "base-x": "^4.0.0" + } + }, + "node_modules/@taquito/utils/node_modules/bs58check": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", + "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "dependencies": { + "@noble/hashes": "^1.2.0", + "bs58": "^5.0.0" + } + }, + "node_modules/@taquito/utils/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@taquito/utils/node_modules/typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, "node_modules/@tootallnate/once": { "version": "2.0.0", "dev": true, @@ -2403,6 +2547,14 @@ "@types/node": "*" } }, + "node_modules/@types/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-xpXaQlOIY1KoXlA/ytHGHpEIU87PJt+g9SH7nC6HdCgaBwT2IEZIwBMHbjuX6BpnfbiUMlmwqurdLDwXpcdmSA==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/minimatch": { "version": "3.0.5", "dev": true, @@ -2827,8 +2979,9 @@ "license": "Apache-2.0" }, "node_modules/bignumber.js": { - "version": "9.1.1", - "license": "MIT", + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "engines": { "node": "*" } @@ -6370,7 +6523,6 @@ }, "node_modules/json-stringify-safe": { "version": "5.0.1", - "dev": true, "license": "ISC" }, "node_modules/json-text-sequence": { @@ -7294,8 +7446,9 @@ "license": "MIT" }, "node_modules/node-fetch": { - "version": "2.6.12", - "license": "MIT", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "dependencies": { "whatwg-url": "^5.0.0" }, @@ -10655,50 +10808,50 @@ }, "packages/acurast": { "name": "@airgap/acurast", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } }, "packages/aeternity": { "name": "@airgap/aeternity", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@stablelib/ed25519": "^1.0.3" } }, "packages/astar": { "name": "@airgap/astar", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } }, "packages/bitcoin": { "name": "@airgap/bitcoin", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "bitcoinjs-lib": "5.2.0" } }, @@ -10833,7 +10986,7 @@ }, "packages/core": { "name": "@airgap/coinlib-core", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { "@stablelib/blake2b": "^1.0.1", @@ -10889,15 +11042,6 @@ "version": "1.1.0", "license": "BSD-3-Clause" }, - "packages/core/node_modules/@stablelib/blake2b": { - "version": "1.0.1", - "license": "MIT", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, "packages/core/node_modules/@stablelib/bytes": { "version": "1.0.1", "license": "MIT" @@ -10997,46 +11141,46 @@ }, "packages/coreum": { "name": "@airgap/coreum", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "packages/cosmos": { "name": "@airgap/cosmos", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "packages/cosmos-core": { "name": "@airgap/cosmos-core", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "packages/crypto": { "name": "@airgap/crypto", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "^0.0.9", "@polkadot/wasm-crypto": "0.20.1", "@stablelib/hmac": "^1.0.1" @@ -11044,13 +11188,13 @@ }, "packages/ethereum": { "name": "@airgap/ethereum", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/common": "2.6.5", "@ethereumjs/tx": "3.4.0", "@metamask/eth-sig-util": "4.0.0" @@ -11058,24 +11202,24 @@ }, "packages/groestlcoin": { "name": "@airgap/groestlcoin", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/bitcoin": "^0.13.27", - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/bitcoin": "^0.13.28", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "packages/icp": { "name": "@airgap/icp", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@dfinity/agent": "^0.15.4", "@dfinity/identity-secp256k1": "^0.15.4", "@dfinity/nns": "^0.14.0", @@ -11121,13 +11265,13 @@ }, "packages/mina": { "name": "@airgap/mina", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "graphql": "^16.7.1", "graphql-request": "^6.1.0", "mina-signer": "^2.0.3" @@ -11135,45 +11279,45 @@ }, "packages/module-kit": { "name": "@airgap/module-kit", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "packages/moonbeam": { "name": "@airgap/moonbeam", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28" } }, "packages/optimism": { "name": "@airgap/optimism", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/ethereum": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/ethereum": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/tx": "3.4.0" } }, "packages/polkadot": { "name": "@airgap/polkadot", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/substrate": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/substrate": "^0.13.28" }, "devDependencies": { "@polkadot/wasm-crypto": "0.20.1" @@ -11181,41 +11325,42 @@ }, "packages/serializer": { "name": "@airgap/serializer", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28" } }, "packages/substrate": { "name": "@airgap/substrate", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } }, "packages/tezos": { "name": "@airgap/tezos", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "0.0.7", - "@airgap/serializer": "^0.13.27", + "@airgap/serializer": "^0.13.28", "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", "@stablelib/nacl": "^1.0.4", "@stablelib/random": "^1.0.2", "@stablelib/utf8": "^1.0.1", - "@taquito/local-forging": "14.0.0", + "@taquito/local-forging": "20.0.1", + "@taquito/rpc": "20.0.1", "graphql": "^16.6.0", "graphql-request": "^5.1.0" } @@ -11223,15 +11368,6 @@ "packages/tezos/node_modules/@airgap/sapling-wasm": { "version": "0.0.7" }, - "packages/tezos/node_modules/@stablelib/blake2b": { - "version": "1.0.1", - "license": "MIT", - "dependencies": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, "packages/tezos/node_modules/@stablelib/bytes": { "version": "1.0.1", "license": "MIT" @@ -11293,68 +11429,6 @@ "@stablelib/wipe": "^1.0.1" } }, - "packages/tezos/node_modules/@taquito/local-forging": { - "version": "14.0.0", - "license": "MIT", - "dependencies": { - "@taquito/utils": "^14.0.0", - "bignumber.js": "^9.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "packages/tezos/node_modules/@taquito/utils": { - "version": "14.0.0", - "license": "MIT", - "dependencies": { - "@stablelib/blake2b": "^1.0.1", - "@stablelib/ed25519": "^1.0.2", - "@types/bs58check": "^2.1.0", - "bignumber.js": "^9.0.2", - "blakejs": "^1.2.1", - "bs58check": "^2.1.2", - "buffer": "^6.0.3", - "elliptic": "^6.5.4", - "typedarray-to-buffer": "^4.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "packages/tezos/node_modules/@types/bs58check": { - "version": "2.1.0", - "license": "MIT", - "dependencies": { - "@types/node": "*" - } - }, - "packages/tezos/node_modules/@types/node": { - "version": "18.11.2", - "license": "MIT" - }, - "packages/tezos/node_modules/buffer": { - "version": "6.0.3", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT", - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "packages/tezos/node_modules/extract-files": { "version": "9.0.0", "license": "MIT", @@ -11390,31 +11464,13 @@ "graphql": "14 - 16" } }, - "packages/tezos/node_modules/typedarray-to-buffer": { - "version": "4.0.0", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "license": "MIT" - }, "packages/wallet": { "name": "@airgap/wallet", - "version": "0.13.27", + "version": "0.13.28", "license": "MIT", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28" } } }, @@ -11422,10 +11478,10 @@ "@airgap/acurast": { "version": "file:packages/acurast", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } @@ -11433,19 +11489,19 @@ "@airgap/aeternity": { "version": "file:packages/aeternity", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@stablelib/ed25519": "^1.0.3" } }, "@airgap/astar": { "version": "file:packages/astar", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } @@ -11453,10 +11509,10 @@ "@airgap/bitcoin": { "version": "file:packages/bitcoin", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "bitcoinjs-lib": "5.2.0" }, "dependencies": { @@ -11607,14 +11663,6 @@ "@protobufjs/utf8": { "version": "1.1.0" }, - "@stablelib/blake2b": { - "version": "1.0.1", - "requires": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, "@stablelib/bytes": { "version": "1.0.1" }, @@ -11702,37 +11750,37 @@ "@airgap/coreum": { "version": "file:packages/coreum", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "@airgap/cosmos": { "version": "file:packages/cosmos", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "@airgap/cosmos-core": { "version": "file:packages/cosmos-core", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "@airgap/crypto": { "version": "file:packages/crypto", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "^0.0.9", "@polkadot/wasm-crypto": "0.20.1", "@stablelib/hmac": "^1.0.1" @@ -11741,10 +11789,10 @@ "@airgap/ethereum": { "version": "file:packages/ethereum", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/common": "2.6.5", "@ethereumjs/tx": "3.4.0", "@metamask/eth-sig-util": "4.0.0" @@ -11753,19 +11801,19 @@ "@airgap/groestlcoin": { "version": "file:packages/groestlcoin", "requires": { - "@airgap/bitcoin": "^0.13.27", - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/bitcoin": "^0.13.28", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "@airgap/icp": { "version": "file:packages/icp", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@dfinity/agent": "^0.15.4", "@dfinity/identity-secp256k1": "^0.15.4", "@dfinity/nns": "^0.14.0", @@ -11806,10 +11854,10 @@ "@airgap/mina": { "version": "file:packages/mina", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "graphql": "^16.7.1", "graphql-request": "^6.1.0", "mina-signer": "^2.0.3" @@ -11818,36 +11866,36 @@ "@airgap/module-kit": { "version": "file:packages/module-kit", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/serializer": "^0.13.28" } }, "@airgap/moonbeam": { "version": "file:packages/moonbeam", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28" } }, "@airgap/optimism": { "version": "file:packages/optimism", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/ethereum": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/ethereum": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/tx": "3.4.0" } }, "@airgap/polkadot": { "version": "file:packages/polkadot", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/wasm-crypto": "0.20.1" } }, @@ -11857,16 +11905,16 @@ "@airgap/serializer": { "version": "file:packages/serializer", "requires": { - "@airgap/coinlib-core": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28" } }, "@airgap/substrate": { "version": "file:packages/substrate", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" } @@ -11874,17 +11922,18 @@ "@airgap/tezos": { "version": "file:packages/tezos", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "0.0.7", - "@airgap/serializer": "^0.13.27", + "@airgap/serializer": "^0.13.28", "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", "@stablelib/nacl": "^1.0.4", "@stablelib/random": "^1.0.2", "@stablelib/utf8": "^1.0.1", - "@taquito/local-forging": "14.0.0", + "@taquito/local-forging": "20.0.1", + "@taquito/rpc": "20.0.1", "graphql": "^16.6.0", "graphql-request": "^5.1.0" }, @@ -11892,14 +11941,6 @@ "@airgap/sapling-wasm": { "version": "0.0.7" }, - "@stablelib/blake2b": { - "version": "1.0.1", - "requires": { - "@stablelib/binary": "^1.0.1", - "@stablelib/hash": "^1.0.1", - "@stablelib/wipe": "^1.0.1" - } - }, "@stablelib/bytes": { "version": "1.0.1" }, @@ -11953,43 +11994,6 @@ "@stablelib/wipe": "^1.0.1" } }, - "@taquito/local-forging": { - "version": "14.0.0", - "requires": { - "@taquito/utils": "^14.0.0", - "bignumber.js": "^9.0.2" - } - }, - "@taquito/utils": { - "version": "14.0.0", - "requires": { - "@stablelib/blake2b": "^1.0.1", - "@stablelib/ed25519": "^1.0.2", - "@types/bs58check": "^2.1.0", - "bignumber.js": "^9.0.2", - "blakejs": "^1.2.1", - "bs58check": "^2.1.2", - "buffer": "^6.0.3", - "elliptic": "^6.5.4", - "typedarray-to-buffer": "^4.0.0" - } - }, - "@types/bs58check": { - "version": "2.1.0", - "requires": { - "@types/node": "*" - } - }, - "@types/node": { - "version": "18.11.2" - }, - "buffer": { - "version": "6.0.3", - "requires": { - "base64-js": "^1.3.1", - "ieee754": "^1.2.1" - } - }, "extract-files": { "version": "9.0.0" }, @@ -12009,17 +12013,14 @@ "extract-files": "^9.0.0", "form-data": "^3.0.0" } - }, - "typedarray-to-buffer": { - "version": "4.0.0" } } }, "@airgap/wallet": { "version": "file:packages/wallet", "requires": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28" } }, "@babel/code-frame": { @@ -13560,6 +13561,16 @@ "@stablelib/int": "^1.0.1" } }, + "@stablelib/blake2b": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@stablelib/blake2b/-/blake2b-1.0.1.tgz", + "integrity": "sha512-B3KyKoBAjkIFeH7romcF96i+pVFYk7K2SBQ1pZvaxV+epSBXJ+n0C66esUhyz6FF+5FbdQVm77C5fzGFcEZpKA==", + "requires": { + "@stablelib/binary": "^1.0.1", + "@stablelib/hash": "^1.0.1", + "@stablelib/wipe": "^1.0.1" + } + }, "@stablelib/constant-time": { "version": "1.0.1" }, @@ -13603,6 +13614,99 @@ "@stablelib/wipe": { "version": "1.0.1" }, + "@taquito/core": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/core/-/core-20.0.1.tgz", + "integrity": "sha512-/NvTkS8Enz5zxm481h7Ld5+MTa3/q84PMqtQ+HN3Mniv4EshnX5uIGfbdXdCQoaAeVdJOCeNIZDgeP6ZnkomRA==", + "requires": { + "json-stringify-safe": "^5.0.1" + } + }, + "@taquito/http-utils": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/http-utils/-/http-utils-20.0.1.tgz", + "integrity": "sha512-belYNmWoT49IF8o51gEB5je5Wz54+C7Q5hmvh7modl7fG0qE8VD1ulSH+WjuZsFTPJdNEAfCe0O50Vb5tNzw2w==", + "requires": { + "@taquito/core": "^20.0.1", + "node-fetch": "^2.7.0" + } + }, + "@taquito/local-forging": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/local-forging/-/local-forging-20.0.1.tgz", + "integrity": "sha512-+XYHnoAYXpOYA4WbUvUO86F6uoUh1anaNQGD544ySaonJW1ZgwhylrGvvTVjQfFSqqP3TRWn69EqINco+hX7gA==", + "requires": { + "@taquito/core": "^20.0.1", + "@taquito/utils": "^20.0.1", + "bignumber.js": "^9.1.2" + } + }, + "@taquito/rpc": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/rpc/-/rpc-20.0.1.tgz", + "integrity": "sha512-Ec6fXoehjLpfILpVAHZ1NJz6cAaguEFs9McK2Ct4RRKmVhModgrVPAGXn17rb7fLXwOLP3MCzqSgFPToY7ZIFA==", + "requires": { + "@taquito/core": "^20.0.1", + "@taquito/http-utils": "^20.0.1", + "@taquito/utils": "^20.0.1", + "bignumber.js": "^9.1.2" + } + }, + "@taquito/utils": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@taquito/utils/-/utils-20.0.1.tgz", + "integrity": "sha512-aJaKukIW9thzU/WZ7p9ARRIDoXLQZ8TsB0brtbf48GqBFoGXDNAsDo72lkeTpehEcgYItSjdBuWEKH/lyTMr+w==", + "requires": { + "@stablelib/blake2b": "^1.0.1", + "@stablelib/ed25519": "^1.0.3", + "@taquito/core": "^20.0.1", + "@types/bs58check": "^2.1.0", + "bignumber.js": "^9.1.2", + "blakejs": "^1.2.1", + "bs58check": "^3.0.1", + "buffer": "^6.0.3", + "elliptic": "^6.5.4", + "typedarray-to-buffer": "^4.0.0" + }, + "dependencies": { + "base-x": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", + "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + }, + "bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "requires": { + "base-x": "^4.0.0" + } + }, + "bs58check": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", + "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "requires": { + "@noble/hashes": "^1.2.0", + "bs58": "^5.0.0" + } + }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "typedarray-to-buffer": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-4.0.0.tgz", + "integrity": "sha512-6dOYeZfS3O9RtRD1caom0sMxgK59b27+IwoNy8RDPsmslSGOyU+mpTamlaIW7aNKi90ZQZ9DFaZL3YRoiSCULQ==" + } + } + }, "@tootallnate/once": { "version": "2.0.0", "dev": true @@ -13625,6 +13729,14 @@ "@types/node": "*" } }, + "@types/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@types/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-xpXaQlOIY1KoXlA/ytHGHpEIU87PJt+g9SH7nC6HdCgaBwT2IEZIwBMHbjuX6BpnfbiUMlmwqurdLDwXpcdmSA==", + "requires": { + "@types/node": "*" + } + }, "@types/minimatch": { "version": "3.0.5", "dev": true @@ -13909,7 +14021,9 @@ "dev": true }, "bignumber.js": { - "version": "9.1.1" + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==" }, "bin-links": { "version": "3.0.3", @@ -16322,8 +16436,7 @@ "dev": true }, "json-stringify-safe": { - "version": "5.0.1", - "dev": true + "version": "5.0.1" }, "json-text-sequence": { "version": "0.3.0", @@ -16946,7 +17059,9 @@ "dev": true }, "node-fetch": { - "version": "2.6.12", + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", "requires": { "whatwg-url": "^5.0.0" } diff --git a/packages/acurast/package.json b/packages/acurast/package.json index fbc6d0a23..9c609d627 100644 --- a/packages/acurast/package.json +++ b/packages/acurast/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/acurast", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/acurast is an Acurast implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -31,10 +31,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" }, diff --git a/packages/aeternity/package.json b/packages/aeternity/package.json index 9f9a01b9f..7c284d846 100644 --- a/packages/aeternity/package.json +++ b/packages/aeternity/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/aeternity", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/aeternity is an Aeternity implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,9 +30,9 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@stablelib/ed25519": "^1.0.3" }, "localDependencies": {}, diff --git a/packages/astar/package.json b/packages/astar/package.json index 36c8dd269..fe66c6537 100644 --- a/packages/astar/package.json +++ b/packages/astar/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/astar", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/astar is an Astar implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -32,10 +32,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" }, diff --git a/packages/bitcoin/package.json b/packages/bitcoin/package.json index 3d2eee946..55eaeaa9d 100644 --- a/packages/bitcoin/package.json +++ b/packages/bitcoin/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/bitcoin", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/bitcoin is a Bitcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "bitcoinjs-lib": "5.2.0" }, "localDependencies": { diff --git a/packages/core/package.json b/packages/core/package.json index c49f7fef6..1a9db8734 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/coinlib-core", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/coinlib-core is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.", "keywords": [ "airgap", diff --git a/packages/coreum/package.json b/packages/coreum/package.json index c2c492216..d7d452e6b 100644 --- a/packages/coreum/package.json +++ b/packages/coreum/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/coreum", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/coreum is a Coreum implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,11 +30,11 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" }, "nyc": { "include": [ diff --git a/packages/cosmos-core/package.json b/packages/cosmos-core/package.json index f3bf976a6..2a52bd290 100644 --- a/packages/cosmos-core/package.json +++ b/packages/cosmos-core/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/cosmos-core", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/cosmos-core is a Cosmos base implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" }, "nyc": { "include": [ diff --git a/packages/cosmos/package.json b/packages/cosmos/package.json index 419301b87..7b4c85007 100644 --- a/packages/cosmos/package.json +++ b/packages/cosmos/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/cosmos", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/cosmos is a Cosmos implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,11 +30,11 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/cosmos-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/cosmos-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" }, "localDependencies": {}, "nyc": { diff --git a/packages/crypto/package.json b/packages/crypto/package.json index 2023d8da1..16ee46668 100644 --- a/packages/crypto/package.json +++ b/packages/crypto/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/crypto", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/crypto packages provides common crypto functionalities.", "keywords": [ "airgap", @@ -30,8 +30,8 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "^0.0.9", "@polkadot/wasm-crypto": "0.20.1", "@stablelib/hmac": "^1.0.1" diff --git a/packages/ethereum/package.json b/packages/ethereum/package.json index f8d208bf1..9c7f65e46 100644 --- a/packages/ethereum/package.json +++ b/packages/ethereum/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/ethereum", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/ethereum is an Ethereum implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/common": "2.6.5", "@ethereumjs/tx": "3.4.0", "@metamask/eth-sig-util": "4.0.0" diff --git a/packages/groestlcoin/package.json b/packages/groestlcoin/package.json index 074184ce6..2529270c2 100644 --- a/packages/groestlcoin/package.json +++ b/packages/groestlcoin/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/groestlcoin", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/groestlcoin is a Groestlcoin implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/bitcoin": "^0.13.27", - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/bitcoin": "^0.13.28", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28" }, "localDependencies": { "groestlcoinjs-message": "2.1.0" diff --git a/packages/icp/package.json b/packages/icp/package.json index fdb27baf3..c16a0de50 100644 --- a/packages/icp/package.json +++ b/packages/icp/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/icp", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/icp is an ICP implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@dfinity/agent": "^0.15.4", "@dfinity/identity-secp256k1": "^0.15.4", "@dfinity/nns": "^0.14.0", diff --git a/packages/mina/package.json b/packages/mina/package.json index 7f3850503..e7bfb7de8 100644 --- a/packages/mina/package.json +++ b/packages/mina/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/mina", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/mina is a Mina implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,10 +30,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "graphql": "^16.7.1", "graphql-request": "^6.1.0", "mina-signer": "^2.0.3" diff --git a/packages/module-kit/package.json b/packages/module-kit/package.json index f0d1ac918..d2d23fcbe 100644 --- a/packages/module-kit/package.json +++ b/packages/module-kit/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/module-kit", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/module-kit package provides the common interfaces and functionalities to implement AirGap modules.", "keywords": [ "airgap", @@ -29,8 +29,8 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/serializer": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/serializer": "^0.13.28" }, "nyc": { "include": [ diff --git a/packages/moonbeam/package.json b/packages/moonbeam/package.json index 09fb73af1..7c35830ec 100644 --- a/packages/moonbeam/package.json +++ b/packages/moonbeam/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/moonbeam", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/moonbeam is a Moonbeam implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -32,10 +32,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", - "@airgap/substrate": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", + "@airgap/substrate": "^0.13.28" }, "localDependencies": {}, "nyc": { diff --git a/packages/optimism/package.json b/packages/optimism/package.json index 6d5f1c677..5b239c036 100644 --- a/packages/optimism/package.json +++ b/packages/optimism/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/optimism", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/optimism is an Optimism implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -31,11 +31,11 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/ethereum": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/ethereum": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@ethereumjs/tx": "3.4.0" }, "nyc": { diff --git a/packages/polkadot/package.json b/packages/polkadot/package.json index fc4d91bde..1c97d4261 100644 --- a/packages/polkadot/package.json +++ b/packages/polkadot/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/polkadot", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/polkadot is a Polkadot implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -32,9 +32,9 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/substrate": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/substrate": "^0.13.28" }, "devDependencies": { "@polkadot/wasm-crypto": "0.20.1" diff --git a/packages/serializer/package.json b/packages/serializer/package.json index fd96ebcaf..a6cb0ecfc 100644 --- a/packages/serializer/package.json +++ b/packages/serializer/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/serializer", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/serializer provides serializers used in AirGap applications.", "keywords": [ "airgap", @@ -37,7 +37,7 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28" }, "localDependencies": {}, "nyc": { diff --git a/packages/substrate/package.json b/packages/substrate/package.json index 520ef218f..3901dde0c 100644 --- a/packages/substrate/package.json +++ b/packages/substrate/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/substrate", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/substrate is a Substrate base implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -32,10 +32,10 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", - "@airgap/serializer": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", + "@airgap/serializer": "^0.13.28", "@polkadot/util": "2.0.1", "@polkadot/wasm-crypto": "0.20.1" }, diff --git a/packages/tezos/package.json b/packages/tezos/package.json index a9fc559b3..da5de1785 100644 --- a/packages/tezos/package.json +++ b/packages/tezos/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/tezos", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/tezos is a Tezos implementation of the ICoinProtocol interface from @airgap/coinlib-core.", "keywords": [ "airgap", @@ -30,17 +30,18 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/crypto": "^0.13.27", - "@airgap/module-kit": "^0.13.27", + "@airgap/coinlib-core": "^0.13.28", + "@airgap/crypto": "^0.13.28", + "@airgap/module-kit": "^0.13.28", "@airgap/sapling-wasm": "0.0.7", - "@airgap/serializer": "^0.13.27", + "@airgap/serializer": "^0.13.28", "@stablelib/blake2b": "^1.0.1", "@stablelib/ed25519": "^1.0.3", "@stablelib/nacl": "^1.0.4", "@stablelib/random": "^1.0.2", "@stablelib/utf8": "^1.0.1", - "@taquito/local-forging": "14.0.0", + "@taquito/local-forging": "20.0.1", + "@taquito/rpc": "20.0.1", "graphql": "^16.6.0", "graphql-request": "^5.1.0" }, diff --git a/packages/tezos/src/v1/protocol/TezosProtocol.ts b/packages/tezos/src/v1/protocol/TezosProtocol.ts index 802ea1560..e9f96e1b4 100644 --- a/packages/tezos/src/v1/protocol/TezosProtocol.ts +++ b/packages/tezos/src/v1/protocol/TezosProtocol.ts @@ -62,10 +62,10 @@ import { TezosDelegationOperation } from '../types/operations/kinds/Delegation' import { TezosOriginationOperation } from '../types/operations/kinds/Origination' import { TezosRevealOperation } from '../types/operations/kinds/Reveal' import { TezosOperation } from '../types/operations/kinds/TezosOperation' -import { TezosTransactionOperation } from '../types/operations/kinds/Transaction' +import { TezosTransactionOperation, TezosTransactionParameters } from '../types/operations/kinds/Transaction' import { TezosOperationType } from '../types/operations/TezosOperationType' import { TezosWrappedOperation } from '../types/operations/TezosWrappedOperation' -import { TezosProtocolNetwork, TezosProtocolOptions, TezosUnits } from '../types/protocol' +import { TezosProtocolNetwork, TezosProtocolOptions, TezosUnits, TezosUnstakeRequest } from '../types/protocol' import { BakerDetails } from '../types/staking/BakerDetails' import { TezosDelegatorAction } from '../types/staking/TezosDelegatorAction' import { TezosSignedTransaction, TezosTransactionCursor, TezosUnsignedTransaction } from '../types/transaction' @@ -96,6 +96,7 @@ export interface TezosProtocol isTezosProtocol: true getMinCycleDuration(): Promise + getstakeBalance(address: string): Promise> getDetailsFromWrappedOperation(wrappedOperation: TezosWrappedOperation): Promise[]> @@ -110,6 +111,8 @@ export interface TezosProtocol ): Promise bakerDetails(address: string | undefined): Promise + getUnfinalizeRequest(address: string): Promise + getFinalizeableBalance(address: string): Promise> } // Implementation @@ -329,6 +332,40 @@ export class TezosProtocolImpl implements TezosProtocol { return this.getBalanceOfAddress(address) } + public async getstakeBalance(address: string): Promise> { + let stakeBalance: BigNumber = new BigNumber(0) + + const { data }: AxiosResponse = await axios.get( + `${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/staked_balance` + ) + + stakeBalance = new BigNumber(data) + + return { total: newAmount(stakeBalance, 'blockchain') } + } + + public async getUnfinalizeRequest(address: string): Promise { + const { data }: AxiosResponse = await axios.get( + `${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/unstake_requests` + ) + + const unfinalizable: TezosUnstakeRequest = data.unfinalizable + + return unfinalizable + } + + public async getFinalizeableBalance(address: string): Promise> { + let stakeBalance: BigNumber = new BigNumber(0) + + const { data }: AxiosResponse = await axios.get( + `${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/unstaked_finalizable_balance` + ) + + stakeBalance = new BigNumber(data) + + return { total: newAmount(stakeBalance, 'blockchain') } + } + public async getBalanceOfAddress(address: string): Promise> { let balance: BigNumber = new BigNumber(0) @@ -411,6 +448,14 @@ export class TezosProtocolImpl implements TezosProtocol { publicKey: PublicKey, details: TransactionDetails[], _configuration?: TransactionSimpleConfiguration + ): Promise> { + return await this.getTransactionFee(publicKey, details) + } + + private async getTransactionFee( + publicKey: PublicKey, + details: TransactionDetails[], + parameters?: TezosTransactionParameters ): Promise> { if (details.length === 0) { return this.feeDefaults @@ -423,11 +468,11 @@ export class TezosProtocolImpl implements TezosProtocol { kind: TezosOperationType.TRANSACTION, amount: newAmount(details[i].amount).blockchain(this.units).value, destination: recipient, - fee: '0' + fee: '0', + parameters } operations.push(transaction as TezosOperation) } - return this.getOperationFeeDefaults(publicKey, operations) } @@ -572,9 +617,17 @@ export class TezosProtocolImpl implements TezosProtocol { } private async getDelegatorDetails(address: string, bakerAddress?: string): Promise { - const results = await Promise.all([axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}`)]) + const results = await Promise.all([ + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}`), + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/staked_balance`), + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/unstaked_finalizable_balance`) + // axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/unstaked_frozen_balance`) + ]) const accountDetails = results[0].data + const stakeBalance: BigNumber = new BigNumber(results[1].data ?? 0) + const unstakedFinalizableBalance = new BigNumber(results[2].data ?? 0) + // const unstakedFrozenBalance = new BigNumber(results[3].data ?? 0) const balance = accountDetails.balance const isDelegating = !!accountDetails.delegate @@ -586,9 +639,28 @@ export class TezosProtocolImpl implements TezosProtocol { args: ['delegate'] }) } else if (!bakerAddress || accountDetails.delegate === bakerAddress) { - availableActions.push({ - type: TezosDelegatorAction.UNDELEGATE - }) + availableActions.push( + { + type: TezosDelegatorAction.UNDELEGATE + }, + { + type: TezosDelegatorAction.STAKE, + args: ['stake'] + } + ) + + if (stakeBalance.gt(0)) { + availableActions.push({ + type: TezosDelegatorAction.UNSTAKE, + args: ['stake'] + }) + } + + if (unstakedFinalizableBalance.gt(0)) { + availableActions.push({ + type: TezosDelegatorAction.UNSTAKEFINALIZABLEBALANCE + }) + } } else { availableActions.push({ type: TezosDelegatorAction.CHANGE_BAKER, @@ -604,6 +676,128 @@ export class TezosProtocolImpl implements TezosProtocol { } } + private async prepareTransactions( + publicKey: PublicKey, + details: TransactionDetails[], + fee?: Amount, + parameters?: TezosTransactionParameters, + operationsPerGroup?: number + ): Promise { + if (fee === undefined) { + const estimatedFee: FeeDefaults = await this.getTransactionFee(publicKey, details, parameters) + fee = estimatedFee.medium + } + + const wrappedFee: BigNumber = new BigNumber(newAmount(fee).blockchain(this.units).value) + const address: string = await this.getAddressFromPublicKey(publicKey) + + const operations: TezosOperation[] = [] + + const results = await Promise.all([ + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/counter`), + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head~2/hash`), + axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/manager_key`) + ]).catch((error) => { + throw new NetworkError(Domain.TEZOS, error as AxiosError) + }) + + const currentCounter = new BigNumber(results[0].data) + let counter = currentCounter.plus(1) + const branch = results[1].data + const accountManager: { key: string } = results[2].data + + // check if we have revealed the address already + if (!accountManager) { + operations.push(createRevealOperation(counter, publicKey, address)) + counter = counter.plus(1) + } + + const { total, transferable }: Balance = await this.getBalanceOfPublicKey(publicKey) + const balance: BigNumber = new BigNumber(newAmount(transferable ?? total).blockchain(this.units).value) + + const transactions: TezosUnsignedTransaction[] = [] + + let allOperations = await this.createTransactionOperations(operations, details, wrappedFee, address, counter, balance, parameters) + allOperations = operations.concat(allOperations) // if we have a reveal in operations, we need to make sure it is present in the allOperations array + + operationsPerGroup = operationsPerGroup ?? MAX_OPERATIONS_PER_GROUP + + const numberOfGroups: number = Math.ceil(allOperations.length / operationsPerGroup) + const startingCounter = numberOfGroups > 1 ? currentCounter.plus(1) : undefined + for (let i = 0; i < numberOfGroups; i++) { + const start = i * operationsPerGroup + const end = start + operationsPerGroup + + const operationsGroup = allOperations.slice(start, end) + + const wrappedOperationWithEstimatedGas: TezosWrappedOperation = await this.estimateAndReplaceLimitsAndFee( + { + branch, + contents: operationsGroup + }, + false, + startingCounter + ) + + const forged: string = await this.forgeOperation(wrappedOperationWithEstimatedGas) + + transactions.push(newUnsignedTransaction({ binary: forged })) + } + + return transactions + } + + private async stake(publicKey: PublicKey, amount: string): Promise { + const address = await this.getAddressFromPublicKey(publicKey) + + const details: TransactionDetails = { + to: address, + amount: newAmount(amount, 'blockchain') + } + + const parameters: TezosTransactionParameters = { + entrypoint: 'stake', + value: { + prim: 'Unit' + } + } + + return (await this.prepareTransactions(publicKey, [details], undefined, parameters))[0] + } + + private async unstake(publicKey: PublicKey, amount: string): Promise { + const address = await this.getAddressFromPublicKey(publicKey) + const details: TransactionDetails = { + to: address, + amount: newAmount(amount, 'blockchain') + } + const parameters: TezosTransactionParameters = { + entrypoint: 'unstake', + value: { + prim: 'Unit' + } + } + + return (await this.prepareTransactions(publicKey, [details], undefined, parameters))[0] + } + + private async finalizeUnstake(publicKey: PublicKey): Promise { + const address = await this.getAddressFromPublicKey(publicKey) + const details: TransactionDetails = { + to: address, + amount: newAmount('0', 'blockchain') + } + + const parameters: TezosTransactionParameters = { + entrypoint: 'finalize_unstake', + value: { + prim: 'Unit' + } + } + + return (await this.prepareTransactions(publicKey, [details], undefined, parameters))[0] + } + public async prepareDelegatorActionFromPublicKey(publicKey: PublicKey, type: any, data?: any): Promise { switch (type) { case TezosDelegatorAction.DELEGATE: @@ -615,6 +809,12 @@ export class TezosProtocolImpl implements TezosProtocol { return [await this.delegate(publicKey, data.delegate)] case TezosDelegatorAction.UNDELEGATE: return [await this.undelegate(publicKey)] + case TezosDelegatorAction.STAKE: + return [await this.stake(publicKey, data.stake)] + case TezosDelegatorAction.UNSTAKE: + return [await this.unstake(publicKey, data.stake)] + case TezosDelegatorAction.UNSTAKEFINALIZABLEBALANCE: + return [await this.finalizeUnstake(publicKey)] default: return Promise.reject('Unsupported delegator action.') } @@ -713,71 +913,7 @@ export class TezosProtocolImpl implements TezosProtocol { details: TransactionDetails[], configuration?: TransactionFullConfiguration & { operationsPerGroup?: number } ): Promise { - const operationsPerGroup: number = configuration?.operationsPerGroup ?? MAX_OPERATIONS_PER_GROUP - - let fee: Amount - if (configuration?.fee !== undefined) { - fee = configuration.fee - } else { - const estimatedFee: FeeDefaults = await this.getTransactionFeeWithPublicKey(publicKey, details) - fee = estimatedFee.medium - } - - const wrappedFee: BigNumber = new BigNumber(newAmount(fee).blockchain(this.units).value) - const address: string = await this.getAddressFromPublicKey(publicKey) - - const operations: TezosOperation[] = [] - - const results = await Promise.all([ - axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/counter`), - axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head~2/hash`), - axios.get(`${this.options.network.rpcUrl}/chains/main/blocks/head/context/contracts/${address}/manager_key`) - ]).catch((error) => { - throw new NetworkError(Domain.TEZOS, error as AxiosError) - }) - - const currentCounter = new BigNumber(results[0].data) - let counter = currentCounter.plus(1) - const branch = results[1].data - const accountManager: { key: string } = results[2].data - - // check if we have revealed the address already - if (!accountManager) { - operations.push(createRevealOperation(counter, publicKey, address)) - counter = counter.plus(1) - } - - const { total, transferable }: Balance = await this.getBalanceOfPublicKey(publicKey) - const balance: BigNumber = new BigNumber(newAmount(transferable ?? total).blockchain(this.units).value) - - const transactions: TezosUnsignedTransaction[] = [] - - let allOperations = await this.createTransactionOperations(operations, details, wrappedFee, address, counter, balance) - allOperations = operations.concat(allOperations) // if we have a reveal in operations, we need to make sure it is present in the allOperations array - - const numberOfGroups: number = Math.ceil(allOperations.length / operationsPerGroup) - const startingCounter = numberOfGroups > 1 ? currentCounter.plus(1) : undefined - for (let i = 0; i < numberOfGroups; i++) { - const start = i * operationsPerGroup - const end = start + operationsPerGroup - - const operationsGroup = allOperations.slice(start, end) - - const wrappedOperationWithEstimatedGas: TezosWrappedOperation = await this.estimateAndReplaceLimitsAndFee( - { - branch, - contents: operationsGroup - }, - false, - startingCounter - ) - - const forged: string = await this.forgeOperation(wrappedOperationWithEstimatedGas) - - transactions.push(newUnsignedTransaction({ binary: forged })) - } - - return transactions + return await this.prepareTransactions(publicKey, details, configuration?.fee, undefined, configuration?.operationsPerGroup) } public async prepareOperations( @@ -1058,7 +1194,8 @@ export class TezosProtocolImpl implements TezosProtocol { fee: BigNumber, address: string, counter: BigNumber, - balance: BigNumber + balance: BigNumber, + parameters?: TezosTransactionParameters ): Promise { const amountUsedByPreviousOperations: BigNumber = getAmountUsedByPreviousOperations(previousOperations) @@ -1099,7 +1236,7 @@ export class TezosProtocolImpl implements TezosProtocol { if (balance.isEqualTo(value.plus(fee))) { // Tezos accounts can never be empty. If user tries to send everything, we must leave 1 mutez behind. value = value.minus(1) - } else if (balance.isLessThan(value.plus(fee))) { + } else if (parameters === undefined && balance.isLessThan(value.plus(fee))) { throw new BalanceError(Domain.TEZOS, 'not enough balance') } @@ -1111,7 +1248,8 @@ export class TezosProtocolImpl implements TezosProtocol { amount: value.toFixed(), counter: counter.plus(i).toFixed(), destination: recipient, - source: address + source: address, + parameters } operations.push(spendOperation) diff --git a/packages/tezos/src/v1/types/protocol.ts b/packages/tezos/src/v1/types/protocol.ts index 5f341a8d2..5a34bde15 100644 --- a/packages/tezos/src/v1/types/protocol.ts +++ b/packages/tezos/src/v1/types/protocol.ts @@ -12,6 +12,16 @@ export type TezosUnits = 'tez' | 'mutez' | 'nanotez' export type TezosProtocolNetworkResolver = (network: string) => TezosProtocolNetwork +export type TezosUnstakeRequest = { + delegate: string + requests: [ + { + cycle: number + amount: string + } + ] +} + export interface TezosProtocolNetwork extends ProtocolNetwork { network: TezosNetwork blockExplorerType: TezosBlockExplorerType diff --git a/packages/tezos/src/v1/types/staking/TezosDelegatorAction.ts b/packages/tezos/src/v1/types/staking/TezosDelegatorAction.ts index b34570d86..b5f4dc30a 100644 --- a/packages/tezos/src/v1/types/staking/TezosDelegatorAction.ts +++ b/packages/tezos/src/v1/types/staking/TezosDelegatorAction.ts @@ -1,5 +1,8 @@ export enum TezosDelegatorAction { DELEGATE = 'delegate', UNDELEGATE = 'undelegate', - CHANGE_BAKER = 'change_baker' + CHANGE_BAKER = 'change_baker', + STAKE = 'stake', + UNSTAKE = 'unstake', + UNSTAKEFINALIZABLEBALANCE = 'unstake_finalizable_balance' } diff --git a/packages/tezos/src/v1/utils/protocol/instance.ts b/packages/tezos/src/v1/utils/protocol/instance.ts index 922d664f2..97e9236ab 100644 --- a/packages/tezos/src/v1/utils/protocol/instance.ts +++ b/packages/tezos/src/v1/utils/protocol/instance.ts @@ -40,7 +40,10 @@ export const tezosProtocolSchema: Schema = { getOperationFeeDefaults: 'required', prepareOperations: 'required', prepareTransactionsWithPublicKey: 'required', - unforgeOperation: 'required' + unforgeOperation: 'required', + getstakeBalance: 'required', + getUnfinalizeRequest: 'required', + getFinalizeableBalance: 'required' } export const tezosFAProtocolSchema: Schema = { diff --git a/packages/tezos/src/v1/utils/protocol/tezos/TezosAccountant.ts b/packages/tezos/src/v1/utils/protocol/tezos/TezosAccountant.ts index c0829a33c..e0ddaa6c6 100644 --- a/packages/tezos/src/v1/utils/protocol/tezos/TezosAccountant.ts +++ b/packages/tezos/src/v1/utils/protocol/tezos/TezosAccountant.ts @@ -15,7 +15,10 @@ import { TezosSignedTransaction, TezosUnsignedTransaction } from '../../../types import { TezosForger } from './TezosForger' export class TezosAccountant<_Units extends string> { - public constructor(protected readonly forger: TezosForger, protected readonly network: TezosProtocolNetwork) {} + public constructor( + protected readonly forger: TezosForger, + protected readonly network: TezosProtocolNetwork + ) {} public async getDetailsFromTransaction( transaction: TezosUnsignedTransaction | TezosSignedTransaction diff --git a/packages/tezos/src/v1/utils/protocol/tezos/TezosForger.ts b/packages/tezos/src/v1/utils/protocol/tezos/TezosForger.ts index a20737d08..8dd47e7cf 100644 --- a/packages/tezos/src/v1/utils/protocol/tezos/TezosForger.ts +++ b/packages/tezos/src/v1/utils/protocol/tezos/TezosForger.ts @@ -1,10 +1,11 @@ import { Domain } from '@airgap/coinlib-core' -import { localForger } from '@airgap/coinlib-core/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging' -import { ForgeParams } from '@airgap/coinlib-core/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface' +// import { localForger } from '@airgap/coinlib-core/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging' +// import { ForgeParams } from '@airgap/coinlib-core/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface' import { ConditionViolationError } from '@airgap/coinlib-core/errors' import { TezosWrappedOperation } from '../../../types/operations/TezosWrappedOperation' import { TezosSignedTransaction, TezosUnsignedTransaction } from '../../../types/transaction' +import { localForger, ForgeParams } from '@taquito/local-forging' export class TezosForger { public async forgeOperation(wrappedOperation: TezosWrappedOperation): Promise { diff --git a/packages/wallet/package.json b/packages/wallet/package.json index 816b6cc9a..ad16dd404 100644 --- a/packages/wallet/package.json +++ b/packages/wallet/package.json @@ -1,6 +1,6 @@ { "name": "@airgap/wallet", - "version": "0.13.27", + "version": "0.13.28", "description": "The @airgap/wallet package provides interfaces for offline/online wallet functionalities.", "keywords": [ "airgap" @@ -27,8 +27,8 @@ }, "author": "Papers AG (https://papers.ch)", "dependencies": { - "@airgap/coinlib-core": "^0.13.27", - "@airgap/module-kit": "^0.13.27" + "@airgap/coinlib-core": "^0.13.28", + "@airgap/module-kit": "^0.13.28" }, "nyc": { "include": [