{"_id":"bls-wallet-clients","_rev":"163-876bf52b3c5acde550a6e0aab17ccd08","name":"bls-wallet-clients","dist-tags":{"latest":"0.9.0","experimental":"0.9.0-405e23a"},"versions":{"0.1.0":{"name":"bls-wallet-clients","version":"0.1.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc"},"peerDependencies":{"ethers":"^5.4.7"},"dependencies":{"bls-wallet-signer":"^0.5.0"},"devDependencies":{"ethers":"^5.4.7"},"_id":"bls-wallet-clients@0.1.0","_nodeVersion":"15.11.0","_npmVersion":"7.6.0","dist":{"integrity":"sha512-lVLCskd0jrOticOHdZZWkZsP3GQY9j5RWCXodELwmbFa7O/RP1rqNK+mQVvFrDX7IZIHA59/uRQeLb14wcNWSg==","shasum":"407b4a3e34421f510b7b0f4b6ffbb2e30a328dee","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.1.0.tgz","fileCount":47,"unpackedSize":75161,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEtE1Jtcbec5rP1eg/SW9uNbE6SpFKBlxAdFdg06DiNXAiEA9qriUcwj0E+Pqr5O35nja+PQnpRd/VO+n1aSYdhpjY0="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.1.0_1634686547192_0.5257627676843721"},"_hasShrinkwrap":false},"0.2.0-rc.1":{"name":"bls-wallet-clients","version":"0.2.0-rc.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"peerDependencies":{"ethers":"^5.4.7"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1"},"devDependencies":{"ethers":"^5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-vaz7rNkXlnNLaCgogwKQnNG/jk59L2NiOJKRCrJmUp74texq1Ndna/rR904tuitFVZKrcRJVFIdBj4ydFcVZug==","shasum":"575d8101f8cb5c3954b784cf632c974b820d512a","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.1.tgz","fileCount":47,"unpackedSize":69567,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICmtZpNn0XnsMd/SfjUVggLBbV1feT7g7yhY10XbnsAvAiEAoDTphFbvG3E/NXckl4imyH5Oa+Wz6J8tmRbXyALzG68="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.1_1634785142523_0.6926491439691496"},"_hasShrinkwrap":false},"0.2.0-rc.2":{"name":"bls-wallet-clients","version":"0.2.0-rc.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"peerDependencies":{"ethers":"5.4.7"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1"},"devDependencies":{"ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.2","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-8KkGoX21R2Q6Uyv3LfyHR1gpWRa93OSVMru8KAVW7XkX0+PdB8ID2xXZuigqXqhHSvnx0NJeODEUmiiZCw+ZxQ==","shasum":"2774047ff93666598de69c6c43562e1a2fe741b5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.2.tgz","fileCount":47,"unpackedSize":69565,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDgSBeh3br6x1MFag/n41gJMAsYQDXAns9QMUeaSAHK0AIgGbNOw5rz/EfjV0sqjBXkVqrPkXmMXbWTKNAujMpMkAo="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.2_1634793573724_0.48338581734430264"},"_hasShrinkwrap":false},"0.2.0-rc.3":{"name":"bls-wallet-clients","version":"0.2.0-rc.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"peerDependencies":{"ethers":"5.4.7"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1"},"devDependencies":{"ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.3","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-mCxPfKzi8YwgJCkHbGO3wIAz7TGY2EdJfkjBSezu3oMLMlyUKeKumSno/vxW35Jw4CXe/jx0Mik3vdDDqxw3/g==","shasum":"6b7a58eb09cb5531d8daacc9f0c6490cf212fc0e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.3.tgz","fileCount":47,"unpackedSize":69565,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuUUtx0HpjD/rQDnNbDuIbCRgl4uyRU/Mb7V64cw7ONQIgWncHqd/4FZbWOt3J45AHurv0j81Fdy/NJu7dd8hLdW0="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.3_1634795021551_0.8240047921628411"},"_hasShrinkwrap":false},"0.2.0-rc.4":{"name":"bls-wallet-clients","version":"0.2.0-rc.4","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.4","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-+N2nOHmdWE12i9NtuT42kAT93AIaOsT+H63oSiiB+RCNqaM8Lwi6YgALkWKrwBbwecs/ekOoYq4ybqiX5s1xEw==","shasum":"c89cad13f137d08baee092ab3c444643fac90837","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.4.tgz","fileCount":47,"unpackedSize":69487,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCCoYu5aa8hUvh5DWRD0Sgt81jObCfXR1vmibsrUwQ+ZwIhAM3IsLUP0TP3FTpTacLqT2Ii+Y/8Df8Ziz+FXYZHW+PB"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.4_1634795416803_0.304169683204631"},"_hasShrinkwrap":false},"0.2.0-rc.5":{"name":"bls-wallet-clients","version":"0.2.0-rc.5","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.5","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-gaA8SEfaPc6Xi+eUa1g0DjN6sx1jDhvBLE1ujqV402mqSzhlXKHXxSDv01hVUrO07cCsDJrUEyuppTF0eGASgg==","shasum":"fbcf8645bd6a4443ae3306ec62ac66c4af6c010e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.5.tgz","fileCount":47,"unpackedSize":69289,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkpNMGJ5MTFifEeueF4LzHbjwtOg1tMCwxRFQlAYTAuQIgdUaebpCR8wUbs+UUrpGiix2bUSZuXJ8fBnn3IDrrMVM="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.5_1634860670061_0.17031502291713752"},"_hasShrinkwrap":false},"0.2.0-rc.6":{"name":"bls-wallet-clients","version":"0.2.0-rc.6","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0-rc.6","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-VH1vN7/+7d34ND46amQ3JUQtEKjORk3nwoYgGAcuxm47lmCbkzNdLrh/9iqdarQouXGD5O6uPQtIod4ulKOU6A==","shasum":"09cf0ef01ae7ad771b13549272a1f8a969c9fda5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0-rc.6.tgz","fileCount":47,"unpackedSize":69320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEiHleYXIXG7b5MyOsKlSzt3hPKj+PrqQQBoKxDlI5+FAiBqFOpHVecoIH4Cw6qQjrEJxVZooifHZNFmb0Y3/dCqRg=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0-rc.6_1634863112545_0.1671522899632476"},"_hasShrinkwrap":false},"0.2.0":{"name":"bls-wallet-clients","version":"0.2.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-RfxrAu5wK8S6dyvLvR9QB4UDH1F7PyM0UGVmtedtGoj6rJwc2BpAUejLXuN+GRPi3kGDSTWLhO2LDmMezJrIOg==","shasum":"249ed5b7bb2c04cfd5e2a7c5b899e5d3119717ac","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.0.tgz","fileCount":47,"unpackedSize":69315,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDkulz+Q+4uM0PMYqoJZVhY45c51Wnfc22nqv+QrgWJFAiEAvI+bdON8PNCtlKLuPHgzA1+3VAkYqb2RPKI7Yx6M82o="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.0_1634873667974_0.6769873197752836"},"_hasShrinkwrap":false},"0.2.1":{"name":"bls-wallet-clients","version":"0.2.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-B80VkT+gK+F6n6wrGeE6EIl9CACXtFgvAEtR/6VVnNEGr3qiRxTSxaaevTeds6z39WX2APq2kzCd8g22qCGAuA==","shasum":"be39d0ae23b1bc28c883f2eeb1aaf7ad152e231c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.1.tgz","fileCount":47,"unpackedSize":69310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEGAeahyajhE7zKHsDxVZFgZSaPLEeIEf92w4eAvjIPlAiEAiCH+LFEWzDGhELdqEKLsNA9fjiEASUS1hcZgkEpCpno="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.1_1634874553424_0.5671826188240916"},"_hasShrinkwrap":false},"0.2.2-rc.1":{"name":"bls-wallet-clients","version":"0.2.2-rc.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.0","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.2-rc.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-6w79H3f8WfA87v6Z5j2uPGxUKl+LF9J1RlOC1llgxrkmusZtw5U3PSdArlGdZTcVnVOs1BeAUt8ZW+sZ9fi+dw==","shasum":"a51d9aa3722e9b4d943b88cb6bb3a7d347e37e6e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.2-rc.1.tgz","fileCount":47,"unpackedSize":69315,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICwiGPE+tbWsApM9rYMmsD8SH3TdOud970cByW67RqoYAiBCSnOJChMmGjDOHEY+LXUOuduKtyQO5cxor/9ph0nZRg=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.2-rc.1_1635723030643_0.5321616425616456"},"_hasShrinkwrap":false},"0.2.2-rc.2":{"name":"bls-wallet-clients","version":"0.2.2-rc.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.1-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.2-rc.2","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-SYSExCdn06xaUIbfUgnTnG/zNblUDh8Ver7D8gYoFGxvZ3n38bGKGL7mQfUjDGsShmRG0WB2Dx2avby3vKMoQQ==","shasum":"f40aceb0d31ca5c1e694c7c58f18d0065aa4041b","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.2-rc.2.tgz","fileCount":47,"unpackedSize":69320,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEtxTIWSR586CsP6K+kY5KETa2FnZijIuIyRkT33E7dIAiAB9jboDCi77Lc0k5U8dDWuhUmr+CTLM2flAJGIQXyfDg=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.2-rc.2_1635724010940_0.18672897546091294"},"_hasShrinkwrap":false},"0.2.2":{"name":"bls-wallet-clients","version":"0.2.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.2","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-VP/Bk1jTMC6auUvU2K7SCEQfetWeckLFBuEZuP9B2WhDkzsvUcLju1H52iP8QuiTcpyt0jV7vHicDp+g0aAZPw==","shasum":"33ce560ea387f66987920725aee9a3f2dfcb1d63","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.2.tgz","fileCount":47,"unpackedSize":69310,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDVgyvgnrPZk62nnCeO3lJTfD2cGs4EloF+EEnIxEDwYAiBudqlXRjM8gc01G71MfQZHBX6xnxlHjd93jyL/L9fYpQ=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.2_1635740329594_0.14845384322174549"},"_hasShrinkwrap":false},"0.2.3":{"name":"bls-wallet-clients","version":"0.2.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.3","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-FXXWl4GRt2WJ3iLaH1VjeiVTJPPZlw7RcTCCK2BfilYoC7lu/Awe4+H5BGZGJpH8fYYaVh+oIdX5/NoL2SAY3g==","shasum":"cb161062d8b5b26f65d33783cf7cc9bac37dab8e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.3.tgz","fileCount":47,"unpackedSize":73288,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDavLmbkU9VSVd3AN9FjMppb+lQAPsYthaL5TpZrZd2xgIgIPSazYco9gNJiq+11PudTnR0d6AFWGBalWmtRm0lkBg="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.3_1635898967216_0.010077242052000557"},"_hasShrinkwrap":false},"0.2.4":{"name":"bls-wallet-clients","version":"0.2.4","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.4","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-zO+7M8VGOHW1ndPW/K8MW20pJ1f5ivWhxvK9fqDxrIj32AbQthQcj299sobg+1o+f1MlRzlUw3vwArOq4MfsQg==","shasum":"0728a948697dc3a1ec67dd11476f9a094ddd8aef","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.4.tgz","fileCount":47,"unpackedSize":71934,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFXFGxDTWyVepKMVYzlfuM0Du30tjezYz4FqnQMvvH5PAiBT4d3D6cC7nrMhLSLuQYVcNZSO0c7lIMFPmYGxTY0Q1g=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.4_1635913802151_0.32341346866850085"},"_hasShrinkwrap":false},"0.2.5-rc.1":{"name":"bls-wallet-clients","version":"0.2.5-rc.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.6.1","ethers":"5.4.7","fp-ts":"^2.11.5","io-ts":"^2.2.16"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.2.5-rc.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-3iSSiGN2mM1KkNmGYnMd5KCTh+BXJo1WxUsgrQMg6lI3hBwcOVYN7suPwfb3lKZt6PnMMCq8ERXtMqctO9yfag==","shasum":"e143667a901eaf4501488dc4578ff409238fefe1","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.2.5-rc.1.tgz","fileCount":52,"unpackedSize":78354,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAWs+DINzasFKrYf+EfIoOBPjN8cE8MbT/ZVsrAWouWkAiEAq/vl1Fq/nE6EtI7B/LyfLWzMVyU4CETNb/vo2pdDvgY="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.2.5-rc.1_1636931646862_0.6940382060941805"},"_hasShrinkwrap":false},"0.3.0-rc.1":{"name":"bls-wallet-clients","version":"0.3.0-rc.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-rc.1","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-O4/Kxfp8bLDKFqJJ8PHqoouaollvL0ACJc33d+cTlolWJrNliue5X+lkkxawXoymSkeQ4QY7MQmQLi+Cm53lCA==","shasum":"98128a7e43db4c7cd77e4ab589649734646fad17","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-rc.1.tgz","fileCount":47,"unpackedSize":59391,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC4G2/vwxfheckjSG0mIWaIQrcpMRv99H05qj8aiFFa0QIgVmIgto2RALlad2BM4RE454SytahLaIl2CSeJoqeTSWk="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-rc.1_1637040394679_0.4534293255469608"},"_hasShrinkwrap":false},"0.3.0-rc.2":{"name":"bls-wallet-clients","version":"0.3.0-rc.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-rc.2","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-evAQi37wz+LnVEQFOqVXJRP6WbCfg6mQQr4MgDRZt6TzL/M00w+Ug5CjrRnoMEg2G1wpZttI/bUmDCLMBmIGlQ==","shasum":"f735010b46b467889baae4431940729acb41e50e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-rc.2.tgz","fileCount":47,"unpackedSize":59510,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk0V6CRA9TVsSAnZWagAA0mQP/RMJ6PGYtgINObDGo5Zr\nm271xknS1CqP9boMVoVnDsEAdPV7M5rwM026WNQnvJBWJYpboiPhSNPELJiA\nX+5gQd7GKTNs6A4j9mu675ReuHhvOJbYS1RUlDOELBKJfb4PzTQ/SAOzbcXL\n52ro4d6g8R5NxESkxAzeFhapcRWRfGIjLtGRlK4HI+sqZPU56WKgrdIJjkSF\nGvMxv0CVWsB34CS3UrijNRRAaLPpq0hFrX32j2D2qEjJD1zwH6aXJTyITr0i\nxV+08UI0G/9bnZ2nGYFV+rm4ATZenx//K+S3Ruu/8qTLx6RuBX9n4bqI4DZA\nKUM/vcUerCOd7JlJ0s64rTdX76RmUoGC5VnLuN74JCSbAS++ijr42hDvdO7R\nl3oZmmYWJQEq97LRwlKKcfyX4nmoD9rFlefMINlDnX0LP+2UFA4Fhm2az1zQ\ndWzMG33Uinq6L4a+8x8dUwb/KnmOC13Pqg1WnIJUrEsJXKApoCirypTAeIQi\nhCH8cEChmBPeyL4hOVKkiCjdRyL+L299NBYHYOeDtMntt6yZJk7V7ITm9GwU\nGDDlkFE5k4c+Dt7CVxkmczDShQ/uMqSMh2xD1rCGmyFQUaUrHSFHLk75VxHB\n5sYdumBb2gZc12aQLxzxV59awvH6OsjAVUBhsVDN7ZUbKuPhyk6CQbuXW+OD\nGoFS\r\n=pw0E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDS/N+R+U0gpECxdJelxdLlj42Xq24RScPtZfB9XFhf+gIhAPGPnHFoXQ61xnpWjgljIsES4KlHz/dMYP18BVRs8c2N"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-rc.2_1637041530702_0.5503693492530628"},"_hasShrinkwrap":false},"0.3.0-rc.3":{"name":"bls-wallet-clients","version":"0.3.0-rc.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-rc.3","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-5acswDhfT4RzLELaTCM2hxNBjULmsSAVs0gnecfZXV1/176yGZ0ap3CQaxFMEFoECcbimXEEAVMTOJmtsPMLFA==","shasum":"e4712203363e2236bd7d4622bb622d6bb8b14485","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-rc.3.tgz","fileCount":47,"unpackedSize":59506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhk0XjCRA9TVsSAnZWagAAfPcQAI3/hujm1kKY6vGgOxIN\nfSItZeaWSldXz/ILxS0OkEZryjGui/wcsKkw9u64E1AV/M7VeKZ4tWtvT94r\n1sbaZJNxVm423JbJ4oGAMFoc/xRJd1AhmuIVkdhiNWtFfVH5TK5/60fth8Th\nqkIlsARCNE4vYAkbBBDsSju7Rdjp0UttUIDGVXarVZOzVmuP1b0V2Onm2use\n36A0BAlkfoeCPv2QVRoQyFJURukHmcOGmuawMID9ErHv3XOLnY0mEVK/x/KD\nT2Kciq1qPAutXwPQf9HFjGzJD+WiNFq8ZqkUrOadskZUt28EKrsU4huEz3uh\nXq1Qq/PyZWqsF9Dtpije7EMKMAEseSdv4GUZyRp0i/5vzOrQzOFXfkFUKsq7\nsclaFVYMRbfOUf1cX2eYLqlFS3trK07D7Fikfn/sEMnzPQjiGThN69nU4XcH\nIuinc22brE19MZIcWjR97eYsPg11wESUIzoeQKCjBHN8tou7WY1tTvt9+fsA\nKehIydxCWsLmiNRdYxALR1aGFEDrVmy9CItWt0ysctzbWFnxt+f9/o2gBdG4\nvArd/+r0oYOC/A7Cdqb7FiaF9q2Q/uW21Te2sd6KOg/1lXBpc7j0eagpsiPt\nedY5nB/pu8aC9pDkSmycwqwQd2/Hb9O1I3iYNB4uHBmFKQR/qaL7XP4GY7mA\ns4H7\r\n=BF5n\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdXZQjYFcb5XRyB1K2PQubHwlWTWp5sMXGMaSSMzIbcgIgHKlLagP791AGcxJaE1H3e813GqLPIVJ9idNQyQ743/U="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-rc.3_1637041635212_0.04334053715548758"},"_hasShrinkwrap":false},"0.3.0":{"name":"bls-wallet-clients","version":"0.3.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-RCpOS2RI32t1AIQ+sBEtVXY3BO2unezzrkb2jB6GzIVVZRNCR29OyInq7a7FApAXHEvcGwmuyknPyX47PF9thA==","shasum":"df3a2a587e083299bd557b82e2a5024aa6d8b485","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0.tgz","fileCount":47,"unpackedSize":62238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlaQICRA9TVsSAnZWagAAlAkQAKCLWo4QCZmMUxi7O6Ea\nxDOtNBrtPIEtkqc0wf1bImQx2KXxnoxh4hGy0B/0s9fhbHg0xlb3BsKAIK67\nHZdkLUSJyGQXhEbj+pFPUbZHTsVs5gBGBdOps5+l6PjHM1TYw2EBFoFdUqvV\n9Jx0Peh+yws/TPMTUfI4ag59IAeEMN1Gk3oO94LRNAWgLd9M+MZiQTGVBY6z\n5WyDymCVqQ1a9Bp8O0yfx51TNHIglCiKROlQxUqFi7f3TJwsUKiGR5wuBBAW\nYQ5U/v+0znjhzxyeqyqjfWk8LHiGllUDYa8k59Icp5vzIqmGxJJ+++Fx6hwG\n2NjBz8f9USa7me+1SbkwRGHbSF3ztaO+v25Yb7daNKu062hbY4zlBOaRlcal\npK8JVFp4nJ5JBRtRJ+A7UyKhEPiQKtdnVKosYA/0Fw603uEZwbucUcp/li7I\nH4KvdD5nqN/Wy2tdNBt4yidVO3vn0fQMwTxEz8O7kQ3Fj7g36jLg0vsbOiIB\nPv8kMEr2u1Tg5TWYM+wRp0JWJ+0Jv4Ym/iS5eRDFUoa5arHWkqOzcmjY8mWc\ntO80XdpZjvlerp775sh2UsfZJu7HjtXIc71BwkcdZZYxWOZu7dbkXwJeQJHz\n2HhhSpi03yj9K273xbMZtcbJpm7ducVfUdvnUMlQu8Rjd+ZhOq997A1AJuDV\nm6NV\r\n=ai+x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCnNIp51QIaOpi7UH2mpJ8BBXX61lA1vWsbqI43+bx2DAIgOK/VT6Vs/77Pn7GNP24OUj4gtgYWKSsHHk2FATV59sM="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0_1637196808719_0.23415534353429024"},"_hasShrinkwrap":false},"0.3.0-3ceb94e":{"name":"bls-wallet-clients","version":"0.3.0-3ceb94e","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-3ceb94e","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-XNO+Mh8mxUEMDNAhDTf+4OWIfOCEhEwwuXRrD7VubwANmvnC5o6LJ1HSGDJgkU9NBkNpYUbPvv5pEQBYmDGglA==","shasum":"3798299164bf47d02baac92ee5310afe528dfee6","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-3ceb94e.tgz","fileCount":47,"unpackedSize":62246,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlaWtCRA9TVsSAnZWagAAfVYQAJArrKP3+ZNyNsgL7SOV\nKKhtiMxSex3m2Cj4CcK8jjLl7c8Wmt67EGVI/KwalPy3pDCTXPYFiqv1h6Ce\n2lCKDBjGqhq9AuWpJ2hDHGi4pQ3pUNhzz8oHar+4bJKBapGliBDXOu3BOrek\nlML9pmZYlx99fhoBMbxqho+jYT0jTC8Qn5qHsVjgeskrZ90fTxwMkWm17/L9\nLXGGSgDWeGZCiQ2HJ/uCR6tQoVYPM097+qfdOyPYF1ZBsTSbrcLa2c3LX7Lp\njvlaRenuB2lvVg7EMM0cg5CZPyxww89xycN5OFfYnkXmykORJmnWOPKvzY74\nxXD8tem9y7nx/jXjSgQE90YWGyPE8FJXzgV3cRn4GOeUAVYPxRBn/ksfQsXR\nH+hH2mRDBhl3rhB2/mXD6bdFj8MBxAZHeY9hbAB+1kcWiPQDypRSIfC6u2xB\nB04I6gGTLNHUfafDtBhW3tT4iGsPi7F2jfIAlx4Lgm9xkaA+gyS9y2s1dj8l\n1zBrcikz8JpiElsq+vDbU54WrVIHAhsSXWTTjDM7VhlubmluUMp0lcnZIIA3\n6o3r7oXQpfqiJdmmUTCT0iin1Hw/daJ0kiJmj/iJax43CeoSaEs9RMqoYNN6\ni4SSbnYfxwpxBC9E+R3BcDZdZGBCiJsYYGNWIMhzd+pbM5svxMUvUAQGkweS\nCnPE\r\n=gas/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTAoE9sSBTa8V52N39K62gVMhv0ptt6Rwbb3/1+rv3lwIgOTsnFdY1SXgyelHkC0mQS4lc/oAtQHK9AnhhnrEfXco="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-3ceb94e_1637197229792_0.8456259431593558"},"_hasShrinkwrap":false},"0.3.0-eec9d49":{"name":"bls-wallet-clients","version":"0.3.0-eec9d49","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-eec9d49","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-yzc9JqJFd4dISuBR28dV7NuuGOP3WMjZZtevzliPFZ3M1E7eyeWgpsIggkB9NJ0D5pLNTDUi5211iW6hbz4osg==","shasum":"95c4328d63c30e7aff044927d4b8c636bc1d9fd8","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-eec9d49.tgz","fileCount":47,"unpackedSize":70764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlb3UCRA9TVsSAnZWagAAYcgP/A2l9lIWhzzW0IsbNVt9\nLcYZH/UIOFyiYwIPdY8P3PuLKtv1QuwMzyO0ohaqxMeAYYXc2RhQ9QzAV0wu\nAscsBo0G7app5u+YylanayJcQqgQPVEOuAYqBqw436MQYWkdlvcsX3mLINXs\nrAc+VFPLNXXOneSUa/Yq+RbXn9uzRvgT6fCRisIFide/mh8XQ3Zi0TjwYiD1\nXbt4eJjti4FB1ZqChdr7AcT7w4ThNoWRl5bIspvri7yb9z5KzuV2AbVbEsf8\nRa+mVFuFvfMAZBol0FdKcQHsV5jDftmi7RZINdX/qIvWyubSxb4W/znWxfjl\nUFivLkWiNx7KQ4IO5yMaxSouNvoU3FAV3awuXXTLS4v3APvb4cq7afopajDX\nNixhBQLMigNE0Ln05mkyFGoYyryuNEyvn8fmY41JXfeaELMrj3I75IdRWlr8\nP8NuJEEpJ0MyPv/rCb/hRKEFKiiYJer1OJfmRXUXJQGKsFkstJ+FCji8nQhD\naYqD4cc4KddO9RfK3cmtpA5QEmAr53fCXvT2fd4JfPMeWCdEebXFsIMVsJsz\nidr9vVKGaJKwwFo5udcLGD0jL9gUoUh9MzxOkWdJz+BuGH3TtDcWbN6pL/pX\nZJHMw3lWU6cc/t93e8N6t9oDhinOfxIemwj9n6/skBnzarrc9ilmgTycS/pq\nAuyw\r\n=5w4F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDDabWTs5R6HLFkggv3a5ct4zjY8liyPEqUZ3GuVd4U6QIhAIxwqx0glwsnOZgPL+nMt5+pAmo0kzZKBP2ZFQzoySAO"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-eec9d49_1637203412129_0.11404635003076313"},"_hasShrinkwrap":false},"0.3.0-07ac8dc":{"name":"bls-wallet-clients","version":"0.3.0-07ac8dc","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"5.4.7"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-07ac8dc","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-tobqXpM7sKGxIFgP0ppQJght4Tt7+3S+3UZvIwtqZ4jYOFltLsSuti+DcDx0URyr/614k3maNIgC8BOy10qktA==","shasum":"7e42932a35c8dc86226fdac8c3969e5215142860","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-07ac8dc.tgz","fileCount":52,"unpackedSize":97776,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlcNRCRA9TVsSAnZWagAALDwP/R+IWGmrxaw1TqKhSBhn\newPxcNcZEDlpfCvAIx/+wRyJg7z2UUA2Sy2QvTcB1Y/95wXP+IY/bOr+S0wj\nRkJaCySwa5ggVg7Uc+evSx5Fc0TfMfy+P6q8/SPj9cgj7fOuIB/T6qVw+Bhz\nQJm/TMdweCdN0HjPt+PxFwF2hqcynYpR0IWN7pXQ8Qt5ZzzvUuIZTTeb21j/\niOoIAbS/sFSQAgdGPAZza/TbfQHHUuaiyeqCMjjgZe3eoXvMg/rklWhFQ9rZ\njIVsfq1xegJcK4PNmTNT0mWyCm2kS38QIspPlhm4c8jclXR9Cum0LxDPXWH/\nyprhPaSVA9rvx/4X+P/im67CnBRU5p2nwBQh0KZZ/JGL/BpywzoPyxsSlqLT\nxyj2zBO/aZXHrIdSMEN3Mw0E6SFu997jQmSXxwNcrRZmre/pWxbmsA0ncCri\ncjJhmbIgdiTzR/z8Ey2akSVzE4MVlgxGhIg/moiGpwAL0fcU8kff+S7y+4Y3\njt/IVj+43LHRTdjhQPXqhbwACJFaqR/RcJhN+52/bK9/TGxDzNolId+eZrpD\n4abQEyZ0AvLPT5l2HToHMHwtU1MbSnZ2F9aEBWW/mIYb9R78sQv6P1ru9cU9\nHSaLXdaTtVsXkGEjj0YDDrUUYK/Hup/zSk81P40khv5Yhdj9WAlsfi5gwuQX\nQ7rO\r\n=T4g5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFCGxruMq4nfubpu5WQTKhHQ2Nhm1EX4DuvgdUhCX+UqAiBXALH9khtAmcqDSOlHwF+pDHiCXBSIcy1K1ntd2bk0FQ=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-07ac8dc_1637204817048_0.5982015710468829"},"_hasShrinkwrap":false},"0.3.0-9bdca2f":{"name":"bls-wallet-clients","version":"0.3.0-9bdca2f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"^5.5.0"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-9bdca2f","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-lKn7kVeK3fqVJG6lGZxLP3p9h7WZzWfYmcSXRLIDUQQ29fIt1mzZfYXPqVSUW4qYoZtYOvhI42OKrYBlJLWipw==","shasum":"dd962f35075cecb3f631a8b9e9846596ef4db3c0","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-9bdca2f.tgz","fileCount":52,"unpackedSize":97777,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlc/NCRA9TVsSAnZWagAAxkYP/39ULAgy2NOZZMpb01H7\n8yyQ6MHZkgI8lpCG1DfCDscWvItFrcgahAjCLR9aCzIZ8iaYk7jDoI2MRKRu\nfq7rKE8iOd4mSzIbI+21uI6y4PMrevavbUsjS4yyUi70tCM4psrD7uyoJv3z\ngYqgH0XNsxe3uFABF7SP2UxqY3JPNodELFGkAkhykGOHkGEpmRQx7MW2ysXN\nDAzUox9fMW7KyIrLXpgmYZA6u6RbebZNnA40YI4x5XJlMN8+K8DexF70LNIS\ng+lrtRq2r9bcgUWL7s4so7LijVz9vtPpzAmFy3RsfqKfmgCM2NuoRiOzYTn9\nTc8nFh5ohzWQj0WIPSJJLwCpQqimQToHyUtEz3lQV8Wkx02v9WefKkDoCU/D\ndDVyKPlElETyiR+fdrJ7ASaaXuoUZ/fJAL4sLqL1qUGh4OdzVU9foHbTjJ2u\n9C+MJeBnIZN51MaAhCEgW8H5UmKC/IKsiHG5Weas3nHeBV2EAEy1ik62iIzJ\n3fI3CLBmieAcp5XYmQOawnpreDZX6aLDdLt9tpEVykl/deMAkgvls1YpgsV5\nORxNZnNKLwVPiwhYJ4fTmjxtKZ/FTCHgelvUkUWthZY3RTgqATpUH8kolbee\npJ3IjIwbLg3BqftQeOgj+rufXzwFmgFxncxHP0iCOBV79EHaRvBvjiMkcAsg\nWIa9\r\n=m6x0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDRCQY38ubuf/gZKsUPx5+YQvK40eEdfVy0rLwOBHu97gIhAIXKY6+MWG9a2wkPjs+9+RFWo15fvYT1XHt5OSRP+oGb"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-9bdca2f_1637208013413_0.3034047042616208"},"_hasShrinkwrap":false},"0.3.0-590deda":{"name":"bls-wallet-clients","version":"0.3.0-590deda","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w"},"dependencies":{"bls-wallet-signer":"0.8.0-rc.1","ethers":"^5.5.0","fp-ts":"^2.11.5","io-ts":"^2.2.16"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.3.0-590deda","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-EKXXFfHU3WWkrWVpuZryVXkRRHzkaIBHjwUevLwrHUrirGaWyvQ2Whc2F6HLeULBdYQ/VWzRNmf47mjzqyswIg==","shasum":"01faf7e06d63658a59a68774c605b027d45662f4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.3.0-590deda.tgz","fileCount":57,"unpackedSize":107802,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhlvvnCRA9TVsSAnZWagAA0rQP/0HgTW+EMu8iaSRKro+J\n/WD1CPuDiCsKsqlgsr08XSMyTRcgypgjLD62GKdvFRDv470NjcY8Ey45awqE\nvLE8OrJzxeQMcOjj7R+Kib45sBcTAFBVSppcnOe92D8QMyUaLE0SmsHOoxoh\nDt8a1PukdwBE+DYRbVku8Gio3X3ZNC1qhWGT+jjtlGGwUlQEMCV8jaqSL3Rk\na3bbzAPJ7mYoVBMHnuEM0mO66ItOG+Pb4lFcr8+tLPXkcex/UqB8MWxz2g+s\nxG+2/OwNhkKwYGr3ks2WIuyd+6AtnYz3GQj01jNPh50kbXOiV6Z1R1XCm8tU\ntTqDj0DhM6zVVarhN1ygIC5GNWZS3C0hZeNuu28Drom3JEBuVKiMwFXeH/fB\n02TGyoQnARIWuqHr62LyaKbJ2ktahOX7XWDCvVtfoofaUWUe5hiCViIShZBT\ny7i1m47VcGR/JHCExMs0fNPx0eK1QAhDUfjsWX8mH1R/MDiqbrqsTMdBWmYu\nwd80vLVH+ScDVTUeTqK2rh0lLQrwDelg4MVefuiwKURctHIFdcQlp0iLkQlS\nU4m+O9b7tdGkj7DTPXur1u5OkMejJTbzVFrAhfKIHD81tTJX/5cexwEtnfl2\nQWk7eAmH4IEvqkUSO+Bpi8nQgc45BGeqgYH5zRDt3yiMPD+PUjr+h7QnP11D\nN2xv\r\n=nRdm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNiUs0wxwS8QyWNLecd7Nr1ewf2HEj39p2bmN0tnb/ggIhAKT6D7S9EVMyiiRVpAYGDe05okj7vZ3gphIhQlpaSOgC"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.3.0-590deda_1637284838845_0.4321756957201319"},"_hasShrinkwrap":false},"0.4.0-225dfbd":{"name":"bls-wallet-clients","version":"0.4.0-225dfbd","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -r typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental"},"dependencies":{"ethers":"^5.5.0","@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n\n## Signer\n\nTODO: Updates... this is just copied from the previous signer module\n\n# BLS Wallet Signer\n\nTypescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in [bls-wallet-contracts](https://github.com/jzaki/bls-wallet-contracts).\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet-aggregator) for verification and aggregation, and in the [plugin](https://github.com/jzaki/bls-wallet-plugin) for signing and aggregation.\n\n```sh\nnpm install bls-wallet-signer\n```\n\n## Usage\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-signer\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const signedTransactionData = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send signedTransactionData to an aggregator or use it with\n  // VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.0-225dfbd","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-AWZLYaC4tN4CudP2HmYcz06o13hJWcOhl+CtRCqGkO3A67O759u8k8gWjQwIuVYBq/2mzNTziJCcdpQLz35Vig==","shasum":"d9099ef0763216e833e4c1bded622853e760200c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.0-225dfbd.tgz","fileCount":112,"unpackedSize":142150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpFzeCRA9TVsSAnZWagAAjWsP/0SV6rwy23pDBEuOloh7\nmzWakzJft2n+WW15u1akiq3zWS2+zfUvl12YpsZTFpzNVIvO7Rjd8J674Yo0\n24bD6PirFx8jLwjD2M5H0Z4laDchk0B7jYtq0J/PZYQMJeiXDMY/inn4J3j8\nuKpVswofgz1nTvyMUkcM1Ds0tLuNwbann9sCjBDbcHgCpIwrKbhR1kZro4yX\nhIkgeaqwHH3kqKINMlQs+u3+1WQGZsrnxJFynVaV2DOYffQhMwtGcTTqv/5l\nH60P5m4W4kY4vXEE+3WpziSkbzSpERbSQMqIaC0nwfCb8wgU2w8q2Ve4Ygiu\nMqWRJPV/hUX1Ah1PO8vGvqQ50ZpBF5Rru211v4ykxf8BgquhNK7Nzgm/TajK\nwFKBPsM7v4Ys50R+cCJZ7iN3uPDD18Y/iOnxqpezlUvP/uomIVcDRM19hNxL\np35vx0UcOCuYXmJtZcGwZn4JBuXO7YelCJa95ADija54K2CxomeOTx/PW/5g\n42h62/1NgiUTZD9rtQVgetecbj5gcNfvYIdRmfsjD6pUM0eYIWHPMGHzCihP\ndgfPi7QWprnS4PfhQ4Oems4fuB3wOIaID9SfES4KRKgmnSCbA3FP3hnAVLGc\nddUxfO5iO3sWSdoGnqJRCRRF7/rl6uaFmoLW65dRF6GQE36nWJkH0wE6F1S7\no7yD\r\n=IKHP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCeE6AbzuzRCm5Tjf7J5ui1cYJ0q9c54wPmgvCQ8w2cSAIgFTjDJyup96hI9Q+EowHe9TcqmBU0ktXlw7XK1Pn7kck="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.0-225dfbd_1638161630448_0.008618515446109809"},"_hasShrinkwrap":false},"0.4.0-48ba9bf":{"name":"bls-wallet-clients","version":"0.4.0-48ba9bf","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -r typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental"},"dependencies":{"ethers":"^5.5.0","@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n\n## Signer\n\nTODO: Updates... this is just copied from the previous signer module\n\n# BLS Wallet Signer\n\nTypescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in [bls-wallet-contracts](https://github.com/jzaki/bls-wallet-contracts).\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet-aggregator) for verification and aggregation, and in the [plugin](https://github.com/jzaki/bls-wallet-plugin) for signing and aggregation.\n\n```sh\nnpm install bls-wallet-signer\n```\n\n## Usage\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-signer\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const signedTransactionData = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send signedTransactionData to an aggregator or use it with\n  // VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.0-48ba9bf","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-6+63UeI8iJiji/G1ysJQeL5CXx7cYaHHswzhC/7WGgKifSu5vvD3MslOe7Su1VsHxOxlG6+GZ24v0+b2tK2zZQ==","shasum":"44b415986e78cf14fcfbb2c94cab1e1a7883571a","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.0-48ba9bf.tgz","fileCount":112,"unpackedSize":142150,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpF3TCRA9TVsSAnZWagAAvs8QAJag9IuBaXx1cn1qLURn\nVVgReRcISTRsjkznPLR059pwPJWopce2sG4LK54nftdgbPgapdv+9c32njeI\ni5mt5FvBeMrazBBDR4FhG6Sp7Jj6M+woO3nWY7kJDaWVdfWqPHxbDsOYKsDJ\njjOsVTV4VR2QycOoGXWdSrPur69GAKuobgYG5SAJylu14A3G4QZdiIfij6e7\n4D+VQ8fFjIScm9X8S0mbUOc5G4rG9/n1HSwHBGWOU0vGNmWIKaB+eT83QRus\n/Ltpds/8NTNLRYqCBgx4hhtwfxkrXl0bf8GBk6h3E9MGNPBSxusm5j9qQmTi\nbZZP/Kp5bAsGcDt0d79ToYL5jcfsyPaol4wVOL4Fp/7u4Chz/GwJBR236Yxq\n/FwsUEh6UclH4z1/qZAQ3d0eIrzPNAkMENATqmLOpNbafoLKWpb1IKBmUj3A\nRTIw5p7/5Osik7HGqbHLHGx5FO42KkZVZmIOhk5tVURyEPXOkt5lpCaqAXLC\n80N0IMEMx02rizFxhA9tfFq9O8C8/faqv6JPCEKSxtE9NGk1WoBP3Xt2w+QU\ngScm5yC7NaovwVjQRhNNGLxG1abXh9MNZRWpV/XFsCK27zMV1H9RlLkBtGhq\ny6An0F8O5Wz7RlZ861+0tm8gtiBS0QlcUOEhRYxhumeqYwin4Vx6xe7R6gda\nUXMo\r\n=7FjC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDxEqvMxfKgZr4OZJzjUgsF7Q3L5HlBaQRsHF2AR1vimAiEAgrjs8D1lOPWCbDSKUsR1U9QIc148Q19sXVQbHMIyM/w="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.0-48ba9bf_1638161875698_0.7467063266813523"},"_hasShrinkwrap":false},"0.4.0-b74e369":{"name":"bls-wallet-clients","version":"0.4.0-b74e369","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -r typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.0","@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n\n## Signer\n\nTODO: Updates... this is just copied from the previous signer module\n\n# BLS Wallet Signer\n\nTypescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in [bls-wallet-contracts](https://github.com/jzaki/bls-wallet-contracts).\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet-aggregator) for verification and aggregation, and in the [plugin](https://github.com/jzaki/bls-wallet-plugin) for signing and aggregation.\n\n```sh\nnpm install bls-wallet-signer\n```\n\n## Usage\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-signer\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const signedTransactionData = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send signedTransactionData to an aggregator or use it with\n  // VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.0-b74e369","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-GQ/cq3Xy+/PZVckqq8g0kOwqX+bxEZNv801XDBjQGb6G2Yb3BvTs3xk35I6oF/1q3Zs5Cxu+UZ8eYmGPCejTrg==","shasum":"c3297c583eec5174c8d3bfbd9b2fb373333a0ce9","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.0-b74e369.tgz","fileCount":112,"unpackedSize":142508,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpGCJCRA9TVsSAnZWagAAysIP/3zZBOqGL2qoMUgaxCKa\nGy0f+6kU6oUxXI5TgUkY7PCVeQZvPcR8NS0MwczUL3jhJXDJ6ILZ/pCIyzNk\nvw6D5+jCnTMEjMf+dWyhday6PMnk3ZgOOgI0XlxMhEFupcmy+EUSna9DFk8d\nRbxSOAUEFhu4iK7r6USnn8V6uyKmLbmLyDIIJGu0shpkjwuvmiVMI3U+jqbY\nco70IXAJN03q2zeSmkss4S4KKOQbjmYEyadTWL8ZoDAO/L8fL47FfyhhBwja\nNjnoBSJBD10s6OMGPVZF98RlXFZfJ5F5XW5xOR16EdcdKNRNZX3VigdjFezX\nYnxsW/fSg8qoY+h0LyYFGVSXEBavKgM5YjAqlbsOEcP0Qp6S/DIpWyaf6SKN\nCoZTNIfpKddXPpqD8J34kL4/9FpoAfaZEo8WvzLqD283IIx/bbLcWW66XMMY\neZF/cMrzMSEq18IUu8IuieiQJt1s0sil+UMN/OauzS5A/SEP3xy7Y/YB2rWp\nMSTsBuoV51hOfaPZkjrG3hA6BHd0awtgsjdIvBshhG1WHoyINKb2hxNN/E66\nqFU16oThpjWvP3J/rfzuJLoqbABWO0/qsceHOr8Tc887xUK5F1qoIz16Py/O\ncv4gW60/GUfVhaA7yuFb9KPIc35LFG5Az6/xpCCpNE8CY9Y0qHMdubj5lV2i\nzWx8\r\n=kqUw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB3nWJGv/XFrO6mvoQli6BxDakqHUv7uQKJDjVV6PMvPAiEAweMtsOq+NvDUA1UsMqK0NQmpSXK4HAP7w6z2dPL/JNI="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.0-b74e369_1638162568964_0.12258788480633842"},"_hasShrinkwrap":false},"0.4.0-3439ba0":{"name":"bls-wallet-clients","version":"0.4.0-3439ba0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.0","@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWallet\n\nModels a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce `Transaction`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWallet } from 'bls-wallet-clients';\n\nconst wallet = await BlsWallet.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst tx = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(tx);\n```\n\n## VerificationGateway\n\nWraps an `ethers.Contract` with a typed interface for `VerificationGateway`.\nAllows sending transactions without relying on an aggregator.\n\n```ts\nimport { VerificationGateway } from 'bls-wallet-clients';\nimport { initBlsWalletSigner } from 'bls-wallet-signer';\n\nconst blsWalletSigner = await initBlsWalletSigner({\n  chainId: 1,\n});\n\nconst verificationGateway = new VerificationGateway(\n  verificationGatewayAddress,\n  regularWallet, // An ethers.Wallet\n);\n\nawait verificationGateway.actionCalls(\n  ethers.constants.AddressZero,\n  blsWalletSigner.aggregate([tx]),\n);\n```\n\n## Signer\n\nTODO: Updates... this is just copied from the previous signer module\n\n# BLS Wallet Signer\n\nTypescript module for signing, aggregating and verifying transactions using the bls signature scheme. Signed transactions are actioned in [bls-wallet-contracts](https://github.com/jzaki/bls-wallet-contracts).\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet-aggregator) for verification and aggregation, and in the [plugin](https://github.com/jzaki/bls-wallet-plugin) for signing and aggregation.\n\n```sh\nnpm install bls-wallet-signer\n```\n\n## Usage\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-signer\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const signedTransactionData = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send signedTransactionData to an aggregator or use it with\n  // VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.0-3439ba0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-3ahhjLn6vzLyimxAb302+jdSEl/kH2TrVI7QNhBJ920HF8Pjx1nCbfphnNTKAZZh2YULzak5wnrPw1oCG5UYwg==","shasum":"4fa318b28107fb7cabbb0a320de4a17ca0b10ca5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.0-3439ba0.tgz","fileCount":251,"unpackedSize":904294,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpGbDCRA9TVsSAnZWagAAYmsP+wd3n6rvLJvZGZz2Q1PA\nI7MVbgnHoyCT4SIhLJ6mL/Yvcmd/04tpbN67FzNmA12dW3czUQaWABDGqcni\nQHvGmvtMWPcnXTTKBxOio1ppUBqWs9y3qlQan6K69ZcFCK94QBC8ZZ+/hAQ7\noLIJ21XACTp7e6+GeKSovjhL/4Op0yikYyvuSxwKvbjxMxtLGTlMxeMKNnxY\nvj5mAYvDSa1Z25HCksm3kCs6IArbWMTNrjiq6syjdzbYZ16pC2UvLCeDYq3M\nAE/QiqbrWbpHPvHadLKQZ4UwYfo6Yu3qTu+JHB+2f4EU+X7oKWF1NqhMNiWn\nF2MAd8bMgNr7Pa/0JP0C2yIcbg2MUDp2W3EZ550ldVaftTt2adiISNBZ9jAq\nNPck87X7IvVFE/nkpfT5wliQXb7kuOYhcoD9bEx7LnWCDMskiXA4r5VcmBEv\npSW+v8/39/I86bZRn5l9U+nVEHGKzimU2LVLS8c8r67ZcY5x+7rfksfuM1vy\nL8jU7ylwL/3zuqReFG+ZGUuAg6YCM+h6J0rPj+kSMKlIEnpvv1ItjcoqO5zR\npBI3kPddC9sj6oPspT2132asSl1O8MsfmqOi7l+f1CNnMHOSQ5jtScWJUkMs\nu8x6dp4Okr4kMXSK/d+QUx8PjLM7grQ+itIgcEvzCCVjW8hvWG6wutPMcUIR\n8Bur\r\n=6Fmg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCSM1Cq9K3qYcID6lKcHFYFFG9d/tPnxiFlmIS9MCktgIhAIiYZj7IDVyHWolQmg+Fhs54zGib2tYa2EannhBjzK5I"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.0-3439ba0_1638164162906_0.9134999725192461"},"_hasShrinkwrap":false},"0.4.0":{"name":"bls-wallet-clients","version":"0.4.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","fp-ts":"^2.11.5","io-ts":"^2.2.16","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-J/gh4H6mFpzrIOz8S7XKhATWjLfUpwO3htZhooibtYkv6ydRrss4vAcpyNQXuPItUZ41JX3NjymJnkQYK4kwQg==","shasum":"84220c33c68626ef9a771ddecbc0a7e7a7f1dd3d","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.0.tgz","fileCount":251,"unpackedSize":889010,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpYwpCRA9TVsSAnZWagAAd9YP/Rer73IICsXHURJ6PwXD\nkywql/rkwYKHuNw/8nSP9XDCL8tzghkNwJ7yIMHkSr5aDu62wg5hfmJDy98u\nmKvLHr2+YVVEPmpazhSwXlQrcVaVtozmkR1fz6Zbydc3g3tlaKfIua5Zw+DR\ngdFGbHcVm08GP9gUJnH9JPMsLWzILjHUKWxlZq2/jEmz/S/1JSPQrlJNFQ+h\n1iBtQjeZT6TFwvG8IbJTffHY/Vb435wWYYVCkBSmwFKc5AqXSC8Upj8ezUlm\ne6byjQsiIY+k5qKXrSR1CZIl9DkBVyPE/LrnZEtSh1Q3o1XdLY8zo4KOdeM1\nq+yKensT2QtLUdUgcTfQY/846OaiAqz61sr9HpBkXFOG0awiLNTX7UEjMBbr\nDKESO61gp9aGd3qEv5IbAL7MT/byrshwi8/aApqKVHyrDrCkkQ673W38A0fl\n2FLuGPN47a5eJOiX+nLUsQS6oQ+zFb3BpNTqo2NheSljPP3twblkWTeHWTTC\nhmuSq9ccUwXGBYaahNSmW135VRUhHH0evi2ISxmbe7iBfOXoYiDYg643nvOS\nwahRKKT0rH6e8tyRR47TklaRf+cPLjPFZXU9QsjKvrvE2wPNsmeWbpgU+ebz\n5jIXGn/CXDUzo4fzoNjdHpIfK9TIJ8F7ovvn0NZyt1UTj3P8w5SF73rzLIEa\nQNwP\r\n=Dky+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID7FkFPvQlv2kMRwjzQgTlFyxRUykXB/Qo4qdUFY5f77AiBMGmfvJ+QlrNvsQsqFxal3xDgH+J7tAUsJcwPOATDe+g=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.0_1638239273290_0.4277765928519732"},"_hasShrinkwrap":false},"0.4.1-3f27d83":{"name":"bls-wallet-clients","version":"0.4.1-3f27d83","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.4.1-3f27d83","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-X4lPCv2/aoQGJ+mxoKQMhXdMwVNREmCwLSD+FMoOXjW3uPKaZvWbSYiPVgHJHAbNbIo4WFKZ8kqWMIAGK9d28w==","shasum":"7f96b000df3936f444f0884893056e4bba9974b6","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.4.1-3f27d83.tgz","fileCount":251,"unpackedSize":889561,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpal2CRA9TVsSAnZWagAAogIP/2sYdN3A3BM6TtJ4sAPS\nFqL6FyP8q3SWm81mVmTDFizLW8L8T0WHzKJYgKxwqTUGtw8hNQyxk+I0cKOa\nDdXbYgnuuRx24G0LUFm+YRqC6KR0DlauTN51eVnV/sKmkGFgGzjPU1vNxhbs\n9eUmLodTMhf82jgj0zZBtgZjee44RSKv/S22Yj3vwilFfs1DUro0dOB8WbHl\n4k1Q5B+YDXf/VFucRSH40BDmbQDfKizKuNfKbrlr+bxeocvxt2mx66Jb4JZS\nINVeVJfmcdvH2/OLAtjg80Mc3CgRaQu949UcTusbBh3hz0YfDFcy68OqNDuc\nhN+AORPvi1tni0nvJeR8Ff+3yD4Rz++aUO02cj8HMoBVvU1ebReWhobSwXE6\nGtKAGn/UN/LMX46fTB+ulPveLTkW3ENaLYW5rHvTBTp2TErcKHcK3fUHCE9O\nS78S0onkmqsd1Dx61dk/0/tJqgC1u33T7uKWmVTl9BZMvAB93J5A89JM4p2e\nmIJMtbCIEJofzSiynZIxQSNX5gsX/Jn2E3GXyijEIewZAQE78RKkVzDoxb5A\nLlpjleUdJP4h5q88oVn9YZduZYjG+mgwswcZAxWi+aolEtzPW7Tra5jJBGxf\nCPfaMQLFOFVOsm/ZgsXDeptz2mu34kUCpNt1Uau4RbVaPqNwQhL87DNuiqX/\nlwGG\r\n=ZQnB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgAKJFEtYTIjCMZAr5C8kpW8H1OSc2AARy1a/vos/WOAIhAMpMcduaMMkAg4yqVo7ewkn1JWuQqU4wFU6lxuODQcsn"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.4.1-3f27d83_1638246774339_0.1934005461819115"},"_hasShrinkwrap":false},"0.5.0-405ec15":{"name":"bls-wallet-clients","version":"0.5.0-405ec15","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-405ec15","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-9p46wswwLB0YdjhFvWkcjv6NqbFVFNV0yLpv62nl9w6gRca0vNWGW/pbZw5ozIhmBbarl5WyZX5/cI5dOpP9nA==","shasum":"f9f8a5510d167f9266dab85dd17ddaeb189833b4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-405ec15.tgz","fileCount":256,"unpackedSize":892639,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpbBgCRA9TVsSAnZWagAAGXgP/2sbrmf5eoKo7Eqhm8cE\nkNCylF+wzmiBQZz1eSWKEiyTCt8iytl9ceh2hz0oAoRGbq1Al+fiOEcTFW4v\npmcB/IndGVn8i8ya/uK5Y1StesZg10F9U84AhNplCLdYVsX4sjvotJGFS8Nt\nP2GME05PH+IWYBP+Mc+zXTYovDohbpBfchkGuvNV+TtCQ2kpJPvompinKNtz\nipecxPOLD5L1be2eVH828KWifNw+vWB+wvr9UZxR/LCRGZ+AL0C2AsC1Z0kB\nIccCN4x63ppGx+lzD0C9OzbrQ7O+1FPdD9HfgBfyDvpdxUK1BPndqjWyx+48\nlaBiKAT7BHcXF0b9dYcfqK9FZa+p+RlrDbtQszedwFb/6a1SazpQUDTis5lm\n5eRF5V2REdX2qnOKA3lYcXEJU5A+VfTum2AdS1/8F8l/ytkPPEXakrjUFW5c\n8EPiRXvRYPaETzDE34XyQtyJPAXqz+xx3XRTadlpvQgqLtL3o1C5CYEpLlQA\n+FSY5rQ5/fxqib1IxH3jMZwLFSawSdOe4oxO4J4CroB/JOOb2Hk9d119qmq2\n/dMGB9Dk4zwjA78QMuo5DBVlorKtbalA5pCE/dTjOXKMhNMCLYNsxMWlNM8l\nWgvGVJODhbNmHOnLtIr3bR8PLTWLvYbIVzVqugOAK1+jI4OE0GFo0J1QO3yl\nJ/AW\r\n=TRFh\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDN/nHyfjt6pGKHrxylQd5hfNaAzTCtf3aPc3xhaGXUaAiB9Xmv2tX3G+5n4B7s9x9qC6QMqPXatNLikXaz1dfmlRw=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-405ec15_1638248544007_0.638120521036722"},"_hasShrinkwrap":false},"0.5.0-3fbaed7":{"name":"bls-wallet-clients","version":"0.5.0-3fbaed7","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-3fbaed7","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-/p83BaW6HFx0Aof1pN9XBQrtbFoLtkjiBXvgb/hXmBkheiTVh+CcE85QNV2vIjHicWirxttH0Y3Q8PDB5GcqRA==","shasum":"d55f92de150838a2cdc0e2a252dcbbecdcd684d3","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-3fbaed7.tgz","fileCount":256,"unpackedSize":893911,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhprziCRA9TVsSAnZWagAAZIAP/3OPkMueMR8xiPgbP2aJ\nVFbKYs5BAVXU5pkOalEZFYWSOiAl5YAReIp41YWVcGJL1iLRH/1fI/uu3Soc\nnsqeyfaAKV7rJ/g17RXVwZ6D9J6IY+I6TBujhv4G5JryjNnPVhI54oAr5tzv\n/VEOSGe8vahCdGGM0fN9Ig5+JKOKr/ixHUNeZFWoyuw5XCm0Esjf1NPQj7aE\nm6w3vDPxocWDOZbkVBz13Oajt7X0Py12qHnYF+AqukV+vck8FRATcTogxiAm\nnYlJFpTelNgXpa/XXsyj9LCklkYazQB48iy43Tv6NT+9CeMUqQvJh2bvIawF\nnStQJeHQXtTuyXuGVe0/cSM+atPlMoKg4+2aq0eBlyiSIT+JxSN1cl9qIgOH\nMc3mm/wrJby9ygRm0OkWUssSLhMveMfvPjoTTRGc8h5Gpze9SRohLklDBprq\nIPCX/BzZg67MEVJi8E0lER7WdsyO6RnnUFYBi2YnvzK1oizFRKCGjko1J0fr\nYxUuyGrGQEKu1VVodov/5WmBiBnKRpaMcqudP4MxGPMQa66/q2VM4vEe3iWc\nWPYzfcgiN3g3jAyEGXG96MsGZInyPlMaDJcPtG+aAnl15nSFwEUPz+fapO10\niL6cquLev1dZStTwZD6buk/+QzlwEJgPJ8V46a5ZvBBfowODSUsUQDxf1Zx2\nBdUK\r\n=LSL5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCGXzrtsSwr6HxUYNFmB/6T7Tc96JcqbPvhNj2qaL/3lQIgYA9pdz94RYl5sGv5XfUwsxuWsOuzM8Csf9UoCA7l7d8="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-3fbaed7_1638317281907_0.3823327735204525"},"_hasShrinkwrap":false},"0.5.0-01c3b96":{"name":"bls-wallet-clients","version":"0.5.0-01c3b96","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-01c3b96","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-W0snMIQvPGGHYyg6IwvUYKocAoXTrjA7nd8Ir1NccgiR9dTqbd4gZNU4g762FplsdqYyNVxDl6Pmy9w+LzAu5g==","shasum":"54ed929ab50d8ade9f9200b41a722e04e056b0cb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-01c3b96.tgz","fileCount":256,"unpackedSize":894043,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpr6mCRA9TVsSAnZWagAA/P0P/iU3bFviph+GuJoyLNtB\n7r/TalS0k6mF9pGaEkINfufTZE0QUg7w+cUvveHUpEIAl0IkFp+yYbmdctuP\nDCR8mwXYimqWBfz/zHIpkGkMikTsn7fk58bWAb6m8cckxkAJBL+9MpLp6hOf\neBe1akmmbq9QwfnXdQD9LLPgAdBXGTn3wYPrOmfj3gMDVsJvjh/FMoguOk0A\nOT6biyqLBdv+9QBDIurj1Nz1LpK5KNHu4i420IVrj+zAz1JjS/mzm0SU0M60\nv2w8gWmMN4UuYgW0kSNbAfNkNb0gnHafnd7DvSe1+yC00a/W64yWjLAdpdir\n+7K4dvV4A0NWDdHxiL1x0+XpxgtPRS9oNmAh7wKwJ9sKbIr8zLgzFE9BioP6\n3bEPalO396VCpNzAXH9gFgzwWNixbx+YqdS+oq2WPyESq6Q90MtQwagRSHLA\n4QTHv9iOtXDV85dh+/mnNcicWEbO3gc742zz8bxlGmxDte+jgn+8fsneeLj/\nJ4zSP3jXfzvwe/CrUew+k38UeCGejX5+6jMiq+B8RfB5136r47ZYdWc5TFsf\niva4xvaRteOa0q/MHja2VRWdokw4i1XH0kHrtuPY5jZ89JpWlp006y8B57MX\nepd6q35lvgUksKvblTLOpOXeUnc5bUNv3v9HoQpCl4Rl+dkDCuih2urTvQ6Z\natdx\r\n=hvXP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICD6vxXkk5LBS2x/giCTLQ3ljcMWxD2UN4qFLXBN3c92AiEApDDOCFS6rdXE23xo4KmN9cZ7IuokktVq3Jins6BtuSc="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-01c3b96_1638317734350_0.15161533571642427"},"_hasShrinkwrap":false},"0.5.0-5dbc9f9":{"name":"bls-wallet-clients","version":"0.5.0-5dbc9f9","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-5dbc9f9","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-1NEMuTAOxu3MVotxcAKY+erfSvvQcTkgCdo/BBpABOdp/sTClnllJS+LqdtZH7K1He4FzeCVPmRbbRNRy4Bn/g==","shasum":"6b47572e1089a21ee27abbfd5affb7d64289c88d","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-5dbc9f9.tgz","fileCount":256,"unpackedSize":894208,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhpr8iCRA9TVsSAnZWagAAXXAP+wdcw9Ru06Ep7wrvHgaJ\ntaf/AN0/XKa3DvwYYV+iO4P6Xq+T3DzWboglQbM5xW2Pi9A3pjde3ByjQSZH\nrd8RoFg/nxu0nKRCI6PeLgwEhxert2a6QFrCbkOQAmvOtAAwj1zTNsWB+g0r\nCrOX0IhWPHRyLevtg2aRXxlI0eZKesr2yveYDBH0KUVONYtF6UqzugCdZNGH\nQqC/3nJySBX1GBRCrXHz+fzdIfwoQ13+NkIQyF9lTKFG5pbPumvZ05+p+RgG\nCAAhTIPeqNk7N+TRkEZSOES2AUz3i6KUewKlueGWcAFLrmpHFkCpRV5aIzR6\np9igxlcp4BuYTQgfv3gdqYZ0wfhJ/xVaUqN+C2jSpGd26hvYht54xSZcZUSp\ntgwojjSHuvRpGu1yDlPgx9aOItTvO31UVQ17/fgVpzqzi9AjCku/rx7Vh5pe\nhrbS8KzVls8vkeIdH1v2ZG3R3KGoQgHVUDLaBbM45lpuJvwGmQJzl67sOYMu\noXk+Vz4hct6bzEY5ph4wD5S/zpxfi5bwTfjmC4/4F9uLsOQ5uVrkX3kO4jar\n4Wdm3lC855rlnBVx+vH5pVVWE/eqGAPrNvaKmtcR7kizMpH7iLLMRxPgj4tg\noFzaYlBePPEZZPaBpNnBqEREjscyRyYOFNO+UI5FVcsPyTI4wHctrrShNzZ8\nqPD8\r\n=ufY+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDyYXlAZ0dQ6kX/sehUXZuzX+0Gi+wi+ajvEUtoUqQFOAiAYEQroEO2Q39ceYQlGi2kSht4y+vWkIMzh6ZFymNduKw=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-5dbc9f9_1638317858257_0.9878524903574961"},"_hasShrinkwrap":false},"0.5.0-3c4c29a":{"name":"bls-wallet-clients","version":"0.5.0-3c4c29a","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readmeFilename":"README.md","readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","_id":"bls-wallet-clients@0.5.0-3c4c29a","dist":{"shasum":"c2c9fa28d1d05aadb8b4ac7098530dde4341a763","integrity":"sha512-ABTlFvydefycNtTpC6+eyl412tPnrUgBleSv9g1N3/uiPU+UyKWtReSA74HFm2+MAlbmuLBYpALXUd7bK0wIpQ==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-3c4c29a.tgz","fileCount":32,"unpackedSize":37112,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuR9jCRA9TVsSAnZWagAAvMwQAIvoFrv0hqfEleg96qS3\nWPCNB/sz9dpe9rKG6LrOaAD/nvwFMdsV+kTrFu7+SRV6jxVqZzGh7J3v62oD\nBt4ZPNmwkaMR6XpenBXy4OJTqNqkySjhI7CffROPL2k7vTaUjCMyS+U7nVQ3\nb/6gK7auTS08Dy/2K6jCTFrXe3tIsEn77zinQ2qWYICit1XD5BJ27+KZrLQD\n8KCTTpgVDNSBvs7RiFwmY4Hvs7WTTlq5xhVWxRspCAAWmoi7melBh1F1OTyU\n1r60GEHCYLlERavyKXJDalq9CjTPJKbAexEZ61S7d/O6607Hs2AA6bWzpoxm\n00cMsRzlPqTScZuCQnPcEaYdOyMx+l/pWa3sVifEtNC82n0K8L3fMwq1f9Zg\n/yTW/cMIO1GQ/STPhe3KX0AtsV+gTW7HEAigAHuymME4TqVpieDSzbmkytiy\ni0ITxuoxTUFHF0RA97xVpdOudRDsshvcrKVmwE2X5FEt9v9k/jIKtIPnN2o+\nR6I9VXzhT5X47grfCBBw4BKWQv2G9kcS7a9l/scSuaWHTNqb9YcYw39RM57u\nY1Vyx6tNE1Iwhplnel2bKA1rGuye4/I04pWY8DPDmGjeliwRFetLHG6tGMC0\nNUlupBoq1nxVT1+tYG7ufTs/4GH+M3QCOmUyV68Wp8gKIROnqJYEMj4tBRPo\ntv05\r\n=1qkl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICPW75YC38t6cmOIP8m7D5pkqdxfEGTn/0+VgbSKY1tGAiEArBF6tThuh6IHU6nyITyLRiL0O3vi8xUYEiNFv6EqbBU="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-3c4c29a_1639522147664_0.524444909515752"},"_hasShrinkwrap":false},"0.5.0-32ca69b":{"name":"bls-wallet-clients","version":"0.5.0-32ca69b","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"32ca69b1f4a7b38145b13f01f705a32914324463","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-32ca69b","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-aXvrn/cHsU8N+s3AoDElyfAoYuNrNl3a8MMiLN/rQEpPIhvHjioSsh6rMpZviR5SZOoZbRt6heQGCVYjjJ71fA==","shasum":"4a54db8aa3b5c0782152a8a53362b8e3172a33e4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-32ca69b.tgz","fileCount":262,"unpackedSize":928248,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhuSGeCRA9TVsSAnZWagAAZwAP/Ao286FAeDVkEUtU8hU0\n1ysK2lbdphmVMkaRhyxUPO87PclglJYrjC3UpfiyG90AGdGgsnfTdHpVwZ6Y\nxYfTgNdGjP5PZoBzfvqhrdL13NaDvcVJQ36Kegj19bTlaRVSFnukVu1Q/B7K\nMP44I6ezLM/Mr/1nZlJ9WWPukiOIgjIL9sxZo7E+/e152VWRjKbrJX+4T5yG\nfttGbRTkbnsc86IKrxpS1yBiV+d0z2t7TPSMfqBXcdGQmlue/AazRhxYoRDZ\negYZqqwY+3dyR1Biu5LP2lSDfXDIo3VQz8+GgC9NctvMkzM+zrRqZlShMm2K\nwKM+gMGRl6dhATl4ucSbaHt/ALAGLYPtJji6jwQlpKJbqw04SmiK6hQVfP0P\ns5WCxB8h4aAvtkDO7bNtJSAI5ofZFgAP4/W+Kf1poFKxcrOJBCbOJgJq/sGp\nqs6oNjt4y+fxGyHw83fx0TPBreoyguU6u+qZPYF+AGNw1PLorUAUWRau9fZ7\n+3w+1RHiUMVaTzgs75tJb2rDTVo8CQOZ2dLs6n2ZVPhWdZ23fVRGo9LM2PJk\nXGoKU3h1sI8jfY8CC5FvQmFeuVdDc4WlumSvUMMFD53VtPIWPZx8CdjVcuFX\n3iibD7FoTviSHDx9Mc+TMNLj8GrjA+aay0SrfKlHqGyuCcJIa3LlNYTY6L8y\nf32Z\r\n=wRwN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGFmPV1rMR2/hPoEcNsrB4T58aHSq/FIjy7g5937U1+5AiEAmqM47zh51Mld76PeuB5nF462ut/sHzVIEv56+3UWwHk="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-32ca69b_1639522718487_0.458274620900595"},"_hasShrinkwrap":false},"0.5.0-d6d7dd4":{"name":"bls-wallet-clients","version":"0.5.0-d6d7dd4","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"d6d7dd4cb54aee1ba29d17bf8e5ee8e1e1edf74e","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.0-d6d7dd4","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-U0Ob1BqAvGrWbXykJpUP5TTsB+rXGFK8BB6kHKR8kQ1WMD14A93C+FxiJbjS1a/hq5PHi6xb9MK7gXooJFqB5g==","shasum":"1c05162f0fd9ce6a39532fceb7cf08cc0b140f1e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0-d6d7dd4.tgz","fileCount":262,"unpackedSize":927969,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu9uhCRA9TVsSAnZWagAAUEoP/0t6NqhRUc5ZeWtAwYO8\n3EjlgOzrTiewoqJPHY+2IXkh8pXZ41BhM6rxVe/3CDwS3sPdXAaAIAFfkiY1\nmATereN+lKmi1oB0X2xhqrTNmF1To4/Czx2kALdoCLArdqRu/uh41kGN2Rjh\n0rh6QydMTntUYYwCOOXunpMkH7wBb3UZsCWakQKwgi68ysadOpsKMYvXT6Sl\ngMa1l91xBbiZfXwdkLryWyDNMtMeTExO6HEIFVJdcyr8wk2aPBWDivy1Jgdy\nf0Vkb0sU4udc7eVwJMcQZWUOY9qnpK7525PwUqW6BxsG97dx98F25Rz/oyv5\nep26bHin9WL1MGZINWQmiQMZEXx+t+8KSldUm++afu+g9nErE3Hin96+QqEL\nw6akR9CTPNusB5kPfkCj+WzDLhX0BiLgBuZ5XLIdCmAP1ekDa+R9gdrdLq//\nHfkhHcWGUcCR0pktyLvlU+dnWYpAkTCDCl8+2GaBCkWZLxbfunIXe7vwTSgp\n5lJpEx8UdI8HW31BTeuI/wsWnej58u/VIN7pQx2uLCaiqwcFCMm3FeYpQh2W\nc5gCjkIbBZigRmilGGz6K5A+HSRVpVWedWK7oQPEUfq/gLcVlsqiLzZnDk5R\naH9S7+ykCTFwx/Wcl5rJjqenmSnDsAtlrRM99ht/ctjnb0Ges6ljGuT9N5fl\n5HhO\r\n=NZSs\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDT1y5OWfaEYmfOJGbNi9ebCeSqSEXvQcawbzShOb8tCgIgEZZF/oHqinC5xaz0NcFjQbRJW/IMgoUiXdCYulCaBZM="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0-d6d7dd4_1639701409158_0.9326527336332466"},"_hasShrinkwrap":false},"0.5.0":{"name":"bls-wallet-clients","version":"0.5.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"_id":"bls-wallet-clients@0.5.0","dist":{"shasum":"54700af4a7b7cc371cdc902b9627e181ecc87b5b","integrity":"sha512-au1o1qZqIyrwauwS9bDaL8DYKTFNcwGxrapL+BWSw0K7eXO6N8PZWK39xBxPi7ZwhM3Jd4ftzKyoqUCZh7V/IA==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.0.tgz","fileCount":278,"unpackedSize":927961,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhw9PUCRA9TVsSAnZWagAAJXYP/jlAib8wMoLBuYW9tcB+\n79fm2i3iEsSQ7RKmXn7vfODO4fNEjmKJ1pstY7LrDbeUJftltOagCo49YV2i\n88urR5xediSEW2nlWxxaEmaTfP/9Wt78WYd26QYprlqa5D7EG/NV5qw3Gs+F\ns0futUV5sNHVlxpg9VHXM95PrvO0XZ6VJ6ujcDbpSsvUpohs/spd8tRcTsho\nBE7KNgJ+BJPk8dL2fkH4VgncP6LKn5yyAu91ChLlzlf09fq50vFi2on4h0uZ\nnCpMxe8H7Yh2Tr9g0HidD8Rs0DvOQ2Zc165kZzW/+PKaUeBUgP0s63LFJxRJ\nViJu4tmFdl4N8Pt4TTRojrHqeYwlnfxXleDOb1/Q+0zsRQ/rxKHB2svSPCdT\n1uO3pj9yAUaLWIRabjEEz2CWXnlTePGqAQmd5JSxSkAuJ6GsZKCqlYy5KyqY\nSCoWF9SDaX38i9oAQWUGTt576nusUWo8h3Mb3y+wVq2IroG65N5OXpJlDXgz\nphOJKwh+6foPjP8oMBN+xNDsTovMwQ82Kwv3a2vaHHwpxIWb2pWY2xzWXxWV\nzdYVAVrjV36/Q9vHVY3Frbx6z3m+Q9+96DM2VxJCGmIVmlczLIotOaoYeJxt\n7O0aPOZkAXn7Zrx2mrYoSsd4q1YBlz2bKEMPt3sqbD7+ZFP/iQy15bnRYBhh\neFf0\r\n=aSnC\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbhCZQkZEy5+xZUrABxzJ3XYz6+JRvFxRlwhiNs8yM6gIgJPiVJe17yqomGlssZFsCBxKN8TanRwIjILEiUoC66jM="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.0_1640223700044_0.8981855715432348"},"_hasShrinkwrap":false},"0.5.1":{"name":"bls-wallet-clients","version":"0.5.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"_id":"bls-wallet-clients@0.5.1","dist":{"shasum":"fbaab1f3a38a6ed18db2369c368e516097fb78cd","integrity":"sha512-9PhOZ/EgLeI1LSG0wfMSPHqN1B8/c77odJ7iaal+EHcfxvh10yunv2SzT4iq4KO6KeAUX0OahPzOh8b9EMUEQQ==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.1.tgz","fileCount":229,"unpackedSize":589543,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxRApCRA9TVsSAnZWagAAilYQAIe1qpIHvo31gogAJnhU\nubBHVKO3OOKONGuwvNtFQSe6vLCaVYv1WEuOkdDV/vs2mgd9pJBOo83+WHl3\n6yhQzlALzF7wX1HkQnYeVT3FewIDc0tOV2HDngUAif91qMyXHanhbZ+7l/EC\nbnCUz1QIucF01gi9j8dUb4zz2x8V5rFWoME+5fjjwE84Yka6GtU/ofpCT95y\nVoyzXQ8QYAysySkImu4DGq/VNoYEmKKYoVye8UAhWEBx0wwUMm3R8B49vvnx\n2cyairmogLk56bTEzZy85uikHeQ/NsONh59G0MUL0TQLf6dopn0hRCYw4Ddr\nP8NdkrwK4AcDMgOw8zXpxZ11nKUzdKNyE2jP/CBnCYKDyEI2KLq95bli8Ks2\nc6koSex7bivR1dQi9FOYi2vx8sglZNOO9+rxwToKsf7OtxazGdtGTrOVmqQC\n5xYNurl3XPDGxQIgetpMsF9UFo3CwpEXLt/8SdH+nVtkjfbvWsKL/Lprrf7v\nw4vh4tWyzpX/0VkvXmzw3TK7znXC4FdAPLV6I3t/jnnPMofn+AkTxRbf40kw\n37KwN+H++I/O7vjT5xFxYE11+Wu4MZIhnq5x7gdmZl4HVM/aNI4eiAhNMmy6\n7SBAWWMqzwcfvNEgyUbnwvleAfxuviJYwWgZxuIDdus9UayWw3gKfvUatMq9\nfjfU\r\n=cJ3F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmmvK2Jo5a4dk5PCr7hzMOtJ5/fvBjbqkdtL3hMC9TRAiEA/4AD1JeI+EWmwA36dPjpMGbUhYeRC6cRigu/5STfPmA="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.1_1640304681307_0.9121098016633848"},"_hasShrinkwrap":false},"0.5.1-d38148c":{"name":"bls-wallet-clients","version":"0.5.1-d38148c","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"d38148cf82edb2cb69c454d444c5fa144f3c5882","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.1-d38148c","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-Cr5NYDHZ2jxNscY7bQwyA5bL8al+lTrG3DRjjXK/yJ6AO9Py3i/FudkGz8oqJvLS9U0TtwBvIm56D9qPzntk5g==","shasum":"0017ef25bb73f47bdc0dabee21f372b2b5078966","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.1-d38148c.tgz","fileCount":238,"unpackedSize":806822,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxTE2CRA9TVsSAnZWagAArMgP/3+euWOsLZnaptAGBI9q\nnG9LIliZRuaFILwpE5YKFzM9HaSQhSbiqOjXyXlH+kmJ5ZOnhuUO8nC6G14p\nT/ENWZeUK/jkKBzCCmI/ylPnHkG+PLFS2MhyYvSxdptB5C5WbVyrfTSAiXl1\nlE89GhLmEs6S8rCgU3tqABfc2YN3sBrIg9tvRDsH4Jggl43iOdlLZwJm7Zo5\n/jI0Vv/8CXRHrZA1oevqmITDiI98TKqXkkop9vsBqTDKfkJem17hyICMpuZx\nFO6MEidTg0xvb8zOsnxCHOToHv3+wNasAVT3uRbsSBCVETii6uUPyAourMhW\nrlBuceihlOIC6SvPpg1kR0nzP1jzwjYeBB7+RJCLERiCX/vlB9UC+CrLLNGZ\n606hNZ1LRqJ1sMJLnof+BDDTRvrWc3j2MDnUg7Pd4DXZudZu+hQlm7b8SVuC\nGRll8dyv06Yn6QeHzjyAO3ktZEFq0Z3scz3+QMqxGChVF7NKJoFgWGzYqB2n\nC8V4GL6Xd12qgK1K28IOpHT3JvzOyjaX/nHctJcgpFEUcP+Nm2iCsk3Z+eMK\nsQNuZsuLLeptkxQC0UUkirBx+q8rec3BCZTYLpsXy/d7Oyja+KnKLuyi72BZ\nkL53bj+O/+ys7156WWP9LOt8A4D8TyivzGQMGGx9Ue/KRuuqeujcV19nweQq\nydhZ\r\n=P7Lu\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXKF9obGMzVhoPEID8bmi61HjimznVN+iqowbx06XiKQIgO+a9y7MjZYWDjRZjqjJCCATbfOUGYWcnrWLpXFlccPg="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.1-d38148c_1640313141997_0.1561652438346115"},"_hasShrinkwrap":false},"0.5.2":{"name":"bls-wallet-clients","version":"0.5.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@ethersproject/abi":"^5.4.0","@ethersproject/bignumber":"^5.4.1","@ethersproject/bytes":"^5.4.0","@ethersproject/keccak256":"^5.4.0","@ethersproject/sha2":"^5.4.0","@ethersproject/solidity":"^5.4.0","ethers":"^5.5.0","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"_id":"bls-wallet-clients@0.5.2","dist":{"shasum":"4e0076d1df1de1acc2f7d90316eeb0c4a8b8413b","integrity":"sha512-fDGbuVLT94GyuR2XpSEvgUJkPciE5CtXGRPYZmsoteUA06caJFUYnTPVODXZYHydPgyxbpfXhaalZxtFEJ067g==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.2.tgz","fileCount":254,"unpackedSize":806814,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxTLECRA9TVsSAnZWagAAgfMP/jxS3h3yxYIHbr8WprhB\nFe2McdXMIwIv+CCxICmii0VPQ1WAnpUBd2EzfenDW1HIly5e/mucb3XOIntC\nmEG7X3icU0RxMp9SU7ex9d3+27Ir5PGXDEk1b7mzzxD7R1eDZwX0L+XrmxoM\npp0+APxJIx2IspVXSoepEkA46G+m76Jl1zQq1vfYKk8QkeIWtbhZYcbpFNa/\nfQqRZuXxpPbs0pj9O8FnaOed3u5h30ry95kMlLpQA3zZwSHvw/XpsXHtK2Qy\npssc4L4qP9rcoeJya4I0qy3gye8tgHSoBS4jpgLdL4gWR1EQKMkY4MzMEk1z\ndy9K25sD/bw/Pgbu3FWtgBVLPZjSv9Pus3HB96pwqCnvTkx6Oh/1k+u8yAiF\nBJNVdeviQQcmoDdGQth5fecS7rb7y+gq5HDyiFLVJ/7sIVs8KdnkuTCBWgqp\ntNsRU74D+ByDTBlDpn9aHi38eC0yLsRlCdXdKJcNLUTVueevjqpwhUoWqE5t\n+8D7zwsgGk0XkLauogZ1Z5+9+HChYUXAArya951IuFtL035o5uNuiiAgAF3J\nV3zJyl+Vi5rqggumv/lXUe8kiKgCjupwf8ZjFvPvvr2bMQDpixnOxKJrbJKN\n/xk+9XtHns4mFa5nWjxu0JRigQLeWKOkPS+KORQ4tTIIGsAFaxAfEe0kw9uV\ndD/Y\r\n=ijQM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAWTDyMXYpJPnEw8DtLftqJnBOvklNS1SuSFgNE6kYcwAiBv0LTY50jqFxnFKtu+JgVpw+a+0IbZ2iYMNdd1aUg9fg=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.2_1640313540568_0.48071947102662804"},"_hasShrinkwrap":false},"0.5.3-2151ea7":{"name":"bls-wallet-clients","version":"0.5.3-2151ea7","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"2151ea7234e02dc41e4992fa80ab932583d789b1","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.3-2151ea7","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-dVjbwLjxAlknUTro9nDwOrEqNOFq6VTCGmO+q6jDHSYrJ/duTA2SOgxGppHyEhjEvuMQf+UI7/MgecVRVE/T+A==","shasum":"b9236a3ed2cb19c2932becb0ab1384d283770086","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.3-2151ea7.tgz","fileCount":238,"unpackedSize":806586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzin3CRA9TVsSAnZWagAALjYP/RVRYOO6F7KtGtzwF37p\nOdy16MFgshcjU/VLcJx7gf4kAnmVmLNnz3vKyXebIjkobx7yAyuHFneUHuH5\nApQ7hn79YsxVLM7b8oOVfvqIpiEkW8iMTIBAxADth9WUrzmEbQTkOAugUWVf\nDLoQD5msXC7IgC+4u7tJbgWzcbEwfR/htbLj5YHjuulOUkSl6hRVLJ6jMpf2\nFLrskr4+rRIFDo/+XEFSJLfMLknCY9TWU4DOq2dm2oY6ln2/dxzGcF4yj2aK\nym8QNAAylb+GKookGQNNe6LXKMnw6cYSH5KjLp1xiBk53+sQYeNw7qBvvnD2\nbiiHAMvAZJu9c6WIr+TSqQbSgCHMq6mA1i4534xgvhzFg34p2q4R6p4x2KOd\nfB6I57pAzFMIOnX8giUyLvPW2jdEf02Q0cYQFYRz/aBpwHV/ynUshr/B3wcd\noKHfWI60ydLgO3sFgIe3KVMFqb0+DE+wAQJyrriMALJfKnFmyqO2R1G933ry\nj8uETUIy/A3OSekiLoReh2qguh9T3l0FKoc/A5t9L4YZHUSjoGwnj0HYg4+u\n6fINpYAFUm8Zrrk+nzRNSkXuWLGZdOKGZXF5BvrPDmd+Kfu+lZPoHH462bWE\npZoTIGtriVH58iK6gl+Vvr0ZqDf9jzYzBuDzs1Y+HV9skIj2NtBIloEkb8+p\niQu7\r\n=wE4w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVBEePIhXM9FmwVPNJA0xbWSN125csfh5kMU887tnmfAiEAnBlkDlI6c8J8DptWnO1F20r1EFusqYkREBEYcsxHubY="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.3-2151ea7_1640901111280_0.3693612632393195"},"_hasShrinkwrap":false},"0.5.3-8da99e2":{"name":"bls-wallet-clients","version":"0.5.3-8da99e2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"8da99e2401ce8e9171e81758f59a3acaae277cb6","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.3-8da99e2","_nodeVersion":"16.13.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-eEnlfV6I0V/sE06xWPJQ/1CROqYS2qTBPSDQta4LlgbeJ1EphccbR+4GDrj+eXk7MD4Z7R6IJ6HHcM7kyV61UQ==","shasum":"134ed5cb0d3e1d233537dcb052d9d1dcb98464f6","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.3-8da99e2.tgz","fileCount":243,"unpackedSize":811535,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzkn8CRA9TVsSAnZWagAAl60P/1RGRe8l5UpmEpraU0Aa\nfZoE7CbIIpxrfdBR5yGmHh/OSgikToZbT1aUUp/ADqyTg1wiHTAcjgDsEaVd\nJ1LrviJt40zrE9753pdFEv8JyaR2r9CHCCyZG6nvBKsm9+JXOb4wYWt7Ub63\neX4ctAjTNN8Ud0kDPwTddsRYzeEqRJ74LHLWEWpQaahP3nzQggKj3QkgZJA/\nX5//HXULlC21+qHdfAKbObNHUNAq7FVdHW+Oni8cvJtWsqQq5soPE+GLSx4y\nCS3iGDDoy4zoxVZbK9/V2swAN36yzV+BFNuLtVTehR73NYLhLu/bFwvAWcPw\nB4376qALTmxiTVVpF5zUBYDHfBeLqA1EAvbiBw6zknU9NjPTgMVHOmZWQVgx\nJ9RnRq9JHBHufjtX/F5Pn9Vm3GPTQBl4yGhmGSh1S49J+fJtCdVtP9pxx+qb\n3erbWG5cdWMp+GlKtCNZFw3rp7wnS6eDmK/+vSIOoCzpqHp+3N2klvhv11/Q\n+X1oTirxHBHFsc50ohOE2gTxZb2GnMXIKY/ssJT2YYk62/vWkqN+1nLSxqow\nNywQbq73JTm6gFEA998DCrAaLCBsfusNJMx9wdmez2E6hXApeFfVqIZwb7Hg\nSFP/Tb4TigpakGKdwX7JwSWclMHdp/TQ1yAtjgcQut7RsCNL0XpSRxx1kT43\nzv/i\r\n=4qey\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEX2ewJpB58YqKPI+COI/e54AbpWSqJ35/BPzQ9cMdPAIhAPAgQ/vNUZpJfsgcgN581/Q8m/+6H155elDQH+MIUXqz"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.3-8da99e2_1640909308359_0.9471957301458083"},"_hasShrinkwrap":false},"0.5.3-c4cc426":{"name":"bls-wallet-clients","version":"0.5.3-c4cc426","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.3-c4cc426","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-S7jkAWazNDIrWGF4n9sXXF/9BJUhnLVnOhko/GbXub4Ljf/1pMNR2HaQTCLdsjeqXE2Tj0fisKf7Fwr/WJRZ5Q==","shasum":"1f13fa23e55b06129b8e6cca79225e64de8101e2","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.3-c4cc426.tgz","fileCount":243,"unpackedSize":811525,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhzpmYCRA9TVsSAnZWagAAeScQAJ1zV8FhoRozFVTvmMkW\nn5ss1tcVKZyvJ1LYGT24KIMGAxGMUd3IBDBm4d+wa9t9hqkOr8aBPrVM4nqX\nrD5gg4oK9/NvFqJT+gYruZ28Em4FdfTYdNhNBCt464NrMBjhvTUuvnZYGf/s\nsgRaADP0n+39qsp6/YZuE4X6W+j7niWYUNA3C3dGMifmWPjVc+RIhLrIrfJn\naQP0w5IrRZtNWhJ6ALtLiOahJ8FBy6h+4blw9QUxWPSSvyEiVkHl7u3F47/S\n54Vvbu1ZgkQqcj94TDzOxLM6aAk2bFtsI1HtVkZ5k4ehI0a03i7KB7MC3KR0\nb5MI2mKTAuAcj4cesVtBsuEPhYkNX3pU/l7HMhBQHW+ZQpJKg8TxZoUBXd70\nGBhaB2fvWWgXAYetvtSmFF01h0NuZ1XUgks2C6L3PXNRlyNCm2vEzn9LTz/t\n8FluqaotTbm6rua1RWVzSODWUMlrr6qrEUlb27Wp4JDFiybJKKOu5SZX7SV2\ndt7ZHhb7eaK5fWzd4HBNkRsfvKFCClCLRY4r4d5Xy/Cb4XOnFk6R0IJjxU05\n3hTYTEh6lcRoa+3PlQHevH7OYUumMku5m21KjnHIiU1OIRMp4SjhRSDLNsT7\nf/R7FRThkXx0jwpQprRwnXOpVHaBbpT7axTaAsQXzPvmJ8I5iaQQ6CQhCQAd\nBxAR\r\n=n8m5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSRFibb4ejPmhxZo05YwttOZ7YXTvULV8uXKD18VQSaAiEAqfiA3/UXBN6D9gUD/r09d1M1OUYZ6fDMvpaK1K0zHW8="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.3-c4cc426_1640929688036_0.6991647620053592"},"_hasShrinkwrap":false},"0.5.3":{"name":"bls-wallet-clients","version":"0.5.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"_id":"bls-wallet-clients@0.5.3","dist":{"shasum":"6a9cab07082040837f57856b528f56ea3c542277","integrity":"sha512-hKo4RQ566f3J3Wu6Z8KgRnBc6cMrweK1O7RUjQs2sXNxOze/pYvAnqnlisfU5GF9cHQTM4txykCsJdsYxCAOsg==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.3.tgz","fileCount":259,"unpackedSize":811517,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh11r/CRA9TVsSAnZWagAAUN0QAIRv8Q41U91Dy7QQU79M\nxzh1eGobJiWQba083IcYsZyRpKRTpWUvQqsp47Flm68dchjqD7MhQKxXIyoj\nPG6wTZiVD5YyoTOSNDAWJUwH4zSqWoizgSziDdYMAWtgY2R7LBm7/2PufE4N\nisXnFeVQSsEPdq2P05GZ2LuS3dCVD7y/w0zS13a7TYD6Xp0Z2Um39gWyYvcg\nosJzPZBBz3YpX3h8W6wTTUCHczhZfUoA+AAHcXz0GoaHHZxiBlNRceS868MQ\nZLvNeVwhGOEH/iXoPKOdzsbCo2wxZ0gSGBXqp9UKZOEnlxtCz4WIvvZUrZY2\nX0TwhF9tPCoS2MnBrBcJNeLNjkll+5c7rRvlLccVtPrQp3kaOowltXRJkkfj\nmJy6tTWOetJJFXcChipbuAaDks66Ff74AYAt6Dk07iZXvm8p+mu4xQ/o/NZu\nRid6VyLPBSWmdn9/Zeoc0Qrb5l5BuU2wximVPn93qNcD0tPOjwmV799RhV4j\nuCDiA2PiO4SW8+6Bh6KEvKeuXBWmQm5S1+01au8Rw9tcanw187fGfYL2DTev\nv13TvhaaDc0QN7IkTuJG+GSBcLyynmBTFtKO2mnijKC86QuYTGKdQCqI0pYF\n7euQSrMUES4ZHT4XnAV/4CPVw8v9C/Ysehbscby7OIq8WlgMxsb08Pba4JWF\nZ0hy\r\n=dsLm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEjJdm8xx1HVkQ4lmSLeBmljcKVG9LgfaDaGYg+IZe3FAiAydYZw0OX9ug09F6nbR7AyIbcFdSllOoN3OQZbz7bWTg=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.3_1641503487414_0.8723478319097973"},"_hasShrinkwrap":false},"0.5.4-68ca9ae":{"name":"bls-wallet-clients","version":"0.5.4-68ca9ae","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"68ca9ae1c0677a346e64f801c736b380eb1be56b","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-68ca9ae","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-BMa3ergFuuWZBdKKqxN4DoiV6yawXU8XUFhOToCjHI9YLizc8BXrqrJINpr0kMi4YhQt8amdoeTpsa66QPW0Rg==","shasum":"f613650cd8b360dd7231b8b148cdc468cfa5a848","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-68ca9ae.tgz","fileCount":218,"unpackedSize":753234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3g6tCRA9TVsSAnZWagAALAgP/0+KemS6Jq5HoDl7HweP\nopSBKJnevL6qTkkcMt3TQ7Z9xpGywwhdx77HzoRjcGwY4/lL9JEhyIMRfTGp\ne3hGFHwGLGmTKlqNldrqTzPk9zyYWdVluyZBZiOxeg22wzciMCT46XImdo+4\n4eeaUJAR6WluI8hJY58pdbOAlycStzg7QreAAQKdI4pP5IRL/9Kn/nS0Cs0V\nuyw7ax6e+s0qK0UDdLl6hkO+MYPi+SX0+UMaBArLNIMTlzjbMd95iiNwERL3\nfX/irWqikpGo6tfNBXAWeh47rS+lqIqpletcntZYXt+YNzCZtsjUF18h5bpg\ndOffbBoJUNGIKlx5ZaWgVkOiSMSNn/AcsJvqwN+9L51kvHkXKtrRvNo8LMIs\nh3bDunIJ7uHbi04oOBKGERb7/rztmllxRzmCgF3YEvq4ow+Rs3HeuOAe1k38\nceIUu4RSXODoHn7E0JAcrtvoHy+yAu0ogp90wUcyvw/g75lX5ZdSjnbccc3h\nqM+ahunMUEimdH7AIsu+eVSjpXVDteoc5r1w48FiXrNLSA7gA93vbTHL6la5\nUbXIpo0ZLtWwKVFm/6BDewL29/Z8+fDJ48GQG+qPdsb40RoQ3cFtHAxXsgKx\nqjkH6Q97LWeuRf2OHn4E2gJjaf4EyjER+S3jFpADQihpXrDCwBNgnPUWJ9/8\n+y6V\r\n=099e\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGXWwZD1UPYz7xOfEsNbEfLwQEOTOPwJeOJQ7TMo1hJrAiEA2oolAAcY2zHdyAWthVvOk+MjCvMxSRIGA5hsoR00vYc="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-68ca9ae_1641942701250_0.1522523179664177"},"_hasShrinkwrap":false},"0.5.4-94d2be0":{"name":"bls-wallet-clients","version":"0.5.4-94d2be0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"94d2be0aa2f96cc84e7c0bf15abad8d72c9a6975","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-94d2be0","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-3dCqiRiLJ5dn+9GZA+gOCA6qxhPQt7gFI8fWYsYcZ5CnH3TrpPhKwjeBlVI/BITgiwnLK0yb833bCmrrHQmhYw==","shasum":"6f2b179c8441511d0f2daa0946451f19d8b8ecdf","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-94d2be0.tgz","fileCount":218,"unpackedSize":753234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3hkwCRA9TVsSAnZWagAAYjcP/i/c7yt/oygtzuAnrbCF\no7S6wWtTPNex+IKYcnFrkzssDQtPNaY3EXXYkQSJrhXqFlRygQxfGs6MD65a\n6Z++GlAbioIdUpaqgI6Th819MfBhjSWTFL+Eqn/sSCEj/D2d5dWGX6xAawjG\nb89zAJx+w4f7lA/grfv+iNSVS2bC+VD2z/Cuc2p3NVaznHLoBH6OjgW06m54\npyfJmuVD/ohHfiQtyToqu++nZGcimkdRKD4BjjlgkifQY+XKqu2Oot80AoSX\n96bpuxj+Bvvl81lHocN7hQC5TMhV26XJ2PtulFpYc2z0k8vfMZ7OM1ZIml1W\neMjxUuIYBkuzpnZlEWExGsKVcybqVDN1DL3EQPwRUzvOaLr5bxkwQGcdp/mG\nUPEs0kfPOpgHeqeuSXg4M4jMfhxIr4xujsJfoxSJJX4FudMcRlp/giH3E77l\n9QBYzfRa/0f0rVFNHlVSxQi6R6wKi302KXs2P6D2QugmPj/7eVSkHhuaeiPQ\nIABcrFWUInoUIiSAm9TtgtlkdWs9BhEqDobKer//OxOwtata1k2e88pSLM8m\n8Nqs8MVcL37C9vTnxlP21t+zC1iVRoVXZ2oWWj4APX7MiI0PpjA8w+eqtMCO\nV0YM4r3XGEMxPBo1sUTCoeWDwKflIpkJVqB9iGghLGkc6+kCwqodR9jBXakf\nXSHf\r\n=z9px\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDE03J9pGmAMhkU+FWGMRfq4m6cJ0PbV9G0nwk39cISwwIgGcEhHQQv6iSQGLWdeXv3ozcI856tKhzy+fHv7/JpS/c="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-94d2be0_1641945392413_0.009600524167407087"},"_hasShrinkwrap":false},"0.5.4-35e1f71":{"name":"bls-wallet-clients","version":"0.5.4-35e1f71","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"@thehubbleproject/bls/ethers":"5.5.3"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"35e1f710fd951c28e092bfd7ae7271299c0ccd94","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-35e1f71","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-El+hgvmQTrJRMX/E9jnYk2bE1I7wPav8HNmo2VcMHHGf0GMBHzHqRPTx+5VxL3E2+lbL4kRINfEAdiKYbkq9nw==","shasum":"fff514a3b13ba3b7ddf71ecc2ade87092c011d28","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-35e1f71.tgz","fileCount":218,"unpackedSize":753302,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3hsXCRA9TVsSAnZWagAA3W4P+wZ13rMzN1EneJtNhKDU\nsWSjL5jnw2Dp2vmE1IDtwBlGFcsIF21NL7dYE2rBJWOqrx+tQtfK6PlmxFJW\nWs5D4rR/613PSboaJv8PxALcdVLYIUH4Z4IJisbMjG7ZNh+YAZ1cgIAHWS0A\ng9ATanU/UWJEywm1vm89PEssk26zd+PEdwlD5t1xjxdtxsWE2GZCa1YaIhEi\nCY6tQDA2dEWfg6c+JD4uWqe/lWIS4ddgZL6uo3b+iq3Splmmn+QqliRLHR51\nSv2WeSpGB9b+uwXcXVYZqX9Ec3pIB9BsRsiK7lxdEcbpIq5Gz4baiz0X8BEe\nmV1NJbqO7cPobyREsneNzEuLRCWDnoRe8UV8OGLRxFEvLj9XIyuUwaFWLdCp\nVBJaAounWysG1IsGVyTOJ1wws8+I81ByqVy57m9iAN+5RWYyhuEW7Vu/vASM\nu2rMSxQ9sf4Lk3YHQG4okpdZ679+dFoeBDn6jTlnrmzuuP1w1R3H257kIVuX\nSpm3DiOrdUcAcdfvn6gU4zFky3XVKlCJTHh3Yo2+5LkSwbVzP6pxfWUL4y4f\nceizGNX15JgXdrD2JzD9iewt6HQJ2iuf5hq9jXMeVIDkB3SfD5kk0DG9H9XE\nfgofFB6x4tlc2nYHYWt4/WC0Fk9XK6zTCz7jZDbMOC0RnI8vSfxaKtQtRIQY\nAO+/\r\n=0Eid\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFkKo4E30aqxaM7JQ8VU4XVSpoKXioJOCs+dpPdDcHQfAiALddzvEdsEQ21RFaE0VjxlBKtljhzQX79ZdOnikFHG/A=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-35e1f71_1641945879799_0.6516701524504955"},"_hasShrinkwrap":false},"0.5.4-a9dd6c8":{"name":"bls-wallet-clients","version":"0.5.4-a9dd6c8","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"ethers":"5.5.3"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"a9dd6c81d1c35e2e31da57f0da09f11d58c23100","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-a9dd6c8","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-qzeOBieVPDhskA+9usfwbD+aByBotFNWFXN/ag+NfDs6Veb52GRAiJJLcAGKvvXxqS0FNUYJzibU1Dlh8fwf6w==","shasum":"10d0618edb9dbdf2aa1625389f3cca9aa9623932","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-a9dd6c8.tgz","fileCount":218,"unpackedSize":753217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3h8ICRA9TVsSAnZWagAASVQP/36g2kgKgU4k8V8dOIYB\nXmdfo/5D3lvZdtRR/1pkiBpDoebtdpLCmlooMJsIgnlE60Ag6gjCBDjNKLre\nbNTa2dFpinmnSItgGFgg32kDl7IdPXru+c31ZWqmqDCrL483cmxiUA1J2p4p\nj2VBNZTjTEJs8zGPjfkKD9Dd4VITfdmHDx3J9AHI0AdKzIqvUXNh6WNiHFV6\nwEr37VL7JKqzL4b88yG0g/npPi/qtlq21/BWW3eT6vu4RJGyll+vHqZdeIrg\nv71gGXagL4ikQ+BmKHHPbquPYWUD8U729ljik8ndXu0oJbzLHYCQmwowYPhx\nSco+Acggq76dRi1JnBIkSqTvVws6qfwXpGsOzqBAY7TbMuWni+PPUIwHT8qs\nURIRpSpEYGVZ2kqbYUSv18LjKj0/sTySqFrA7WsHg9CktsBLRGGrmn8/iRVV\nTQhDTBYX2lvogtTrjVvoyxZlxrzmGV1lR+p+D/XEJ6SL9BYFu/xJLVJqF5G0\nfTQmGl4j76Rr574Apy0BwWXvhrBfejgOzi6Adz/52q1NpI4v1UVkXTravaHO\nCXT9NYmyupUP/cpKRSU+vij5ltA+NyuX2O9yiPoLMaGKlQjS7yxQLjPlZA+v\nLb58ivQP+wQqOX0NoZpzn+Xd4h0PZLQEwUMf14ERlUwjUY/4FzNK92uh5VtA\nc/rW\r\n=j4ub\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOjE7h5fYSTa4Wj6HYijincL63Opop6YwYgwc7/YFdnAIhAMj+59SzAjDKovzGQKvyhaMRbBV2qlMs5sCDz81ItEP3"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-a9dd6c8_1641946888218_0.9904888530422917"},"_hasShrinkwrap":false},"0.5.4-ae1b035":{"name":"bls-wallet-clients","version":"0.5.4-ae1b035","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"ethers":"5.5.3"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"ae1b0351fc80c2cae495dd512092dc0d9a734ac1","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-ae1b035","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-/aNB4j99i7bkYJ+iZgJONwWzTW6oK07HV34LxF6l04Y1T+QXLsU2k0lSp3k+rl8x4mjvj2EqIC/g0TeKr9vIOA==","shasum":"e8024f163ebace28d69e253db7329e992f380f45","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-ae1b035.tgz","fileCount":218,"unpackedSize":753357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3iDZCRA9TVsSAnZWagAAhioQAJ41sCOMvK5V/NLDIzns\nFLraUJuXvoT//ju9ezGQ7mBtSaY1GODqEURoHfzbZh7pidVVyX4h0zJymuvU\naVCdVstLHkpVmhQ6tuXQ1X/Xh00Q0pjAbWzR11AKmvCqH3HdO9mdxCAD6kj5\nCNn6Z5alucVxdOLhMH43KzWNSwp2+0ZW8OBgWD9LZbHDLxE27vMVzNT8TK6R\nRvjl/yQokBE2aZTLPhqYC1JzNLbsUyDCoWECdVSYENHDv10+bJfAzfrIaKrh\nd5fsOsjv3B9MiqQZTMWW0EthOkpyRZL63WIf2iU8qBWthuqnurBQDOWaIMQN\nzblLE3PnfiFeEXG+secsdoj3UyyNCIGmZDCNwkDp4dJizWUzFLHXAK/1PSWz\nBuhuQbOfTlbu1QE/63K5Ybd5g78AKclhSP+jDlKoO7Z/G1HE0HTESJejHUWH\nzgpRcQjcbKc3b1tFqDI+r8Ll7z9HsWLx24da9YH90ImWdsDWsmy0z7JYKpCw\nOuJ2eAhVe6RUpJbaq62TfruzdJcMy3NLnwrsQm/7iT0NXfnNNarilxGyjO7h\nDRi5S7KR0xQd6LK045csYN1TesR3gspeJZ9F/Wy6f056Wj56PvTfmrAVmmDY\nazd34obofSLexlKkaNR5ZGOOKN/c+0dVTTpX+zR/oII3VcSYJXBZusI41PsZ\nLiQJ\r\n=n0U3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEd+o06WPqZ25YS79OFvf3C4USSF1PI3rciuX8sSsInSAiEApAMDZQl4xEZAs5H5Zi38FXbVv0hxXgtjJyLtxUOAGg0="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-ae1b035_1641947352946_0.8554451356751174"},"_hasShrinkwrap":false},"0.5.4-38130e8":{"name":"bls-wallet-clients","version":"0.5.4-38130e8","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"ethers":"5.5.3"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"38130e8cb98cf708711ff58fee031b1c1d635d21","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-38130e8","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-HuzML2HRHUHr7vEo+omTNuZH7r8kMts+W9dCnKbN0kLpxd+lD6qgaS0Lq7FyRMZg2Ymul4TkATKBuPdJxf+JAg==","shasum":"4f8e2bf77be30630d8cc847df558023ae5f41835","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-38130e8.tgz","fileCount":218,"unpackedSize":753217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3iJ5CRA9TVsSAnZWagAAD6IP/ipud93QirOVN4NvzYbk\nZV1TR9ovKae0E31T+VMAiY3HI0xz8S2BFc4qB3TWRBH8D+rMGLPFFvRfAqja\nbL24jwHcKO9lwOHusGf5KOjY3uUT45BckiwelU+3eod/C5IINxEpi3WJuVl1\njnk8/yH9VJ4mykSnrRp2Iv3aOUcgzI0G2qoTJsWHYhdxkSNgJl7IGfAFo6ew\nDiJ8B/uAPM9hmnOB5BXT9jHDJCCMTk6qs+HlJaka8Vxir1pFA+SjIH28W5+Q\nmfGhVQRcBRvhq+GzMwE1GHa1W+ZHiTV/5RNDxoPmRtYf3ADLWDDpHucQLI/w\nrArSV94tbw56q2ECVddnVLGsNctGnYsVG+4bbLLcPzUkgpVBT+l/Um0DxLeK\nkhTwEbLRTiKqALkvkGu5dPHk15tcdUUmDRDF+N1+/i3obUYFAPpvRJN92c32\nx9/nwR5/5LHFf2uhZ2gL9MBZKY8ydM11Ly5baqLy1xQ3bn3lyEGWAwdN0NCO\nXgHU4bKxMLeVMhZ2l8SGZ4fcsXNRg/PNK2ffyKD6lVBRRuV9qaZvM2HUm2Cf\n9htkzwTrBmZEoQT3XKB9hIfhh6zMQUF+tFezpItU36trLdR3mTryCYjxOTva\nNPgBs/Oyj6CfI0AyPsaNmTOy/5+R7gMJbGSKj5kvzP7vIwE2lFVgE4vapa65\nZiBg\r\n=YY5x\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIQgL/W3TavjE5AhDW7T9UjV//6DUwgsSbehH7JZcscgIhAP5QWMx25DzPODYYwlhmEEYMBStn0ZPeMaf6OKCFtH28"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-38130e8_1641947769184_0.1392607039363285"},"_hasShrinkwrap":false},"0.5.4-90687e3":{"name":"bls-wallet-clients","version":"0.5.4-90687e3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"ethers":"5.5.3","mcl-wasm":"1.0.0"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"90687e302654b6692d80c0d647447ba91a0f64e5","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-90687e3","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-BhbV520pxiVLLU4MTKWAvPySzHAKkOmE9qq+eFeJ00qzR3kcjM2qXmKp3UtzMGoWAT5dK+QJP1OXcx7OgDarQg==","shasum":"c2d46b2bce58bb1e99204b6c25bbf7e2a95669b1","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-90687e3.tgz","fileCount":218,"unpackedSize":753217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3iaQCRA9TVsSAnZWagAAFqgQAKCpqu6QEZA8Xv9npyrX\nCaMFNbU3zMbRYXaMfGTZnX6Lcc8H+QC1ywKP9eRKXPzIasSZpvtS+d0OiA6F\ncfRAzxdUPX5OOxgKdyiVk5hxuoAu3lF4s9+xt7IsgP9qFNrn02+Wd/fob/EG\n2Jern3OOO1ascQZexTXlf7yR7KB9QQ+zBVq3T0FiiBwQgfS/TGmZRGkanjBu\n6M1teEzNdSH9awUusY/b6qxtfDn9rtoYYdkaYGm7HEVXJyyStohtHw17zXtK\nslyjdEgbQNRfbWY/deFoMp2fLl1/QHH2RxbE8qyD9cUINPD0O7BWO8NCBqYT\n1IiTsgn1Jzlei2xKGPo/yJWPIbgn2pGqtwv4S9x9FLCu/+zZM0iflAszT2RP\nJyD/3FFo6KOu4tg4w5OMFmQV2MAWuClVkK1KFe3vuIgfScgZxPYsDoRlCYYw\nUfmu3DtTSBd1AZcb15XsZF1d/OKVoKfi4qF0OKxMSn6p+IRwZo649Z6bLn7N\nsIO1u/Qt2Z949oqdDDkrNh1LCv7QPEmWBt78Plsi4tJVRtgcBVaUzKGbxy5d\naMTGW8aPmxAuGv8kWz4Asr52FK65XeCTmAN5VQEJAendR7p80FHOV4vT1Ed2\nYHBMmEwZ+plNYlmED7ozW1LBN+CcUFiBnCm5aPqCuhagWs8ce2+DKlXnu/96\nRtDf\r\n=n9DB\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0U8RsHtYXPoO2vFnS3vaF0COFI8JdiFSjjNjO1X4ZngIgJ4KhQzT2qeEw02oNTuYJbXjklZ0W8qUmWJG2LiwDzoY="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-90687e3_1641948816701_0.3132359975966341"},"_hasShrinkwrap":false},"0.5.4-c47077f":{"name":"bls-wallet-clients","version":"0.5.4-c47077f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"resolutions":{"ethers":"5.5.3","mcl-wasm":"1.0.0"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"c47077f9381d76a729b6a01f265fd139f636b0c2","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-c47077f","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-Qms0N5wkIVqtXLTo6m3G2Ffi1DRVEg81xL62Pq9K/gK3vt8urtvSlCh+dazE+4L3GpVpZoatL7Sitf42ekrABw==","shasum":"81132c87c7eb7d75d12686f8cfb67c92d2bbbd13","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-c47077f.tgz","fileCount":218,"unpackedSize":753217,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3itKCRA9TVsSAnZWagAAH6MP/RwDftDmwNYyGFK2N4k5\nwWPmMpgcrOFtUTEZC12tKITLWburOYDMtKu2TW3qEFeziLyyhHRVFUPy7o2w\nsCD7qbJGim6XZepvU+HPR9cYID1w0ozKIAcKY75VVawyHKLh5XmD6DM7ypfJ\na4THs2VWYdKCOubq/VLHVkuC8968i5vCeMxx8XGX5mmnu05huPzkadCxUOLd\neqr5yE0NzD43R81l4ndC0OQ0g53mHPrkzv+FRX362FYQAyT/AG44fivWApz/\nQMejDja0XanSaAu2b2D4zEsDggM7/Feg1PJTgTssg5l4GlJEURKx15mcSsJe\nxt2MStvNJ8RVv7dtDZm5EsHFpbOzkmIypnBRcoQCXYP/yV5DBu40NiLWWjYz\nhnlG0acDLUY7y6K3ymFJ88Dx6j5NiRoLT+JzO0nbRPClob1SgQKZFtr3KP85\nmfPHBTTKK/KVDPfiCI9IwM/NJG8uqtRRq7w1gYnjEd82QuOcjrNC9KqvFMsm\nsNK8HdqD3YjP1nnD7Ofs+rHDG0g4yKgCQBoRzXbehHQUagp7BMYZxMPJlNVB\nlZn7Hk8hkQo7/Yhijil88B00RGDJluO4e6dvbAqk40AZtBiIQPT9KRcyk93/\nkgQuSnLSu8kGzHfF42hnzD7oIPP0iD2VbLypV813DD2ytLHMglPEJi4l3p3N\nT+vL\r\n=GXu/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGcxnugBZu+v2aVpIGrb7FyHR6dIGiuG2tHDSKuiENyPAiAa6omjAMdMDCyfy0ky7yn7Z1k54ZGXaRSS2UvhBKV9Ig=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-c47077f_1641950025903_0.16620466592390937"},"_hasShrinkwrap":false},"0.5.4-0ada8d0":{"name":"bls-wallet-clients","version":"0.5.4-0ada8d0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"0ada8d00e6952fd26ff9b0f7533fea985a46b3db","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-0ada8d0","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-nhnj02aKo6N4gcDVpV8hc/Al30uDErtrdIiiGzteoFVe52b7rKhFZRWuhtgyfP+K8FBrwuFYNY7vXZcjOxlYoQ==","shasum":"e9b7e0f6c4cff6b92dfa40c6ac187ebb0f0b03fa","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-0ada8d0.tgz","fileCount":218,"unpackedSize":753146,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3jGfCRA9TVsSAnZWagAAtxYQAIIS6i6yt3sfPmu9fL+5\nzVZn3LmnhuPu/sM5tZpTVD4fBJf8LA0PJUxnHb2RI56SgbwUQdHhrqQgEyNJ\nAbBjlxA6iwBys1V9LUuULM1bDPtuoOfZWNFIFGoWUgsDUjs7CnyV4byAmL3Q\nNlKyR4/twtyenyqHkY5MjzfgRAWNBfTvBBDAEyDFiTI/b6ddc/xGYRauuVrS\nC5MEdaObjchnLrWVdi2AkqnCddoftQgS3pK/bf0TSEOURLU8PgL/WJNBzqeG\n5j3j+3tIWN4MJ8+t3ya/dKQIB4MEZy164tOPVBqMF4/nbDKAdnXsVXkO6Hj0\nTvOjCfiWGCsZn3Rf6ABcCrWziiGha0XJQC0yX5G+QMLhSPWZRmozQyU88OeA\nRRfWf+J43sm9rJ2F8dLLVbluQcitQi3qX7/41Ku0qVEfehCbhDEGY1vQ2PyU\nRq8EHQnL0XkW3HB25Oi5TjWwErPk5VDxKDpKag75+DUjnKjdNNo2K+u3aRIy\np1pkVPgS5eLPZqeRkxHxAoicGi2zoGp4mKWpd+UoAxr2cSww0z5gIfT3O6PX\nXdXZRw2MABAIE5yjrtGxCrojuSy3U/RPpSYwtPsdrSIOp81LS0+7bb20oGhJ\npvA/MBVE50kYl0KiEvq5ixeHqke1YTr6I3Vht0kCRjwFta+rHcl9D4/+sb6u\nGWnm\r\n=RwIN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1wEewv5Ux/j8pS6TOwlsjNXyGOdeStWy5FLzsB0+TygIgHTJbA2nTVqVhoxgojlDoF+STvitW29KnDw3dcvieSTk="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-0ada8d0_1641951646938_0.7884895570519359"},"_hasShrinkwrap":false},"0.5.4-d697f5f":{"name":"bls-wallet-clients","version":"0.5.4-d697f5f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"resolutions":{"mcl-wasm":"1.0.0"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"d697f5fa5ee934fac1cde6b28425cae34a2b477f","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-d697f5f","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-mpC4FcVz0c7wd5qfdRVeUfORhlsikkW78FJkvU8sWnuo3iQr3t1xAYXKkeD/MixFaqeJwCqWjou3AlqMgNibrg==","shasum":"fb2951202f12408b13b48c07e2290fb69d4f1a6c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-d697f5f.tgz","fileCount":223,"unpackedSize":754716,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh564LCRA9TVsSAnZWagAAfpwP/2i5O7+721ulg1mYcH8q\nSYKapmrXIl8CMLMiH/8dKt5HCweLFSmnG5yqi/obDKWWg9SdmXd8OfrfuBzo\nt6yP6OjTv91ptkaca0rcIywwVZdv7e1YuakQ9I2apRIpCXvqyn5MUycdLrro\nTu5nnE8HRmFoUkshLDWQorHBNn4KcS/5IK1mbP9fgm+/qEhFOAwvRXzjDtA2\n7hBUNEUZoFqhxDluPBpypyabqKJHGOW8yFsLxLu/G5QPk9+U1d24+U+jbt5j\n6kBBPiLm1F/hlTtaNy6Rgf+fhzDqMb/o2YGxJ1LXYc98KmDWJYx1wa0Ueq9N\nd8aD0AqneXCXWxunpvK2yDqoneap4Q4eKIJWG/GetMtpuk39wS/HzmQ1HCZY\nthxEyBzQgMuVIFeUZrfTwSTdle+R2x5lYHjWya5sKGuVxdFHrEydRdwuPgNi\nMNeUhkCWy+FUghvj6Qg4C6wtaIlqADe/RbO09+E+EqHlkQTV8bgZJ1ywRho2\nKDPPrbmnJZWKILOA5SWWyc71miLkv5rmkGvuKysiIQG8MciA4xj6IpMRGESI\noWkPPE3yDSbW979zHUsSPsSqYv4NK5+aUmpKaiOv3NJ6c1Mnc6EvK3L1RqD0\nZNhv0+QtbmlfHcFmCKeExe4QHFSh6kO3R4i3oWxogIRta5ZioCzat7j/X+od\n1Ym+\r\n=gKrZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQEqCh8DvefX+aeCHXiH8MH2vlTc7ggLidwRuaNmuzEQIhAONZEzcQT+ekGaGz57Wgg7bkytWyk+4L6w+SFX9sWFf0"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-d697f5f_1642573323693_0.4698757815372856"},"_hasShrinkwrap":false},"0.5.4-68d5a81":{"name":"bls-wallet-clients","version":"0.5.4-68d5a81","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"resolutions":{"mcl-wasm":"1.0.0"},"dependencies":{"@thehubbleproject/bls":"^0.4.0","ethers":"^5.5.3"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.1.4","source-map-support":"^0.5.21","typescript":"^4.5.4"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"68d5a8132bd5d87dd9670148423e85435590801f","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-68d5a81","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-0hjw04Urnr/QBbsH2i0GYPyguB98ITOJRbsL8kncB1BZVamroScclRynAN6H7L6UbgF2vGGjP3FrMcqcUvDo6w==","shasum":"ef95c2f007ea084729c378c3c03e270a1a82cb37","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-68d5a81.tgz","fileCount":223,"unpackedSize":754715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh57YDCRA9TVsSAnZWagAA6ewQAIEGBtHnjnoWVi+mTi1Y\netWpvAYdZJlC5tbKfqAO6HMJ9F22TxLwcc8Kmk0NRC6/6Vx4iJqrMa+DFW/f\ncC6sr3MGPw7iZImzgnBAS7rUFQS/DcC1TRB1di7qKR4+f32TWvdsvKjOhq2B\nbOZfJ4pm3zSiFwHsCnBdG1j/z705HBkNxdCaPCSafXtk+fT3DG8GhoRXNfzT\nbQpp+cBfEmZYgX7bXbfH4jmb1XiErw2cDjqztrZLM0yK2LMxxxaM2nrQVY2A\neeyeHm9+GTjlCdI15oGufzOfvsmTb5m7VPxEmRNfGOsBMOVf6RL31fD9s2mS\nVnG2OGuMtk5GxaY8eLTSE0qx1lKRJOgdxETdCqgNx6v89hcyCUB4Wim8QSLI\n1hQWbpuSyLlnMLp33/sD8uA4DxhEb3vAQ9JvF4Rlp/u3L9Vs9JaQVV12jRLl\nZDcDzEDpKfHipbNm271Fvuh2zlJWQCw9dvoC7TpevfNd4FsLA/bHxDEOPdGM\nqDO/jEy7d8qiCkv42RjZG8F6uvLgxJDWVO8kkY0OWS+C270V4igXXj5L2sSN\nOmSm7SrTIUD16MgYXeJhxJN+ubbOdnQ4v0EeIMJnodgAxiwJFQOFBVfP008d\ndYqPLF0C3QfHs1ZEh3RAbwJ0y5LnGGjAjRYB4XyhLeTBWW02KNZr4ozseWJ5\nqbIl\r\n=sGgY\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHMydvnWEYmU3Os+Mg+K0XuXEEhtyRehA39c4mV2vL3OAiAxdCVoeM+87Ap+qsj2Nh6KbMo9+yHuidikxgDMBT8HPg=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-68d5a81_1642575363274_0.8964898999827893"},"_hasShrinkwrap":false},"0.5.4-05c23aa":{"name":"bls-wallet-clients","version":"0.5.4-05c23aa","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.0","ethers":"^5.5.3"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.4","mocha":"^9.1.4","source-map-support":"^0.5.21","typescript":"^4.5.5"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"05c23aa1eba8cc6b02345f9eadc3c2b5191cc68e","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-05c23aa","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-Dr4FHU54tki7fdFEfIsPi52+rwtoOO7+7UsaztoftyszQax4ju5SqS7uoi5ni2aVAm0gsdhiUbEZ3PCRsWHPcQ==","shasum":"11ee883cf708de4fd4128efc3326522cf65b95b5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-05c23aa.tgz","fileCount":223,"unpackedSize":754667,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh60rvCRA9TVsSAnZWagAA71MP/RJ5uUzMDy1f7ZZG8zFe\noj54n8V8eoyxeyuWqkbeVwRU+N4vlgvjYrnqy4vHHSmP8ZeUbC9+GaQ/Zxh3\nFhsOGkyb8h+k4ISeY5kJ/ni4zEj8CStslmTEAG75ug7HfhrzUYqQjqYuyu0z\nB2uAEH0EkgrDClBfeB9F7dNfOFlTe1sJlFSzlxffXa/KqfEWuRzOfcmj8oKz\nS7cocDHeDU4EPJeFrMToU02ek4BOkGqt13PB23ISceDzAA0OodY6xJrcUIse\nAwfIyXwcw08mYIikeDeIxXnh9j0ES4gYPIIsVWQfWxmaEH3alRhmreRwBQqH\nQ/dw3Thak+x0SKG/AoaITAS33VPqCpYDzXTz52N/q1xejcnbyMuzwq7hyMDq\nxLdJJpNiyMmeVXkWoMSTjefzp062ZNuCkQUHeBExDs3Cu1OKJI6twxj/80+J\nm9dt4hy9CXc9bGs+bx3RtR+kilxfd4kaXUgp2/EqXO7PvMwgn9G+j8T2eNbz\nApR6y4NCJcbGt8L82QV5ZlH2uIpMpTFX45U6Q5QZTZTijnTgp/D5ujV93ArW\nYOUBWRu/b6t7FWd2oFxyelA55AsQIcknWr/13Dx9CtyzBYxvS1Rf/o+NBE/u\n45GHer5AFleoQvKu9V7C8740JXsielmmySXmjQAZj36iV341ZsWmb4AJSN/k\ny0z9\r\n=Xtp/\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3uKbc7/E5yOsLw1iMreFurN5+W7tCbnDst8Ljh5W+YAiBGbRdOOkLtFnfXCux3V1EkaqIRo+YqdZRSBXYjXi/J5w=="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-05c23aa_1642810094891_0.8514225217110651"},"_hasShrinkwrap":false},"0.5.4-5c120cc":{"name":"bls-wallet-clients","version":"0.5.4-5c120cc","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-5c120cc","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-rfzMtGQZy+0KYRwuOA35Cm34FgSNvJpcjOcYUoi5/RBUjkenRAfMkut9QH0bV8OFleQOTv1hDRpzXSQNIi+NzQ==","shasum":"3059b290015edb79e0c87f61eb6bf90797c24b7d","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-5c120cc.tgz","fileCount":248,"unpackedSize":827164,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAgmxCRA9TVsSAnZWagAAxmsQAImTyNc9TyMr5v64Wuj9\ns8PtNiOZ9DQg+nxBk4l66gu7wuJ6+mcMvcVmh265gWH2CLoD4KA7rACTy9m5\nZWPEBEngvB7X1GU+kfXT0p5UdnHU+oP/uTGipcYyISIZUgoC+IWcLKDArE6k\nhsn++7beOoIkVXHzQRy5J+mOS9FseOqh90UxVS/46fdtfY7ylOVM+0DlCcrH\nr35It2HVm3th6h983eSnXeSOP2ZxUVlzVw09xypUFTiA4uzgOjgBOZLEUFVd\nCYNbmFTLIMdg2L1e9a6xeXILIfvmC98/Gfz8Zjihe1y7VSdTO15HkHCSJEY6\nNLOsPudD1NH0EqKSNpmiDnqrDYrCAsOKX/hEAtHm7DYNlSCe+rzr7t8vrE7h\nqHjksKFtMfrDqWm9kP0BMuF1AmaURnAU1rMJAQLUiWmFg9EejJk/VQgWdHP5\ndBCJguGDTclGmKNftCSRqp5KMfajnh/tesfVvVNdbwybDMAIgoD6jKbLe3wC\nd2FWMSvYlxKG6Pc4dJvmzGxg1Ajm4973Wcv/zLEvMf0PkRmbLrHNkJZhvtjy\nBWdGN9oh27jwB+TPtNzIb3V2P0pBVTjpmgbTNOrJFW+GC7KYGfjsaHP2TKWt\nPLdOrx9YHfPF6bBp5A1J5/QA+JqEZPl/RNjhw5KUiVFxeVf88sqeMaMxrru+\nvZ8g\r\n=iCcP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxz+T4YUyvF7m7Z3b6BY+qksP8WLTuJQQzOpFcrkr3DAIgTMDXhVaiXgvJDJmgMvL886K2xX2OHxM074M839Rd1Tg="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-5c120cc_1644300721057_0.5408601825243742"},"_hasShrinkwrap":false},"0.5.4-b991dbf":{"name":"bls-wallet-clients","version":"0.5.4-b991dbf","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-b991dbf","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-iK/JFfeTSmNNVndM3HUwTwKKEHfgZyymQYWk/3Y0N5/SSPHUlfaD0p29zNn+LWxTnNLF1AZ963JXtwlGh9XsgQ==","shasum":"c8efa791901f66d0a2ae427c5a52267ec53e5a93","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-b991dbf.tgz","fileCount":248,"unpackedSize":827414,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAzWsCRA9TVsSAnZWagAAlewQAIPzFl99kJTdL9q3htXc\n6h7w1gBQMc8e+9pcQa6BGOAefWi+kDZMiNROmrML4/fhl6z0IrQhy7V1CQ+m\n6PSDExbk78Z/TqDnsiJN7JS0X+3AUP+fRz8o7DKx29LNsMaJtQ6jZi9HYmMa\nsjOgjKgqClnHT/bkQAZVP80q7U9sXNkNoUCMMbNXEBpNoYEoT9y31VuYOJZs\nbOjVReu8b4K6ug7a24fvZq1VFiTn7Juc/GdRnSVUapgd3VOSjnRyrgxvbbuD\nnZnjFbntJ/w0IoixuSHXHCrsOi8RH6yl10Gguub2SYvm9Dey9Uy4DTw7u9ho\nT9C5FD3Iej9kXFjBEQSEIUTl+tCt0W8HaxNs7+j5cMhDbul+FmZ7Kxa8rfaT\nVuFDR+tGU0GmNW8QXn06GSgeOYgRmcnldemwPPaTDlKB58IoaYswAhtQ/P3O\nn+Y586UsNd/KPFYkfq8imF5xHe0yhWb+rBJhFcTvXxgdQ9FfT94Fei2UVYXv\nWFERVrWeuSeQHBTuwW0nCv2jQQys51e5O7c8pH4bXbvchocNcyXuSCrBhD7u\nMPCIw/CO4ZoQxECWF2/lNqU1oOfN/CskMZ/by1QvnFS33JB2wGtMIZrlDOZ0\nmCnwEtyMzkkA0pkRjBx3cXmiuZzF3iRYrx5kZlK8fxHKL3Us4uiZMVHq6Snw\nif45\r\n=GILi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDPCsTkE1OKWTwyMjNEMgj4S3GSXwYx1Ss9BYCH1hCx/gIgGFSUZjLLZZ4TYA5QxUJ+4dSJyVHcf+1ezR6QD+NlvbA="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-b991dbf_1644377516728_0.3082779772377384"},"_hasShrinkwrap":false},"0.5.4-bb3f98e":{"name":"bls-wallet-clients","version":"0.5.4-bb3f98e","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-bb3f98e","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-JJul5pgZRVoOcfnXAl785R88DD3/rEg3AelMw8zkGMDYG6Dg+cDiOK83HNPxNqO3e0SnaAeVlMrHXX4GC8ou0A==","shasum":"664ea38154971e40690e4c2c15b4db7aa18a9b13","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-bb3f98e.tgz","fileCount":248,"unpackedSize":829175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiA1UkCRA9TVsSAnZWagAAIdAP/A4O1CvHqKVVm8L10Xl7\n+ke9ZvpNgl4iokwm69G4M6XEZtMn3WjCsVkbm6xMLPkrKBVpzcRqIjWgMgn5\n87Ge6dX9zMTxkQwiPb87prK2akoktJcS5j33ofzIoIrONunezC0x45cDMMnH\nsdmRW/DJBtk8iIaZRiPGJm/rmIPkpsk8HI5TYJOeNrb2GpaYF7AwYh6xRA1n\noKrsOBDDvI+1IkWsEjfq9sTGGuZJ+W4mFF23Xo4z3L/hlZ20qi5LRQlXeuj+\n7S7qfrxwf7CyCe6P/4fVRj6BhmRumY1vFtxWwHqNOvtW/vJUJ9jI2ZevB9da\nncfj7rw1hj6bzrZvmWTpv0DHjKnkzCxUW/mob9GEQ8xT838nuE/BGoZCve8B\nDffqZrCkFvFAukvzItlQIDGDSFUpuuYpz2TLOLW7JmsbiBGwZ4s1iFAnETi6\nXAXUkaOc7o50JN73dwkw9CcturNn3z+I8zUMigmS9FnFTHKKOP28WP9Mzz5h\nzWmEpMYKm6I6b7td9r0PvqCj0g8PQNPyqbLLh7WJN54hg9BkFE4UhhHDpqi7\nkqXy9I7gWij8M07XMzm7raCC6Ngn5QjbrzL714xT3MLWJpESj25KFc2F/d0s\n3GN60KfgTz86JOaeEPlcVSOoNijVtLR1RFnh4qQx8jpkZ2E9+8OTw1l0/v2o\nUoKo\r\n=lsUk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGQWDICLm8kftQzR0aPI0VV0LfDHB43OcdKqxhQiyiJqAiEA9KsrtOjoEJxFEYuzjeYGIb6ul9mljGEEJl3N82j4Y40="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-bb3f98e_1644385572646_0.8372904522454345"},"_hasShrinkwrap":false},"0.5.4-2563e2c":{"name":"bls-wallet-clients","version":"0.5.4-2563e2c","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-2563e2c","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-H8/tnVAsUCoAPUtmPPwqnuBClupNolhf45iX/smyzkfEyqszIxDYw7qMhlCa3xaKeLBHc121p5ad6Y3NHIYKEw==","shasum":"bb4655e37dfc5ea8ccc288be138cb676b77c13cf","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-2563e2c.tgz","fileCount":248,"unpackedSize":831180,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBGHvCRA9TVsSAnZWagAASCkP/jLDaHSJkNF098p2n3YK\nwRnlSqZdpIRY+PROF0v28UV313YN/y5omEMf0WyVdsKseWTp/T9VJN7pWG5q\nYurYnN+giLMVX7o/kwxFlpSS7l7V/OEIb2Sq1Io8JOKJMjTtcZZaJHBnulN6\nBGJZwIKT4oWbPRXkYULk0CcNijSq1gtj62Ir8vM8NF0WDmQ/AMTdqutNOxKC\nhKUtu+iOXHuzk/kbj2L52YB7W3TkiI2cMM920zMlNrgVsGUjXlZIWWRLYt3c\nYnB1v1ysLOgP1ZFcgRsu5BHDsouBDaTHslvyW2Zs/y6FYew5Ug5CB93yoWMA\nVZ0UBINZPkUJeF9LezLbxlNC5hd9c83Y0GK3cVWsTe5tR9qs9w9ny+l2DgAF\nqkcz3FwhJhvjQsA78sbvW1u6bLR/wscFh2HTaVq6PvzQK78L970jbNLu8O1H\n49AIthSa1AjEPpvUm3c3FujPlJGw6xU1mLCkMxeiv3jqmuiEJo0cnW4/GKUj\nCDTi1Bt4OSeT5tisF54BEjdlMMJLkHcIixNldANRy2TbPyHeWxg4J2oK+B+i\nc9Mo9cFroVKuacwBVuG2EPSixH1RBXcpt9MTddIYBp+UBnndNtoL1qWIn0Qh\nPYyw0unQeHDYogom2VpSM3X84/VoXg96MRwZIuD9Ef53ogNXJ6MrEaCINaBv\nQQtx\r\n=33yR\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi4FPwySgVTIeMVS05tnB565l87HpCoBTcfM0bnMGVdQIhAO5pbVx770G2jxpqoE+Xt0Udl5mZWHq21GoXoFLYtV/j"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-2563e2c_1644454383388_0.16789681291415914"},"_hasShrinkwrap":false},"0.5.4-f6926ca":{"name":"bls-wallet-clients","version":"0.5.4-f6926ca","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-f6926ca","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-QWqE88CzS5yT2maOmqHkET2thPM4ab3yQzZE1xqLZw+OgLUhOJtdmlsEM0t+EjFqGAFeqKhRXgNUZkIC6TdLKA==","shasum":"d4baf611044b87c736d2b48496e45e1c16463d39","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-f6926ca.tgz","fileCount":253,"unpackedSize":836098,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBbm8CRA9TVsSAnZWagAApoUQAKPVuzAIuMoZ7JysWz1r\ndARn6AhyKIPPoanukAGNw4jKvfgfm7JH56KkEn/yxsFYcmzB3Dmm2N4hM1pE\ncdwAhTr4XLDCLASkQynd/IrU+Wg6AnPbNF6JRO+l0J5AoZRtIlC33H9WPDYh\nyLA5iN30n0eos92mDzf3IiecBAUQZPdrTM68+wMNlRWgTQKpVAy0l2MJIO2A\nkUNwSNoTm1jp/YpP2CqJUH5d+QEZjlR2s13X+Idn295/pfQamIntSX51eBAa\nQzO9zQLZOonZ476X6ljCs24DjpEqLpd1OYwwQif5Eg0QzgRhGH0hk0A4AedQ\nF5OT2Jco/y1Qrth8wBTNnDXRDBGj43x6TOMaMkFoo8XxmUV+qMynkgkw8tdl\nnojpf+598DaBnVw8S9IitehYuOTcQg7HElITjbCDX75C0ZFpnxTITI80F41p\nPCjoXUD7vVLSrNLjARuCt9WZ5OHRD/SJAInEVZgmNzTzKMmTTYzMgDOs3xBN\nRX4dxQ6JMscHPn64fBdx/nzKAP+RzTHz3oDfPyh9VbjNxVvvQ+dFovQyd9Gv\naT9PuMFwihuAkosLUZP9Viqel5KfaP8SuLUnKktZCieaHklCB2Bvm9sBpoZJ\nuAMJRpsWuQ81jtp7cM/HQ2TBeDWPoa0VIoS0Q3SDTkGxCE9J7g9QrS7r+E3B\nfBbt\r\n=R6te\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEX6qQrfqG1VAbmxbUFLGK8u8LFkbdXfaKWrfrB/xMcsAiB1FLpuXWPJp+B1jiMxBZkj5Jp2qNrjLQJe/sJWB/mxMA=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-f6926ca_1644542396210_0.5120347444337074"},"_hasShrinkwrap":false},"0.5.4-1d458de":{"name":"bls-wallet-clients","version":"0.5.4-1d458de","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-1d458de","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-ufTZm3ChmosT4BPGlwsDOdhUMlUmpKvyJeO0hzlmwLS77oeR+UhqFQHTebcrguwWYrBWpJTn3CcwcjaWFc4rIA==","shasum":"0ee33e465024f28ac4ee46ebac2e88b104d950a0","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-1d458de.tgz","fileCount":253,"unpackedSize":836098,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBdGlCRA9TVsSAnZWagAAY90P/iAXhgZfz5yzp5ciXkHZ\n3Si0pQeZTaM4zKYpg/ENNhW3R+M2gm3GXb2g9RVjVLHqtxohNaNVnF/nt4fy\nNJ3f+S99cC2R9r+E9MRzQKsl0qKC4RJW7ITUrTFVqkEGegYyht3Ax7VQ12bB\nsrDMqF1KFkFxKqYoCsJ3xV8ZBIdy5hrtaL7VoAvM12VdJAf+sJqCb4Y29Jqc\nD1NdtKz9P6LBYMB/h2EpVaQuwMrvMNjo6rOcTu/czS7XZGlWTyWVLgGCgH+s\nwdgjU2yshlbhCsPp/uxfVXWL2Ob+oAK5X1zf1NAtL2R0Nmc5/udok4psNkIp\nWdugVBtrgUr/aojUMP0rgh9B0vUjEWdZ+zuTIqHbYrk7xXMfy3yhhbWbKlyy\npiVVJMM+nobePjGqQV9J0peFwnk/9PeEQxKDexuysJLA/g4mGMI70r0GOJKB\n8Hh6nmr3fP1LT6ZHZe+LVXA1A115XanyMoL4Z9uWnzlHe8cS/20DAFwnONdR\nFThTVYfvEollkvxCgKA5ybaL6OCc45mpoyG4sXCNOnp1Y5xj0x+F/QvS8ohI\nkXWN3sCEUQKlfCIi+p0VLYpuBeFN2H5wB+WViuRS1cyw96SzT8Glqa5SmTn+\nKanqkDk0OZkYwMoQZrrYeC0JQxThBz5eAmpQ0Tk9u6fPDqiOl4xqdM3qACgs\na795\r\n=bevw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJp17nCwS8Tn1V8GnIL5dhoxD8RfJEhKaWxE+g9zTbzgIgLrmv0bCFcwL1t2iE7Hqxzi+BhHLLc7LhTni5jcKviiU="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-1d458de_1644548516855_0.08965067242537605"},"_hasShrinkwrap":false},"0.5.4-2c78bc0":{"name":"bls-wallet-clients","version":"0.5.4-2c78bc0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-2c78bc0","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-/YJ06ET+YC2GV1rLBPwWowXXWzebIxVqm8gPtdKJWHI3AH1P2q+mKLQpLTMVhzLpF/TGJBls8dhVC5V6jCJWSA==","shasum":"7bdffbe77d941beae74b9da40e449ce81539b544","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-2c78bc0.tgz","fileCount":258,"unpackedSize":854328,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEx+eACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4gQ//dCxPXDaFbWJL5ajgUocsB7tYgWnxAQsPzxmaxAEdqYFVOrDp\r\nKpK4xu+YB2RW6RGXh5cjXP0F1j8vg7kX+ilVqsm0Ho619zdlsAm1o0yZ+7T/\r\n7RQB/EetHP2k2dhhUiQzrwSFo3xQpVdfyDQuT5SglQfx4CyzQ1fP4Tdk2kbM\r\n2wykrTvHN5eY+VkpbVf7qk5D5FwJ3JzPAdbitq7PLycqHfoUrs0qc/cvYxxJ\r\npAX6QHgczoccyeQGMAuCVWs/E1pNslrj8vqU//97zUMvPc4EqpvxqKc2A1Z9\r\n1dm16RaAmcsHrvbzPCh8Ha0jPyVrB+QaqQd0O5uNXQIuT8PoRELKjRGA0Z4p\r\n/XzzrmIWRI6pVRKc4cNbjP8dfbzp+Kw6tF+gPvnr3BJqf3ZdJsRwV+4lr/fl\r\nRE69mNFGrEsgCSL24ABwJCvljZjSgdhdSDk+/NEYGfBoqX0G0OYhofRkBhDA\r\nGUY5fOfkbs9cAe4F4mzhCOvQy/bXo9BVRHqMfIza4HgepvEIKeWo9+TWFyP2\r\n8TZiwgHLX2ntLX2jaHRRyJRjCLI7hWBIq5qOkTV054/HJV6nWRBUbBV7bEAM\r\nFrq96KfrtT9FZDeKx/oMKvGalPYaykDlEfsmC1tKRXt5VbPDvkjv4M4JcGr7\r\nuGj8qe7WXVpkfhUcWGsT7fJQJlgOIoLxGcs=\r\n=s6tr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBe+SujTA4j8atBxCsm5rM6wYvvd/hWwCcJk9CVBMcKAIgRnYZL5HPwZ7hj4ArYQPhcLufQDYcLG6qiDzm7zvHZbM="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-2c78bc0_1645420445995_0.5577507539720867"},"_hasShrinkwrap":false},"0.5.4-73ba8e7":{"name":"bls-wallet-clients","version":"0.5.4-73ba8e7","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-73ba8e7","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-DpwZ1IvkB8FBulowp0+96g3iaWQkYX7gkWwTDJkMQ8humw8uXZxR+oc7AIWSjBKz1Sw6GPBzunJP+2kS5IJl+g==","shasum":"9544ad4c4c693dca5fa2e6e3a2486213c44822b3","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-73ba8e7.tgz","fileCount":258,"unpackedSize":851009,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFXIPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZyQ/+L+GfIKx/urlnX+FwcqFYpU5NJ9aS91+TinPJOfbYCDb7Ym60\r\nBwjDNgfiJEfJGLvDg5ANm+1NYp1VvDgA893xit4srrZF7YmVhBZrwLAfjivC\r\nNlZrVTT9A+khRzJ+5/LrJxzaUs283cNVv106Ode2kZ8/HhRXWHzNwK2YAdgC\r\n+Srp74yRVuTu4zpfW6jiYrYH4ccMNd3tx1SIjVV7CiCHqYKC8uDflDWF3fBZ\r\neOuesUJ+FmEx4waKOjgOy4GOBrcjiHhD38E3cJbxvPzMWohzoy/V1IzcPD8W\r\n+CrdGJLeq9Nh2mEEdw9iwawB3NBbmQwPZokwi3Y8+FMLhgsC6H6OnbkXt2g0\r\npV/Ds4rIvMa9YnmRv1Y2j3r+WKD2u15XnxVfuwgKZwaNosQKKVOeedaQgtan\r\n5boA/JFgr6WBk5dFxD74dTbNlTaSl1YgIXu8Di4XT/4up5cWHeq009X58FIT\r\nHBra5Mr3QPKgGIQef6DIUpvxDmmzQrIROp6J4Od1vYx21At3qyqWgO/EQljq\r\nOnlBldEu7RQ4NA+rtorWlqEAR6BEd6WhG7vuVETZrIHuTuCvwq/87znMxOKn\r\n+JcqR/Dnbv9hsYrowrnEmhjMXSyegLw8OP6M9zE/FE/Zn6smHVk3jXkNhtQr\r\nYCEeOvl6u3hemZPue6x0KRKTwhv0Qncuo84=\r\n=sB+E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICy085pvfeQ2iSH4ovPx/ZGoRE4kDVsHM6RmhB/XyIb7AiA+tUCe4RT1DRJWjL5oyQs1E219Bp5cfg28nvqLfGutmg=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-73ba8e7_1645572622981_0.14276350094491086"},"_hasShrinkwrap":false},"0.5.4-8402c55":{"name":"bls-wallet-clients","version":"0.5.4-8402c55","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-8402c55","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-43KTWBqoWE+f8g9+KCAa/xmjvpWfL3+WcGFn5fWCtDCaMi4UaiUwlmjOCVTzHVdxV0sV8Cb0Hkq6UhWwrjEHXA==","shasum":"c07b79e7524701fdb21b62929768d136c14d7723","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-8402c55.tgz","fileCount":258,"unpackedSize":854683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFwILACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpzug/+K/AT22wDP/8612l0AXeidrALlYcRx+vMOKRugbhnhU3zoYme\r\ncfLDMzShlFBozb5MgXE7AxK/4jbPeV+HsfdAozZjcbMgdoUzxgDLOuiu5TvN\r\n3GlMyF5GVJXl/Pg1sfgIbwLuMHlqn474bI3Y376EqmFYEpZxocRTHRGGPMIJ\r\n9XvU46JjyHRe5k7U8dowDO2l17/muSlSr/aCcFJxvrLXkOjCdTp8yrx69RAC\r\nYJbmEXqN7OOgQffPigU2aiXSeNuoXn58Ez68EPlyHy2FiNN5o1o6IukUZSAJ\r\nPBfYAURTP0kFm7vLlNaaO/jI0rEPtRSYla3msr0C05/YjtgOfd5ZMc+c1P6F\r\nxpD6y/+rJpH/tCdasfG/iidCTHsxKVDawyvy5nVepVjJ/tHx00noSkBaYqVj\r\nH5gUPFHKXG+RgNc808VqaCaCnZ+w9P/0ZBvvz63gfq3lrZ2u5NcN+nsQg1jx\r\npC+MEmI7F9fZoprVSDSMhm/sB7DbVB8A+3Xmjs6LpEKdqliw1wWyUr/tEblU\r\nOzwyM4HYjKwrjbG5TX+VE/WICGHi1SqN2RvR0iLVg9CU3+YIDyUovxn4Cb6B\r\nuoK1QCJnn4RfRTyaSHZmWh817wwY+Q420f04QaDK31mIbqY+Co/VPlEz6Cdm\r\ndTJfjknPgKF3R4UVXRSzDMBOGWbVa6bLhJc=\r\n=dGhz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCDer7hBGfURfrR4eBOMiZ3R89zxfMh5OOCGyF8iQOBmgIgZfEKY+FB4SJY40OT4IdXmNfGYeGlUc1A+aKXSaizvfc="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-8402c55_1645675018988_0.4905133756037645"},"_hasShrinkwrap":false},"0.5.4-0d31a34":{"name":"bls-wallet-clients","version":"0.5.4-0d31a34","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-0d31a34","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-BYhJ9fajOSo43bzPVfx7Xt3WiV01Z2giHkosdU1Ai3ZxgaYoJvXQqqI7MN3L1HA5R+Ro/AI4t4RsrDbTDAfk+Q==","shasum":"40683dad4876bbd0b7dfb3c7693ed3c550c81720","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-0d31a34.tgz","fileCount":258,"unpackedSize":854683,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFwI/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp2NA/+OfmbuZvytGebpi5bIB0wBhp7rwLs9KM34eiuzLiLmKDsFKuP\r\nzue/fcx2e1nzGWSrmh9m5+EH3yhC5Zxw28Mdry/T7z0/tn8enR3VNBWhPGUc\r\nb7ofcoMcoMgFpTqSaWw0x16vla9KDtYc1YHbEonXcz05bC3ypEQfTm8d87mN\r\n7TYcjMBbvC0oW8zc5aXKdwswnTaADniAeO8/sL3JC8QFxv5NJy+TKUDi1h0P\r\nRVZkU1uaphRs7ncUlwurCh4b3llF9pdCOIeHoHatMKXNDT6r2Rvg1Fu/iat0\r\nXO17uxfnvU2VoWOvktartmZmSKC5c9UECPD/h76jsMfN98kTF7h6L0NsYloy\r\nx71k5X4heNiEonh50HfQ9azKJA34ETk09SLD7k+1hz4S71WqhtBx6XmSicFC\r\n9Vy9gpUHElpHKTCm1+YdA4njV0tDYZSHgUiluhrC0YiJ6hLI3yd4bpzHDtVF\r\nNE9Tfmccsex+7bzLyOBhzij6iF7/IrtPDIA2Te8yHdtQ4udbwYa2mE5K6w/M\r\nMLfjfcyilwqnzdmyWi7GDPlQXgux6j/B1CgUQBqJ6Uf5J9jfQe2bjFyof53E\r\nqwKWKItsxsloihEUDvQ50QI2FTPtvwIDikn2QAkHE+muqze2TeLP1lO2ziZD\r\ntlqiR9/GXVs1NnG1P3/rajuIJ2ySVjOd91s=\r\n=sxki\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBAKGjeWDdWlVPJxcAxCRDy9k3w/xZB5t4L5D1CTwxTHAiEAtWH7y3KgmgO0oJM9GTJAZftfqyQawgqQILO6UwYgq/c="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-0d31a34_1645675071486_0.74997185132922"},"_hasShrinkwrap":false},"0.5.4-8c9c0ef":{"name":"bls-wallet-clients","version":"0.5.4-8c9c0ef","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-8c9c0ef","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-rks6VdH42Q0PtDXVYZf3YB2Ti9WtRM3cL0quCX4dPnx4nqZ61RAEhv0xY8LcceI7baPaNv99njR7y+9qXp6kZg==","shasum":"c5cc87527357650b98990c24a8004ba036255dcb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-8c9c0ef.tgz","fileCount":258,"unpackedSize":859325,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFxgmACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrexQ/+J2On8h1eTFs4x4Fwgx/qcGS4LsaMl/qI8mTwiPXtGh9frs4J\r\nzpjZcxxs8UPLSRltQK/ASozjx8d+07ijvnRTXB+EOJmQdlLpCHqXg/T+780q\r\n63/8js6xBCEoITyLG4/GQV+acxGeb5VOR6Y+UnPbeYNBL2vWqUSryn0cRrtQ\r\nUOk28ygoAxyzLGbeonj6IaFyL7XzJN7rHgyRIjn5FoZo8JGbHzyiSLp5MbH5\r\nAlzIvFS3yTMlj+kKwVZwB5I5e0nsjwWz+XZ0IpQVeqsXvHHmD8A7TqpaYjTq\r\nZZ8KPpt/RyhEm+Jp9XIsuiuokN9X2CUG01+JcZ7v5W0r1XvYRqJMQBy1sNh0\r\n5cAhAe0CFoksOakQq3YMJEDE83q9ZjIwmC+e1v50w+VDx+cqjt2l9iTH1FcQ\r\nqBdayh+SjvukPhfqRC3U0FKbe/GUs5+ZPdhcTjVsGCN2AH5OOMS0fZg6Hu5+\r\nCzJXtzg3K3672+jE6oDLnI1Jo9egWOp7Id9jnGvygKk4UUDweB8S0x8AVd4T\r\nP2aG45gC4Osr1a8nuep/pCTVxiDmvoOx2UFGjwo/8rsR3sVq7LC8Qa/H0e4l\r\nZLcCZok7j7l1o0OhaBmdS9CaoDgNDZTF3Ib101hZlP1Pdo9dmcOaBEgnhfj7\r\n+VOx8X6n5PuhVOBnAcC/CIyZZ4sRt5qdgpY=\r\n=eNeP\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT5AvPlFRIQgDgiaFcmOy2OPLMgd3cwlzo/4WWjtIKbAIhANe0O6oM64f8K9t9Qpq8zKSQTT5ZWWhqR2Vw+XEwHTlM"}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-8c9c0ef_1645680677913_0.4106537899146303"},"_hasShrinkwrap":false},"0.5.4-5f7be70":{"name":"bls-wallet-clients","version":"0.5.4-5f7be70","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-5f7be70","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-I3g2/XRZnqSsuiN89QYbsC18IRudoI5k0g8L7qWjdJu5fqk5YfX3b3Q4Fd8qOKdnL+Kb7HMTwPnNJ6ww+Ornew==","shasum":"f2895a824eeacc45c05d8474fa32cb812545eb96","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-5f7be70.tgz","fileCount":258,"unpackedSize":856133,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJbCdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoE6A//Y2b8EL5PBIE+N5yuyc5wdwuCepl3sWhjFcsCg7FdoWarttzg\r\n7ukP5gO1Ui5/l02amZDDLfyYunkXOuBKTk3Bk5bqIspEgvVWLqkRu+PSSVVe\r\nU0o9nk5xYMJl25ZSYtalx5m8nntHa8WnDKqmS3O1Ss84VhkgAD3GCXBkfMko\r\nS7kQ3kR/EFUfE8QQIvd+8u3Yb58/8l6uyjL4zSelLEmlnPwdxGidCTejnZDF\r\n4g/mKHmudLMoghfFxtKNDijTkKRCY1iCJKU/eNNj51890KBKkA8vrms1Oh2W\r\n5Swy2ygb+FACbzJTKirnKkjBtAJBCBcqi/CC2FVmPEPG3XJwG83B/WbAvAcM\r\nyVLXfzNafxVxUqye0mf0+IpVQipdf+5OVBqY3bAa0LzUG5ZMCEdO2hjyM+TM\r\nGZmwbBP+BQz7gy04soYZthTxOKAdiJDbts+J4Qi3ce3e6PFNrsiv9RF1Thdl\r\n1zs1UvwQUkaicYm7fIiq7sCTjqi+0cy7lzby7ryjwoCSEIeFrO5qYnhCr7wW\r\nPyWMxWmmt0TN/J2mmGoJgKm3tbJcEvjNEhFYvJMYAZ5ThsLl3gux+za7OVVV\r\nSBZQdWm8N7OWttsmliJ8lJi8Ihxot0n47jnN1HqPmi7GXI3g3ljRL3BDi4yh\r\nwPgRpPxIVBtY7vDeSg1r0UREcfDeLqS+5K4=\r\n=FXer\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICPNrfJhkoEcIQ7Jvzsp91DhTg69NlLi/5k/lxzpR8rAAiAfD6RucsAGxvknHkrfl0CUR4c3+raEHwUlE0meC05yoQ=="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-5f7be70_1646637213463_0.34227902924661424"},"_hasShrinkwrap":false},"0.5.4-3dc82be":{"name":"bls-wallet-clients","version":"0.5.4-3dc82be","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-3dc82be","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-2oWXnG8QdHGqaOm8CNYUZjpY3MgmKlXrAaYg0+QvehkNbOLepX3VmU7RbeKvMyrf+ZlZtOwMxt25+coCuvED/A==","shasum":"607bc275571ac8f2755b1e82b382d6c58f20c828","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-3dc82be.tgz","fileCount":258,"unpackedSize":856141,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJbGzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQbQ/+M+Qgw3T555BskyfJiX/qBUlg7x+7eenPdoR0NkhrTvr6qPDe\r\nXOhYIyKWhF/aFFkqpqYUm/F3DMzb5gsOEOScswQiTpAgwb2mcH45P8t43lhn\r\n7frhhEEnLJu1jpAT+K8RZ07HlyzNn2uinIVIBhXGDuLZOXm3VIWLwah2nkc9\r\nCRBlKpZj39r13GzP0GSGDqE7NG/fwQR5xLheY9mqe8tYh/TCfeJkdGefcGcr\r\njXrteM6gAKP729RapIGhO+E3XMeEFIR72A2AJjGi92fxPGFcMP6Symgtyz1s\r\nTmdcmdj79F2Op/bmdXusgnP7MlSaunkUa6u4tp6IwLO7LGQ3FTlFGH3s+vbe\r\nXh15Q6frQQMZAKWWqjbnH04LgwgIEJXIZ2aFVYqCYEXETkimGRbS9Ud/MwEH\r\nvOm2dNrPYTz+3EjXOZeA68uXRIMm7OnuouG90BnmteLRKbsP6hE4q+2aQSoV\r\nyfKSiUPI/WzMyoTqlhLGXUIR/ui/gd1ffb57Hju5Tykx0xpIHIFnwbdXIjFL\r\nGMgB9DgNssvM2jBPRv68ezpW8vrQvFKAODmObp2UgL+WutHrT37sO7cezoPs\r\nNCBN6+x1bm10+BWyN0VV1OeQkP8V50T63CyXlhuONVj99CnCQpYUlnNMGe5p\r\nzHVIOjk1+fPlEv9Ia+goMviD+pE3j9GejAk=\r\n=FzpJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAmVG7ENjrejmUHmqN3NYMDyCy9fIveE7YHPmHyHgR3vAiEAgFTQV5D2NGkBXPSjylwN/9/us1R6sJ1UMsCTHZ+i7IY="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-3dc82be_1646637491433_0.9806067640226024"},"_hasShrinkwrap":false},"0.5.4-50dbd9f":{"name":"bls-wallet-clients","version":"0.5.4-50dbd9f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-50dbd9f","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-+90zXVm0LFhSqMkD3/A4WsAL7mNZFdDBKbhijbeOoVIWYz7QimXjepmTCx8LTyUfwJokfArpipHRonS/3ItEYg==","shasum":"78e9ec6a7f3a3de9cf10c763707a0dd2efd5133f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-50dbd9f.tgz","fileCount":258,"unpackedSize":856178,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJqKRACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpa2g/+IH/hPM1HNqkhwq5duE0aPK9A+62tHKh0RtyES1uOo2gFSxHQ\r\niwWNAjJZ7Fjdp79RuASfSsxKsHhCXU8wPlqK/+sF5NTCApBhW0pi1svRDiiE\r\nX0FA53f8FwLn3TTGolz2RdEBtDr7fy4NTTZfCnzjws97PO5CRvhjyWokMNk9\r\npL7aNTGd4PISNKD2GtsRTGVD/gaKAS5T/GKmI7VqqQQahpU/GWiy0iDnyizF\r\nXYDPaSJJlN93PQQ7Lijq1+9LzABXR6y/YgRE3s2cDXJhS7ty4jShBKpLfmSb\r\nHZzKuQVssRbj3SszgYaYA3lbjP5fWUa9hltxMNDDMSCVhJqs64aZ0X1UTJ6z\r\nOMy7q7LPItXlDiHFWpl9h63OSHH+T8J2Mh1nnyL/lA80nYjzZ1Q8LX1B6T7Y\r\nbptqEk/RJIvUwtJ9eTQYmCt/I6RCuN4hYh1uFC0IO3fo61PvQaueTecc3vbH\r\nOsN34pkeufc1PA+dgqbn3aLwj7Zo8YSZOu4hgf2IwstL9jodoxsph+rf4t7N\r\nhNwiDtccEcINX2xssF/fTb8g0JLJTldNrfZR+r+RbUppqlizdcb3bUiL+upA\r\nyxnWrp9c0bMm2d7OLXFmxLsuSGCplRxGy4MJHsXDrJ3OSTmeIK1Ix5wpLBca\r\n+no4hG5dUzYMdbj6/hc+i+9NCWAVQCmHAf4=\r\n=JB3I\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAMajAVOmZtW0ZUGy5wyujIR1d4Erd76pOAV2I0mii/XAiEAktAs+rD0Z1QBL6f0F1izgDHtFoeA7Vn0/ZbGJpok0Xg="}]},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-50dbd9f_1646699153224_0.18610425622156002"},"_hasShrinkwrap":false},"0.5.4-7209856":{"name":"bls-wallet-clients","version":"0.5.4-7209856","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.6.0"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.4","mocha":"^9.1.4","source-map-support":"^0.5.21","typescript":"^4.5.5"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"720985674346e79e509040f0d30a9ec62dccd41b","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-7209856","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-ltR2KpSiQ8B0rezRD4WPIiJbJvFvqjvX2YVfLejjsXBcoo+MR0b1IpSUy2R/2YUuzX8kME2yeWQtAAXF5LACRw==","shasum":"1b433c6227b42c460c9490fba050755c617b5898","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-7209856.tgz","fileCount":233,"unpackedSize":781520,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiKqFLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqSPA//RNCmXxCaJl7K2fB0y9fNuaSicuC6X7WwtTPKGcn4tfDNL4O5\r\nSMNHOH9YdoxLIVz+aD554thyD7KGxCNTuNE5BuPF34SJyEo+773aWPMG7orM\r\nzOsablvqlXC2QT5i3r66xP4QpPtsVqpFy6O+i4h6MAQeUCJR1yamEKZF1Lvk\r\nHQKiQBFxanpjSeNHqdyctegP5XxIglgGWeMeE9B0I8QIttrCVgw85nF9kOrz\r\nOSy0O/VfTWx8pvWqlm3M7ShsQyu+xrpllGydt9NlrXWKlL51Yp3h7nYrcPWF\r\ndNJJsenaf+DGJ2fx/gjzQwwIszUIP28hkfkZJZPi6SpqxC7k7KobW0OosP5S\r\nWwadnbLS99hCh10uINsWPL2gUB1/c29fVSZr+R0Cxdrl7PuSlkUfv15UYGGX\r\nlqgzorq3MS2Mfnm7jHoL4TJ9jfQ1MbgboppiD1QEEjd/1hAxjUd52mbKjyCx\r\na3n6NjcOI4Uv7/clRfPImZbhoqUc20edvnei+MiH3IppcyP15wEvNT6Zuuv8\r\nk+3PCaCb65T+sDrDivUrohUcaQnvUva6JpMorZk8gYG/2SKozK4ZpIKzW/TP\r\n/RBu55giYVaY7PieWY2uO295NNYzLbxS+MQc8VYfmHKWn77u7OERpVCMnnPb\r\nRSEkjiqYo/v6cGowQXE83CNy0JoEMBRzD6k=\r\n=ErCc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDoOZ8DNKF4C5oQjiyR9RnQThVx+GFG3bqQbTzfVVKm9QIgWOYlE5bFlHChaksFbzcEhdhnaSJLJS3Mol5vMO2hRZc="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-7209856_1646960971092_0.8969386355139195"},"_hasShrinkwrap":false},"0.5.4-62c545f":{"name":"bls-wallet-clients","version":"0.5.4-62c545f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.5.3"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.4","mocha":"^9.1.4","source-map-support":"^0.5.21","typescript":"^4.5.5"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"62c545f50261964cb821be2415bf2f06adc65afb","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-62c545f","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-dBZN7hhr+J0UhVPi480Sd6up6rlIX82s6MvI8HvfoMAXqWfE1Pc8gOZi4DF5PdJAmcOyGlbVLpZU7E+KABk36g==","shasum":"197b57ff40dbcdaa39f7d4c267325d6827555ef6","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-62c545f.tgz","fileCount":233,"unpackedSize":783891,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK+VZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUHQ//akQOKIEYiWAdMChn80UnCf6R7qEnBcgq5iSb3mIGDIkAdcBU\r\nwyrYU7bA8RHXu0uYTNaA6XfXCWV2jiRhMOn48m1pW3TWv73AyzmYcLsE9FyH\r\nLObOja620vCkGo+ldqQPzqPfsJi8lypnRBT3t9AfYyVRZPQXmwAMRf6cIJdX\r\n4UccI7O5s/I7Js3/Icqb6c5EIBTm98OE4SFtwe7m1KdEhF2nXQ/kYjL0mTzb\r\nWm8ljsWeUczNJW5sgOfDVzKiOPgcgp9ey3OOqs66E6MfsHCSqLhP+mEXbn6l\r\n6W5S3aFwZfUiEG8JMaEzrq0lKPLGZLEgSnwcY+Y3eFl3i1jnfz8JWs/fv/Ns\r\n/b3x06m0WjQRsfIxjU6uMQM7cc5rAWijdpye+33ZihPyulUskvLqVC2mT5cH\r\nlczud+gvSyBHlBjGApFREZP27OlSYxH4CnRmyB2jWVDCO1PwkxQ4/NtKSCkW\r\nlxWtgZke8lW0NKqMt2lKU/JT/ZaLlCRiWdXGjhINiZ3pOvjy7LgwiFWOxS8w\r\nH/dIOJuvq/lnGWX5w/vBl4dyr3UKPuDUhF3ZbqsZlwr6h6B35T6RKNc5s59s\r\nwhLOyDCTVevyidtTc/nOYo0ANprTUwzIO/UC486UNxv6Q1Y5VbNgw/pqXiiE\r\nrNOO6l2zgBeRsGOCNjLU18o5xQs5wTU0a30=\r\n=khWc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHRIQSozOpvI7lidAODkDp8D6j1lKqPNpB4hDNFdwIe9AiEAh+xVSICT/PThCGrmfqnQ0djhgX0ltKLzN1zxp3NZkcs="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-62c545f_1647043929265_0.8159754492642199"},"_hasShrinkwrap":false},"0.5.4-11b7d61":{"name":"bls-wallet-clients","version":"0.5.4-11b7d61","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.4","mocha":"^9.1.4","source-map-support":"^0.5.21","typescript":"^4.5.5"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"11b7d61338a273e168ced44d2b71f508072ca20f","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-11b7d61","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-q6VTbhW1hAwFP8Rm70jzgwT6UetvGpB58QhH3L2N5yikRwuAytWHIAL42WhDehMKmHrDeB4NSeD4FEHklE0Pbg==","shasum":"9747d458d16d691f779b6695404c5af2693d0580","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-11b7d61.tgz","fileCount":228,"unpackedSize":778047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMO2pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpb1BAAisdOAht/yVNOvZwPOnFguEewnR9NwtkoH/Q8uxQIymAlJzlX\r\nDZZZ2VOJzfmkX/vPay6x1nSK3oOG4o2GuyLV3i2e+Vd/MnbbQVzINa8JYrAO\r\n0FJ7vubPGukugRpzNB046XS3LCdKNqK1Ccy7+T2il5N8OqMv8mTGwpc2euDI\r\nchAJG+T0AdQJLlO2UGOeCeBBiYk93xqaBZQI7nb0C/yN0nFbYdhUTPDDhWn4\r\nOmvRTmUtZttkHDWv4iTmsCf9XiEEn8kDxb2uPHzHkmN7JJbhb78aSkaGfe9h\r\nAmPIGaGbwAi5+vd38N/6qFqjQZVlttKYNMoMDZvOad6o41KAAxWHKiySlsjU\r\nQIuFqbWkQAzoA8eOBAHnW+Cxkj3Lh63JPYnwHNB6k49dtRtUelxxFoxTb8rA\r\nGtw8YwJizdcrPrT/vH4C41LOzpCzpczt8rlecdp03DJBLIDrejpVi6deixzu\r\nHyu7nZqrjcMmD0H0BPfBx0kEpRQb10x6fEjuIUmI4Zv+GlgRxvJY78uqsjS4\r\nGew3X2GrnldHG14Pp3e2PLgGM58uI6FMF5rHYUUeeq2wZYpL3fcHzkrJjL08\r\n2Pv0MFd5AQqKBupUWA+ctzfNnWE8XVjaiLKAOBw5RvyKRHM+8xh8TkS9Jzs0\r\nz/ekimc9i65PJcLVDp44K2p7TNLlXSGeS1w=\r\n=pZuN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD6sMC4bPf1aQ91SZSWfa/B6ZB5tNGtNnhIA7MNS/sfngIhAI/HfhJKB2d/6OOQUrPn/jTG5XwMx+mQAu7Syz6W4jyx"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-11b7d61_1647373737057_0.650454704884631"},"_hasShrinkwrap":false},"0.5.4-f2bad77":{"name":"bls-wallet-clients","version":"0.5.4-f2bad77","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"f2bad776292e6dee0fb11ee31066570ff552cd5d","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-f2bad77","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-54CZUjjoh4jDiHT6+5EtTQgLNsm/jmldmAgT2aC/l9/viGcY9st6NBTsiwwiMIwy2Cy3tMVkrHR/vOBdMcJE0g==","shasum":"a052ea6447180bb0d7cb0209ebf5b1525f14ab39","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-f2bad77.tgz","fileCount":228,"unpackedSize":778047,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiMQrnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0PQ/9GYRpLKxzhIE5g6A9PVwSpXBNB5ITw+QS02CPQWZQ02eT+8Em\r\npCeK88E+BHj1dlVIunm6DjMKEjGQYdn3s+oEp/s4mGEHhKnOVz8vw6gwz0gD\r\nC47WxmHunSMVVYYyv9cu1SqY/OlQErkWxQh/q+bLuHT6VYkayb8DgelAWQqr\r\n22cc9Dx4/5h8yL1RKMsja23mO8Q3sH9kTq9YfMoTNIVF1/peOsW7ARM0EJ8s\r\nAVLKN1ROURyDflhKcgzerwNF3ld1l3AMvSMX86342Tt6dqmN0f8Wz4SHGUjV\r\nhn/QQHSXLvQUqNJhA11OXQuQ4kudxxby+rsqOkqWunoeTxVdXS8cPleJbrEo\r\nZULPlrP5UP2F/oHh4glCJQEFdOBH43PsV9OoGgiQAQgRcvGSucMI0CtRFMN2\r\nRiqnhPbpPkXidFpkRRZkQXY6nv1c2HBLqw6l9mvqEgJl5vbXI10yugCX9hMs\r\njsLrQENSMPqBrnxADJ7W0qs4q6QVfFwfyt/jLeqTyqqZ16N74TBq017kjBe0\r\nqCWyVhlLN9O+VZv+MghVvyEjmXl7Zhvq+WK/acKeHvQ5w0DEP0xbBXXhqVD8\r\nYS2xTqCIXk7pF7eZfYsbzo79QW9VF03nPADI4Oeyb1EUR5HVnWpI0j1W9Tow\r\nCPQNt8QQ2espa3VoaCDa1saTRwoJs6E37VQ=\r\n=rShm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDookjOhrJyQX57Rb0reW7azbfi7Qo1ewCgTDMbcN+/XAiEAxbfBwF53aRkAhidwBFOeM3mtwJiPatgZRLZDTY0bd70="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-f2bad77_1647381222875_0.9953040359490144"},"_hasShrinkwrap":false},"0.5.4-3b87263":{"name":"bls-wallet-clients","version":"0.5.4-3b87263","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.5.4-3b87263","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-Bh5BaWY1u1fxya17PTKPNttZ+B6gpHqA4DgLhx0b67WXIVGu7AwFOBorT6oeEyodr7j8T7NN6a/axIomIj9ggQ==","shasum":"5132de4c91fb4b0422296ed828381153e63f6129","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.5.4-3b87263.tgz","fileCount":258,"unpackedSize":858304,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDVNQG+WgSNQMbU2uK3pR9leaFPU59X2bLr2KYKfnZVrwIhAOZqzn0WZhB9mEHtzXzYv1AUH1dKFBaiqBPiL+johgtN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTPFDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSaQ/+KEZceJfPMIfiTDacDmn7yy0bQhmQ9s2gykXjYXJkePjdq0ST\r\nWtxG/G9PtzDIFpByXnTnsmVcW0UZlYQzgml7aeybfotXZLTG16d0Bu+jel6L\r\n/2dODw0K2Fn+02rzexLjvsCA+fBLSlKt2hnE0YoPVvPPTl3byNTEYRA/tiCx\r\ns3+m6XN2RM0SL+rj9gPcs0e8kBH8KS4nfNssCpQldpz1Vi6fR3p/Ibl1mon4\r\nJIRarL3xFIPKGif+3LOvz4TNNjjjaKM7Am66s/yGtpL6OgPllHgrrGcfQb0n\r\nxM11PR1kPCuLplSPEWAgw7n3FEPMEVFdulCO3S6mLTNqo6huxQqMmNLG4kGC\r\nrhCRAyiX4fuepu2/UFHelb2nCITp6u0KP4TSpB1XF06WjDe8MYInKG9BP0M7\r\nDq44pMIrjgg5MguQibyxJdgrlDLtDuUDhy399cezNy2TbY/SYpVaEn7LBpaD\r\nZzXlLif98zLMe/eC7ZTBVvOnJ/UyVFahE9nwvPACo4QIX94ES9ANHDw3Db4w\r\niWVnAxkYTs98kbfVhsHbvvvKT1S4rV+S7RIXcQbXWNMskG5qb2yj6Efy/pg0\r\neeRQTd3tBpKlTw1qQo3qjbqIF7FUO8fq8BACJG22L+utCt8/jauiPWhV/T3T\r\nI51dLRe0UljwAmpO5jJqBr6o6bwVRQlPpMA=\r\n=K7bC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.5.4-3b87263_1649209667237_0.6118070424060955"},"_hasShrinkwrap":false},"0.6.0-3b87263":{"name":"bls-wallet-clients","version":"0.6.0-3b87263","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-3b87263","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-abFIjN/A+WsojSyQU0YAmAmUCGAJ3x84AD7pS948gajwxaoGoRzw61Ven0mY29JYtqAMcYLG4ylAjBeOX4b2AQ==","shasum":"615f6653a7d9449f673a3dac973ece6a35bd7f0f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-3b87263.tgz","fileCount":258,"unpackedSize":858304,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEgelZ+Ay+z7jIHtotta5LA1/FoNJbhFIMMVUrOSbXKrAiAqElF30omvbIC26pbi95clTqCEiWRWLUVNKEHtJ5mlwA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTPFdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpCgA//ZcDy2tK/T2OXx+hfIIiAuYaqRIvPA7rZWjdBE4tIbPa3/LCW\r\nN5SvoKp7K/PPw0UxvA2zHMdhIMCRnhVqYnC+cx14MFW5CFBXmIv0QC4Gylpm\r\nV0cPxB+Y9mrEFWBC9zgxQNC9s8FZBee8XsBemy7S8XIX5RFyUsFnG8XGrs0/\r\nHL5epd9vuPoqASSQCESVbER0vEpcQ6BqkubXAhRB5Tuhv7sHIYzR+0zRx2fT\r\nMu9+iFnypq8jsGKY6tJAWhEYn1r8MMtzPeGAzksaKRZPgSzpuqChocSdvviY\r\ng9ONdmFhMx5M2IsOG3HuCYHY7npT+hWWah8sKk5b/UZuTPLSDkhZfnxwVOaa\r\nMwimkmTi+HKVAtcXHZpTUEa/IT4rPVjMTb9FyHAznqZL2+p/5LIh8bg+qChV\r\nBnZOBcFzB9AkNe6ZDoSMlLOkVdKoE+h54vHwvXtuKz1BvJJw92eceG7cCXU1\r\nEbTlvS274y1WBZ88Kta03n/dArzUW9SRAKg7avyLnfVjYAoVclBvCBYKwqOt\r\nVJ8y4zJCHOVLFyjV7dFp84R9I4aUs/YvbwprB51Ly4MIm9MK5I0Nhvtq1asz\r\nSTgs7l6eU7tgJIw/a9NKLIMfSeVmpDUSMxjspseehmaHVDEx3GHsMwchw+rR\r\n9j+Ls/zdFaAN+8O+OzJW4vR3D3K/anwQAaY=\r\n=+Hlk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-3b87263_1649209693507_0.5229996120029945"},"_hasShrinkwrap":false},"0.6.0-45def92":{"name":"bls-wallet-clients","version":"0.6.0-45def92","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"ethers":"^5.5.2","mcl-wasm":"0.7.6","typescript":"^4.3.5"},"devDependencies":{"@types/chai":"^4.2.21","@types/mocha":"^9.0.0","chai":"^4.3.4","mocha":"^9.0.3","source-map-support":"^0.5.20"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-45def92","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-J7lv+RD2GfFoc0BkFkxkoh169mk8YHcO3MQGo592EvXEpHKXLaEyLN16c1s8xCPKmaWfxQVt3Qj/vo13CkcYXA==","shasum":"6d439b56d236fee47facd78da738f7091ce66c7f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-45def92.tgz","fileCount":258,"unpackedSize":858304,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbH1fpbTjjjpfhQkf+J0IewnwoOnSGq2Qoy4WKrWxz4wIhAMS1FhUyPR4AoMyfxKlY0JQD+eTJSX9TmAcTukwJF0f5"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiTPFyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/5w/8Cm5QlnJkacKdqrOpSHp7TcMW+8FPM5GZG5VnZuiD9jEBDG8O\r\nDBZjx5BZ2EpYonKqy3zTWd5sLWaBROOdAB5zQU/kq/bh8tHW1cBkOLTn8DTS\r\n+34W46NhNjN5smM1kW1wRCKDYZBZCCZYUBQBovV8Zzi+ROTPAtxfQm0E18q6\r\nKGJwOEO9wLaR/m2iU3x5WwdBA6IDWKDBTPhuSw7ZN4hcyRDZHch2WQnHyy75\r\nKeSHtA5tGNnidcYNnVexdXSwCKLPqjoLbtsXhiV9KZm+gVkXa11ZzKoSACPf\r\nUUyhOuSAwn4MJn24Tq9Cwq3cuo75f+ZqrCRmbiiRr0nx+Z10G2nTJT4u5mLT\r\nwEzZqlxWW0ZUpGsNrXqhTLNE2x+XRj/JaRN8Tj0Ptj/EKFCkzIoR6kpMRE8M\r\nhEvUcq17UB00x1WU2i4JuZYG/G0okOqp/kPmeKaQCLrEkyHGsPukFzDPCVVl\r\nUnaZeP+c1kBrD3DDEUR/cICZGERkNR65un/rjZRlfR+lOHUmdkehHDNDBP3P\r\nc6HLXts6SYclO+MfGqbb+7B86DcRII3Ppa2/oa00IKGH0Njr0hjyjy76e7hs\r\ns5Mn3VxKyD3/G4get3iursnVhL/YRUXQf10T3a/+nOtxxQtTqNNIe+QiUE07\r\nd9R77Yl+TH9WBi9VcRxOnUz8Gk1Dp5xgK2Q=\r\n=9I9j\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-45def92_1649209714712_0.6751933627707407"},"_hasShrinkwrap":false},"0.6.0-aadc14a":{"name":"bls-wallet-clients","version":"0.6.0-aadc14a","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-aadc14a","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-AsJhV7NP/YoprAYzZ1vm9Y818X+LDJvsZjgk4Ewi7Ey5SKbfn289PN66YqK+dtkdOVF4Af7RD+B4Xh0CICqLgw==","shasum":"567e56b9f88feec8ee174d6476d99098a2ca6cc5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-aadc14a.tgz","fileCount":238,"unpackedSize":803194,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHXIOSzHfexTUcR07bnctO9EV66jZ+Ib0GWYigcEEpf3AiEAhzQ2Bkk9v2lW/S/e+mQxI0ZLkwu+j+6JBBFIsACvOdM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUA0lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotYQ/+IFRQWwC+gJzwobM3pmMI3FvEgHhDDuuVP0mYGHXgeKqkTeuO\r\nPIDMkhL79w4pxvi42dKgVSISMLuLBVFMY+mHLGfuDTjl7/du+XMg4PlvcXYI\r\nNDWnH7MSdcTWYc1W/yKyzfyK7sCsgvovvfYDYzUcP/0vECq1OMHTdnro1PGn\r\nFbZHxQYSSCn4NvY1JpDtxnkJqxutjNwwQON5hHrReY6Wqj05hc6ZA0/VZx2f\r\nGmmsUrFexGNbR0Zhapwb4lsj4HKX2AOriIZ/WJB7R2VsK4AEnJRceIlDTGEQ\r\noE9NjLDpFMpxWQ3zeLVOnxqTDEvrRR4/1p1gDar/4urMnbojqDdLVXyG51Tv\r\nAJ+3Z8lg7WVBJmJida2YeVFQZZCqCSZF9XfF2CPVXvaIRPMM5/npY+x66QiF\r\n1OmoI5LZ2I0Anch+fw04uwW07fM1P6s/7XnZuRgUaBYEDJM47BENc7IByY/1\r\nRjehUca3+pAR2SBC6PauKl9Tw4Dl+JnEGR4m30SsxuZfMVAHkNySoLc6pnnw\r\nymr6u4U3Tm9TsJpUMIOM4vmMxbBfJmXkHaR1x6wYUpcSrT1TUFzBV+NQyDM4\r\ntNanxujC+Jj+RVN/KHW4aKR4sqTOMad11RTtbqgIv5uEM34ZeCtRIYTjXwWE\r\noYUd3AdzBmQUNK4NjiPxwa96tqV0es9/J4I=\r\n=WeN3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-aadc14a_1649413413423_0.9725473408243077"},"_hasShrinkwrap":false},"0.6.0-5e2b347":{"name":"bls-wallet-clients","version":"0.6.0-5e2b347","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-5e2b347","_nodeVersion":"16.1.0","_npmVersion":"7.11.2","dist":{"integrity":"sha512-xiSxK6Ys0q8H8YLDuiXIPUsezNynLTu6JHmLdTy6mED6lCe6b8RfvT/NeCbk36hlur6ws41Hs0z2IMhBGnsqfA==","shasum":"5fb8dc42b055d650d528ba9d35ebfeeae24fb195","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-5e2b347.tgz","fileCount":238,"unpackedSize":803397,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD5iBjW23Fa/YOpl2yC4kL6t1zLnCfPiPU1nGTal3myvQIgYBYdRWE5qPUg6PPWyx8epmyHEaR0gjwJOoLaVbmOdfc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiUA/bACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpH1w//Xm3nz/u887LPON95j13aNT4seek7TB9Us1IHVLfqp8RTANoa\r\nN4ZCbTZyHRuN1ECaSj2UI8R4oXjFrs8qdyXmmDH3DAEuBq9UfYxtMnagO2Ma\r\nWrVdmbPP+xTuFvybDU5hGi8MAWleDw6rDyBHe7FCCrfe4iYCZhOjCB/hipv/\r\nXv/HbzRfJYCNOeBeJHIBt6WpdOX3Ztbd2a/9hhMYtFLUgFB4uzYCdluMrpTS\r\n9XZt3kP5f7ohDpfVSlfDKxTyCcyLzb9weoBovZTX4xzhz2jOrY1P/3+nHxjP\r\nQfq81/Gin8fGi7bT74CwW8a37dm434h4kJoAdFXwamkMNbkABry5jYJDgoWa\r\n2Uq0gNACLrSUJ1cLM8QbTtpoSx4+R/M+ov6TYqna9U8azUbkIJg7FIH65BFA\r\nfxF60Ocro8HsbmYnTAgqSuA9RYkE9ZPU5YULxqIZES+s5so6LCmN7eqNTnaw\r\nTRWJTDH0Fa3bpkiccy4jbd+ZFrJOtKk2eES7lBVF6yfZdF+CvrSGgupQ4Eb0\r\nN1ztUni7oCwTmF0UKV5Ih5XsJaoKF5jyMNoO1yb5+bti8Pnp8tswDgRdwb5G\r\nfn/CJdKn+fQqH+IthEcA2+gOeUaVBEb2RlCWZlVch7ku1seFfo8YAWNoLu3v\r\nGb/INvnEvZt4zg10f6iMnotBg+qO007Nu3k=\r\n=UW0A\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-5e2b347_1649414106843_0.4822536608017498"},"_hasShrinkwrap":false},"0.6.0-40b8479":{"name":"bls-wallet-clients","version":"0.6.0-40b8479","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"40b8479b8856b62f2f52ea47993c1d0aeab6dc1e","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-40b8479","_nodeVersion":"16.13.1","_npmVersion":"8.3.0","dist":{"integrity":"sha512-1kC1Acj5+7m4qPa/mqq12lRdM4/MMMZ/LHVGXyhmgYhodol3vKuystMFYdFIZQc7pNKRYZHtLaYMUMklAK+FaQ==","shasum":"6ec3f2ca39d51a6565b19ca9ec6b879b10725ea8","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-40b8479.tgz","fileCount":228,"unpackedSize":779122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDVqe6XUKcH8rXvjFlirRllVvxHNmnmHKE1RFh70JeG/AiEAkaebTpjlu8dpMfj7Rns0t1cafXgyq2vnlGRH2e0dGMw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiVEI7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpKnQ//XBVLqQ9QbFV03QZimBnwvhCPadshDfyl9PPLAPYiRr8OO6Vk\r\nJ8nCoGNHrhHV/lHxUIXzfWRdr2uQcetnXQAWlTuKg8X3/Xe8Yvc2s4gbDHxF\r\nH+NPM4LvXrzkXrPJmoLtteproZ+AN/XfzqJCseWCT0PJnhGQK0Fzm13bOZRG\r\nbPdHEmlN0EyPOQiwhpPVZe7bDq7ImYHPNmKCOXGYPGrXd+kdSMfCMOTOku9I\r\nsqIgfx6nOYYxhceKBWNEZpOzd4JO5X5C7mvZXvrzloM2whIsqpag/R5aOTOP\r\nNlH/tW0/a7NknTGo9tfW6+1ijV2/F2KWxbt3UVrA3QMva+DUB43seFh61IPq\r\nDHYZsny0V0ycDA9ACh5OQmbKeljkDmRjs0ekTs+EQT5O06uqRNe2Ix9qyr9T\r\n1YznSc9faGoc96FIhfprXWCpumFvr4CXkl1J/ZgTSmWpt16sR4Q6imObYyFA\r\nfztUc14PxL4QhMdnUH5Wj9MceZKTLjOrr1oxHPvhQlNC74f4pFhUVgr/Mgff\r\nntgGgN+dN3ae4YH9HdbD39euF75sSR0HmCe2N8cYw8JzhdvwigNduj/TX39s\r\nQw+mjHLq3mcqTsCV74SvPPfA+RXesmHzXqkbMd6Awa80KRTMBAlloQm/eutk\r\nIKgXGgIpT8cCso3eHo6cfhsc3k1fO49X71g=\r\n=0y72\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-40b8479_1649689147222_0.86815643439683"},"_hasShrinkwrap":false},"0.6.0-6abef92":{"name":"bls-wallet-clients","version":"0.6.0-6abef92","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/jzaki/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP api.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.addTransaction(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.addTransaction(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      contract: someToken, // An ethers.Contract\n      method: 'transfer',\n      args: [recipientAddress, ethers.utils.parseUnits('1', 18)],\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.addTransaction(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n","readmeFilename":"README.md","gitHead":"6abef927d6d0225399cf48ece4631679efad277e","bugs":{"url":"https://github.com/jzaki/bls-wallet/issues"},"homepage":"https://github.com/jzaki/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-6abef92","_nodeVersion":"16.14.2","_npmVersion":"8.5.0","dist":{"integrity":"sha512-qhaa5fwjGRcqA4RONi/IwvoBnKw/ba2YD6tJjhVi/XAi9lqcRM8la6CIOzpEtluJBwMFjfEc2RmpLp4FS20ReA==","shasum":"4893048a6551fd510fc3efc388c5f460a52dac5c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-6abef92.tgz","fileCount":228,"unpackedSize":779476,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCqbp3IA4wwT26Qc882R/l0yPiMpDIL7CovyTm08qC2QIgNXFSI37t2BX6g394pCaNdYW82h+wFx/92L1+w6VVhSE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWWNCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0Pg/9FaPp3ihrTWZqZWI4n5/3WKD82OrxD4BUYjsq+2VkfO36PSof\r\nFEe5b5eS5Pt0Cc6F0l31RXRoy9OBas0Zo31dH60GADyEidIpwCoabKHOd8rO\r\nhF04kv/I1EEtouTu3OxNQQNlOsdlEVe5zei7abfSS0c5hgUbCNUyfMGfsEkc\r\nKeGjsi1qmw6vBkXa8NB4kGtQZP1EpAgHwzZyTC/3NekOzv3whjZ9BWOX5IYh\r\nNDRLykaymByvXy765Kygk+bkzPBFAUxxi27BhfCO7xuvCcun4K38eVj6Cuzu\r\nPjig6EChfUw7n1RU4PX93D88gwubiuUcXLo7WaulKq7ROrzzl6VPBSO8onB3\r\nRhQZrSpNPWHY+zbaeru57G1z1aSwaMxNA2wvxFcTP4LQ2//Ihl8geWbyMF0O\r\nwNBtwJc7eKBSAFSGWd/89SMF9AttlgIAblyqTZSEEYSgZ6BN+Fea2wf6iV47\r\nqrtfar6LBNjVSNpkdvVAskeolD8B+L2CDLHN21epLJCFkIaIR+eNX2hGURVo\r\nulvrZFz0Oy3dhGtzCMfGOIEYiWSQpH7bpZwsSNnH9heUpvNIAczPCC2Riz3H\r\nmpr2it1ECkG4zQiG9l0RGG3ZfRtvhbI1/AWD17kTd6RkLcCHzdaDc72QwITD\r\nwsMmUO705eUIR0pql8m7oroVWC4+gBl1kPk=\r\n=xc8o\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-6abef92_1650025282436_0.3353512638413152"},"_hasShrinkwrap":false},"0.6.0":{"name":"bls-wallet-clients","version":"0.6.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/jzaki/bls-wallet/tree/main/client"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha dist/**/*.test.js","premerge":"yarn build && yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"_id":"bls-wallet-clients@0.6.0","dist":{"shasum":"9d9b1add69420bbaf807c1442151e487f4ee87a5","integrity":"sha512-6EivjMe2uRGIt6Aq5IampqlmsECavLqHGPm6Ki2l3+c+FnwfOQUzNelctVN/vRVxDbDpTX4iAfTIrYYpr1S/vw==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0.tgz","fileCount":240,"unpackedSize":779468,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIANeIyHKQNVotBoVVFUpkT6vWct1LH7yXYesGDOZ7Jh/AiEA4M8h2Bq9FTiS2v6fp+bliUh3FeL8F0drz4KCgw/8ux8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiWXA6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/KQ//aIK5GmyamyIivSNCn6L4tNIVolNt8gN/ul/6NQo+Qq0gCO4E\r\nigykbI1uN/8LTtmzsNoth2K/y7kcBjPEiKHRG0mZbe4aYlpP7PZlbU1uv2Vg\r\nsINKQaMSNbDw0B0OzuKOEROD9sBNRPgiIzUNbCfzzu7zLkyZCI8wCjghFDZV\r\nUFRT8q46QLS7l5dkUdq+Txxh2atqnlmddRlWuwHYnxTay6lu5rQ9UXrckCS/\r\nUw4cJ2oufUdSSfH2rlxRUvFfdnpT+vPZIy2kkQrgqz0eqIcMOk079nG9RzPR\r\no6kQlVg+UfNNBO5JAaJ5YbMaGHzDtrUTyBzDLzx/GGzo5dnBFA72nsGddKHE\r\nP6EBRR+PO5nf7TVDeyP7UKdfK36FY4p3VIrjbfSYzdjAHORZ89k+/rSicQr9\r\nxG7PcGsBsHuMY7LK2621JQi6F/wyc7odaSEvoty9y06qVvc1stL6fpLt3q7x\r\nDT+g1T8zHZ379Y1bQQMxC9SyZQI/NxiumWtr3R7Z7s5B/Vm1SMgwEHxR5PyP\r\nwmEYUJzy1+wbrxgPOAYT0su1dhP1KyrsHng7Lo1Emvir2cgydnVZjtEQxfnJ\r\nbFoRSPhWLRxJMce4JtApL4N+MSBKttkVnggNJs23hnSoTGpyDaMy8UTZHS0V\r\nI4UYcGm9dHVn2zjASadqkIv3B5Xva8k8eOg=\r\n=Mi+q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0_1650028602439_0.542075446924571"},"_hasShrinkwrap":false},"0.6.0-bfada65":{"name":"bls-wallet-clients","version":"0.6.0-bfada65","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","pretest":"yarn build","test":"mocha dist/**/*.test.js","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"bfada6526060878b86ab94fd92b729e4f9c14307","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-bfada65","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-NX0vYECzVgSNXFybxi+EoYQyDpw3rsfMMyXHyhEXoG/gtvjlVj4HVfJQdeIoxsMtJB2sc3oKKNVFAawbWqANTg==","shasum":"13f794190d08e99d649d6e30e0969a89d628c934","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-bfada65.tgz","fileCount":223,"unpackedSize":742729,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB+cFy18HN9AF+5DkLb4aVArf18zD0RK3VbpToh7VHXXAiEA5/gmcwxOIItLf+9UW9Nv/cvO+WmJMXdtLe97/gH3lsg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiz8ERACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoExw//TKQSUU2QRMwEViLQFdR9N/bcnHjKNisMe7EsPejMRLHST45l\r\nNJPjbLFBpSfwd7xGtEhOudKdawc2UD2LEPr32wnKZcpuAEVy8YRcqIYflqe1\r\nLmqpbJxrtSE1ujwn9rFqENV69CPfdpomeE9o0zbPpRcs3YPWOQbTuSxGO8+X\r\noZ2q0Ol1K9KVdRMGTatpOI5GQaoymVNlNKkZi0tGwPXXJgOXuFM6R89rH/7A\r\nRt2l770Gn/TztvXnP38oNqhsWJDSN8zDi3Sx+LuMKhg9dSyWyPTIM72aQmX9\r\nFyCi5kbOcpSnz0WZMC840LtEEGPLvBalEF4Npp1IYp6GCmXOi+PAMNvjQlPp\r\nU+7/9odX7r9kbVZPE4uwWwHIwX8ALe8of5cmnkEkJWoOBiChKcZ+NbMMrme2\r\nvAErhnUdjhPrrAoema8mRr7x5z6jc0BnOW6CmM4fvEajJaYGrWlurMaqdUHF\r\naw6k41zvscWUQomFfm8qfQrmjTLClwq1FxWRs0LWVSfsdV6e6WHqzY0hC/ir\r\ngDlWtxzp88LDvNpLzTk92Iq9l5qyHka48tnj9o3+G25Qo1O0RaiUUAM9ioNJ\r\nYxo/Eqqk0mEcceOk1S/1ixDKx2I3TJAssiiyMEHodl6+KM0YHYAdA6vars3P\r\nH4xCxHSiNCk7xreH5I1zf1VCMYCpYjWDTRI=\r\n=BGXq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-bfada65_1657782545064_0.7924022328421441"},"_hasShrinkwrap":false},"0.6.0-26686cd":{"name":"bls-wallet-clients","version":"0.6.0-26686cd","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","pretest":"yarn build","test":"mocha dist/**/*.test.js","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"26686cdfe3f2ff0fb709e002d92a50c8602a065c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-26686cd","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-c1qamXSXVqIDzgpGOo3Ao/ZIRAwj4L2rlNK6A3zQ+Q37/cKpQvWbjwGXUmatVAxkZzDe/ZScaicLM5HyGFpyMQ==","shasum":"832349101fb1b66102938fb4279ffffc437da544","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-26686cd.tgz","fileCount":228,"unpackedSize":780012,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICyLBIUAef+v3BgwR3zb6Nqp8xm+hJVi2TMBUhMSSnneAiEA0aIAReu92PoZ/td9Clh+Yh7eoJRAlgLz3I5KHgHX7o8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi0MM8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8Cw/9G0GVFTdkJsZ3fBkEkVR+iiFVs7/utUYSQhjTIkVGX+INLDg/\r\nm4hQe7BuF7mR2nPsVQtXWapuHCa2sxLsE3JGVXA1CQ3G+aTK8BVY9SMV5K3s\r\n0GVzgNnT8a7rtYdKX14Y9J2ru6Y+5y7QR5y0GwSmgXAN7YJRtYVrr0BPy1VN\r\nChZZ6N/hchxhpc3uAQS2+yI0Uh6spE3jHN68jSO5vO5/EYDjvKVj870Q42MF\r\npXnwkqsECQJRfB2hEdofvWA672jzP+qC4WZEzKKxevlSSpm33yg/bh7Rog4e\r\nRQMqFutvdI2EIUwq2mLr7UDZyv941A9/j4XaWuSwjWclw0WZ4lJnx8L5/itD\r\nIjlomjEXAUYAdnUyANcCTRIGBglgcsn4wXMPmA3UYn3PYD+9hUgWa95STAGY\r\nuX0vg52fORnlByLjWF7zn5a0q5oS9I1zwQUPE21f86vwq+dVncWPy/Vcbk/i\r\nMwDiVJcHMLRJ9VkWEbYP6piAJ1R6d0TBSAlQTIOJxFVLA/RlvuOt3r7zmA6M\r\nNpi16cUugxJjfv9qmve0HZL82+Ejgak/3oiQ0VHSjqc7Ie6QNn2FM9XYp6jY\r\nSYOZodCwEbocLsW8B1VOQjd4pzsFixv0HrkOEpX0y/H4P5z5ZLAhWqiHhS7/\r\nN6wg/OR6d80a2/DAsA4MMqrUfigWLE663ZU=\r\n=rKsi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-26686cd_1657848636336_0.9502971879968916"},"_hasShrinkwrap":false},"0.6.0-2f62a6d":{"name":"bls-wallet-clients","version":"0.6.0-2f62a6d","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"2f62a6da8f6da06630e328518a6acd4b85bc2c0b","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-2f62a6d","_nodeVersion":"16.16.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-qfDa2/1eN2augKgKV5YrZ6wOrvx5gbyMJt8N1qfMd7PwA++MMhXHvfwZyJuGniEga1FKifI1D51GeIBuXwUT4A==","shasum":"1757f0862be7d2d54c64a143d5f1f2ca1733073d","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-2f62a6d.tgz","fileCount":233,"unpackedSize":769696,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbYSxUA5Kh3CxpsoW9zRrMNMkayOMo5O0DYDlhAk6W6AiEAjt7ifeKpSe0gvushpyVJ90XJrAsLQ97iUFIc/ThABHQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjE6ufACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvIw//XNVbqEeG2K96cYwwsLisJZjm93++HpZYW3LZvD2ZGhmK988L\r\n861TxQMllCapElSuDWUgXDTRozpaqJyOEaciUE6PbQdnKH5zyH0ugfazdMRD\r\nNILuW6RIyrkRW5qRm/IN7nlrp7W2040sGah5xGWNkNhTGGcSBssSQDPu953U\r\nmwnNOaDGSxCvbAyBpeDKwIMresMugq5OSccCy02Ddi+WP0V+wcKn9okD8re/\r\nZkDoKvls8FFd1HayDpPfoLpY2wGJm9zYXgRMFRkux4MdwOqkeiPUsA2q+t1z\r\nFxe2hMdan/2h33uSatQE1/NB23sbJ8zXqujmrvP90G/agXoZoFI30PyD0KCd\r\nqg+iYooPysoqffqzijnqEkD1+FtXBKod57jgW8R2nDW8kbqUvmvlYhAHtSTZ\r\nTZ8JIpdUmIbe5cY9rbU/o7rI1CUHK347QQqEOSU8HjLrN2wEPbG/HCcob+oF\r\nW20C3HnqqZb/B33hEf9DzDowldSuSAnPop9SWoOt66rnqz02QY7055Iwa8Nw\r\nEKz0EE/kwsxB3MuOq+/0l1vB5g8tLrXnIejAkA3q+RjGIOPSG9An7mgUPg0X\r\nusArolJLQo1qVRLwzWSgB1Eom811NZOd2BB57zVnkcrgv5PsXq+mz7hSqudD\r\n7xh/UZaKCal1Zaf0AsMywg0t994NLIZh4aI=\r\n=SY7Z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-2f62a6d_1662233502908_0.31082566949540125"},"_hasShrinkwrap":false},"0.6.0-87eb0b5":{"name":"bls-wallet-clients","version":"0.6.0-87eb0b5","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","pretest":"yarn build","test":"mocha dist/**/*.test.js","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"87eb0b53fb8b667080c64e3ceb77a450fd258031","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-87eb0b5","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-WsATAaulGcSJnODp12GRtsQf0P4yXn/PejXhnphHRbSN108QKGZeR0HFuEm6SeAwhdqw27uhms+RsP4Mf64M4A==","shasum":"099993bef822b9b13245a496c9d8e90b116b5b56","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-87eb0b5.tgz","fileCount":228,"unpackedSize":762331,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCuOPe1QJrXJq5csZiyog33biIWslXsUHK2PkgsSTOGdwIgOcpMAyRHlkDrI6G2nnOaKi6pRNDSxoURYrxb98G2rs0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjGn5CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUEhAAh1qfbmowDvdK4LNjIIRIdbzD3nVftQoK3MYr92GsMjxjNZ+N\r\nwxv7m0nAC2TcgPkKuUjPeKiRtCMlpnRlyqjDPqrU+XP74sXkUgjytuwqQmsv\r\n915y+reGJgB3ApO24bS1FcY+VTxHJLC7NCRFvWgukG+LOBc4W2qIL1MrEi95\r\nTLRM16TnjxOeGCsYoRd4qJZdv0AgpqQdAv9cbR7j0V8JPNkbWRQUpAf6mmmO\r\nBtL8GzuUU5F+o/tjWd4Ncl1VCKUWzTkPEbBJbmkCoFSuIu26B2g68Zp+n73r\r\nuvXjuUYqFKvQaGjmFvFRNf1kShd9QNm2BlJoY7jE5fyqTN2WgAkJW62Xzk8K\r\nEVJzyojk1N5P1ozYkNc2FPgwRiYluaF/wFEs9u/BIqORPZFiIzyjiRuS3VNz\r\niSFsD0jEx/UZfpcIScKfnEYT3GKAHEJsCIDb6jv8kA1H+EZiXscHzoI4gbC7\r\ntwz7U8WY9kyAlPt5bNcJPJprRWDjqStkZ3tNrCEz94xheIRi5WU2geMZ55nW\r\nfXuZadk+6Uo7oRj4/aZsBq5GEloXCueqxAuGUeWEZIXFEqopfE3jJxnZ54+L\r\nXtj9QA94xbMTz9vK2fB1Hc+qYODaF/3SRK4H1NxA4QL4OQNT+YuIt9Jl/fYy\r\n28i2o9/L+Lzh5S+mVysHwdktzX+FM2DKBrY=\r\n=5s8H\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-87eb0b5_1662680641999_0.4663791165642399"},"_hasShrinkwrap":false},"0.7.0":{"name":"bls-wallet-clients","version":"0.7.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","pretest":"yarn build","test":"mocha dist/**/*.test.js","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.0","@types/mocha":"^9.1.0","chai":"^4.3.6","mocha":"^9.2.2","source-map-support":"^0.5.21","typescript":"^4.6.2"},"gitHead":"53e2f518d5e5af82abdfa1873a136cc22a7cd692","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.0","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-qNSRW7YfHd7/YN10P4NqIep4C+YKjbJTPG8jO+oay3kJyrNIj94SzDocMe7+FZ3JLzISXAlIbDAzIfJTacv6tA==","shasum":"1ce5b6942bf3f026d3263948e9a257501732fe57","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.0.tgz","fileCount":228,"unpackedSize":762323,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDIbrqazD0mTInUYu4b+C1qYtBxjDm4o+Pe4WzChfLjvgIhANZ+K6ko3jWvlsx51RVB0mRXRabfUWH9gkBUiL9HFDO1"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjH90BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqGCQ/8Du2LnvnJMP4kZHXSRj/ZNwPXENOqfA/W3JE2sgOr08sedafl\r\nAl5gZE1C+RR+n+nbYArns8iFE1g077/6JhMP1Hgdfak9+hDCkVeO9Y0X8Q0Z\r\nKRnKO/jTLB2Y+uTUDQj85M4gttSR7t5Vrt2whUgPWA+aVZeM78NwRZ43jWpy\r\n4lso7wqBXrSP5HFgF5CL1WcwJiBA7s7VXN0klVUYss4UAOrFyOKWevdi9B68\r\nXtB6bPvTh8Pl4+nFBkCNZWJKRyfJE5joc/h80cdvBdK6u+hy/6gkWmOrCPL8\r\no7IbU6Tifj6Xv3MTrYZK+oFBbSJAzOzpLFVAqcYuIwfi0od2EvOd8PIJ5Iuv\r\nbnxYTeBdRvUfUvR7jPrPUzgoMjWw/9gjSeYx3bPiRwyKyFKLQFxtOSTq0jSu\r\ne9n8xmvwljZRADS+SjC08aBzN6NbSYSAGiKzKR8EJr7g8ot+siCdoxaFPLNv\r\nNqFfNPkHcO1RsFQKobcHC9C3rylrDpKspHI4ERrocHj9b9kkkFi9Cpv0jrBA\r\nKjpPdrMpEGq7IafAsjOZ9VL0zm+PnzkUlTZNOR7tOKMdielwxNeVLuBNrDCk\r\nE5cMcipZbF1hgWGgIlJouCMoCPCJHP0PjP9I3n8gmzcQK8RKedJ87gHK9PAe\r\nOUdCQG5jipvxFqefmTjiU+rHFXK7TmvAKOU=\r\n=77xh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.0_1663032577016_0.28100864129379377"},"_hasShrinkwrap":false},"0.6.0-576802a":{"name":"bls-wallet-clients","version":"0.6.0-576802a","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"576802a79a6c4ad9ff6302ac09af81ff31e5e7bb","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-576802a","_nodeVersion":"16.16.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-Anq//kgAkViwzOBY/2NKYgSedbch9F/cjLbJ2rA7/q2aWS9TGm5M4321nzM5fx8vONRrhD+7CN5Wk4vSUDAFFQ==","shasum":"460b4048ccb7a88fcaa38511dfa582c16a967202","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-576802a.tgz","fileCount":233,"unpackedSize":769455,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZG8jZ3IRbHfyMiYoTZxbFwi+r+ZqH9nzWcFhHTzH/zAIgNAW2bfw4WGi1hyRgg7Ptqy5qUdzHhOFStGDqXJm5n/w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIRgzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpoWg/7BRRfkex7Hxi8F3FqypBeJOSQIWyOyRjydD2eRz+TeKAN8qmx\r\nYiIVqGIDfToguNYZakhFGaaijj8nlA6KodrZrQWPVhkVvH2m21Ru5bDr0VzI\r\nrneYH++FuvuwHOLvHVk0XcyuGQHbYF5LKRyUROLv6e/IetnDu4+y+WrTM7uZ\r\nN5ACkkuulStB8YHkU9q7aR6bpBnSi54+vsBMk2J/OCwkGQXSGOZvzsL++4xt\r\ndZYmEkJZP2cGNhD7x1GAd5+zFZ2mzSw6L3QBMz2pajEvhLOlk3WK6WalANTW\r\nk6kk0h4DR/z2vjt/wsMVyT4GwKN8Kvc+3pJglAxaCMyIKcknlAN1RvP9lrtv\r\nghoo3wcf2HuHFHktCkJSuIy71P4qLtNGizehEjgojRy+VNWLnsPX3hCR/gty\r\nGfoCxHiPbTr0lb4rCMBOEHtLCOjyYZHRLjjz4AXI9HquF5oZT6gY79YbIRZQ\r\nc9+RBuSXic/HbwhiwUcKX9EFVFTEczcbU71IIdsVrhQOo4kHyEwgGHI7cSEA\r\nmjIluLeDxfz/QXkgx/ZeGNvhHrhRvVPIJ6IauiVk8s2wVs7/4F4zvsKP7Okx\r\nVF97j+XobXSqJR+Sc9LQ5Y4DjsjLOO+cMV2Y2kDUNvmCdWQFBA+R4NErYarO\r\nXfHpQdksCbXmmGrNKdplxvtWiFv6VshgdYY=\r\n=OxhD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-576802a_1663113267670_0.2648426861548123"},"_hasShrinkwrap":false},"0.6.0-60be9d6":{"name":"bls-wallet-clients","version":"0.6.0-60be9d6","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"60be9d610722318350eba7ed18215f7040ccc64e","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.6.0-60be9d6","_nodeVersion":"16.16.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-Hgr8VEdWTKTt5ubNCeGUtFcnGvyumKs92J+NAL9RITyWOEh3e5YXRgzCA94FF6dBt1rKMp43dg43tkpbqjcaKA==","shasum":"2494b52a8b76e296815d838e023e55dc77a3f8c0","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.6.0-60be9d6.tgz","fileCount":233,"unpackedSize":771271,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHayh7IO4nB6WoC9F5FnXLVtqpYgeyjqjlsbZYFYwtFTAiBSAu6XiQmfJs9y9BwySgxrX0z/ZGelZYxHJVqFIfDB/g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIjmEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmppsw//QGvBBZMMwsGOAM7gt79iDCcRpgFYm44vuG/kHVAF0TVwcdAR\r\nSwbsQCfUfblAqNy3OG5gGoGKWpLr29CM4Se9DtlTLapg/YgmR4fKFtFgPV23\r\nnNLBNGXLMVcVLxUckBioBm966Zdq7qFCTBfChGJsm4SsPUiOaTSL2MYKlB+F\r\n1KaTwe/MBROlkxKUKXr2qazcWeGig9KLeJapvBnR+l4wlQoKUJWv/uUqb0M/\r\ntKI5utkoInWc/ifvefl0DiME/PRJHDzMWDLrm4s5uqLw2sN/Aeiu4LSDozPo\r\npVFpaJwjbVrvRgoy/0SfVe/us9ia4Td4MIs9dZaoG+P+ywtacPt/QFyMGu1O\r\ntSMfK/7n0nj5JgVt7kWmZ7LK0ieZpy+XmtM5G+y/ioKeZkhghnrjiJJqdEU5\r\nEFBXtZlp6O/5rp25jka99Rxt73JXqt5H/NYoXtFV+6hND97OZmOlr1Sm25o0\r\nrr9Bwzvfz+2qjwUhok6G2T5LHfwZ9i/IVVpkuZ9rijkt8nK3/42AfNUGDnFm\r\nQi/nObuHgOk2nS9rAOU7zmd+FiKyqB4YdBvu813IhfmpBjGl1iiy9zsOscph\r\niyDCC1c5cnPOFOllyTcEriswhBoR5Gh0KrjpKuZIpMf8eE5q9rWNVvN1r6S4\r\nVip64POoLbLv3/vuzTKG6EriFcRPGG8SpWI=\r\n=1Wxl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.6.0-60be9d6_1663187331805_0.6131020364412936"},"_hasShrinkwrap":false},"0.7.1":{"name":"bls-wallet-clients","version":"0.7.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"gitHead":"080513ec128ac2a635dd4ed3728e882e8533b94c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-LyTad7HsniNIE8dBTrF4aMksHj0sjwpvPuQmdPokXLlsJA/KTI11av5PLJNVpiAF1sQAKnA0BJglrete+TYyIg==","shasum":"912705c7b997e0cb4ec003796766f20b117b4547","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.1.tgz","fileCount":233,"unpackedSize":769447,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwYM1J/wdYk9VrHrdhgvZHa0MClezNcT25HX959dd1SAiEAjzVg42KymOfmfqIGNF/rPRSgEVUKiu5rVU7pMjB+0pE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIp+oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMMA/9EBBqyYeItxPCEg4kBM6o3VpbTCdm86XczOFsahAXqMBmkmab\r\nBbOa36figfa4JTs5xThebq+DB+iJihb4Z5hrZlAWB7msVRp3A8jZ5Gw4fTKp\r\nNWc7VJRbjV8mBWQrtOfa1SckfMycJnxDbe0d2kkMs4l503OYv8vtOHLC5mzh\r\ngNWgKGsERwDMlfXovezkT6Ox0lQqDhSZxTyg/PVz6LkfSz9FLuISoxaIY1uz\r\nCNBuwl7twR4b5eqIBucJ4rDWkSuk6DweGA+M5l5nn1BO8tc1vkGueGIq+Pej\r\nJCRV0lSOzoNl67mOX1OdIQXMiRGpquJFyVmOAHkT3QVaxWCHYvuz7xepUAPI\r\ns4Gfv/5l2RLTpgGcjeI5OqWLij8fWJWXKqU+YIXyx7DWSl/uxrFnI+C74+8x\r\nhtga3uMmibv7hKStie1kk+BbqIRV/9G4XAzHVO6t/JRgHnFY+LOI4i+/dqju\r\nlQa+EYllLX6Oh5MDjOgz6ulV48/+05GcQ1AfVXgSTY0nhRMwsVc3Flf/0xYe\r\ncNF7bmivzMVHykS6tAtiXeFh1ZmcKWjbz/ENINJU6iTqgxMQmEx5b07PSKI5\r\n9iNC/fUWvwyPhaZN3baUFsQaIUZWR0ycjGvAvkCQY7LZvBGu2919VKdSzQa6\r\nakf+FGkcSUqcsF31XNaFAyHGC3HZ6E27JjU=\r\n=jNxd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.1_1663213479835_0.7357365342118956"},"_hasShrinkwrap":false},"0.7.1-2790596":{"name":"bls-wallet-clients","version":"0.7.1-2790596","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"27905963b3c83cc4c53526530d8a3c09e27a9d64","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.1-2790596","_nodeVersion":"16.16.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-6paGPxnCu9oGlww0dx6T4H4G/pYK8ElJEeCeKN5Kcvno3BQ7HaK9eUiXYq8RSBLkX915y1ZUj4mPHowBH9iksQ==","shasum":"0a89e8551b25e7c62e12ac1e015e8c6972bc9ecb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.1-2790596.tgz","fileCount":233,"unpackedSize":769407,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC42eePGtGPqT0/Z3lZqLPUaW7Dwz6uxaF9tGuqwtyVogIgDqrmU4mTYy/cmnOehzuoXdZ7yUfMTqznK0pY0RD+V50="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjI4AyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq84Q//WM8m+i+tMrVGDTicbsWprR/gDeLHikgSmeLdg5vCoFl9lzsw\r\nv/kcgre97KT1Np3mv+SSFhMSCWMjXt5ud0aTPKeUptADrOjCMbkVzRtvh3JI\r\nUHoJ9rJxHpfee5vig+XmwV4Uq/XCMCj+gyIHqQibrHA2s8rU5lYeUfg7JpMH\r\n+Vue6zjZuLe1+AFc9yFyXjWGmu7IdaKwUwi6kGvqg9RC98mZxheHewoQq0MK\r\np9kbgqMQU/i6/G0ip/l9hCpWhZj6wW69hnuhfbu59I5D80IVRafaOm0TU0YY\r\neGx8H7TesOdSmnp7bPVzImSYNerzRPhhSfZnNVHoTtOp7zLI5yAyuyjeGkGB\r\nZehLk1VuP0c3Ix5fQRMUxfZgwG0arUDjDbp/RGWWbXsyV77xsnf7ZSIxYJPI\r\n2YeMNH8dXIjXefGgktWYparyEzOW9k9vyx07SICXBZACMXPqYHb/ljAMLGUc\r\nc1WS1vmP4R+6lJLO3heTGuTUmmSby47qZtx29mGkM6AFsJ2Vyppp8GWpOhgE\r\nx0EFcwb1GeD4zHiL6RoTg8/faNWCOP5vS+fVF5UGllfbFejrNMZaYy4BAp8Z\r\nYF1YFDTBEH7EqK84KSNW2OF24wkg2J1iqcB5+WwmX/7BOl4QogbmI13T5mm1\r\n5sgbpYHueJ2iUgLPbV7QmuzoLxNKZ6Vl26k=\r\n=1LFu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.1-2790596_1663270962324_0.8218032478164714"},"_hasShrinkwrap":false},"0.7.2":{"name":"bls-wallet-clients","version":"0.7.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"gitHead":"b547361d86b03a76e4f6e746e5e6b6909705d7bc","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.2","_nodeVersion":"16.16.0","_npmVersion":"8.14.0","dist":{"integrity":"sha512-1dT9RBx1MrVr8OfUkx2i2YoQCf8R3ngTTUmTP00a3yUS4L93wrffubnW5c1Ai+YGzrSQKzBF2hS2FLdN05OXTw==","shasum":"c7ea26e7119d9bdf6998cb5f5524451242477a35","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.2.tgz","fileCount":24,"unpackedSize":29704,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBP1SB/40eZlgUjlXQH9L9G6F3ysEQQZt5PC/xhSX9UgAiB3z+GMYpyNhSAls0bijg2LvL/VEdmB2o6iO0H8aGvGMw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJKm0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmopAw//S3fD287gnHZ9A3Y+pGNSQr3IVouG4pj2wyvqnWgffLLbFtML\r\nsuSdxWuQWUIanwlpNl6SPMK/JpqUwRHZpERUZWnkk9sRxkmCJdJ4XQMot7ud\r\nglOnrG47VnhxGW690+n8mwuiPxSwTqoUKSUIxAzWd1+9etBdNVGqTNyaDy2q\r\n+xZZlhAdZEH34afxxngro5TrPXD2GhfqS4TOpwN5B+Xo08geFdG64ybAS4dA\r\nOeIWPvDOAIXhLxlwCyYnvvbmZ/aGymf9eKEVSEqazBT5TLkvowPkWoYD5MRl\r\nVLw2Db5eUL4EJI+ZXwU7oFQWhW5KveZdxE1m6witaL3OO7ypNLSaO0JgvrUN\r\neYnDIvqUhgMXvSpnfwbUfpezqxn7VdARuSNkOmgHE1q0Ixv9HBWwg30ulXay\r\nWsjJslHrXv8yv0Kgkf93rgpj3mD9oSWJv/v0phqJ6Nk6s7o1lGdaRAWTyrDt\r\n0FHXGtOQXG7t2dMvHx48uogiv1Ba4ZuJF616I7faAXJ2LpSjFjxCXgsA2H8i\r\nMRAzPoRlDGqguWVIATXBSaWG/+I8H9Z8h7ROo1L5utyhdcHD1pgxdbMYXtAC\r\n8/KdwGhXKXMY5Jz1LfB/0r+JBE/CgYIMt1TpixLheOIJdbWrcPnxRFG8OuZN\r\nAA93lwBNZD2udklcXD8p0zq3kkG53f0r5dI=\r\n=FBrd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kkautuk","email":"kautukkundan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.2_1663347124286_0.6886647044683227"},"_hasShrinkwrap":false,"deprecated":"use 0.7.3 instead"},"0.7.3":{"name":"bls-wallet-clients","version":"0.7.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"_id":"bls-wallet-clients@0.7.3","dist":{"shasum":"22fae2434c67b642d172023f259131233e396eb7","integrity":"sha512-u2mwyf5+1KHYCyeutfl4jhEDCmsW/C+S54QKbicUkU26MvAGJ76/TxSOOIBiWTjzVDdDUBdJ/zQRoRd35GSGcQ==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.3.tgz","fileCount":240,"unpackedSize":750370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDKgKmPcfXSf3yU4bkVdcU7D2N4/DuB4rNGa9agD/wiwAIfQU+4Jy9v+6Sy6ACebbfGPOt5zu1veJIy5UQ7gf7S/Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJK4yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrQZRAAo6f5+oxede7+6kXsrSPn6PRIS8MepNfcws2B5VBHsYSmRfjA\r\nU6ZaYgY34Oge58quRTaoF/sZ03PMWWM1yd9bR2WnNpGFsHFRGMeAZYymosPG\r\nA7fytwZ8X6uoZvWWWQb5PM1ZmTFUCaHvT0V4WXordAKbXf7TC86lzBJ/knVC\r\nQ686laiiE2hzBMtb6jQ2hueoy0BCWeJ+Dl9Q8jNgrUytSQXZ4JUgEuvMjWqR\r\nTU5jLrAhN/LrwLgoGUdhSFsL9Izy6yqk/6nvkv8bK1rSykKGITPFvHnNaisr\r\nCrZ21LsiBVbrw2b7/jOT2G0nrOM6pCmJ60r0DhMJTJ9NM9PlCK2K2WP7+mHS\r\nno+3QX4HoDyydyi6vS4okSSbdJTx2aEzpgjReoXySIL4O2rtbSUX11R+bcxd\r\nas3fvpNuNDrw5tAYw62ApQ1nRYJ1cw66W0n5L1DtisJhcpm4pYQLPm9gbq/j\r\nhiDwSZq94hR4+8J60ZIeVZwyiVYmFJuX6CymsvCqn5anpbGRwCNQtKrUPiAD\r\ntPNfAXmwRDRWuky0pHNRLuHwxL8whINKPq/CGg7+dkaoGLdWhQjeC9uez2cg\r\nGoGvX1VR1drCurj5l/J3ljDfTQTYyBmpZArGLmkLIfrr7THdzikx3JI+rwIC\r\nXrKv0nc2nH3t0v5HS9yB8NDhQdP1iZa+8ZE=\r\n=/QXU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"kkautuk","email":"kautukkundan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.3_1663348274113_0.5909418177367929"},"_hasShrinkwrap":false},"0.7.3-d193dff":{"name":"bls-wallet-clients","version":"0.7.3-d193dff","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"d193dff0de6501ebb530ae977de2dde369061fbc","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.3-d193dff","_nodeVersion":"16.16.0","_npmVersion":"8.16.0","dist":{"integrity":"sha512-BOm93cEsy/MHJoKVG6UfEUsZTlMHqyUTm61it7ZcOQ/WrjpCBQzXHNm83OATckxYIqsdbhQgwL46OCt+vuHsww==","shasum":"00ea9770850a827e0a717fcbf7adf8c2c0f07593","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.3-d193dff.tgz","fileCount":233,"unpackedSize":782450,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBWYqOMzbvzKtfeuLV1Vu5jdhsmceE3c8km67S+X3OlwIhAMqWfG45szQiSga3Du0EgYXRHZXkdBAsvNmEG2r3pHqI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJRQOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo/zQ/+I3XxgCHmXqemoMJ3b5Lu0IPrUmDRCCPAWvxkGzF+7ijAxKC7\r\nfqIb77vO59zCnFE/L6YJ3QqrvRR7Jayo4IPN6gPp+AOtYwNgpCg1U710UGIM\r\nke0uNVB6yp1GxtZjIRoL0VUvb7+dfvb40AIkS3k7EGFqI4wwXCAXSqk3/+Nj\r\nQgzXRYXFNxIPgYW75VmVIsbslMh1CFGey6PBYFpSs/QlnyKYZ74YDw2I0bNK\r\n+HZpNHZuBFpx4ETGSXSmixkfIUf4OMrgYhy7HDWUDUsnnsa9BVlyl8Bk/Pl3\r\nWmdP0hhyBoiNb6tqAj4LZ7ZLR3+3AHwSiBtS1EUozjBQjpTjS7IduyjAHOCj\r\nFtz+DjElbGiqaPXq3Shvy1fLxikvXQcRIhM7wDIluIpC0PKDrQ28o6AgH2L6\r\nyQQr145IEdMgPf86mMkRjZUJv/Eoy/TeiT+tJkwUHiR0iCizDtRaDQ4iy7L0\r\nkI87QqkC1zWCOwTn17He8kYlXCuqRNRPlqspn8Cj3rs3j0XE2wEsGSJjFCI2\r\nTrEgPnqZsreLXXpXsy/iUM6f5es+LjREx5EWYYQP1akZozNY/YJCtVuHi4gG\r\nRa7SQNTTrNX713ROtPCp58slmr5jZDPmOOcbP81k/z2STZoFlRVoHvWz1Sa1\r\nXIk8KwNo1gHaFnK6mii8Qwx3dLt6Tmuoe68=\r\n=XTrY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.3-d193dff_1663374350519_0.0433124850670914"},"_hasShrinkwrap":false},"0.7.3-c3e79a7":{"name":"bls-wallet-clients","version":"0.7.3-c3e79a7","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"c3e79a7c8e0c27182dff6cdacd9ff4b9ae507866","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.3-c3e79a7","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-sKGynAyCNhNHtYnCqW/hHbR2vqwhPcDg+abQmoe3wGDaDPPOOdHlEA3YaACIorVNN7+HZXSay8SfEZojgHdc4g==","shasum":"2e8ada5cb3b567476b16c01ed89c45f4f9f6d011","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.3-c3e79a7.tgz","fileCount":233,"unpackedSize":781621,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCMsp66FtmiMVt990arKPZ3OHlnEUtg8nMT3SJYHKeYnAIgPDmObe8GPRFu1HMUbbBsM2REAaxFf1eIAlCpKjmMIic="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPf/YACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoUaw//XOjLkoal402k7s7hUSBbLfv9mOqacaMD2smh7/0wnHGoN8kr\r\n+p2i505MT4CrlSUL3dJ9FJ9LVhCa1+6O/B8nuPF2bx+5qitCjoYmDAUJ6b3e\r\n3o4pJv7yPm92P9glDS/e4bx6To/GOgcCqRKJXsOJ+WcSAjcnz2d8X2kLKBgf\r\nxilrfUtr2urs4C9QUoSVKIaKweiusaoX7aaF+Mtp9WfFvMQlvavz97TetQk1\r\nHANvjErkW1NQPBpD8QHTLLqGv4CVhSpV7oscD5iEW1OdibyD3LbbeGBMoZtk\r\nVPkjJpN+CBHJC9uhpF4ipL1gn9Mdp9XENnI0OrqBcH+RkKkazr1oOq3U+ybQ\r\npP9zxFR6t8PHR69ALpUfAHmbsf3SYo8gmGqKed5ZVEicPAriy4RO977zNjR8\r\n3lSw7udD124YYHcgcZKeoeCj6i0qaSxWkkQEImuA2EU3faOO4GQcR5PDIYoe\r\nzjSgHR8dYdcuj2tY3kzLESzmAaNZ+VLxfBDdQqgdZPgdkXYjPeLPgqUkQA2R\r\nXWu7nvKb9DWskJd/wvsKtwFkY660sxnxmFPmK65najhBsvUk8tRg4RJZcLSv\r\nol164AjCMhCzyaXI1xPaYWoK2L6kw/uz6i7in+7BNdy/QUx5KKz3Y4o98tg4\r\n7/pdUcNePqZbRgSYdfn08snpa9fj3wBE9mU=\r\n=d32v\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.3-c3e79a7_1665007576058_0.2778623786630299"},"_hasShrinkwrap":false},"0.7.3-92b9b13":{"name":"bls-wallet-clients","version":"0.7.3-92b9b13","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"92b9b136a7aaa958ede98023607ffb5ab4dcae0b","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.7.3-92b9b13","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-x9Ab4Eru67PAydp20RTmm2vUJ56OuzHrtEOJejijGRSCYF196Lyef9gjichMsbQzif9+245u1QnKQY18AEobsw==","shasum":"ffc432c18747c16501a4c1e71008a12b54828c6c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.7.3-92b9b13.tgz","fileCount":233,"unpackedSize":784051,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9HSsAekF1HJ+nJjTG62FC68HBa21NRUuyh2TorFp/TAIgWqHh3qIy2h87SDt1PO6tUQPtVRrUQH0ybwMOn2JY/Mk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPgzhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo55g/+IyjJxnj9cjE5fwi3TypqrTeyAr5GnPNBFHQ001gi2JNStNup\r\nQQ/6DdnYpsAp0+VCYWrHAl0gqkw96j72xeI84Gib50JJEvoFKm7mXj7W9kXg\r\nnxCswQV9q+/J64KMEoqc8XDqrbXT75h1KsFN3ojYsOOMsKEwkao/XXf8f+Y+\r\nzptGJpfR1M6u/aTr6Q8gI4oGmgDulMK2i6ZmAmUU92CwHQ91/eNfEqtcgQzd\r\nNIcgfgolL4mXH3KRBgg17NtDZcNttPJSERJVFsLy3z4ECltAlaLQj4gMQKa0\r\n/wHa3Qsmy/266LmauCSMIJQ3WXz3AAdLkFzDwZRsYyiBFtbplAUGG3UsfKWQ\r\ncTr0oM/CNMkm6Zv23ZHwx6aSl9o0PJnJl2es2Gas4mYI0I73k6STfUKCvnkk\r\nQv1tMZLYEAjr00vQg4Vj6hD+6pM2B/SVLnNwlfpQixEqK9KQcMgtF9h4ZpoY\r\nW+1dlDKx8cakjTE62Jnyg9HYVhlwW0dKaV/GtrqY5J8sTRrXFvxjZ26jh5Dj\r\nLjykceCtYdRX4G4u8JzP7+m1C4KdizPoa5aMCcqHD095BItwEzEyTMsl16tY\r\naYGbZGgpYqC+MWbhMI8/Y5sLCP2E7blQzLEUUhm7WJnBWE2H2N9RfAHQmaGC\r\nVSVGH1fU7yWt6A0d7XpT8Iqv/cKM7/N+FfA=\r\n=moWj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.7.3-92b9b13_1665010913767_0.5681272885924997"},"_hasShrinkwrap":false},"0.8.0-2d28b7b":{"name":"bls-wallet-clients","version":"0.8.0-2d28b7b","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain dist/typechain && find ./dist/typechain -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^9.1.1","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.0.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.2"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"2d28b7b17a605a4683b91e11475a4e7a581a0ef2","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-2d28b7b","_nodeVersion":"16.17.1","_npmVersion":"8.15.0","dist":{"integrity":"sha512-CL2qm51DVN/OwE4A80fUA+jfFf7t/Notc1uX2unf4A04QR62bLCvIVijQ7h8CvxoK8p8HCcllgWff1faPNWgVA==","shasum":"e91c415daa190d9d44f23f1fa9c04476b65a83c4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-2d28b7b.tgz","fileCount":233,"unpackedSize":784051,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVzJs3p9lb+pyDjbjIMbgBXVq3uL0o9moWAoKRIc5YYQIhAKUBj5wpblcou5bKiUrR16aPD7ROMtYixrXbQG05GilD"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPg/dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFPw/6Awgqz67yHVEKmIAb+cnF8XFHOjptW1B2oFj+2t9c4Tdgu8uP\r\nCD5LOO37eprTSDuDrkxRhgTrfuHZzs4o53Jpxk/ng23iP79k8+Zs6sqip7gf\r\neZtfdzz5aZlRgesF+X938QK9Qe5J53wCqpE/mD6tdEbRHJv2Dco6n/QV3zKc\r\nAdyB8TgbloRwoTFfMh6XmiM64uSapVoP5/cnKeGfmUKItN0+4u8RTBe3lppB\r\n97P+iX8d36C9yqm++HaJz+mqnPE6h2ISwY/92KsxEiCeqshTKiSg7GMISKv9\r\n4XLzJIzksZEJfCk8HcnA274VQvojAmNspsULaXM/x4PRcF9r9unUXtN1vTV9\r\nNJwPlnupuBUc2pvTx7O6HMVbZ71vqNaajxCaQcgwrnZYX+iAmJVhKEtXCE7j\r\nIXZ6Cy5KvvN9dKxX0iUBD4Hsw2lFVVjRmRmwQNTn0RcD6ScD3rKEM7Gp5x73\r\neI/mh163yaLUgDtSkvAuRSwj8FVxZPVYlCILClJJ+lrLJq16WbBwnnYMDDp4\r\nJCIR1Hr6homjkBoDbSM7hAbFpPnDdS855+v1RBVdGgiOrwGact8YC0dSmGy0\r\nIY3bBtiQgJeFw4oG/OX74scGdb9l3sL/o0N8UTglSrN8xKQhslRLc0ZYEixV\r\np8HuTcq2fd+94fSzt3fu+QgWdDsEzE8IxSk=\r\n=h1t+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-2d28b7b_1665011676801_0.6877141238090403"},"_hasShrinkwrap":false},"0.8.0-bc3d146":{"name":"bls-wallet-clients","version":"0.8.0-bc3d146","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"bc3d1463f163b742026f951a2574016966b5c857","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-bc3d146","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-DgFPCVCLZ1xqBpLqztI0PldBZc3s37wm1LBqGvHQqcJfjRHP+DO6wahq7BtoiZ5sz7SeMiORCkFWPdh3rlaF0w==","shasum":"2e9343607f30c3891c616e0b77f4e00a12774c52","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-bc3d146.tgz","fileCount":498,"unpackedSize":1057011,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICcX9MB5q+yAfoWzDza2gAuyK9IW2zm7D5fs6LWUBcZ3AiAuMF5/qU5dpdyIMwWArkm//oEgMQnAzT+8F0jxhEAvuQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjbZ4fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9Fw//ap2YPk3r0DFeGnzVt31xpsfzzn9o7cuWN5635OUIbIxyqG/0\r\nxxUXGg4l3XCs0zYoUAPkrWR8IovyccL7oH56TtGanC4TkGKqnvklQRFBBBQN\r\ntPpZ3n5kFP5sjXk1kqj9BukNr93fSuzrQQDKu8Sx1GD88cnqb3YjFb8Cmhs0\r\nzH5DzCcdAxND5tZ3ozRj7jAZfOISRIqu6HHG7TW7mPrQlv5dRYkMlBmYA5Uz\r\naAJ/4/OjP7dnsbWYPKV7YzMQlcGffAJuVmE9QwRWHxUdLi4OdDBGK6Yp8fBH\r\n9e9GMH+wWHnR+9+sTzTzvGcp5355W3j3HJeu1cD318iSjEsGJ6pdd+kL6BIu\r\nODjpNzpStD9buAeQWYZOcxCUNCMEsc8XYryi7nVipRTicHZkYd1ZD7NSQ4U+\r\nqyG0TRiz+GWCeYpRG1fmrfYza/TP9UmTeRs+bn+aJb+Ddr2qzv22+h9d0fn0\r\nMcEk5Skif4a6H3bbNyOF2cCxj5A+jSu45ubcPR/jO2d6CGEK+cMTuqyDyPiM\r\nSgAG5bkSCbVU9LMP0wYb6Zm19KtHb+IHKrl+rEJ4Ue+GSKCG+67ahRacuQBY\r\nuuhMIuUyXRfE/sjnyTPxYgXro6pE8kzutN+wHx8BGo9AnMmKlwXzSkTHcFQ3\r\nENHfexL/o8IJz48iNAAp8wQEfxU5a0rYXw8=\r\n=zmJA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-bc3d146_1668128287660_0.7682594038503312"},"_hasShrinkwrap":false},"0.8.0-940dd11":{"name":"bls-wallet-clients","version":"0.8.0-940dd11","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"940dd11de9c707a5800da13458f7178e79188751","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-940dd11","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-f5zqGf5dAq7IPXbrsNLdvEX0lJx2/7DBOqbkvHABGEWEKnHd32tMKDZxUeGt/cPV+2W0nKmQk3uYPNGCEuC6EA==","shasum":"6488e58b1fad12e577ec06d10a3c4f9763c1e395","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-940dd11.tgz","fileCount":498,"unpackedSize":1057473,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFZCmW7nRw7BYq2+ge8fC8cvIIHP0GMIlMPERH4o/0LGAiAl+GXVmCJWgEpDdE0vQscNknmndC9zf41kj9kGvTAM7w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjceR1ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsTA//UTSRY13pOPG48siWiRi/Bd+f3Wt96ZOfV9NTMr+qepChHhh9\r\nLkY4F2TFOeIsS4kYhUguFO4HZLi4xODwujikF6b5sOqUdi6QuVCaTDepv3WK\r\n9S/1jkdX3ktHI9vNoU+/ofDHRphJzg5NczNr78pRelwTEJxmRVsLVukCVIsF\r\nNVQyrJFIsBC33EsNsDZ0sfxqKC865vwZ15BNDp799ajBbV3+hRPoRwUAtf4O\r\nnHPs04PHVlcTTji9AXrIg54SI0aXrVZDfhDWl617VYzhnyuK6J7EYjQrDSLi\r\nvspBGhWThX6G8xJXUbdVrojWuaZ6fRjR3hzP25fMj8IwMBY2HQQsqZb/LRbL\r\nyZu0g7rFPirQBHNEXrUgvfQT0MSX6JbrkEgO0rxd6UGRBN1UmrPEOsW1aAXU\r\nguR9aLOu4gz8mXHRJNuFlgfWt9P+f6D5f4jAgwYk5GsMkBwHGCZy1me/VN6V\r\nP7YYIPZsOj0Muq1i8LBorqvYNuzoKcUsMk8oJj8spXA+JKb5ceWb3ToUhh/h\r\nrl/Ixtj8894E1yjXHLUzl/yl1xYt8w4UOHaQUy6j+QkAl58hQ9xW78QJW1iq\r\ngr8hXtmRNK4IVg+xNAgBJ2us1EZ+lTrco8gqNgyUqJbY+LD+1Ybz0pOyjk5O\r\ngc7QAWM14AWPmDxAf/ShuZr6fbJMZsdPnpQ=\r\n=aSf6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-940dd11_1668408437107_0.7372069833256396"},"_hasShrinkwrap":false},"0.8.0":{"name":"bls-wallet-clients","version":"0.8.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"_id":"bls-wallet-clients@0.8.0","dist":{"shasum":"7b6510dede672fcbcfd743caa85a038fa26aad11","integrity":"sha512-cutglRs+1vRiFPmo5uwMRZRjkeNxr/X3NiyUqsB4VgIRQ+EixCMXvuY7BDok5yby6GWzXox2ZAqJkGTFuHyr2w==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0.tgz","fileCount":552,"unpackedSize":1057465,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCuX/Q1Pxaoh3c2+y1F8oCi0tUVBSFNLZU7BGxgcMTQYQIhAMIFtIAVJTQYd9KbNju7kG2UUssE5iWIT2y1TXiMh/Rd"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjdDL+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrgEw/+It0HQuLB6fBLjkk9Qq+FLnyCox7y+bSqP8MofVzoVJoIEykC\r\nTvsLbLKHU7eYpHA3vwau0uQSdii3fo5PeL6pyM3I3CGbo2aKzRY8CfqSR48h\r\nJefpmU49C8MZ54qNbeAGvKkILp9YRklJamjUY2UXXc9VF2VcVh/Bo7gEdT9B\r\n5B8lPzf69W64QhB4CeltPy+gU1qsjlu/Pwn1OrU9K87+yQNvHTtyJXfXZG3K\r\nc7S5zUpDKq2PGsN6VR9r3tC/dLDTvIHVWrjYCdnMMf+nk6hjCHFHzC+IIN1X\r\nBo0hpoZ0B0D9s3UuAYZUD53dvsBOK0fK391lr7GP5ZH99408G9etWiMtIe5s\r\nRc7uLNKnkBvHnw2jc9B0UP+S8kYDoZZcwNyicjqhXduR+qKdfr10e3DF6Xoe\r\nz6r8+EKikRKDJVzD7HJEy0OeREe/NN5L0ymDrE9pxQkVwq9F6NoWW/I8A19v\r\nLZzQDb7F4gYxPLLRxQG/Ahxvm+hJjGYLd8iu1+VOseCl7aQOGTUds2/kLcRc\r\nmZy0t8LsQF4N3HiiMBiaLZBxnBjJwzaYCJrxi97qC4BS0TLwlcZWFd2FyLY7\r\nb1qvjMBgUwvKY1VDPt3irVMUYCupt7DuVaN+B6KB27K+09sjnfQTwheH3RrP\r\n/oYSbaWoL2V8z6YAnzRZhXPkTytm02Z9V4k=\r\n=sX1X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0_1668559614653_0.15658625963058648"},"_hasShrinkwrap":false},"0.8.0-72b546c":{"name":"bls-wallet-clients","version":"0.8.0-72b546c","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version","asdf":"npm whoami"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"72b546c7a7cb354629b65cb38d44a19e0fba4f4f","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-72b546c","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-y3GCvU64EAdIwxNYx6nGi1d5eoYLIx57CYyTyMqbDKY9Ff5NnVWtUforiLFswP3QWpx0+tNrQpMNcSXvnorrKw==","shasum":"bf41b2047e7c0b20f76706cd1ecbf681789f5b85","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-72b546c.tgz","fileCount":498,"unpackedSize":1059296,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAZnYHRZgEObRt6qUifSkEhHCyg+Zz/TBVEqSaPK7q8MAiEApfZdOnSs+HIoAFKj4JvZNbYOZazEkLT2tapM2fgQ63g="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhiRNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqdJw//d6+yD65ROnH7eJZcsRtEAAwxZPl7lt1iiqXCPHDwLuYgQEiF\r\n9pT3OcCOSFmWUUVHx6hzA9CmlH8PvIK4Pc+dMZQ0eCVipGwyn8TnztsqypzH\r\nVIoY3lHPojyJMdeOwc/W23uvqTxL72mVvMC/I6V5n1VnC5eJ84gbAWWU/YOH\r\nTwsKi7SOoi4392mGVPlKBdssQCur0afpico57LeLnOnesASDnWJuVLSjXbXb\r\nPpv+m8xqDLmmntSMqhgaioLIKqMaJlwDjLGouGPYHliDRLX9fJxVhiC+WhIX\r\nakqDzVhy9X4anr10mT2W+KovrViQhNzsX2wRGxCOc8P+uxMyI/Fsii8jO5Z2\r\nP/rEer7WCJl5WylDBb5/8W8wrVeE1i9urPRwBt5D/4b3VVAsu5fS7zzSox5y\r\ndWXClAGgdDf6sVA/ShCOpFqbhidx2fQDesGRSy5VfBzcfnS02XHXy4XKKXAq\r\nbIxhlGPPXBR7/1zOzvqkwxiF7j5rnaeUSkhlpvoH3etSIblnLLpBra4GdHdw\r\n9ZlRy4xISz00joPNsAMwkuaaLHlMxT3WM6dOcGxRLpbc1cLyFBYbqV0X3Lty\r\nuCbb0c/Tyj5GEYM6GbCWomFJ/KBsXEz6+bIWoeJxa2UFzSl/U1emMnQsQRrC\r\nQWzg1S3SlQ1Cf7TCqcREVskkm6zt9p5g4ZE=\r\n=Cy2K\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-72b546c_1669735501625_0.5914247571588638"},"_hasShrinkwrap":false},"0.8.0-69a1a19":{"name":"bls-wallet-clients","version":"0.8.0-69a1a19","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"69a1a19edbd934ea52946df0d399cafa35f171a8","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-69a1a19","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-geOA7dz2308Z3M9bLV/lEyqH/oi5NEv66AziRVaIo8w9sTe+XRy9/6+6L2uZEEDrlimvJyPwjjbYmgCqwzhJ2A==","shasum":"587769e2dc17c49bc2ddba62a383d24af51b62ac","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-69a1a19.tgz","fileCount":498,"unpackedSize":1058045,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCqG6tguMuAQS1neNPzYfbqCKYMlEwwSz4yq1k5w3TjigIgN7MG1Dmfaoj4iyI8rD6hTlXT4/WaAdwSuTgp3irxaYg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhyktACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnPxAAmEix8eYoFe6wkEcFQa9CBIBkP2p3u3UQuAsRKqfD+ivQl3c9\r\n3kJcfDFgHUAs+LCZZ0N7vfyefsDdxUXNo78B55PH79csoFZF80ZkxBWvydIy\r\nxJVBW92rjj7RXZC3uPkLnCL9ZuBsswaYZPBNTPMLLe6cYdLLJcLfnVvWWpqX\r\nVDRUQNwdO+fod1d4W8M9mKT7zZ8catQ0rYJHl7jK4nw6kh3YZulNKel3n5TA\r\n69LlKDHwqF4F8FypFfkI9hpzbF79RuP6PLTUtZHliH+LDt8bp3I2YWLvWslm\r\n/MrvkAPTDE8AyX/PA3pi5rPv28cNAZsybHyYWTUSwQgg7WxyyiF7o1AyiIda\r\ndT/RXgpy42HUx00kU/6Oo0sa/pxSCVLOM46urIAUnbDvsg8N9EsdMsbOs/SH\r\nYHlACPi/zVXTFwfWYzdbcXR7FDNiaP2SGtFmz7oDGB4QmjOhaVPBA8PwAy2j\r\nFsYrwRjmOwKhrbyPlVjxurC0MSwrevkIQafa5L1YbJUDF83D0fazQm035SUR\r\nb6X7EvqCtHVfHSw3JTYkU6Q0nWU6ttqkRDeJGohyGciXqXLf54ZIt52Q/46i\r\nWfyUfGsVinnJVbKmQSc2IVl0CQPVdRgSzspcvCRykDbkNaYYCp3QFzy3fueW\r\nCyqSMpZr7MsHzsKCz1akH9UI1p3t7xbrwP0=\r\n=BuKK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-69a1a19_1669802284905_0.4709356357162702"},"_hasShrinkwrap":false},"0.8.0-035891a":{"name":"bls-wallet-clients","version":"0.8.0-035891a","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"035891aa37bd25a5e01f59b3bb5854230a398585","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-035891a","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-rsNCHdJfYDWDQE6DuweSxNPMXVgpVrUbx4z6Vv8t5SbCGilrRjQ8Nu9GsJgPVZQpqFOWlpatDI90QitJiwtVkQ==","shasum":"178050bfc45023bd895737e7bae0eab110ab7f91","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-035891a.tgz","fileCount":498,"unpackedSize":1058783,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDazD+XE2SEALmDofHlzVFfW40BOH0n69y1g6iGn8CdAAIhAM20h8pU0oPfC7QKCM4a26rRxEoGy9TIKRSs+7a/+S4F"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhyozACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqD1w//bgETAU705eRcjvvuiB/56v2rBgbdOBb86yk6x5UasrRAclXb\r\nPffGSddhY/omOGgObT4o+xsy92AO4IcLMcBMVcMz03McGrD8KScJfCwtglBQ\r\nopG/Nj/fRiNPGFXvvC0xPYA6f77lWp8vLai4zn2WDibOMlxZ5VfvyMYJehUI\r\nrpJTeOUmFglYI3rgYqe3oybPqZ8ePZTp+k0qYj4xB3VCT5Ho2dnCMxP4KpWv\r\nyCzRKs8vwmAU71JJah3v/gEdY1wS7rAmHTwJp0v9AoLe+zxPivPjqhBRvZMz\r\nOJ0Dc96oazalbG5OexltV51jyxCVlGjuukSIYwWyEL9D6KiGOa8NxWpbf/7w\r\nG0sAvsvHwRuuJy5+Amm2BJxsGAGF+zrd7VzejxMXRuYP3QOYoaxE5cFg5OZy\r\nJu5GwmuVyVWpiJGP/hVNQcASvo/V4T2qMh5H/uMYMW+HQosEdsZHj++xakkW\r\np7Q6ntwsM8lJvpl+Wpa8g0cM4WjFz8dFlPwjb9h1qckoDRpCZbRLjhsI2a2E\r\nMqT+eGnQZm0H7Wr+QWdtOi8w2vmY2T7i/fi5G4oncCqbWOjIn8eNDFz+95Kf\r\nDCgxgokCMBl9XrZHwSRexeCQdA6vAS1WZEy3RBedvE5OyyTBbapcKfPdeupp\r\npuwg2LaER5QIblmIOf5jhgFfSQZx1WFR4GA=\r\n=e3NZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-035891a_1669802547638_0.006964180266218811"},"_hasShrinkwrap":false},"0.8.0-045c675":{"name":"bls-wallet-clients","version":"0.8.0-045c675","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"045c675edc72a5791c026f250538d175a0d984e4","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-045c675","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-QYJZYWx0Cxu3y8r+j7SlxCkN65VVsA/KFqiXr+Iyc9OZpWh+sReK3sYHSb1f6ec92W6ryjqCe4APbZua8zYo9A==","shasum":"073de1f47cc954aefdc199a9406e21f7e80b2a18","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-045c675.tgz","fileCount":498,"unpackedSize":1059842,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDFHtMWfgh/9jrGBDUOAs6aQOHrh4UyJjw3hBinyMvj5AIgVv6MVfzFNF6BS81kyZoskm7/XOm1CyRN4VGi9IbPis8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjhy7VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp/RQ/5ATNJe43o0k8qlENNGCGVaGUQvhZKDYR6Cx1L4aUFRotKAWfL\r\n9kd6nCyJrUygPcMBCrhk+srNUydH3yDUI5njhJJvuPVS2BY9uHhu5KMySjku\r\nM2LogsqOdeBXx41mEsZxgrG81CQBhiCuBjmEpISgi27jI5w8M7QrPYmhtlzU\r\ntStxY8L0mZd9Fq8cD0NTo9sfDBpCU7XpijMte+AZSI6eH66t6mZV2QMpDmfh\r\nyYFGFkfD7wZpZ9ntcZOUElVXWFnTmGKUvQNOMQVXUUjLECoIQ/c8FzEND0z+\r\nYcUweYxx20rBs7PHfV7Zei8yiLYLMx4swz+yF0AD6J3x2IxO1vkB7kPd2Zfy\r\n/5p8Y8Pc4j0mFM1pUW2Q1XgETDv2F+ezYkkz1XdxihICjUWkZY2HUO3mNN2C\r\nEBesnPKWw1lwDd/PuCpZRb5iZNUxQqs0c72vujAx4jnzAbNF03r5MNP++klf\r\nP02RC/X3hN7bQF5I9JI7SpWfxQrbiDdb1LCeB/vuI/DJ9b9JDDPzje1il+3p\r\np7gDwQTk+9Po1fuVPX8c21t1LoHzP0aMHfK6qhkj588O0QALdvrSBYnT++R/\r\ny4LXCIEJLEuMxlO6c3Qzte+622GBeWn92jAKLbOhOkjLSfq2XCRPySIDMbUN\r\nc1k3khkOSuTO0AOhMh4CU6ePutkEtDcqt6Q=\r\n=KV/T\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-045c675_1669803733686_0.26466625630148477"},"_hasShrinkwrap":false},"0.8.0-56f33ec":{"name":"bls-wallet-clients","version":"0.8.0-56f33ec","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"56f33ecf4eeaca199b45fb6af8f3d9998813f3bc","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-56f33ec","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-uHKV4ep+K2MqArNsarM1nRCQwls5DymUSyZcLh5WWJAQM1Ht9hwBv5Hjti/TXqP3MEw3HsZZPvBwZKvFx33hEA==","shasum":"a0ed67df429c6c1d39ddd272accfb7087c5e6613","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-56f33ec.tgz","fileCount":498,"unpackedSize":1059842,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjwNNcl7ZIPRQAq5x9Vi0Cj1zrMBS1h/nNeue6Mx81wwIgREqotJTe3//9BHYsjPE12lsicsJHlEzFuknJgZCqCHo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjh1boACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoy8A/9HP2FRKWDCrboMfQIUqY0UIDyhuQtbhHCfOOnW9BfoVFnfrG5\r\nX7zvLO5YKxBfji/gL9iYESxdLqbyeIvpCWRes2gTCRO10ibX0CZ3NNd1qjaM\r\nI4FcNEo8Yoy4BAm66LBIRt4MFumAZqnwoXWX2X4cLIEKBpS5paJrLvdB2wUd\r\nyfvT/rTqgvFilD3EkJiIhulltb6IZKRVY2LyauBgt6Iu+DWtSqiGtCqGa1GA\r\nsG/GFrTKrtHOJbXQ/r/bP/SJ6q+5uAdXsL789DlYhS/adMmwVNuM8vjeDvuZ\r\n/8mANxQOBC/rszz206KVyAAZNp+hm0x5gHbPJbR2BCvBnM5cNyZfjuzYdhJ7\r\n0s4J9N03ZC5hA8xSbe6183+24yWIVN2PiuftyT/eCy20fQnw5kOjVN4yhutR\r\nNJGs6EtwCWNinFIe8qGoPQy5QD74Y2c09sUkQyYRBCbUJ/jzhYgXhA6PagMp\r\nwlPSa+nsDt3ml4R/Y9dcN1xhOHC5q1vzSgz0C/gy/MpJsd0YPbwDtZFxjes6\r\nOd/45MrmOzyVMTt43NVQLBZKW7hwV2XhA9DkSOtPqO8hj+1wS+a/oDrKkPby\r\nbsJzCLzzxO1Na55D4gpAYNy56vFVi+0P0SoSF6v+OTSYhHghjfOHjZyNP9BW\r\nGUDc3oNA6A1wHyaQuQZV9tikSW006M6yotw=\r\n=LN7/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-56f33ec_1669813992238_0.26543350995563975"},"_hasShrinkwrap":false},"0.8.0-efa2e06":{"name":"bls-wallet-clients","version":"0.8.0-efa2e06","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"efa2e062cc699aaea52f26c941abd52afdc4a034","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.0-efa2e06","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-LGl+wLnK2OJsjmVDcFXmh270efAnysyW6EWDeKMQKl3la/KZs41OsmdpSW2Exf/wclZuRHdCSwT57+kvBiCMgQ==","shasum":"b095696bfed5ccdf6bc7db20b19b81433de0f497","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.0-efa2e06.tgz","fileCount":498,"unpackedSize":1059424,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOwzxAli/H6Ol99NieJKryC+GMKo2ytHp6DuABDYr7fAiEA04r9rI0VTJ2f77AxhYzfsbur/1DEPtPhL6m92RUOkSk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjidToACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBLw//QbY57Ul2/BhACPfVJvwQMfUGJ0wxnrUuXuq+WlVuL/N3FQpp\r\nj08kWI/8z0YC8/ITkhf7nGMl1h/8HvCvNF40JxgDxEB/ECJ85p6ypIpda7H2\r\nlxm2WFt10xMT2aVS81Tr8YmQnZQULo5bQUY8w/bPiSgw9b+HDuzTcpvxazLf\r\nWvffwtAnf+TLYEfZNkGRTwT0BaEG4YnA1nLoACYmatWQlOhLxn96acLOAh/1\r\nnZaUSmSA5uAs+Fvpb8U8ilpANynzLzxSPII0gq4SE1qj6vWx8l4OubmWmbeX\r\n5H48JkxWuDgY96dzhlARKNGoaEPqzN2b2FfpL8RfMehwmJJmaHcKhSst+jRT\r\nHZvLMU0o9hHkTQiB0kMWqfHQ6QwE1na84TuoZs+jp/Svwxun0AO//M9s2i7G\r\nrSohEWaFl8Q/X6jaJH38S5GeIzGfxMz0OMwI+CK/qM8A8FlL+SpKGa7lKlQx\r\n8sQgQe8jpj3en611oU3x3hZD0NBLlSOOjf5EZff6vSu5WocGPf2iohXW9iA1\r\nVUdIIzLoQ7RUVuZUR6BIPFBI2mdUrOjwbPUXOTWspHD7IhPgUSpdsys27xPU\r\n5EcwotNruRvW9KZufnTfmBJDbmNeU1CgNsP7wD9FjczVBMMkbKjt9R53+m5s\r\nL6+vNaFcMhqVpt3Zmdjew8hZgGe9Lqb4tM8=\r\n=OwGd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.0-efa2e06_1669977319748_0.3573968270417849"},"_hasShrinkwrap":false},"0.8.1-980039":{"name":"bls-wallet-clients","version":"0.8.1-980039","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"098003999d9f14033d46499cc1ff17a6aec2cfe4","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-980039","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-xhMeKxku94odlF/MLT10JZqtYLH4cIXxQxyyXNcf4n3HeEVKnm0hiNzsdAd9iYjr/8juUBqOJzMcwineTQVTug==","shasum":"6dd2a9e951609516da511a8fbfe5cec99fcb9ab7","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-980039.tgz","fileCount":513,"unpackedSize":1102215,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGeVYNGbBzqfn6bu4C6JYvRxMl6pV5OIyafacdDkYS8QIhAN4aWqNN3w0CBXKyCTUvc0oUsMDD+EKeDhKEgMi6NJP6"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl3dYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmplAxAAoj5JV0okJt6aTN3dIeJPtf5bCCVprgP30s2RuyMAJMc4IHdj\r\nxLaIenxxU40xzOE6tuSIVb9+JXSJBf223VfJ3glX/fwVT+EWiF5HBDzV1hj7\r\noHV5tJ9+AGQVjAXG0INM1JJMtRsP3XlYY76i2aZbr5S8SFsIaVs+htlaKeoI\r\npGKki4VTZxNhiCd0DeNkVTehNzK169/UhfmlcGLD9j98l/NO2TuJlal/SO2t\r\nwlfMXhDmGMdwb0C7WWlb8qiCj/qmY1Zw2+lA7FjyaIl10hrkaKTj0aWjsP1v\r\naNGMPAlGpnEIJqlcAib9Zh/T9L4PoeFwMKm/gnMsIf39Zxp86o+QNKdQI5GK\r\nPTVVQrdHBJCbU0/z6oG8OyOc8y6bj/6aON7HJKzH22SA4QF2kj1r+STwKEgP\r\nqNwYVLNczeboMMS11qbvUnW9hdnXbWmjOPLSeJfyWfcuZZCZihYjpTU1uzFz\r\n6tiqT397jYxwUKo3XsjN5AQvATdU1BeLVn2RlB5g7cWkCaf8egkwm4FB9+19\r\ncsdGk4se8lsalAk7+QMCX4UvCRmBD9VQ58dG4iZzy+RlFQUk86E8ht75UKQR\r\nf59zuVrwcjy9Ciw0SsvoDR+E7oKJhzVyc1//WfzXOf3qVAS8wy+aaFXvJl3U\r\naMddG/RUt+lRGn3s2g+m2viUJ+IcgfhrcMI=\r\n=dwoJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-980039_1670870871845_0.7284014044284264"},"_hasShrinkwrap":false},"0.8.1-bfdcf0f":{"name":"bls-wallet-clients","version":"0.8.1-bfdcf0f","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2"},"devDependencies":{"@types/chai":"^4.3.3","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.0","chai":"^4.3.6","chai-as-promised":"^7.1.1","mocha":"^10.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.8.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"bfdcf0f24af18e902e34bcf1c330b703edd9310e","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-bfdcf0f","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-6wXu0AiHFYVRQt5n0Q5og7kq93xN9zexcsaYf7XBb3+0BAiMDv/3yakBCzGDRL+kwRGqRDAwVF6fwy5txiMjGw==","shasum":"4c8e073ab98fe9a4f14ecae9caa9c6dd26cbbe76","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-bfdcf0f.tgz","fileCount":513,"unpackedSize":1102469,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDhMFZ9XILWQN5id4RxPK5oa9Iss3OGn+ncjpFFqWe/rwIgCkyEIBOJMEl8i7Qlsvfa43MEbjaBAWsTvQv9mMMvPs4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl3yGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqidw//QMh0FWQ8q32TNdIrHSFDhhHmarE0l5WPEAStOHSRJt8lZTJl\r\n4KR16YVWde9lOOc0hAnejbdambIHEUjjD7wNl3zCZt0zZdyh+xfbqIcFrR4W\r\nPflyo7XTVK3p6EbcrNheYEZG//ct8bHUh0Z8SbPG1miMYzua5XOFcOVmzmIN\r\nDd4ZKmysR3nmixF4Im5NsadO9iKl2tLXyVIJe4Ndu1+mRMPpyN+fiqJus3Ow\r\ngH9//6MBgPFequGLUG4Ep2aJXVp+EGNboLTgTC3syCkzMi5P0TEMB6KKDn5U\r\nRHDHcu5bLOrAeN8bXUcJ0gPrwJgxWlSNTHWfbk8dyYeW1yKRwlGBLtFxQcP7\r\npKo16U4YJiTG2FnzLCxmuKw9kNJfnUY0PKUIOzElSQy1jZ8tzM2SEdHZkV/9\r\naTj7OeTmI5i73woI0f9xrYzQxlOtFbsgHsLxwuxuoqa9h2wMNIi697sYt4eq\r\nfhTE3lgN63h336PeN9DycWnabL0LMHaKur7gRYzxgx9fgz+Eu/PufojqhAgn\r\n3BVobD8DWsLDfcazMn+DJSNAB0/yk6fuMW19EtwTHks9bjr/m7QFeIu6H7H2\r\nwrJzL9K8PUGYrXyFUL9XirNLZxJkIE8vb3GikxBXlq33HdGuQGAEx01PtSLg\r\nOOoNOKPSfg/wtZ0q1WlRJ51KFx3u8Vzpw6Q=\r\n=0msW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-bfdcf0f_1670872197660_0.6336717263166431"},"_hasShrinkwrap":false},"0.8.1-28894cb":{"name":"bls-wallet-clients","version":"0.8.1-28894cb","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"28894cb5e696fd38798b87f5cb2cd2d47cf9c0c2","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-28894cb","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-UT8uoebIdS2JvraUHgGldvU83UN1rQNPHfZb/E3vEXf3Z41pL25gYNHVOOP2jcKfIcs2MBdL6fIrKuMbyEpvlQ==","shasum":"11adbaf640dd9a183c05a043bf389d1b3a64d695","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-28894cb.tgz","fileCount":513,"unpackedSize":1101917,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKQEhWe6MtdFxZ52mbyp5jq3m1i8NItudHP/zN1nfYQAIgGimgWDlS0V7DpkfYO5MTL4ClULWTCh0eUQ6W6GEooS4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl3+zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphEBAAlqYYNanRLezFekIFBFovT63tSPZWp3lIhknz4LH73jM+mU6U\r\ndTDMZ9pZyXV2mD5nb6AJ/AJALaAmcnv5PFEjHIwge3iYFTD/Tu4Ok8RL1Ba9\r\nE7HQnuafBZ6F3OXZF6lJe+ix90uYhjb8PIvWJd5DE4Q9SbYzKOsVKQdbhL+2\r\nR5i2tKbPS7VrLzdba3ak2V9Me3RGxCfJdbxc3R/q9dGFmoTdnJcaw3aCiM7S\r\nSqXYAk8Bg7BBmvp46MpimcQck8YaUF1fie9xvj3jpxWVQf9hQ1HxG7iIuTf6\r\nJz7SSRDIl7sk6/t3Cr13znIJhE0xiClf3o4FiOvkHKM0a6FT0+ou25FNUDQ5\r\nsUfnYF3rlEigId/PwOxslOXgdV/fgI+rLxaD2QpeK1iPBrPS2M9znsGYFExw\r\nU2Oe310JQhnNcYToRtX0om0iyY2u9lwl9iIBUiXMdltzHapRMv7QwhB7PkKy\r\nCvbecs9LwxlrBAG2BLrfSE0K74gUHZVMoV1zfgbL2vjIcUFTDbATMNxUxpQP\r\npLzV+iTRzQNq1i6e7ci9aHi8g/sPoFfc7QSeZXTof/MMDi35G8yaF75vA/Dg\r\nYOSUmmXCq7R5LdReWzf3ZNjCJb9Z0R+KHnTZOAwQAS8s3AUlKq0c9D5coHRG\r\ntVltMO6scAp/29yADbOFzdKYTV7l+L5AqOE=\r\n=tmfH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-28894cb_1670873011519_0.5598380045810729"},"_hasShrinkwrap":false},"0.8.1-036d05e":{"name":"bls-wallet-clients","version":"0.8.1-036d05e","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"036d05ecbaf2be08674d5fd14e2ae3feb2401936","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-036d05e","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-JPgj+Y1K+PI9lQqCFNEHmOUuXnSRAw3EtZ+bPsKm8p4kiLAk0Ueqkpx4xhntJ5uW1s8JYrAOHPnd0K6fLPgcJg==","shasum":"f2133d20194fa7a3ba1e5aa30ced89568b6b5091","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-036d05e.tgz","fileCount":513,"unpackedSize":1101922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCO7dEzWtB5ZIrazrEPgiwL3rsAWCZsLKLES/xIBVHMxAIgb9k0etkjG5wTV5N0LUwoB/ZK50yOSSzMpVZrV1qds5Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl5NlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQsA//TlYFeT3O29uOEAQjnJkwqP093ENCR/wKdEzeVkUH4YZK2aM9\r\nvPvqzW6W8my8VDFsabsID/qUCP8lOsFhmEVfUBhbBTHUzy7H2Bx2pSQrvDll\r\nGbG+TGs8dUYVDG1VMAKmEHSUHYob5Sp34QKQDsHhKm2VQE6aXnkxuQJcn42+\r\nS5c0w8bDuKw1Iw01XsysGQecAsDOTGd4EM+B9o3r7bjVkUX2WDiEDLbt9Iv7\r\ncI0cztZiVSXK8FfPOtBEV18nzzJwwx/P3tILiV/grQ5hQyHIXZP9yYF0cxZn\r\n+w0cTjTSorq/QKYQC6tQ7Rh3bCmHbNbrkr3niP/eqsF80+n+Tw1Gb59vjAxm\r\nj0ZNwyK272xk0tvU9D3uT5un4SxkO3KWvWS1YzeDRL0IbjHILKrqEDEuUhHm\r\n0EJX6ImqBbqbVqxS2eKnz7A2JNPG0PRQgXg+PALmYW2qAP7DedYQ7x2owy1I\r\n0G86s1Da6V75V/rUqCnUHnf8HY4W7x9XRPHAHJw8qdkLz4bTNWtGOttvr5SS\r\nvbqn6GxhGuTlSqn3fQKPWCUEce1Jtxg5v/wK2eHkW4mUpTLoDJfRJbFXs4Ma\r\nz8I4W6NGnuCKvoDnuUhDHUJ9rllt+pm3gMGlpKbQkg53/uNjO67s//N0+XvD\r\nAx9iov8xWkyJTvMmTw5yC/Vk14ATPujta5Q=\r\n=L1dK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-036d05e_1670878053061_0.10073744361624803"},"_hasShrinkwrap":false},"0.8.1-d7f4b6c":{"name":"bls-wallet-clients","version":"0.8.1-d7f4b6c","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"d7f4b6cf8d2ecee2267ad1ddb2ff9dd497e4464e","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-d7f4b6c","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-hP5icwqI1ToQqW1KUxJa2IS/ruqp6uXSVVbtGCPLgrEkO8906TY1/mXvh3Abjq/L5d3jp4KbSwjMUWDh4gi23A==","shasum":"97ceeb84464d0ab9d0f44ffd004d7b7848c29f52","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-d7f4b6c.tgz","fileCount":513,"unpackedSize":1101939,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC97ztGZDBBoPRy/rEkwEjm6LnxqPK68fFpP3kRFNC5jgIhAP+LmTxxxUMmmhm/rFOufbix9Pcl5FRauFxBHqkWhmfA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl5agACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrGjRAAlGKA9GMZMiU5DhIMEB96nB29oXMoZgO48sxz8XPxKFDjwgIm\r\nwYlyxAqvUs0Mep6bnzG+j1ACuUkvQkdo2khwrmUo3vJPo75cK5yII0XIp1vH\r\ndJl8pfgMaNGWT7xytQyr2d7FpS2FYrgI7wpQtsOiyRDSEbBGoYzP00UlvC62\r\n2sTgYUtwTgUBxVOK1005IBlPI+FQ6cqMfgGYip5HeQhRmjD5ou8Bw2JheC+k\r\ny160SEM/2/Cm/6gyqUXnwk67TTo4IK+wOduatavZ/+QZg250iGm3416m1T/Y\r\n3bq6SC9g6pDkBAGgKFp7IE83eT5ndGUz1J+LxuNOoxTIsbWQqY/bnTYcMIQ6\r\nx1Zz6PPZpAjaFU09JWBRoSDpAat4ArbyUaFaOFh+68k4aeo4gZxJIOXpiooK\r\n59BZHcuyydlEBV8uWMoq/jDONdE/OlErLSJ6nO/PgT9gbknwG33YD1axDCJz\r\nW7OxuFYi4wZZfNhOmkppqWps7uo4yHFYBp43HDckQAvA3rGyBBXPDcM57Dmj\r\nkOXET3zxsdO6Kbq4Vlz/ucxEhn3KU4iSrnuZhhjQIbMTE4UfGIYePmoHL3K3\r\nP3wDcjPqbfcZ/IddCcLYS0+weyQIezaFJ7kxGxGEvTHGy5oCzCDqtFGEDuQc\r\n+/ZVObtyWhkqQhdbfpM032rVqH7+wzg+GeU=\r\n=GVum\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-d7f4b6c_1670878880730_0.25678880615345046"},"_hasShrinkwrap":false},"0.8.1-a2c1805":{"name":"bls-wallet-clients","version":"0.8.1-a2c1805","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"a2c1805c3942a098aca0f9b6fc29a6cf0c711986","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-a2c1805","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-1eEEfb+rVNHarPg8BuJ3KCHnlcGhoOlnDW4A38eCie0QHa3/MZsmBHjgYyMyYa/VCetAPv1nk0v2qcN1Vwn9EQ==","shasum":"ebf7cef62e2c8fddd6be0d661032d2823bd519e4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-a2c1805.tgz","fileCount":513,"unpackedSize":1101781,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDcHIsgXyzbDSQ0iE63G9kNrY+YWErpNfBMSKD5eWo8FAiEAnGJRo8nw0jpvzWZHAqO6tQ1EX+RWGRVOUFIO7DbRW60="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl7BpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpV0Q/+KR6PTEekiJcA11cx+40slvsi7RRtHdroYtZ8F8IUbThXwdqr\r\nlmWY5Hj60F0bQaMe/XPEHyPzam+/AV8WMZJEyvfLGCh4T8cB2qD7VX0ep+dU\r\nYBrzRmPEZpyY0crMi87WpCGUGi/4RRAmQuV3Q/JdYqLnUoa/1ceUksB40Nxe\r\n+CibDMycKXS88IyH9NoaVeHFm6bY9PlYfnfMYnBmZrxTF23QkGk4pzfvFPU+\r\nHS3eTWamHulMTAz288Bt5TgQNFLjIFaXYT4pryKtzJDR40dYWGlS5nMaH5Ib\r\n4GhJFYLuFeOnhhHINVQUsWbeiGVPTzLJoWkOCC+yobTi8PRJvk/LZOSt8OrH\r\n73nM2L3mCgw51d+CNOX/Tuw5suUAh+Zijtr9yuonlbRgCfACABL12bXu3eaU\r\no4w8Q2MpfGwXmr9J1HspVAA6K9hZe8H4kNxwcdk65u2CUfvWgFDrzclE1MLO\r\n+ISIEDZCxbn3LXsE4rFJncx6+9zeb2vtp0EKVJaywK5kY9vPb51WMCYHnp5t\r\nqIy1PTBd8IQ7zoRPQveZDnObgapM8AtFgyMZT8ktrwzBA1fPMT9pepe4ih41\r\nabH+uxY4Na7h+t6Xny0YC9Rl6216vlPjvM1XNkWDya9VUJ2/Ns5N8SgMuP31\r\ndkp7tsVzqT8qQtIgMyWvYuRoe8kgXLI/7hM=\r\n=cXiC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-a2c1805_1670885481104_0.5515275379151097"},"_hasShrinkwrap":false},"0.8.1-f8acbf3":{"name":"bls-wallet-clients","version":"0.8.1-f8acbf3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"f8acbf3ab826cd77901b9c9e15b1b16cbc6e7e3a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-f8acbf3","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-lXNn72lQSzyZqezQD0CSWZu+X6wa0fi1QbYlMj0x253X2bsnNljvkTJU6AwnRwGmGbXQbpXDzuHKpZtRYrj3kw==","shasum":"d13504021db639a5d9a1ac2a0ef06518d65df6ff","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-f8acbf3.tgz","fileCount":513,"unpackedSize":1101781,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCBefHBKmhPeDAzveE3Z6VGRUdZQJF/+QKSBsU49/e1GAIhAM2ypok3GxIWNdvltVu5IzNn/5APgD3LjS6pub08u77X"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl7ChACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7ng//XbiwwmzgtefBA4PRj4WPqx9/Yg3PeetZIfKatwLdPkcMqJLR\r\nIDQzuPZXZkV8r4n6wMx3DKHpBzfcwzhgFsS7VloY8E7aCURZnp9jPT3rkePD\r\nNQRULkC9uLcD7l79tpfzwcsK+VIYrhDGF0n28v3n2jet+HB3iwwzyruW2r1k\r\nReKQxl2no6XuBVML26G4+W0O6f4WUjmRECuysecdyKPnna/DL6BuTwn5opm+\r\nDmh6FiG2iRsnapmrgPJxXHDCgAjdEAa0qQ4bgyBbLY3C0g7LB+EKcMchsX9W\r\nMm4JUaLTdCz6qHUYPwdGmrt3U/n13xAYhY0nFyuWSxyxCl2swC4+4+2ekETj\r\nULknCKJqmAcu2ux9mS7QaXl9Lns5jinq6mK4PKxVcQTee80QgDhkZkIywG66\r\n2gPcS+akLnojY8p3sXDbGcMjNWc/icCp9lKKzr5NmtRhu6F7nYKPTAF0Ak8s\r\nBRfpo+JpENtgA3FTxOOdHdjX4FYkU6kpfmMHzM7gsXQQu3ULfXvf3SDYs/4B\r\nDyxio00EWLJl54j3fh9lbP7eW7rTVut35tmgXjVQl+w2tOUIpyYB9r4Gskdf\r\nyFKgikxZLBqF+xych0FBYYpGtgvdMswsSwBqo/51/hTDkbO/fZL2MViJWNN+\r\nSVgoRFJvQDBw89YHppYBonEeLY1H9QvKTJo=\r\n=Wnv/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-f8acbf3_1670885536874_0.5538563026799013"},"_hasShrinkwrap":false},"0.8.1-83d2f28":{"name":"bls-wallet-clients","version":"0.8.1-83d2f28","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"83d2f28959969221a5bc49e6020aa1660cc98653","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-83d2f28","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-Ty/hEoDtA8NUtXU7CHG61LGo8dJ2awXO6F2mS7V4/VMVJ9UmhR37TWTl4HVEB2S2B8wX4JZYpLEZxNNO/zANaQ==","shasum":"9219d807ca2f4958d8630f5658e006169e44acfb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-83d2f28.tgz","fileCount":513,"unpackedSize":1101660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBzQdmyRxOKcQ8nJdThwo8DAYBVpDhWWOP0pF49t6UM7AiABaN77b50cWYJ0dI7oLm+vuN2boe77PxDpzSeojEBzUg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjl7KOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBMQ/9HLP2tK7rNuqpdNrI9ZWAKqsnMXUyGSiB9pBP/qocHiW48L82\r\nW5fgWRquJqeXDsqo+slc3ugk7qYAm/5xx0NFGOoGtr7SK0/TGfCttZXTV2ws\r\n/4JezgxEPKR7PFT89k2ZcqfYkJRD7Cw34oG9jKXm5sayynR5WBeNXXeNcYYc\r\n7v+w5gWDyiLalK7FFkjiHhtd4ImhFnfz18fcaaT349JrMeguAG5KdXYHHZtQ\r\nhbzODOC2XxMVUbfGIy8ZRoolPY/TlhIDIzCkpYtymIDQAAKS4pBdiH1oBvoh\r\nBot2y23golMrvUFkrHfT1NJWHIs2vaWpHB5Ib+V1K/x1qGAjs4v7M1In7WSU\r\nm1s9c7Z7NqDaRmTbnE2eOHOIuMABOrKYZPLDGDM+eFvQdOa85CpVnaYo5x6o\r\nZBzSlY4g2mGvGY62lZt0Qm8qZVQyoLjGfm9dYUTuk7RDwTocby09z5EXehTZ\r\nLXd7ozyzFpPKj2toiwM+b0u+sEvXVtduRX3TaHe2cJTnci0rNaLjwhJsvk4C\r\nYHqktTNI8TAtR+sFw8/Lu3ZQlNmDPElEGigifLmWA+VCHfwdcs1Nt/iRiPze\r\nQOKKSVHxP5LW6JnzNcbmNCrxobzCMSXULtbSbe6n2OXbrQkBDQn+ZX1AB7h1\r\nrw9n6Y1ngAgfh4vbBG1Gr1oKpLG5MqlOm2k=\r\n=f2dX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-83d2f28_1670886030449_0.2921042735305195"},"_hasShrinkwrap":false},"0.8.1-0ba7441":{"name":"bls-wallet-clients","version":"0.8.1-0ba7441","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"0ba744110bed68fbd1c1372d48edd6d7b19dab1a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-0ba7441","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-/cpqxaoeTK1dFag2Ma0U18UBPHslCZxGr9hYdKNBBTA/Pdo6y7QdX/7YaKkCclp1fU7zd9TdVOL8DY0l8WJBOQ==","shasum":"c0db8086482c641213c86bdf93775af8b1c18b1f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-0ba7441.tgz","fileCount":513,"unpackedSize":1101994,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHBE7j9C7fUJN+KOhz13GhmKzp9gpnc/xK0qr5G8OtYfAiEA8yGbyhn0DOdNk15q4iSRolrHsJVutu08e798jwr7E3Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjml8VACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqaLBAAogv2cb06f9ZJ/+Dp2tU8GJH36OO5y7KbTGh9tA9P1QqJMuXQ\r\nXeIURnKeboRzbmQswJP60WmekRXk/CYdO9QN9+uGwK+sJKKMfqpNuFf7mFU9\r\nhCpRLG/9b9oNTmKrqsU6QbmrFJGOOcN6kQMUqGGsA4d1Hm9O5KvhH4neAYhq\r\nV1ptHC3FjqipWfwYOHK/nsWQGTxByf7VxscUndpmbprBlzmtm1dEkMsQCskB\r\ngzBcORt5NlhFW0yIaWktvnPZQc+z1WbHbXHsb7bxJFCTy0PcQfdQsbA83cKo\r\njhcZBjFSrl3r2y1xfV0k83aEirF7zYnbdFZ4kVXeIAsrG3Hngzecp1M16akC\r\n2l32ZixHwtSe9g9xxj7KljbcxtmmHLKZS18MT4fNiK/nbMPDZ9TbNK4Vqq4+\r\nh3rxh9+R6wkEilRFzs6ClPkk8Q9EbWAHFXxRLc0bQ9ScE6j1gGpeNlQUwcqp\r\nYvnNVnxfhUPMhFEAyV2Rdu28N0dkjoLys9aFxsGY8cn69uz0ikA5h3prgBfW\r\nwqc1mQbl7Fh0brior4+KaNTKKi635BvgLfvA+SxF01aAyUqB4bpZImIVIO9n\r\nJDBXzQJA95JMIKVZg9tyHKXG3+Re5lMJVXS+oujp8w9fvcH8l+SSZoQdD5Oe\r\nsB2P6wg5KIIYIB+HGdJp5UMNPuS4Ntozv7E=\r\n=iKpM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-0ba7441_1671061268940_0.5958844694153673"},"_hasShrinkwrap":false},"0.8.1-1995bbc":{"name":"bls-wallet-clients","version":"0.8.1-1995bbc","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"^3.3.0"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://rinkarby.blswallet.org');\n\nawait aggregator.add(...);\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"1995bbcba04adb0ec3a7e51544da947f4695df01","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-1995bbc","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-7CMvBWhffM0K7VUxJD+DcOLUNqRL9R6Dx5LN+0SdXXqAAmRu4YUHX9RjZsEFLpu8alL3FjkWYSLgOBlVEvqxOQ==","shasum":"7bb2cb741357807e95ecf15593296e861805d413","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-1995bbc.tgz","fileCount":513,"unpackedSize":1106173,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFhZj0eJSihGUJePwmG01EjX9YMnTP7wP/ULmY+NTc41AiAM2fZoupBI8u/wYp4GOjtu1j71f79lClFaKfvCXXeNYg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmmWSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrecA/9GBbCEwsuYEfV6toTuz4i9xaJUJuYXZVABH6N2XfxH8G5FOrZ\r\nExu0S1XJd8+2dMTWki0+9uuPbdMVUFdvJZSAqV+E4lQb+IyV4+A0rcTjLMEX\r\nBJhx75m4Z0O6POvh+1fbDx6QDla+jHRdzImMmJCPNyaVNJGHqv5I2Eai677q\r\nihuW56QzAhUCCYh9HgykPsAZHsDWxlrPtZk5gARA99vppBhHKtUOFvoCyPJ4\r\nBwe9gwx89Ij9xVMdgikIQIOxtOroa1brh17u0orpkQRrRNpcVGZdumriWbtY\r\nabLZG9b8Pfj8gk8jQ58M4uZU7ZAk37bJvmOlg/u6/Xl6EzHgqC+1x6Z6I+5T\r\nf67hfHtJ2t0y9hHkqa/BUvrmhuKu94exLS4YO0Wh4na1G+PCXWfaJWLzlB0e\r\nxo48sgxOT2+3ZAEM+V3rd6pEct4r9MiK+y34hTLRQH4oYlA5IwGKabGbdtbE\r\nCNdDuexjOQqXcqDZQstkC/Yf2keb59kwZz025/UsjFYsvBiYm3yd7m1RrRTM\r\ngiDQ0D2xzuIS6iK7GGkv8L4UtixgZ1QENehrPd1fY9jt7MhNJXmh5ldWJNl4\r\nPKk9+fj290tk7A+blqojfCNlOO5JBj1TwIf7idNbF5c5WaiYBH46YJDHJBC4\r\nEzbnD3L9r+nTHkM+JsQre/et8Vqlw4UKn4Q=\r\n=CY7H\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-1995bbc_1671062930057_0.4522167963428365"},"_hasShrinkwrap":false},"0.8.1-758c7c4":{"name":"bls-wallet-clients","version":"0.8.1-758c7c4","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2.6.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"758c7c4fe2a33f16d0c2ee1c2dd85be2d419c28c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.1-758c7c4","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-bvI0BJVKZow1y/0BDmhFSlr3ScQQDofUX+6J+BB9pLMu2WIQogmfpLqHsH5oOOq+RQbR/ivNoknR+YU4Un0HRQ==","shasum":"1366b8c704912bdacc933c44061a3198dec80ec5","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1-758c7c4.tgz","fileCount":513,"unpackedSize":1110197,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBVhBlyTeIlwzkbO/22l1ZoPS1ZzzdR1OqogWt/mviVkAiEAh5DK7L0wgrvHcrZrYUM8jxnehjgs00w96T/buFazCoM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjmm3wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkrA//QmuMBlXn7z4GVEWZruyjyH+qnQg043Sjz1jRBp/57ayFnN4h\r\noNkCj3leCjpIf+yfxhQChKs0YHrhnbnfnt87rjBhKvX2P396YQg4PsFpkXOt\r\nURIm9592O3Fbc7q60UDQbj/ut5UfkBDKXqZb7T9Me6q64ugCkYcTEe2ps8QD\r\nkNSyOKXsT4Tj+Fbi7SyZFUsQ2Ucm+kczJN6/HTbbyYw9EEPARAauxQnWVAa+\r\nv6Gr1Z4XL9OhfYzxWNl9yTdW47uAb7c+qNp0Q0dx6QMOziRp4F/3cik+eOzL\r\nNDhNyUKS5PL6f36uFAOCNG9/yrKO8Z2yHxDd2HB/Bx46DY4rSXKOSaknxEEG\r\ndPrG+DGuW8fkJfiS0Yg6Oqv4wv5b5p71Sse/YNUgK0bB3f4HcGuiqF5DUisr\r\n758c1F08eruqUVS3HHxrtY4SexKS7AKsSSAS/zhmA89B/H4wF8saaBaGmtmw\r\nRNAA34ISLGqCzCqJkBdvjC3TDOoREYi9e1BEMvmglhvC+XU3Etjrnd8JHrOP\r\nKUksAhOeNbeXQT/5lKYab/+5aNLbpEaXFEJR20aiGkwwTQG37CVnFyZ1DUgu\r\n/ASHwBYSd26H++Vr2hr67vvYu+b0aYlDEgeuGVEdoyw5SFWZwk6GPbDtZCw8\r\njhk6twkpPywoJduMQXHLq9zYEvF3N5Tpv5s=\r\n=3BEd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1-758c7c4_1671065071743_0.24789107287015777"},"_hasShrinkwrap":false},"0.8.1":{"name":"bls-wallet-clients","version":"0.8.1","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2.6.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"_id":"bls-wallet-clients@0.8.1","dist":{"shasum":"13344a00371e2709312f853e25ea6e3f354e643f","integrity":"sha512-D+EON6jwmIs2rVCXuspqLVjLN1aDIBP5mYq5539RfpP+ZBgheJ8gGJvAK7JDZj+W8zJjwdZfTIXgcXNpCpBXpw==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.1.tgz","fileCount":567,"unpackedSize":1110189,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICa+cFiVYe3Ktqr46vaGio6PlyDvCQ67mj3E9F3JCE0GAiAGnxjm6kQSuzk87yPV/q9sxULZyVna9InR9oc2yvRSBQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjm2o6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmom7A/+PnzMgOcJl/mJCyUQEDtA8cyL0uPoY5n5k8iDH1bQZGXJkDKo\r\n0Frpv18VyR5WBuYMq0ZqYOqp2rQ5JeRogJVYqEXHBS0rNLBrHGh1GsjJ1aaQ\r\naw6wGfcw+3rS2DcTRv22F9P6GgeeIyNGYVlmVSWuZrtzmA6qSJEfBAQBjPfq\r\njEX7Yrg4qFrePicoY4xCiAwc0eqjkTKTunT5Ntmqyxj6lvB980pZQGKtjK15\r\nJInJTtnsDVGTDpMwtKxY9rgspyYunGd5ENn6P+VW6WatqH6N74j+HANOAONQ\r\n7JafGuTfSO5NJ3FKNVmuODXAtI255eA7asYqtt3OKC7jcyAi4PT1f2wMjnF6\r\nNWraeknrhNF1Bm/TVFPkf/e04mAZB6cissXrfDRZLDzPPKa+0l6P3nJEL8sO\r\nRsXmU/At6XQUBxTdkSp9mwmY/OWF5SoaiFowXggQsPyMsXYtzySEplRdwMuI\r\ncW0kuTHxXhP2AU+7JgxwT0dcFO0/C/YKMq0FdfPOu0o9yOcrr5wVtQhNPXuL\r\n+lgiYSmNSSRk4fT15ddKDSU2TSW/kx/2+mTMliYMKH6D42stZDUxHm3SQobP\r\nvse57G7XTig+E6BPplqg//RQ/gUG6YSY9vfJqKpd46cGNluDcu5MqwUSlVaU\r\n15U6AXQ8dbLhfkT4046qByS9524H/Fd+ORY=\r\n=P+nk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.1_1671129658647_0.696174519660328"},"_hasShrinkwrap":false,"deprecated":"use 0.8.2"},"0.8.2-a3a7cc6":{"name":"bls-wallet-clients","version":"0.8.2-a3a7cc6","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2.6.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"a3a7cc6fe7d0748eb09f34b92df49e547d8f7dfd","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-a3a7cc6","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-HTtzV2ein8dGmyAVPFUkD8kgQzmZh5RFZ8nKC8Gr9z1Hqb4PRzg1kUooNojvbotDc1gz7wzqN4Pq6rAGaP2MzQ==","shasum":"d80f9cbc7eefa692b4bad81fc19ea8a90a16e500","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-a3a7cc6.tgz","fileCount":513,"unpackedSize":1110266,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsXMEVLSCNTjd1h8rOPneekIQZqwbQup/spyS1JvEZwgIgLMiAdxDkcw5pYXhUP7kykOFgoZVlr79l7vVT7Rd79n0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoR4yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroaQ//Qlc28LCOURHA5B9SQNdFj4StwgzYPy6UIzH9GPD9depYhTMB\r\nyrChSn8BKvHXgWtvfeVwxTW5NPHVSkzScP6+Rcq8krBcBjxZyt4W8JxLo2sD\r\n+Mr3jWbPCI32B38hSGugx/JfiEQvS4agPTBCyp5QQ+Qhh2W/zs5gsjWj10Dq\r\nY7YzT7rxwf+V6N6qOD5OGfvxFMzADgeUAht0tPpZvTaMc7e6N+iCfBgvXvZd\r\nkcNKBWSXl8V/7LkQJSB4GFGrfqkEwC9AB9gqtiw6G186VBjTZDEOn8x4qiK8\r\n1GuzEG9vQsEcgmnfM9mhRwkCVQu2gORxn6kFf5lcPNEcDu8CBaIIutbpn3Ri\r\nDftaLcMnfiG+R5SK6C0l5QSd9cS4tSDCUvRDHMSVssE9Mxncxbd40Uy5rHQH\r\n5YgiJ4DddKatIqtZT5XjsnhD7GBlHg1nT9lg60teLFkmt7V2LsjOylMugJcX\r\nlb8t/4laXz0f9CsD9QRQstX6ApI4XWZZxmBQqKBs7M2T5UWmmmGzxMGma4NM\r\nL3as1Qwzuu9v1NJg3H/M4NeIinVgw8FWxP+BEJ80RPZmnUt5VJgTT/ghxg/u\r\nkB/TSQINkhUsy4efL+UhnCnuwMyXQqZgyjMYTxbAEjjrhXTK4/1GzQUy5QUW\r\ndWRg6C7+9g43R1xndqw/5008vQaLun+kP1Q=\r\n=PbfH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-a3a7cc6_1671503410008_0.11555905802184574"},"_hasShrinkwrap":false},"0.8.2-add1351":{"name":"bls-wallet-clients","version":"0.8.2-add1351","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2.6.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"add135161fd792a981da20fdf0f22591374daee5","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-add1351","_nodeVersion":"16.18.0","_npmVersion":"8.19.2","dist":{"integrity":"sha512-XWSSxrmJHr4wu+IEL+AMlgMkqSxpD1yOKhPwyiKJ2vU8wRMcudBJqJzJgT/jS+JSXwypMXy2zZ+Mata8zVHztQ==","shasum":"64481aa7af9fd3b361108ce50b92b838b3b539ac","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-add1351.tgz","fileCount":513,"unpackedSize":1110571,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDIonFxivF+5t/FkHRWXcDrOBurYf5mhbLGsfdSYCn3NgIgAUCA8sCq8aFAn+bGRxWcG5RPaSbgcKMqDaVLLboYZHk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjoR/MACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmplxQ/+OMP5r6l2tdQP9TPVztevjKxsifdHJp2eGdT6XbhT0SiigyOI\r\njH6NRnINw1L17j58BQaEEjNw0x20aq/cOkXTss8GcKsHfuIkBpMZjZV4mpXv\r\nPAur1Hpw8Gty1z1KIIxI3uTxmmWMBZSMX4m4jhKnuSpzLS/ydShYMFUEPGN5\r\nt05Kipu91jDyh5EuaisyRdS5jJQYC6/3wyn9l2GW8eICoZOG6vDHtde0vnBL\r\nWGq/5vXKS2b1gF/mBblkuF+bsclmMEw60U6cqu1RVPtKGLgyixA7vjOHF7Z2\r\ngMiNulVBtvDwVAf3BElfOi/ljpY8oGQdK9fvd0VhaJ+N8NddFHUs6hJcMOEY\r\ncvIeFKiMCjLCjR8yWkAAj1zilyDc1uR61/Ujcx7WgofeepBDg7rrmvzHkvSz\r\nt+pNzD5CkLoWwEUak/Z2+NUAi4Nr9FHr5k/LrImAhuVi9VUkQzDZJTYUBbhP\r\nHjHvtFAaQojZfc4ohPMQeM/RbMfuqax71leyyGvLBKm4D95t1Qijwak3i3qU\r\nsg0RWeJSHNp1X23Ya61v47kBhNt4NI1KH9LY01HSMlAC/RTDsMcwgvaw8Txk\r\naLaeU0TyyzEzZZs9Fc69/JWFfaxBvmyeOYgNKo+E70W7vuNAm2UkEy0ya7r1\r\n8Ge/aNK7YpzjpYZCucVS3l1R8bYv988HbfQ=\r\n=c86q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-add1351_1671503819998_0.35247053581167775"},"_hasShrinkwrap":false},"0.8.2":{"name":"bls-wallet-clients","version":"0.8.2","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"5.5.4","node-fetch":"2.6.7"},"devDependencies":{"@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"_id":"bls-wallet-clients@0.8.2","dist":{"shasum":"6795dbb9b3f3c174280332d3181dbaf924a862bf","integrity":"sha512-d8TkeNAWn6qLPIEl6z8UpZcF3ZE23lW28iGOzCt11zQiF3yRG/P7OY/Z1imwftaQs+Zou2OFOmEKpDuU3Iki5Q==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2.tgz","fileCount":663,"unpackedSize":1399028,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCvMcew5yIi76tlwmeqQikIzjOORfpSw5h4cm8NtbxyZAIhAIIIyXejBUUNKcPbOgwWUBNrllWfu2F9IqTVwxCNyoQ6"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjpf6OACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojrA/+Pilbg/Irvolba0EfuIW0xl/kalX0MibVhy24F++X2RNhJDEw\r\nKTFyeTIMzx0NoUMwQLqcIy+Ewc7NBv5vTmV3I3JcCDuAQJ3QAz2R9Xryntde\r\nRFk+ZzXAlJY8tKN0b/vc/VHtR9lLawm0UjFu7LzqtoBHs1kx70U5pizFTxV1\r\nV4xTUPiL9zySSoLHVct847+xMts3AALx1awffpjiOrTs8Q97O5nMrIriEBA5\r\nqk1v04QbbOPTSBV8WqB8U+7wgr3oYZvHaG9YcomV+zhkaJ7e72h4OxtSAxJQ\r\nXIPItAXk9/ZrbySATcHrrxhj7Jo+ScwJMIRlrpVEabYhmQWk2qEAdMxTmeQQ\r\nXoYwh9tTu3VUDcQk3BGpTSv40PcXT4drm4ixQFPhOztgd47uQIMKpD5yeqnG\r\nUywhkHVHGPdjKHsothabtFCYdj6d0By9Rc2bCwMCo1kWk1WqBVzuiENiD+AU\r\nE06mITeHqC6+XQXL6sRtNvjMSADmS0IR7cb29LmQMQphSncSyvqg6JlDffex\r\nrPWJrr28QD/FcM61AgRuul3IuOUTxW/p0zeYVzSo5ST9PzU0QTFbSULoiKfl\r\n+isWKuPtj1vtmY5DGjOb4oUMRZ0irMM/4s2+GUh+zVdhBsWlKqQ0QEIUmAQd\r\nn6dQP/QDFuUOngj+hitD1+dscrzlWuUArkM=\r\n=Dbz7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2_1671822989853_0.8595808237360407"},"_hasShrinkwrap":false},"0.8.2-05f8972":{"name":"bls-wallet-clients","version":"0.8.2-05f8972","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"05f8972af5504fad1f111b9024cea6547c1bca6c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-05f8972","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-lrTg+gFHRhDVQnKW9PBRI6+oDaSAI717lNWrV8V0jJ94l3LCxk+ckbXW6GpuxD//ig1RvupLh6P/3bFToOE72g==","shasum":"7f8a1306ab01489960f20be4aaa289ba8959b5d3","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-05f8972.tgz","fileCount":601,"unpackedSize":1404824,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCiyaGlGAYv4GBUSakFUzVTSLvyqTg685VNH2mNORkrmAIhAORs2JNB6c2udTksX67IQKAOF/8wFwrFg0FTiJYB5WJN"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjz7e+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIng/+NWX7wEO4sBGUJWlMBC8374juKl9nTMVd/VUZsyCRS69oUd6N\r\nTwr3/VNzVdOt4UJF3xpPWX6nY3jEoIr+HB4VAbtKv/WX3xDydvnbsZGDRMra\r\nZTqTDXLvrk/xjG970mnRYEc54LkadJOAVx+ShnGfgj+jYGJq1nBh1MIoWZR0\r\n1hRDaYVUxie65vQE9znCPWWcnAoev3chrUdToOHPjc15C0u17G1LRNw2J7Zg\r\n/8u7QbEvdn9nD08XsfoEh2mv+7sRraXo1FN+ZUl8zEHXC0EQxGEnlQWIB/aB\r\nw0/MQBrbNI9xVnPZ4VUkbusQx1ahWM7e7T45pCzG/uvQfLmWUzdtPzWAG6uR\r\nSMM4CLts3R6Il5iDqleOXk1A+sFd/xREesQ2HJGbcaS6PZUJAoYumylF+v5v\r\n+QmB4AInP5fKcZ6nG2Q0YNXSRPgApiEilvw3gfyMBbyNA901qjK5Dkzcr9Yp\r\nOPKoqggXf+g9rXX1wLrX0JdzIgjR8sxKqmNStKgpNKT+cikmFoY6XtphxAcw\r\n9ve1mzg3LtRU2GR9t49miEhdWNOU3cQkGhOd/GIZjRbQuKUmeWOpbJEwNySn\r\nMVgA1xoXuurJkMJfYz7ccg/vIaO8ZLPEQvVZVRgLoxlsZKVaUT4KnXx4ixEo\r\ngdnYXSWIJdHaOloQWq+S5O3nj/hA4RKAKGk=\r\n=DL8d\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-05f8972_1674557374080_0.1618935250178999"},"_hasShrinkwrap":false},"0.8.2-4f9ddac":{"name":"bls-wallet-clients","version":"0.8.2-4f9ddac","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"4f9ddac4b8fe8f64ab2a6bbb5579e470e3eebbea","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-4f9ddac","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-Ea4CwA4I4ZNMZCip4OvwYAFTdSJn9n1J8yekt9FxEnBvolx8/cIPBNz36Ng6QuaJIqRiNSup4sArJLANVc8/XQ==","shasum":"3516a1dc001faef62af0cd1dad39c7f4f548801f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-4f9ddac.tgz","fileCount":601,"unpackedSize":1404886,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAOW8YFlEr+7pNt8o/R4fufXdR3oLhB6z3pAxt9xuf4KAiAKUAtapmFiwrKz0PWXysTdlTBnC+tW5DRVra/2x4ZMDA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0k7aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNlRAAhf0p05nDdt/3hXvSSaahshaxo/OP/wvMkvIJS8zJupM209jK\r\nkFb6OEmLBYMQCw4eh4rgQwb8ICICLZ3E8lDfP1gOliJBUT2VrNafOqhTrVhi\r\npPkHdxuk/q3TY8bOyXomKIXHKbuvYKi5pIuESG3TyNO2lPQTXb3GcBOvy+Ba\r\nClLv2dMFYhryARSsthLvis16iVNN1t+rovLbXiVgfl2gso5jab7T6gxTubb3\r\n+ZKfyBmBg+HtVcGaWoYvwbe+HW+e3vWYFrc/RihzNGiROoY38zvWo/TIFwfw\r\nMQofhpOuIHFewvDpBzbDgWjXW6easpC1bNuEEH4dRbghYsK2f7lNyYapaEqK\r\nXofOi+kjhNF82OeAI5yUEk2cpNY+Djq8pIcth0TKUu+xzzslpPF2lCJN2AXL\r\n2+4k1alLC+ovHTY4E3JVe+No9U1WIzk9S+HIbRwaru1CVLg9rSIOe1txDRRt\r\nn8y6BmSKLnJHRZGLtKWKp1iCKZa+qto+hWi4s+MQ5VGHk1uMDnMbtjQvlaUG\r\nwkOYbdMAFrIJmA99uORY86AxaZR06Qa73+87DcsNZd9URlkaN4wDoUI1iN1L\r\ncbqoMBnJd1CpKE8H9oKULLG5ZYrChlCaRLTJYu1l8Rn88M5hBxOWI3xnRTq1\r\ndy8GAKtwmiWsIh/pSqY+BAp1Yjwm2DEl00I=\r\n=P1qB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-4f9ddac_1674727130502_0.26578459325636405"},"_hasShrinkwrap":false},"0.8.2-d39c16b":{"name":"bls-wallet-clients","version":"0.8.2-d39c16b","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"d39c16bfdb814ea82d2de968d0312428f48de34a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-d39c16b","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-MBfe4EkJiC7qrOw3+OrKDwJ83Ln+uMycbGrohczMykHRALvKBUYQ7lvYoxmiiOyO9qpbHDCoaLabVDHMapnJfA==","shasum":"b4c9e7fbe1412c667c375565320f505c532e111e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-d39c16b.tgz","fileCount":601,"unpackedSize":1404806,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF7rrWU48Nc/dQwKD3nAemUT6AtGWCxfPwwWGKTwgw+yAiEA+V57f3NUMA2hpIh15sQPBknoEHDoaYR+AjltmyVWRXw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0nV5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrpew//aodR/iPn34CdFtGbPpuAZVyf7XVBD8xCPxwOAggsDdLl/JYq\r\nzAih2KzKnP+SPHk3RS1lA8nz+Cx7n6v1opnjF43KQQdi6Ydna6vMRnMM7XTL\r\n5YHUN88RsE6Rj7MAGYpCdH2MqUUJauvEuZPozuCQdyNoO6eHWlyRNLqqjxzo\r\nhxsLSWhEe8dGBZiiV97YpPpGgiuQ6u5kBPGS7QS8J++L4OpinJuK+0Vf+Z1P\r\n2Y5aGlpcYB5YDZEcSlg6SegcIjsxcu4Xo+Fn9ohv+oYw9w3wA3bbac+EjkHJ\r\nv5/cNnXVUvQfq+VAgJu+waUW6aMZ3Oczn5mFqdtBggPkXoZtRfbXc+g6Oi/8\r\nLjsGvoQXTjy80HdG3jEqh3VbRkUFsPSiXEao5AfvTNDrLsEjZn4s+7ZewFjg\r\nI4c5afYMw8amT+ut39SClyedGHU0iWeq8CHcYix+9P9zn+KhAcDsPjGhNvL5\r\nrb/RUID0tXEb5A7ECeM5YXt5wQyLLnNCc9for4cMV5U4f1Vlf5oJjiVgpeA9\r\nxHlwXU4wg+z64jWPrs28ezBPOWyaEDjEa3/HIUYq6uWIwP3iywpRMB2/80jJ\r\nNKSO9aGruUJqBL3sP4lRfyZUQ+6l5yG2g/VbFibW/crwycAPupzHZ0/L+Kos\r\nCCV1Vy8yXP3f8SnFk4q5ydJWZgaam4/MhFI=\r\n=pCnO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-d39c16b_1674737017408_0.6405263207775489"},"_hasShrinkwrap":false},"0.8.2-f1af837":{"name":"bls-wallet-clients","version":"0.8.2-f1af837","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"f1af837d5cd06131ffdbfe361e0460e47052cd59","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-f1af837","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-OSU/QJucg1bHIHn8q04WokfJyhkOXvCTMBzrGVLWaNpicKYf/oWtRFZ4z1/R9DFFSZ0hj5FaBQrxb0ovvEFf0w==","shasum":"450cfce259d80e4e169ed20f90c92a32fcd21ebb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-f1af837.tgz","fileCount":30,"unpackedSize":58455,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA7jzBVAeGeSAevkGxrnh3+p25AAQM25t8Ab0SmJthVaAiEAtX9nnwE2IHrXPCsrIKMqpgtcm1+AaekZ+GBtJPKiPCM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0qyPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoSZg//dHSmFEfhhMRS8YF3L/+b437KCA86CFsFYxC6J7hgUjFePYuP\r\nptnBeysmYvzN4cJTIGufthMCt5zsaV/jp4DHN+IZK+/M4rFdGnTMmWBf298b\r\nH1IrwlOJ1H3m+bQ/Wp/ENZgJog5TIj+sEkWzoV0uTi1T/oEx152r3GHaxMoA\r\nHLheLALlQS+67V7rb1UdyGEfXWGjo2fqns2KyhgObkFGeh7Jk8p6MCeFwuFl\r\nrOQRxd2SZoavh42GxX0I2tvlYU7lDKsmfOq59CIti8QmBLpBnAliaWQZ9qig\r\nyQznVxttUYJy3+IQ8PscAC8YoGWOJvCwllkfniTsBlPzPd75lSUEujZdx0z5\r\nMpM58pl6dJX13VPgQF4usFHSAwzHqJ2L1VIqeVpa3zzY0Bw16BlQSz4Zz15h\r\nuFLEgQ2EwWmvTf+gQHvVJBwXas3MMMXi6nxrquNu1zehLDykMqEjE/iqnUNW\r\nRBqBsKHxihqydlJYcZ7La3rffaHw2xqiU2eg4PtVfUrngIj9QaK29NyMkipX\r\n2aHXx22RA+vEWjRjoak9I/D+Oq+vFJPFPCyKiPso9i9K+p02zSEDbw/giMAS\r\nsfHMvy56LQUwkngLxFewC/uHnbMBZbhpblinGiJqIAa3I29mCz5lvanYTakC\r\nRE1vDrCuhUSUxbcRI4uPyh3kTHDCvLVOL+8=\r\n=eIjv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-f1af837_1674751119739_0.5475971602576131"},"_hasShrinkwrap":false},"0.8.2-f1af838":{"name":"bls-wallet-clients","version":"0.8.2-f1af838","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-f1af838 --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-f1af838 --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"f1af837d5cd06131ffdbfe361e0460e47052cd59","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-f1af838","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-gqJf8tcBirSANdW6gyEHgadInqqR1kDHmnlRb1d4QESqBwrk60P5FY9XKf27eLikYxN92raFzNNDWdKT8yro/A==","shasum":"505e0761d34bbebdd7891f2784a6a5d3b40b33eb","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-f1af838.tgz","fileCount":30,"unpackedSize":58502,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC768QBDCDyd7BC3ixMhRTNYblS2feVXezcovOgq+HxnAIgHS/X3CZ3xn6m9j7ve9MaEDhp5oP3kpMI4WsEMpm79UE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0rUTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqViQ/+KhaJ3LxwAineIO7rZhbzvQFcCrS4C+HJBk7rh5tAZKTvJm09\r\n2+0IyYjAFBkwEv7lSB9mPN8WSfmh53GHMpLeVjRCf6CYUKOwz/2k269EX423\r\naTVpMg7gFBDEArsLRX6Xa92laHonFYYMZhVEdw1o3aY83Q98q1YjqpV11v2D\r\nLg1cszpIuIqMiAsQ0f49Wa993bGebNGE6DisSF9nhonmNr5cnCcKSkG02Rvi\r\nxJ9pi9d/Qf8Z6X0ZqvfXtHFGOkSIQ+iXSesxavgkY1yk7MIyjeqp/zFfq6OJ\r\nxtNHAjOwr0GTRgyfItdyvXrhVetAy6K3VDdO+5vx8EfU6wSPy3jcYYLrJshG\r\n5qzPyeeYkvpROON3wBbewxOF50gARVIy6IcoH18YgWWpTjTQbV+QA567doOJ\r\nAKWV10XV6nnTAMsT+B7H44DUWs24Dv11sHLk32ya6qEsE2d0dS3lfcotvYyC\r\nlqGKgzezzwTYgrl4HMRFnI1PzAYSsAgu5zmQHdlo6BhgRwcsWdFUPH1fynjb\r\nfXqw0/fh43Ko+vM9fW5Q/qOvBrbqCIZHNNV70piHF+fl9HpuEu/ik4LKvjwf\r\nBx0iCjgkijVMLnb350FMCUduzFAlSDYD4zaFgXbPjfdUceAw7RS5BGFXomdt\r\nR+mWZ8ShTAJs8qDgkN7ZzYk8tsCiHewmdh8=\r\n=Q8yW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-f1af838_1674753299597_0.9201213305609834"},"_hasShrinkwrap":false},"0.8.2-f1af839":{"name":"bls-wallet-clients","version":"0.8.2-f1af839","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-f1af839 --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-f1af838 --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"8fa0ee2aac669ce1bc0d3f6fc62dad0d1343607d","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-f1af839","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-tHBMrQ+Kroy4/sMWGz2eiwJCbiEVzXqO9djQoTPNY2uVWMenrkKq8IUpqYFvWrrqM8gVDwOxkTQmg2eim+dP4g==","shasum":"8f00b90603c698034b152e49da8e936217110a62","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-f1af839.tgz","fileCount":30,"unpackedSize":58502,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDplNDy8ut2DjtUkMHE8KBh61PwEsQOsgUNXZs4Nd1gAgIhAMADWSF0w3D9L+SocO69YKbazzYz2XawDhwnEEyh6XWc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0rpGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbJBAApEK2LWcpxGmwh5xeBSQxXEuE5dpOsox48bqCDA8MM4pEfM07\r\nSgHn6/5YVm5ujsu12yiEYtIKYgh309hHwthNnXMV2HSgDtVG/5nfBxvyXpzF\r\nBTT8De5Uu34GVCUwmN/aEwu4fsCJM9STUZRyq+25Zf+XY+oeiJqbJS2uh4kI\r\naNNTpOxn0ILyeRmvilpJsVmjq4jYAFMMrfkOtac+X85JmIbI9//AepkEQ4ox\r\nRdNjjUHUqFk+AmyQHPIiAE6GFaqFq3lC2sz03BNt4UUtzVtVaRKU3kW0Prxd\r\no3aJujQTlBavEB43e1Xf3EkFZ2n/bxbsanP5/TYask2vWdPkR7rZzopD67MK\r\n+MBxEeSfbqhBjRFGpopjAUNg5vaEJ2GPIlNqwIHwNbVPYmrFF49GgD79Orgl\r\n/1dzl4wmEWqxiUxJeVr7qKyJQ4ONAco1QKFUEzGkedXN/90xW3KE/X0WL0uD\r\nE5oMCW53ZllhWgBxj5ck9AP/M5SNn0glhItgYWV1AJtYUx0ZeyCxWUWZBMy2\r\naAkxY8kD9amjEY6HoY8Qu5Z6xzMnHhC0xjQdvEldIQjW86eKeD+7LYSVZv6d\r\nI5yBqIdgYsHgDqTe4rhaBPFRBSSWPX2/VIJsieN68KwhxSo/SDXhSRTIhYfK\r\n1ve3COdYQwrN4HZ1uscVuH9e9SYScszjGdg=\r\n=xWDR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-f1af839_1674754630528_0.9323084089522047"},"_hasShrinkwrap":false},"0.8.2-f1af810":{"name":"bls-wallet-clients","version":"0.8.2-f1af810","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-f1af810 --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"d8a33a99c4d0bb2df2c9399c51bd2c70bdd3bc56","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-f1af810","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-LCl2vC9qqcUAdQHGygskcOD0DMy9yJ2ldXoAStOOxgJg7SfhvJhcIfy0WaZWEqon+4fpf1gxSJjLy/6heOhnmg==","shasum":"2484a191a2f41b18d3c21295da27d89158505400","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-f1af810.tgz","fileCount":29,"unpackedSize":58795,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC5CofkdxDpF2lSMQREjmIImGMJSMFcnsI4vBo5lcm48AIgThagyGZseaTOZwNT3LMizvSTfOjOl3HRsj82GRpUqqs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0r4ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoVpg//U7URsvcWjt3xp8BUpSK4UqHw8JXA+jpulTCkPTTbtvvWRJ5z\r\nQwvCDvBXGNwYfG5JKHni7lJLKezBtY2+FWnJEJZ37SchSzPy0Y78JWb3rcu3\r\ncbDr1jh+IhKfqAflSaESQzX3I0wqxnOMx7TS7qFlm6wIaE0181BPsa1gnPzH\r\nM9UDza9oNkdaeVufIr55NAZ0WMyodCCz2NYZEhFi+YuMQGzmzH2+E6g4DwCw\r\nNyyVyrGJntiPXmHuYyb+EW740oiqfvHCpvPINtaxmPmf+XGK9OqtteRFuJ5B\r\n+5SPT4xkQINgnTYznEU0pop6D+R06CPZ+Ky/zNVv/56iorV4KyVnS/tylssA\r\n7TKfg2F5f7tEuenzhEALyVwXdWe27SFhrDCmqlWKT9Fnam6wTh+ZyX7MlkKc\r\nsOz5p7gsW+LHFIMm809PcPY+1Mo7TzFO2iOX4+YhTSM4F+2R9eS/egzYHrzQ\r\nmHOdbrefZeZuIa2oFSR13BCF4B1KgftrM6pDJmvtKG8s3QirrvkTr7LtmQU3\r\nJZiC4xSz0F7ogqIS3DUZyj0y0EWaC+eFTTyvKsu+UpqQSziePVTvnA11fETU\r\nrt+4RxSHCjMC8ZwzqOrzUVDY7s30ojv8xQ+fLZq3QBfdl/54NneRUuGQSpb5\r\nNv3exhDf3wLy9UjT9fyM2bDXIXuz3alFtDI=\r\n=0ghx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-f1af810_1674755609014_0.1914403383267953"},"_hasShrinkwrap":false},"0.8.2-4322d96":{"name":"bls-wallet-clients","version":"0.8.2-4322d96","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"4322d961f91e2e3ae832af342ed5f54150438c9a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-4322d96","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-2J9L41OPArPppzNujsVjqH/qwg71T3ic5DbNfcYWYn+gUlOmjUGZXXHI6usYnNs8KsPvhQ6fLbpJL+qpH214xA==","shasum":"33635d5b1dbc7869ce7f7d78bf7f0a9504645e9c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-4322d96.tgz","fileCount":606,"unpackedSize":1412835,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFLytHffd+nt3j7Pocnc81VSdsDnquEUZJm+cH+21c5hAiApbxmwYu6zaGbltFUlvclaoUkuYkiQdezkPuhJ0YBx0g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0tpYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBng/+ORvNKYhBcvkiR6QWC+DYwy6lGO9UcODpQH5NOhV3JfhU/9tu\r\njHT9V96eEDsLqAEBocEVIMA+2wfw775ZeSn1EeDy27whBCyp/WQgjq/WNWr5\r\n33Ztxi2lRzFAHaYpnebpFLk0iNWs3LNSkNltrwQY1ntlOW3esgg0y81bZSlM\r\nkWSo6OZetAsj+qBwuiD6gDIINSVciKzBDQ0KldALXYSW1lB+hb6Z9ivSDdaA\r\n3uyONZC8DeQS4593A1wssoohJYcz+LZDM/E5VVwIlD5NU/64T4aH5LSevS5V\r\nXfa8RXdY0xTv0mmkJ4QlQlFqEwtxJuvpjP6Yz1bkKMCDHLlKuFUnOWIR1bqD\r\nvGHTpqXfyPf2fRTP2J2eIUIR2wXCcdMux3IVz7WkHANnlrmgFOWo1P5u6nMG\r\np8wYq93mKiAKfnBi367aQiAamoOwrKKFVWp1Kql0rsiq4YdB4k7ChEV0Tmps\r\nctepSWG6JqcztoCZ+PqaAQLO/3aEvfFOkXm0O59pq62bcR6Xt2j/NC4HNYva\r\nvL3T/9ti3Kk481CwTwcG0/8qTtCVwqbkj+Z37gW8soIsBf4HCQtGoIvZvIdv\r\ntsklCheAjMnESSOEGmhYxtuZPuMksIoxpBZaR9XLVmpA8Qts74iAljrYAYf3\r\n5KLeQJ0z5HaLaLdM1sLFTI28h2G8GpVoH6U=\r\n=cwxZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-4322d96_1674762840574_0.9270207506118202"},"_hasShrinkwrap":false},"0.8.2-821654":{"name":"bls-wallet-clients","version":"0.8.2-821654","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","mcl-wasm":"^1.0.6","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"08216549af432263378198714f9e3370cc94194a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-821654","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-jOH7nvf2CaAo/JBU7QPEz6qGHX3Jb/byleZJYv+AikEBXsDtFI5nL8G5InNqDLysAqFJV9sqgs3my9uiLAEekw==","shasum":"6b33014e254fae2b3e08739217d1b65abc3ca4e4","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-821654.tgz","fileCount":601,"unpackedSize":1412649,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSEzdntrYSbxOTcabjHA4ZoHxWj+oGuY5zUmDXqaE5lAiEAyU9WtsyjSS+6OT/9Dsdu8YUZef1oTISAmWYaiorDdVc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0+LlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG9g//QVK21P9r+nWxmmiL5WeQffkfbfoFQEMrjbY7L1E3Bre0qwgo\r\nm6e0a0ZBxKPFhcwQZD6Bcm51RW/0sWGcMWq3PvL5dJEM5hZ2XRY4va3jv+h1\r\nvbwSpOpoeE6jWyHkXaZE+aHCJo2+DOXaoaVzF/E1F9405HP/7eNOnf/Sv0aG\r\noegbJL+Pl9qIZwFpmZhZ0X9RxWhpGF+tzuyGIFN+f0qu4SY6qZPBMIRHVuju\r\nikp8a21QFcbRBY5chUa2NeJm8lcdoAeV/uFXyAzWUNPDucitq5yUfsIR7F8o\r\nMVpfo7Vnuxe3VN56e+TPvroOmDF9ca6mu5YjR/ivRvYueQ4eYv2QE6j3YsJH\r\noFM8K8fs1JEkwssMHbcle4IH3/ZgOxlovS5yIMjt3SJrKe6o9FhLG2wK/mnt\r\nX9ZdZj9k9Tj0odvBDGPm/PonUeYn8/pHykSpdavhPJ8feYyA1TU1kyjfgjTg\r\n+lE1kGSjlJGiUVe8GAjH895H3ES9tAcTgMf2J1qpgZnLp1QWHxUv1bgSwIqX\r\nkpBwcYVAlax2wGsij9+UGjaU0tr2dDo+h6+f4fi8NDHEgLYOI6T71v82iUi3\r\nCwrbFy+Hbr2HWKnLsJTqAMGZoQowQJu145zb6TXNqovPd0p/jKoNmHifBHQr\r\ncP977CQdYsRu7TKZZOY2/iFZ92/tEzf21gI=\r\n=rYYu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-821654_1674830565344_0.6576378450802984"},"_hasShrinkwrap":false},"0.8.2-77f1638":{"name":"bls-wallet-clients","version":"0.8.2-77f1638","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n*Client libraries for interacting with BLS Wallet components*\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n```ts\nimport { Aggregator } from 'bls-wallet-clients';\n\nconst aggregator = new Aggregator('https://arbitrum-goerli.blswallet.org');\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`.\n\n```ts\nimport { BlsWalletWrapper } from 'bls-wallet-clients';\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(1).pow(18)],\n      ),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from 'bls-wallet-clients';\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\n        \"transfer\",\n        [\"0x...some address...\", ethers.BigNumber.from(10).pow(18)],\n      ),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n","readmeFilename":"README.md","gitHead":"77f1638d50f6d9bf7aa6b23cdb726e24b032470c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-77f1638","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-2gTVHUvs4+/fBwgtcZCO+DsKTnJAiebYrpCUdygIqZaFeHdEyp6xU2F8ZT+XOcNoMeN1B9TT5EupV1RTvISFkQ==","shasum":"61212aac502aed821bc6036cb95a2cdaa9c0b67e","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-77f1638.tgz","fileCount":606,"unpackedSize":1412198,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwHynnOxoZdV3VK5GP2ODeMvhwWHIFfgxthl1b5jZqpAIhAM8waH04MV/kkBeLB3UPcPp7kGoT1exQybHUDcrJuUqm"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj2nuhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo94Q/+Oa0AhIsLf5XkHzd8PXyLkNd2+Nz6mx5zMiOTwj81WA7vjx+i\r\nhvmHxh21e5oyxqCSTvBs1m2QW2kch/iEo83hSPO2rcaT6GdsXzv+W2bHrPu6\r\nmPVQzNnGsf6ZJ66y8iRDIouNTvdTuQoZSuUB+lsxEEyaqtMnarq9iDOwwWRG\r\nB5QIPs4nj7+rjPENrLO+a7TdJINdo9m7eNgUL8qxx5jdF59g84NTsU6qCacy\r\nPjF6QRWlvLcoOziOVzBQOjmkojkudcJFPB54YAtQGUJNKbOYQaoEpMAMydwW\r\ny6VxGR7ei49th35QQ1FEByOc8XbZs1vhMGYt0t5XSzAXUfHZHjiEZ/wxm4Nl\r\nTj8fIiG2M1j6Qh007ZCdpklPD2X+SeDTmE6jWmQi4Hc0fW+ojqRowMF9Nvb+\r\n/+/wRLRu6WKwxh4M+XmMV9BV4+k1hLx6VABgsMhnyjtekIvIHE36uHNuu8gH\r\nWHylX1f7Keps4Ra/3sCoYBhko4FI0KF50wL74uRo9E0UgtmSLF2qWLZLVcCC\r\nFKDdLLApmP6UVwFtHMLXhF3BGPSEHuXBBb+yDvQwI4e7mJmru6NFkGPwJMAL\r\n9Atmm6ltfU6M0rA9CPTVGqQKOQOr3bTKGmDiFe9SnJmSwZGmxAA9z7divZtU\r\nd+B90T/L04kiYFDWd9yGPv/59J3C+Y5xWWQ=\r\n=4OcL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-77f1638_1675262881254_0.3342419126935865"},"_hasShrinkwrap":false},"0.8.2-c963d62":{"name":"bls-wallet-clients","version":"0.8.2-c963d62","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\nSince the aggregator detects that fees have been paid by observing the effect of a bundle on its own balance, you can also tranfer the required fee directly to the aggregator. Following the same example as above, you can add an action that transfers the fee amount to the aggregator address, instead of the action that calls sendEthToTxOrigin. Ensure you modify the estimateFeeBundle to use this action instead.\n\n```ts\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorAddress,\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\nSince the aggregator detects that fees have been paid by observing the effect of a bundle on its own balance, you can also tranfer the required fee directly to the aggregator. Following the same example as above, you can add an action that transfers the fee amount to the aggregator address, instead of the action that calls sendEthToTxOrigin. Ensure you modify the estimateFeeBundle to use this action instead.\n\n```ts\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"transfer\", [\n        aggregatorAddress,\n        safeFee, // fee amount\n      ]),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const signer = await initBlsWalletSigner({ chainId: 10 });\n\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n    privateKey,\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"c963d622a158bf202de95f9cd246a9f8738631c2","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-c963d62","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-d/Aqrey/vOtlyQKazl1+KXxPGuCqYX0bmaYPjqzUxVDfjfVx7wZIBoauurgCt87zktrDdVNxq7ikwpmBoI8EHg==","shasum":"8ab6e5892dcedd1b9037c8c7ed0e3e224d66972f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-c963d62.tgz","fileCount":603,"unpackedSize":1422407,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB4S6SDEfi9xQJT+yA1re/be9L61ILIB4w4fGvsAxhohAiEA99VcGWG4hJRO7hXZRyfkCYOdtxQxXMo2xBR82iSFeuA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBd0FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDUhAAicbfwoNmhQM6JJHmmZ51mFWgl1jA4KiteTp4hDxfUXHyXOE7\r\nEFNuHrTolR0cDxpIUnpmL0uAedYxM4mPrvuu9MCRZ01jkzQdZUVVs7cKu4Xh\r\nmBp6ofgqKQ32JFTFlU/+X/iG45u8dy0lQKCTrxbpK92rNQUU5AcuZnNWoZFt\r\nS1ajPWS4zYReZ7bCVJgDTQpGe8DX9Vmo6IHD33UJX4TRhxFMF3hbA58G92Ic\r\nlcuNEhf1eCCTepJ+BdcAF8/8Gk8wwKU3xv90G+vih//T/X8l/BUEv8ibp8K9\r\nNjbT99M98coT95qTpVTR1t5Wi7HHTxcceH2NAePkAb+6YxXhLnH2IhBFnO1G\r\n1M77py4qvrGVVJRxebRBY+0hBqwvFZ5xd0DBBVBleLqcNF+3Q3CXNZT59ju3\r\nWp02qla6sWrlUJQRKdYxNyyHyGGNIhzmkBDuZ3Er0k6BRqrcEVmOEulW2E6X\r\nSVnQXC4Xyg2ZIq39o0+gJYS7qAXJXNpROhZ2WTZxeljmotmYGlxtXX7uY7mk\r\ndRy5bLXO7zjTfgcqxKAnWji3i+sHaqotT6uTD7IBnppkPoyApr1OxnsWfPKi\r\nVi+h0fxD2Th2re29qlGAWP8sEfThMs0+9qLj7A123S9bnDsZLUbD3SsVWyf3\r\niI/SbW/XS1JD2CzLszPhy0nHg7NZ+KnPhpo=\r\n=+qVj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-c963d62_1678105860950_0.9721996538271025"},"_hasShrinkwrap":false},"0.8.2-1452ef5":{"name":"bls-wallet-clients","version":"0.8.2-1452ef5","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\nSince the aggregator detects that fees have been paid by observing the effect of a bundle on its own balance, you can also tranfer the required fee directly to the aggregator. Following the same example as above, you can add an action that transfers the fee amount to the aggregator address, instead of the action that calls sendEthToTxOrigin. Ensure you modify the estimateFeeBundle to use this action instead.\n\n```ts\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorAddress,\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\nSince the aggregator detects that fees have been paid by observing the effect of a bundle on its own balance, you can also tranfer the required fee directly to the aggregator. Following the same example as above, you can add an action that transfers the fee amount to the aggregator address, instead of the action that calls sendEthToTxOrigin. Ensure you modify the estimateFeeBundle to use this action instead.\n\n```ts\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"transfer\", [\n        aggregatorAddress,\n        safeFee, // fee amount\n      ]),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"1452ef5f4a7d0f1bf9b5590e97fd7d3e0882b4ad","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-1452ef5","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-bg7WLr9NRbvDzj+zgkLNfaPzr1m0m13Cc8RJoZ2s6s+ic7WxSiwxTkZGc2SChFgmG8ZGi1O9DnR6//lrTsMVUA==","shasum":"d76e938ca45ec5da44c8e59699d1bd5f6c69dcd2","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-1452ef5.tgz","fileCount":627,"unpackedSize":1489009,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE2lJXRPn2SfYWytMiMSl9+fVhBpieQheurWMwuJEQUWAiEA55pQ6H++wG4U6rSbI/I+Kk/L6u+IrkgQNgK/o6PgtSA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBiDrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMNxAAgq0q8EfY8XnHL6zrsnLgsZX5V7BxG1/+zDd9M7uONtnIBs3O\r\nVSHvGN/OtH9gxgkJ+eYIlrCo/fueVOdDDUi+u3Ba9+hz7I5Z+abCTsJKFFCJ\r\nUi80LZWj2UPp9f3v0v+no9wexQHubqX5/4Ki5HuhndP8kD8wx4TjhZOomOef\r\n721XhAMfPsYc60lObK6d465YVzjBqL36A/gK3f4jprRYlF6qhVKYxf+jLLxk\r\nij5u8vfESNAaEYxxaCatajk3kam5dMwuH0NsCTFs7X+G7lyVOfFcw5FP57cx\r\n0VTNMK4leN+c2OM9iu3LvSThmenLyMz9jHIJnIPW2LObKNlyg5ehPNwYbZsW\r\nNClIBiYPOhJn6BlYaBCwhhykNS0ACK+uNEu8VRGw2jMGqegCI3jg7duhlMIj\r\njACs3K0QPBYme6z12hM9DNRQWL+5XuaMADXt6MjhCXvtw3GrwdRKBSq6medw\r\nOP9ve3hPXWkwwCE01jIcxkjzYSofHgBPiBBgStKDtm44pDicHeVb+RdkQgGp\r\neVcoua1Mheoygytxwmnmdz83rQ1KhrlxXsuTEnE5Z5RRwBF0kZVYHGw2DfnQ\r\nwucd3f/hQ/KkEXkKnHpOedaScY2DXqhFh1cJJSci0PcYdyCJe/LgaX0mjP0C\r\n/GAYxl12NE/9YlsIPBH+F5xPNvnLnydXoBM=\r\n=05kk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-1452ef5_1678123243042_0.7309345511117133"},"_hasShrinkwrap":false},"0.8.2-1fb4a55":{"name":"bls-wallet-clients","version":"0.8.2-1fb4a55","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n  const verificationGatewayAddress = \"0x123...456\";\n\n  const signer = await initBlsWalletSigner({\n    chainId: 10,\n    privateKey,\n    verificationGatewayAddress\n  });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"1fb4a557abc4c201b86c3ff21b5c0967aad2e949","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-1fb4a55","_nodeVersion":"16.17.0","_npmVersion":"9.1.2","dist":{"integrity":"sha512-2tlwOSUGzsOiam0G7GBmsN3W5cHjUwTmHR/DvGRH584zLkCC/8TFdAn2/laSF2baTYvegtIHwQNl1zX5DWivEQ==","shasum":"bab40801ee1e60ffbc9c0bc924943c6f90605e7c","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-1fb4a55.tgz","fileCount":632,"unpackedSize":1537332,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGWMe6yh2P+t23s67tulugXdpVxbQTBV8l4tFTGU3YvcAiEA7fg8ttSjLMHXt2xWBoRDfmVbrQLA3QT+Hm7g5V99UAA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIvlzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPbBAAolj6Hv7DT+x+GWsbD9vQdT0HQrtW+tW+69i94KyjHTE0CNLk\r\nE6ODbKkgWqlliAKrqFvS3u/VAt0FlZ2KMCIDLdXlHj1PVajUf/ZIZDHDpjsc\r\nJyweth4w53BhnMdqLA7x4lEx5Fuyp9Y/RYjzaKM+18ssmakN+/n0O05gP7ne\r\nYbGUjOqVOrIIdMY8z8lmT+Pdt3SdPN9qngYCFHvgdDiwaYh4uU2bOhxz10tA\r\nlGmEATnWukSaMg3vmltaZ1FUjIGCqIJMjI4tAGOSetLOAzlvYx3FIdFZD5Sv\r\nwQ6RA8inpztFcNfnpE+g9cVdUIcb5KpMhmgH0+EG7FgigqJ1L08ctk/N5UQQ\r\npcVc2nBRXKsweDD6sSHqT9MH2CiEPYpePfMelyF68iSdjTeFItNATgFZeXNl\r\ngfF/wa84lHjXa0K2YZ5TkgWmT4L/DZenhepI9W6tzffDWDK5d2ssqLWBQEzn\r\n9oI8KIDJgyMo6mpx6gbC1X/G++yh9OlhGfczQcR8Ka8OxlaNDptm3Vos+sAM\r\nplsJnq8Mq/lIYuZV15kc8CEMJVjiO34xZf5IuTa/TfNrBQRwKRpbOnCES8hk\r\nJI+f+kTDqlnYQlM9zyPZLP+HAtZ6MJ3CODDBh0UTtyDfHdmz3CDcJON7fK6A\r\nIs9CJixB3oOhtHCCw21IySBj1ugUBHlTrp0=\r\n=0nHz\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"blakecduncan","email":"blakecduncan@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-1fb4a55_1680013683356_0.5394838173232472"},"_hasShrinkwrap":false},"0.8.2-b988fbc":{"name":"bls-wallet-clients","version":"0.8.2-b988fbc","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"b988fbc92c7518a62609b10953e68449f4b8e1f5","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-b988fbc","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-aHJWIDo0QUv+fRJQYt+0mVevhhw175dJbEhIgVXcriF0TnNP95fffnxtj1cYGgcsGX4fRFg2MtayTxEq9gregA==","shasum":"211187149a3e9087b19a9407dccfc593fe2bae25","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-b988fbc.tgz","fileCount":744,"unpackedSize":1897682,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCEhnw+8elLXs59aa4oOfU8609CXJ9//NuUj7K1IkSSpwIgP+mdEVImjtroUVDNZAzHqBphs76c37DBn0KrSlE0DCs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJBmMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmpA/+KnlPttjRfEY2MU0j14bvnkVc55glBDxlth7rSyAXtkFUW7cy\r\nrz0K6MrWWMLVlKJFg6g309DqurAbCBOSXEUEB0Up3pLtgeeLSLZWnlAk2FHh\r\n+bI9Lul2AYWsCWKldILBWTQ8HiWCusxkc5lzjDY+JOdyoTZS5eiJ5gxl4B8n\r\nQ8vFmwFxsrbnvjoK+XNyv4yzNzj4MHfLY6cjWzJzB1jYF64onoQ3zJJsx994\r\ndfpi6Vs69j5RczRBKzwfi3ZX38eofNk9VjRhBGFAF9QWV5pd1dC1locaIExt\r\n3xRheSxQzB60qDtLIgeGdanpcraNOCqnsFTx9yhrrLXPdKxHjfd48uKLgy/R\r\nrTXti16gSgZCbDmWzFLEZcb554U5KEd62AZ4cOwgo4hbJ0eVSXnRkGhw8ZEV\r\n51gRblEeBVVrRiEbYvB/FenJHxi7UTbPy9E0A6JAP4K3faRUBFqc8d+F6ft7\r\ngHsgXnpNPxO5+clZDfhoowFlTEdmJ7MbteQeeqhactqdl4zWE6ONI3QNBxj2\r\nXVrlEIzknsj3cf5pdH9uel5CCLrBEU+MyLQmVopX0rVjfvmxCyFr0pznVanX\r\nBDx0SmuTc8PRodb/sORohBpMV/Naqhw22uhzlyWC8G1PDrzRnC4BFzBBXITL\r\nm7Mjcj30kwPfyxVmPN+XyqVN891OOoZlHx4=\r\n=s821\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-b988fbc_1680087435974_0.7660686477260223"},"_hasShrinkwrap":false},"0.8.2-de12b3c":{"name":"bls-wallet-clients","version":"0.8.2-de12b3c","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"de12b3c62fe00656225d20c4dec91c2c7c38af89","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-de12b3c","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-quoDibpDL3Injw4b4/2FjhMhH/Rq9hjO4n7sVMMa5jRe5Ttd1gCzCvGMkvNpL856k7zDxV20PNPxJf7GQgziCw==","shasum":"819ac2d80533c728900616f35918353dd07eb2c2","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-de12b3c.tgz","fileCount":744,"unpackedSize":1897682,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZzU/8IX13XkzGN1eOfvt4os13bQhERYD79JyD3fdldwIgehoay37zzNFBsW4v2GB+bG+FU4j8YlEp/5tKd+aXzec="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJClCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmonqg/9G/UipCFSZOKl5at7bRQzP/7TzBi24JDrfyO49Z/xI1d53ymt\r\n49AglY1Sv7U4CvZ5ReSPEv6NTIYYM4YozOX7hEHd7esK6KtJ5ffzzzVbLxGG\r\nhlQ9knEXyLzGvrnO5TBS/jxjTi7NX0fLQCLy84dJPebukxefEHrtjn7Ilxfk\r\nRE/tPhFPFR+albIJt4RW5HNELAvQmKOmBKcEIyGhfi3cS+zA5O+axxUa6KAj\r\nVHZSJdPyAnh2IfhkBiJs/mpiRbI5o+jseBlHLS15InZsY+PUVvpK/LH2L80S\r\n3dgEddGSbDiXBeFwa7rXMAjy4SFex+P+MHcqfU57OFIy92b4qeaERPxRIJZB\r\nXujH2I3juVYFBBkGlRB6sX1Xy7w0+d5EU8XxX2kDuE334mPiANWU47NFrzWx\r\nmMgv8sceZ4S3JB3P1QMXBOHq90YP9NPVIV3ITYthvbsrPb9FPa6JAxNW5E8Z\r\ns5F7Jr2V4vvZZw37l7pmCsLKFlR1Q1fKPALJ+ZklE9bJA4ckmVZ5t7g9AGMV\r\nGl3vkazbEN/j6tZAdENWczlUp2cSDBt2CT74aNKaCki1I7Sz6ONyU1CSXeJm\r\nn8Vuryx8yM4zbe/6zCoLVyc+NNeotR6erh56SPaSG7iSUFW8ISp0LXc67ukU\r\nvsX0iv5ymadstHFKhY528Z5JSeOo4pn2Gbg=\r\n=s6St\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-de12b3c_1680091457777_0.6728379285538462"},"_hasShrinkwrap":false},"0.8.2-4557e03":{"name":"bls-wallet-clients","version":"0.8.2-4557e03","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"4557e03cab8231589ce9676363918dbb13f3b740","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.2-4557e03","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-yL44ov5PKEV5Jt1iHAcns4XT9AKai4ETABI2JRP+bFUMzUb//ZfzYN4iqnLnpDqaLFeELPXHEuTPbKhFBqVe+A==","shasum":"473e271a320a99af3143b9d29942cd4a1520fcfa","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.2-4557e03.tgz","fileCount":799,"unpackedSize":2104076,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHFHm9MEs2YB43y26YCLTYFGIEOmuw44ihk3TLX6dyhjAiBDRGj9ywoTQNEcOqQ5OAisclZunlk0sLrSQZUBDIt/kQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkK7tfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrWag/6AhCH8rq+BqgrjL6W/wNVPWc5AwSRKvgPvc8Vs3yLd8GBcIUi\r\nP4oofIitM6pA6rw8g08z8DG88y7f1UIqNq1aCLGZ/lAAe+qS5IMA/xE3rp9q\r\nRtb8tTAxCPfAGPjq36yiEPnTDz/bFsnEqHaOe8GPkkq02dEuUoML8/ERhamD\r\nYhaiymf1UniRlIN3sXOovgZbmqJY8hLy/DlKQ7CfY8cFSULcNxoPhviNeoP3\r\nocK33vZdW2W2qR+JE83xY2meBXLMod1Vv7/CbrIAznSJHYPJQptHgCzz4UKB\r\nXMHlUQnu0lV7B123uizqHFy2Q61tYduSydY27wMA0/x/aaeWj8NknQo5Tr5Q\r\ndXqmntZ/qsRc9cYMDSmNNF3tkGlYCBatoughLdoi1IKI9WHmsC48B009I4D0\r\nDpfU4OZdM3fm4ZUwykQ5Rp5OdWxhS6yzLkyUvnmk5vRiCegnbOnvUPbrRZJc\r\nWWqPKq0B3zLc5fVrbpi5uFHcAroYf3PV43J5O5MtpEnLBPGCodY1nYRnLJk8\r\nMCuAYccoxraNFfeuHKGMVuvq3RA+pJcFBnzn9/YRRJGN8PPt/LKtllLTVbZG\r\nyXZknVahIGtd0F+U/u+mW+h5hO6i2Cj/VFPp6Yu+2d3lkdmW9QXRNnjvkn6X\r\nHqifO7YEhD5DCy+ASEEbocgDA9Kz5V/8758=\r\n=atAK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.2-4557e03_1680587615216_0.32902733562116304"},"_hasShrinkwrap":false},"0.8.3":{"name":"bls-wallet-clients","version":"0.8.3","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"_id":"bls-wallet-clients@0.8.3","dist":{"shasum":"7d3ee34ad3508ee730f3c4766980301bc3625d61","integrity":"sha512-U5CQ7dZXIDmThu7spZyEhAgXyZ1FkamQk5jjV024L3egPr5zhenaeghdRqnjgp5YJ0PuxeFbe0c3SC5s42z7tQ==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3.tgz","fileCount":812,"unpackedSize":1897674,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRsC2vMSVnyo39g58l0foyvNMg+Yt/3M4/Wu1rvjjrXAIhAIxA70II0Yak8TtbxZON01chCQJ7dyoPqKADKCLqW1LM"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkLGfeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolHw//UJ87nM7/OyOrQyiI7obop5DcTgv/LEQzvX6jJOK1MSCsI0bM\r\nIQPbU39YVO48NvvFhSDCwJb4fnSl/rNC0P7MpNnPyD5YNcOasjkOu+DDUv5X\r\nDADdASaqDvyBb7es8shm//4d5LGZJ/sL7vaf6lNgVX1NST6POiC6QQMONnfZ\r\nz4hogMEaMKFPuASRi3n/Nod5NZ/Nf89JDryQ7xd5NKiGnzdGm6hWde+FkhVS\r\n4ENr7ISLCxGecpeAHMDEvaiFwreC42x0IHmt+kpxFoiF/x0DLtJciiptvq+n\r\nH4x7Pjat5dQvYmPT53j9D5ae9TqNuH8FTLC8bzzrgEyHM+AsywoW2YNHwgFN\r\naXo6PBgYVJPWo+/fhc7TPAQaUbUlnDU5gvyOlvTvzLShXaP2xregQOAGAM44\r\naRg9kWW9PuOxRyOY5siXnVEmCRLPWffW0468DsBvqVas3dh3d0R5L0HvFia4\r\nZzGWs+0KO4ES8GkzxAVOmnYcP8lN/9T9PAAs1BtpuK3Vy6CUMUQ02hGTdryN\r\nQOH3H2FZ/5mcIVWvuGahnstqIQGujYhcHuRkitxsnSva0qTF87ubMJZi5gbA\r\nN4BhzTsuBP9h/hZO9t/j0l/PGRn/2cW5iDsjQSmhNJ96nKmoIPKT0ctQMu9a\r\ncY9nP8khYBf99gsfxmKINLwU8HU6vaHvqBo=\r\n=0yCd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3_1680631774232_0.8377829701136257"},"_hasShrinkwrap":false},"0.8.3-f6ab5d9":{"name":"bls-wallet-clients","version":"0.8.3-f6ab5d9","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"f6ab5d93ed0a6f298a2a9bdbc55af5bf362d8913","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-f6ab5d9","_nodeVersion":"16.19.1","_npmVersion":"8.19.3","dist":{"integrity":"sha512-SGFIXr+T3t1DI9YkIDb1yal+ROZ2WMWsJxSKlUYEnTA1xqpwZAmpDhNqBclobr31E691ELTthp0X3miTP7m9mQ==","shasum":"020c5eb342f84aa5012133915578f4809101ec59","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-f6ab5d9.tgz","fileCount":794,"unpackedSize":2157791,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOWTq8YHlIb2EozSOHtAXDnIWZYmmNso2G5n+m4pV8WQIhAK8VMrlyWHtCRRKk7ZUAqJIFF3fpykPcrzSi/qe6kW+n"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkNeneACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqyZg//SFS36LNknx+/eslux1zgOtANWKc/T95g2u/9iNsBfiPnaTgQ\r\ntJsxfZ21gqNhwvmdhKJ9hcptLc8QK+XWJvcHj2oaAU9Bx0G/yO4biXq3Ajp9\r\nZCEbYMgiySrUNxdSWqzG3AoxVf54saRGCRYcXhjmStGcpytnMoGwVm2HgMYD\r\nVUlnRHrUfXd+TE9CFJdd6H269+gEzm432nRmNtwok8zV1H+F/LaW5orp6RqO\r\n/8YpgWSdRRyXb7XgAJQDdsbI9pbxS5yt0gSO6HdWrIgbtlLdE/PVUSBZ4Syo\r\nounHgKyOlOTl7qHsx3Ss6knzfL+5GQtBExcWgyfXs3XAxSpRAxUYd3MTzDeb\r\nojF8FhqOGZR5pzk1QEGIlFbmLgOx5Kzjcj9Nd6gzDcKh+63sTYkD15aWzTMs\r\n+qKKTQeng1fOPVvumpZl3b1ZJgcDmjkzt+0PyN5RKGQZ0hqJGDeO0ZXdGP+8\r\njdvvJFv37DxNAI/nOkOq4Xk1FNv9YCAXDNWQ8EIOyX8ajCWURLXHtfM/90zS\r\naKQj0I/hcNpYUM3YHCN5y9+DxphfpWOS9w4LEIcee8sLMByBph+0Plo/JsDi\r\n+MJrnUNAzRK7YF3b8ta725Ui6t0MgkkjCV1OrZSavGxjbTGJx8/1p08OB8FG\r\nKGOv07Uzgvhe3heQ2qt+yBnUkZ5nzvk1Ye0=\r\n=tDrs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-f6ab5d9_1681254878704_0.9737754083562729"},"_hasShrinkwrap":false},"0.8.3-c34db60":{"name":"bls-wallet-clients","version":"0.8.3-c34db60","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"c34db600cd089cef78c39412a4d8f15a735f478f","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-c34db60","_nodeVersion":"16.20.0","_npmVersion":"8.19.4","dist":{"integrity":"sha512-paXXfQcNGYR9rS9A5TfoCX1W11GQ9MZUvr9z4Vyrj8U98UZvldPvwgI7J2g87RUKJCqKlx//j/Hul7PRjPgBAA==","shasum":"85a0c9d335e967723e48d736cc63e13ee17b7dfe","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-c34db60.tgz","fileCount":799,"unpackedSize":2160676,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFK6Ic4qSSFOAXhUdRCc//xNrNGTrpXdCG07PM/AZGDWAiBtbyqDjCUrANAU6IyY3I91rt5vctdUCC0rmwFJwWltVw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN4lyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpuxg/9GS5RXt5tYrt7q8VibGuoB0r0fxv+7bCS2/xx/ASX+nMlDh6c\r\nqaNEbDMP/cZRCtMmwoV7/x0vCOUN4E7FfmK/A4TWlBu+sUR57KeNNYr2V9aG\r\n+DWLm/3P8jd7c835JctUhjt95vUFIiViEDXMo6V+f4RM3WXq2gP6sjylQC1O\r\n4vAFenLVVOrtut74gQojLH9goIY39ZPLkEETLdV28JcRavcB6/AJFtEfY7qj\r\nBAuh6JkuJBypFN7Iq2Wvl9RZenMP/ES+Icu+/Prtfkf0wevrTXKTrKk4iUA+\r\n2Lg2iP1IP3WBJDpFQCrzstj9I/rdZMmZD1cEJziytnJuTPK/w4cSH678jyHK\r\nmWwM57lnke0Wg4CfYB2akdinJOiffgT2/ySxfIR/IQ4LvktGVf4X40ueTFtA\r\nqJrax2WilRZyOaoR2sKW3BEFQEmSjg7d/yku5k+q4EfuYImnoivr9mlNHBs5\r\npoh0h0J1dP4ah1I6emziuFna7gftXELXY+khoxyEQOE17LLm/KI5ZZ4TB/zr\r\nVe3My1vETOSFgg5hmeMhUrHAwIEY6vk6h6c3WxJBV2Uk+9aWUBmd5NWvn2pO\r\nOLU5iRneUQttfskoh2ziBdUMr3dQgQ791Trwxt39GHZPyVZCEIrVgXzAYFli\r\n8v5XEraGUTj2qiDc3zIV1rQZuYjBlwTbYL8=\r\n=REZT\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-c34db60_1681361266337_0.5022737323368969"},"_hasShrinkwrap":false},"0.8.3-c624ff9":{"name":"bls-wallet-clients","version":"0.8.3-c624ff9","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"c624ff970f3d850bfa44782f11f846de9729cafb","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-c624ff9","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-ZtcpjTzgx6Sz/51BO2wP5PI8Td44RqnNGy8oX78g6L8lLA3ElnFRbkbd+1eC5GRIZe81X/uM3AT7vnuMog6vtA==","shasum":"29570d3cc2564e13e41945edcb40d94a2e1a9982","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-c624ff9.tgz","fileCount":800,"unpackedSize":2194723,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvlWsBmlKJpjlq06rq3G3k3U7pLbGjywlR/dhzDiH1JAIgA2OrzMuOoEaArR7+uB2KLn1gD7KpAvAz5fFWlhQ3bFE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQgRyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFxhAAkP1VqF6xXqoB/NJt1ZMNMnnd9qpTTaqbudKAV7Pc6I3Ns9fz\r\nBD04rm23wn+dItRThGQsF9KlBzl20jIu3rbUh3y9qlywIJfqwoPOUoG0Ay+g\r\nzIeQhDHNAJ1jcCE5TL3E7i+gG4knxuZbX1f+UztypSAPuaJtUDfJu3DK3khc\r\nqncOMp5eZ91NH7CrE5vBCQceOxY9YvGqFd58KpKMOkO93O+zYyGFg8exHP4R\r\nouRKcBDZKXPhw1R13NabRBdcF2iKqh9W8AGvu6L0QmmC7cFvDok7rfqUg9F/\r\nZ20RDJG4rx9YTwBjtO3IrAuC4PWO7/9TYfSPd6vDb6UG714zVRimoJsp+fTh\r\na2LU3zEBuXVcNS1GBLCh3w2bvKN7oV3bIb/dbbw+t6pArViRdrvdAlZEfhyz\r\nh98IeDUsaTjmroy4BtZaDSTKqQhJkuLtOjba3PiEYqMl8nOfjhv6nvchUH6u\r\ne7yoqZe85xmBLljy3uhh32AFLVHQ5eDnyR+iudG8kEkOE6qgFoqsGtcg0hgt\r\n3ypDohDY7hFBymMozEkU50gs2Ri1XLuF0qtWxbocOwIAD+lAfQoK9mV6LzFf\r\nEomwST37q7LW1AaCxs6KjWXyYZD9W47YGHYCyYSOFlNneXR60eWYcK52RlDt\r\njyDuKOooY2+MFlOv849Soto9jhB71zuQ8kY=\r\n=geZr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-c624ff9_1682048114507_0.9622126888335998"},"_hasShrinkwrap":false},"0.8.3-c534a05":{"name":"bls-wallet-clients","version":"0.8.3-c534a05","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"c534a05ce5ac11054c16253a0e668a21f0cf4dc3","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-c534a05","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-z45thY4J82mLKaSuF9p2bZ5mCTKCUmDs35uGzRzFqKqkwo3Fj0cVdl7I+19Jm9tCxY0WEzlvLtiDNEPiCSIqcQ==","shasum":"80b09d9e60f4ed6fa7817bf0ea24069f10bdb2a0","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-c534a05.tgz","fileCount":804,"unpackedSize":2208583,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4rB5ZEs5fe02CIXaaiP69d4eDjYhcCsD7m1QCWPa2MgIhANGcXyDt6ZaNXqkFCqx7yh0FVZxJg9AGKlEs8Y3vuYuc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQgTpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfYw/+M9OzU+THSKAOajjtn3u2rmUi0yUW/ywRaKiFohvItmfsuUyo\r\nj1KzOwDcpqgnzwjWVgLfqqBCGU6u57z4ogXBZcYXbbaWzdOxp+dFz6mvt7jD\r\ndV3DH105q87akFHXHVh1qpFC4A6UuPqxLCosiygUeWRnXXJ7rUS/Aoyp0dbW\r\n3c/8CnViAXyoQiz2a/sqAqpWf4rd9MQn2tUendib17ktZ4LBhz817XSc9NB0\r\nQEBOMto/DdxM7dbweNqIT6qcz+hV9FP6HfbvXqQ7rElbxduINkorFHBs6/WJ\r\n5127KritZZAnUfAdR2Tf8w33U+4l+GASZQoYRp8SdKtQhNhmGRUYAn0HTBk8\r\nD3tWQarAPEsGE6OVrIehUtvNMHYrGyZU5cgKOFg8mAxJYgBaWxHb1hTPQMzD\r\n67b+5XvLQ4n/keIOz8AgloteRJnG1y5nEOJcp0L89IgLJyAbw9N4JLWISf6Z\r\n1Xt7rfFOwe0Op6ni4CxVnlENGKsrslLh99D/w5mzRk2WrXB9LCXYMXkGU0tJ\r\nQqT3ci8PyG3NTi3mQa+6GeZHP73g3hbbGGJwbb3METHfecrIZ2mDknmtIX5A\r\nuj2SYzaa1LbeDRsyACVL+HOWQRn+1IZ/M/ZCxFUTDWr027HxTA866Imx6GNv\r\nb0ekVqC6BtH5jlyGoi/BxquklPttUC2PqrA=\r\n=gekF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-c534a05_1682048233647_0.3655391282808822"},"_hasShrinkwrap":false},"0.8.3-bee2034":{"name":"bls-wallet-clients","version":"0.8.3-bee2034","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"bee2034a7a07a99bab5a2063843c82fa420fd014","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-bee2034","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-NU5V/mql1zUMun2GAbRhj8rMa2/EaXT6j8MyEYoWydfUIee5KApTLmvJbhJyMp0PlcyijPdrWMJ8L+omniEhiw==","shasum":"06ad216a0d2a675b1a0476fdac41df2794638903","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-bee2034.tgz","fileCount":809,"unpackedSize":2224813,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICJ160VF4R3MlNGaplzY0CXkwt2Rqm1rS5vsF7vqLuNOAiBkw3Wa0unnF19pleiIfLWFByHuheKAvZQUOYM8FpPkfw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkQhgpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqX8w/+K70RQ60sIehLF5f7njlAaG6uHG8QLauVwVm5DkHihshB1pvg\r\n9lgOQFVAFrTCESkT6U4LRGDbxcPBMJ2SKa/58iode09jmX4IgeIqa6jsWZt3\r\nRZ+EauK6qSFaYq85I3OVOh6ICRmAEEed9dLRhjqSQtZGQSPg6ib+Z/f2mwQG\r\nR/nk8+nI7f2Q7mSg/v1BHnqVrx9mlQD+douEWIqaEoCdW2jXqsfKonbRTfrB\r\nFd9rB1U59wmS8wh0j07w2gHJUKjHwbIeBobRkx31ei0OXE46m4KNXkNpxAgC\r\nx544gk9pTrLj13qUHQjuPXCxizpYXXqOzus74VZn5MrDesEPQjGN9PDp3u8E\r\nxmNzVW9Asr5R/YwdDp0OR34UKHAu82Ng2osBr1uEgH6AkMIH1W/b+/o0skCL\r\n8IRbI02lGfWtqPlQD1l5T3VDGFCDKr81d4Dhn1QgATqSJkfdxjfPOZKVbSro\r\nv6k6n/Qhz5GOmb/gBi6+J9XARgsUnANaiw9fKrmnWJnhSuY0wC8lw/dCtglT\r\n2gY5me6Ea7kCLIL4ctPIT/O3kNGsgtzX0+OFfowMhep0LuxA7UYyyraM0wGd\r\nEosVomNyhDPFDrVGXj7HG71wtnDaO8rpEexy4gGhEnqsM2YjMK1WYKjhDbXW\r\nyVlvLZFhKjjjKj6Sn4o+HpxykVIyXvNDaIU=\r\n=+mGv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-bee2034_1682053161516_0.9925386367770286"},"_hasShrinkwrap":false},"0.8.3-dc488ec":{"name":"bls-wallet-clients","version":"0.8.3-dc488ec","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"dc488ecc00de8123699bf7ee0bbaae2095a4180f","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-dc488ec","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-UzpWfJFoHZCF5hpOSPzy1cePlacilzXyUVPkrpzLxzD4E94CBXFGt2uNIforl8SBAROy852vus3MV0ZsYFcDGg==","shasum":"c317b1d91708d705106258bcf4c0cff79939ee38","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-dc488ec.tgz","fileCount":841,"unpackedSize":2296060,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrwCPKxX4B4HhrGR3HvnGPVr3FFiAPjyuKCcTYZXo5ywIhAMSc4/tOuhbRf6/lwQvEEe1HuPuZS/Lc0OPzkwBPWkg8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSbxrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqjtA/+NkoLDr/37PqaAHpWpkwkVk5HyyXCZZH8v3IqcG0V3aSTqjOW\r\nAMnWTYhH2xlXGHdLr1KfNIpnxhGwSqPbHeFQjp94kpMKqVMvxgrUW3HntFu3\r\noxMXuMEYClxP3W8PHsydiKvkMJKM6+aVUUipXpueKxEirVDD8iTDBTpL5EVD\r\n0b7Fuq7qdSjt9bfvMw2od2wvljjZCaspNePEBza5tvRutggo6lZnm9MgvfgD\r\nlk/6CZO7A38Ib+KY0G1Bwqwy2ZQMbqUAPy2DoWCazi0WswRx2Tbuvd9A+rXB\r\nkfCaq8QQfdm7PllPjQIpmnAG+KSnahHjA2x6XOjfuglCN82fEjEBuxmWSgn7\r\nNMDdE7el+I6MIpPPogBjI6HWPcZgOYPQe1fqGsVhpq0yYpw1CV4oe1saB7gd\r\nFdQHCQlAt6wTaYCKHqcW0HEXOIpBejUGSIwzL+ZFLmbbVySCeT+6nIk8bswR\r\nLIkdFh1M84hVeO+4o22RTmDf5gpDWIam49TbhOM+zkjMIuWROglSy/MhNqZO\r\n4CZAVG7s74Sqlr1kyL1tOQZO5WFETbRaYKqxgWSRo/H2K2bq0TKx/52+g/DL\r\nj45ik8kycXBmbmqTOB/6V7T3vNkVnNSgj7OLuaWaFuNC1iVkToIm5wDfoWMh\r\no4UZzaQpNW7/raTNYRGyaUh7kf5d4KWs494=\r\n=i397\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-dc488ec_1682553963395_0.436038938100781"},"_hasShrinkwrap":false},"0.8.3-0d52ddb":{"name":"bls-wallet-clients","version":"0.8.3-0d52ddb","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"0d52ddb20f2a395f3fff13130459a8561533024b","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-0d52ddb","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-6ltB4/xw7/roU6WaLy5hTP4ofmtqy8dYYY2hnWVqwGrtl75M08ljha39x2GAKmzJz4cnxSPXJcze74xWk3R3Dg==","shasum":"d8ce03055c196c6e8bc8a7bb0d85949f1829bc0f","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-0d52ddb.tgz","fileCount":841,"unpackedSize":2298230,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC09yISSFEEDLyQH1QYjNXMMInOzbA7PIJZ6kutvIijgAiBxrWEKER5gXTmrujMdVpH2D78USSXyD9mzFyEmmnFaSg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkUcQgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqX0hAAhhaLp7ujGXvo63sGAOuNbkaPHbGVwtwfpyC05YJG/BWvN5am\r\nj1UKZS3tChElIqH2bi1Qe3w3XCZnEOypExEeuKc7KsORfiD0MszoXLH9hqsx\r\ncOuwXRA+mzFBytLOjT9qk8euLtI5bP1ZvuiZkE5XD8inDn+YUmi9BSTockm7\r\ny77FKtn7au8lcBcksMziDisKMAQzF0mhlhkxux8FRQP2dR2cTbfPkUQxqrcf\r\n/6Ypbr7Hqr8BkvOGMzHfW++tnwbDvDeafrr15gRW0Pn+BG7C06LcKYrt+om+\r\nWaIbm4rd4JwMUEcKYnmsPjv/mQsXzca4nbCzMYXjjgi/dA+DEYTtNXjRPXPo\r\nkENbUmMmgHFlAbodAfEF4/yrv4TsW6e+Hglvw/E9ovXHw3NDVQLxPrQcRKsg\r\n4enRtPtZXHaqnbzUki82pAONm1lWqsS9l5kdOTTKSXfsv0VhntzUgsWJTWqF\r\nbxzb7jYaj0mR25WUfVar9XyvfP8ZhejEh3Cqa8PySjSImF/GbricDcj5eZq/\r\nUhndgC99g8vKvAq0IduMRxhzXBy4l1y1htr4t8pFSKksxTgbQ0q0ed8CB6IS\r\nOiV4O2XqdAJpvACNlKJTeNMVKdnY/cBUc+rxYRJqdvnEMQHhoDwTBR7qiEay\r\nL3WMAbwVc28x6oeKVWwyW7T015zFylr0F5Y=\r\n=gkaJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"voltrevo","email":"voltrevo@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-0d52ddb_1683080224474_0.8792329980407143"},"_hasShrinkwrap":false},"0.8.3-a9c0b22":{"name":"bls-wallet-clients","version":"0.8.3-a9c0b22","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"a9c0b22ed02329193662b4c88039b040b5f2c77c","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-a9c0b22","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-P7Kad9ylcRO5truvGMp+lkDr8rLgFtH6DdTdrWeE41zQLg++5XQj7SMZofe/2EPOPRSAfyF6HJscmH10VCdH4A==","shasum":"b214ae72993280b0faab51caedcf95171878f158","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-a9c0b22.tgz","fileCount":841,"unpackedSize":2326675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDWLqCvJIrD3EF764CvuwhpeFFzspjvJvYgGPf66MLFSAiAvmgrFZQHVBFBoFlLdbQ+pzdBrWVc6saUxeGadgIuI2Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVM0fACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmproBAAm8FKSD7UN0ZrpwCFHeV0mX8idtXG/rU6ICVgaUhMthr6T3O/\r\nDdABoZqM5SJAXC87zwJlSdGoMYni+VXkkHiIkKZBlEOX/w13iRF2a2NDxQv0\r\nTl1zMpzOjWcKsqO24jtUx8/wPs8cpucHVHx4DOR3nc7jCoAPerHRN9aR4Vd9\r\nTeXzNrnB5yfaQ1/cK3wc7hEaIWAWLOtRqkKtH4VJWsWXpZi4d7I4ijLUY02w\r\nDauEeIAQeEUleAq0yR4mdEBBsTP//Viwe4b4c/WHDbnW4CWuFV6n/pftejXr\r\nv4WkCgqoiK9VupNtdrXNP55vexH0EewXSM1fN7ElYnSNmICAnB6Y3kQEk/ZN\r\nlQ8nq28ompxk2QvjJwHOVy4V45Y4hauxcEs0Yik+F4Uy9Jf4BX/FUnWduBIl\r\nOMt5ryZOk0Cz/p4d4Vg803txVJONHiiVZgmbqzFnnZ62VSsUpbKckg78W9i4\r\n90ifHtm6/l8suae1+HsCV4VT9bHHU5+Ucy+y5alDO5m3hH/fZE64wPZB7WaW\r\nHbw1yK3OC0ifMEAOIGf9f4Hga4FY21fGI0YDGUQH5Zl8g4eeBrzlGHi6CSRz\r\noRLwffg95Nzti5sZ/FRs46YD56rhXOw2s3NTQrVDlXtNHHufQOmRHbXeKiww\r\n56iIyIDKShLiIkq2Prjd3FGV/COGr727F6Y=\r\n=NJ1R\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-a9c0b22_1683279134868_0.11875788687997701"},"_hasShrinkwrap":false},"0.8.3-1945961":{"name":"bls-wallet-clients","version":"0.8.3-1945961","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"194596140f0f3a968e94966a309a34458adb953a","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.8.3-1945961","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-3q99zaMxhaABlCVIxxIDOIYEVpuAC62vJp2B3vk82zini9yjYKzDVaJeRc+x920OkWg4AE21O2AAHCqU2uPL7A==","shasum":"194e110608ce8baf9c39da5c272dbfb9cbcb2632","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.8.3-1945961.tgz","fileCount":846,"unpackedSize":2335736,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOVVv1X5yOmOswy2c1R6jGtcnvuklslf/lNiN4nB2ZEAiEAvrmyJuZTuskUxP+7iEEdQPCWDup8Fu1fJawF9kYGP8s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVNwGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoB6Q/8DXfGugunwWy6A33xWPxWBhUplFxnin3Z7L8In1fEzJ2O8TTC\r\nDz6qm/xs/fNKyEZLNu5+uM7iswjecjFaoGeSocwCN3q6CcpfjalWbh/VgIQ4\r\ngPFR5FLH/o7NiUsgeNyAFDMNDV28C1UipzbAmNXQ85qlrB00m6TUbWYQ27+2\r\nTQWG1ztLoZhDJzROUqriz4ScvBipeYN05s6L1toRLz46dAYbZonpCT/7mo28\r\nsiCPTPa5wjWX8gIqKIvTIQZ2QH+REM8DtjIjc5QdezO/MDWZzhqxwXnQxY2F\r\nIQTTS9pdvnq4lRAr4cTU5YkMD7nqTm2TuhdVMpZLUOhPQyH40VfqVusVOwEC\r\n9BzAvhByBNP7BPyDZUgsgx95VE03VMXi2I0W2MMVoc1PXfQBj0j7QaTVJNrP\r\nQhwbdvhOK9xXl57kJtmsh1Bw2EHbzp9jovTRZ6Ok+nqOp1rIvqUdyKt6aHbz\r\n0lzE5/5CJEJYTUfDsVEVC5coi5w2nMjk+cp6egOgHQO2FX79E1ooKVKO6ZSl\r\nCRXuikHulp/p3O2YYMpPu5gtTvl6Jrp9NQV4djMklv0Eu9pFmoI3B70Zllhn\r\nt+cIteRFuzmY0CDyUzmiARr/lNx3ARvzO4z28DszD3uDnNDEa/JeQMyLhHke\r\njVABx0iTniTobbmyRANnnucsifLALHUTdMA=\r\n=9u83\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.8.3-1945961_1683282950414_0.8577189794889184"},"_hasShrinkwrap":false},"0.9.0":{"name":"bls-wallet-clients","version":"0.9.0","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"_id":"bls-wallet-clients@0.9.0","dist":{"shasum":"edfbdb24011856b52d9b438af174b6acbeda27ec","integrity":"sha512-ebEifAPkGfTft6xdVVgQfC6HEXzgw+wX2d76w2K1OUsB4FeKiAYRLMXtnKtl7tdQoMknHElD6xrLChKaCACYLQ==","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0.tgz","fileCount":911,"unpackedSize":2330167,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZcv/Xwtx516nnRAKC72Mzt+aAe0nGtFcnFjFlFwGo2AiB0dtbPa12ksvDhw+qsZXbT6FI3wh8fjerbkX/XNpKCXg=="}]},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0_1683301385869_0.3644804363418921"},"_hasShrinkwrap":false},"0.9.0-4b76bb5":{"name":"bls-wallet-clients","version":"0.9.0-4b76bb5","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"4b76bb5667eb9327bf183efdb86d87e40b21e241","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-4b76bb5","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-L2uIW6MrECzTLbrjHDM2OLk3lOwiKS0lBhKAWiyeKNpWDZT2RJOYJiv+h4aiZPFwUFPl46xaOKJa9igyBBSVjg==","shasum":"6cbae2d604dc4f7032ac94e9e51fc41ceeefc7e0","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-4b76bb5.tgz","fileCount":846,"unpackedSize":2335738,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFk1uSNqDabEiE62yVMMnv4HTEsUHd/ztrGaymKIVEbUAiEAhI7EAbYNc48iYdDpyEkMiZMpiTohJ9Y1eS0M3ntU+zE="}]},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-4b76bb5_1683548175514_0.8777137411325353"},"_hasShrinkwrap":false},"0.9.0-1620721":{"name":"bls-wallet-clients","version":"0.9.0-1620721","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"162072155d8ee25cf112672bf1ed0faabb4db6db","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-1620721","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-ekSrK2bCiWoTuhnqdKTp0kXDuIUmE3lc9pqtonOAZC/6ReU2cVbW+F6U1/echtagdWL6GBArJgB2JnVQVznRpg==","shasum":"572798d10fa6246ab44bbd0e11b97df11abd6d15","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-1620721.tgz","fileCount":841,"unpackedSize":2326675,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZ+awpORsfyN7fibhd0552ahUSIQg92ZymWZhlQt37dAiA09sCkF8qAekv6BQ02AxpZUSCDwRq/NGMPlHEJCqAEfQ=="}]},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-1620721_1683550097449_0.7557092904215341"},"_hasShrinkwrap":false},"0.9.0-2a20bfe":{"name":"bls-wallet-clients","version":"0.9.0-2a20bfe","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"2a20bfeb8d1f36756c73900ceaa39dbcc7a7c5b4","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-2a20bfe","_nodeVersion":"16.16.0","_npmVersion":"8.11.0","dist":{"integrity":"sha512-w4efcArPBEowrAkIdVYc2mOLlkN8E5O9eIqEhoo6IrRVrN21p/JVNdoot4N3o5MAKFbeaYfid/u9lL6p2DNdiw==","shasum":"2e39757a18df3ba78d816ae15f6b88000443a2a6","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-2a20bfe.tgz","fileCount":846,"unpackedSize":2335813,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDETwzNHDrUHYKbYHRY2l4Yfdo4tEENNIwSZyOL7xyVcAiBjUP1+tbrUhiySgk4iX79MExMReWzvsIwl0S0lPKofew=="}]},"_npmUser":{"name":"johnguilding","email":"jwguilding@gmail.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-2a20bfe_1683649217611_0.8559344942515461"},"_hasShrinkwrap":false},"0.9.0-3251dec":{"name":"bls-wallet-clients","version":"0.9.0-3251dec","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"3251deca540a0b36e48cd6c8a904d579fd184e9e","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-3251dec","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-GBjJToEK3nEkldnWB8971BlIKCF0AT78GsrnkXfC1WtAYsvtqyZxmfGABMmN4si8GgykyyjYcxTypORz61AGZQ==","shasum":"46f6795110abd90a242fec5a59af1ae2a9f45cd9","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-3251dec.tgz","fileCount":846,"unpackedSize":2307370,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJvJ6KPLopd73G+8w08kX2S7UvVUbz/F72ZhvFesj5FwIgR+3AAqHdQGHUzeE8A7U4espQFdvP8Km9cWwNPLPc4po="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-3251dec_1687895037734_0.621304591561521"},"_hasShrinkwrap":false},"0.9.0-5d98448":{"name":"bls-wallet-clients","version":"0.9.0-5d98448","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"5d98448c6635bc51d28d0fd11ef31a4e341ca2f2","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-5d98448","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-MymcglLwEEwAbUUaz713G47bLgByzz4Hspb0PbqH5aJ0BRO7wgbflrK5Hk/xr06PPYXZ+WHbv3W1o9UWkLqTeA==","shasum":"2387626724dc60b957e9e2c44c26f61fc64e5c47","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-5d98448.tgz","fileCount":846,"unpackedSize":2309440,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBxanJmRpF2EwH251O4eb5zqVBiMwUnlcALTzne4hNZiAiEA+gFy/0ntMgdmv7BYwFv9Hdo9IDJee4NSnhmUVZG0dS0="}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-5d98448_1687898769273_0.9909644048894044"},"_hasShrinkwrap":false},"0.9.0-405e23a":{"name":"bls-wallet-clients","version":"0.9.0-405e23a","description":"Client libraries for interacting with BLS Wallet components","main":"dist/src/index.js","types":"dist/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/web3well/bls-wallet.git#main"},"author":{"name":"Andrew Morris"},"license":"MIT","private":false,"engines":{"node":">=16.0.0","yarn":">=1.0.0"},"scripts":{"build":"rm -rf dist && mkdir dist && cp -rH typechain-types dist/typechain-types && find ./dist/typechain-types -type f \\! -name '*.d.ts' -name '*.ts' -delete && tsc","watch":"tsc -w","test":"nyc --reporter=text --reporter=html mocha --require ts-node/register --require source-map-support/register --require ./test/init.ts --recursive **/*.test.ts","premerge":"yarn test","publish-experimental":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental && npm version $(cat .version) && rm .version","publish-experimental-dry-run":"node scripts/showVersion.js >.version && npm version $(node scripts/showBaseVersion.js)-$(git rev-parse HEAD | head -c7) --allow-same-version && npm publish --tag experimental --dry-run && npm version $(cat .version) && rm .version"},"dependencies":{"@thehubbleproject/bls":"^0.5.1","ethers":"^5.7.2","node-fetch":"2.6.7"},"devDependencies":{"@istanbuljs/nyc-config-typescript":"^1.0.2","@types/chai":"^4.3.4","@types/chai-as-promised":"^7.1.5","@types/mocha":"^10.0.1","chai":"^4.3.7","chai-as-promised":"^7.1.1","mocha":"^10.2.0","nyc":"^15.1.0","source-map-support":"^0.5.21","ts-node":"^10.9.1","typescript":"^4.9.4"},"readme":"# BLS Wallet Clients\n\n[![npm version](https://img.shields.io/npm/v/bls-wallet-clients)](https://www.npmjs.com/package/bls-wallet-clients)\n\n_Client libraries for interacting with BLS Wallet components_\n\n## Network Config\n\nDeployed contract addresses and metadata.\n\n```ts\nimport { NetworkConfig, getConfig } from 'bls-wallet-clients';\n\nconst netCfg: NetworkConfig = await getConfig(\n  '/path/to/network/config',\n  async (path) => ... /* fetch, fs.readFile, etc. */\n);\n// Read from netCfg.addresses.verificationGateway, etc.\n```\n\n## Aggregator\n\nExposes typed functions for interacting with the Aggregator's HTTP API.\n\n### Add a bundle to an aggregator\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n```\n\n### Get the bundle receipt that contains the transaction hash you can lookup on a block explorer\n\nYou will have to poll for the bundle receipt once you have added a bundle to an aggregator. The transaction hash is located on the bundle receipt. The property you need is `bundleReceipt.transactionHash`. This represents the transaction hash for the bundle submitted to the Verification Gatewaty, and can be used in a block explorer.\n\nNote this transaction is reprentative of the entire bundle submitted by the aggregator, and does not represent individual operations. To retrieve information about individual operations, use the get `getOperationResults` helper method which is explained under the [VerificationGateway](#verificationgateway) section below.\n\n```ts\nimport { Aggregator } from \"bls-wallet-clients\";\n\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\nconst resp = await aggregator.add(bundle); // See BlsWalletWrapper section below\n// Aggregator did not accept bundle\nif (\"failures\" in resp) {\n  throw new Error(resp.failures.join(\", \"));\n}\n\nlet receipt;\nwhile (!receipt) {\n  receipt = await aggregator.lookupReceipt(resp.hash);\n  // There was an issue submitting the bundle on chain\n  if (receipt && \"submitError\" in receipt) {\n    throw new Error(receipt.submitError);\n  }\n  // Some function which waits i.e. setTimeout\n  await sleep(5000);\n}\n```\n\n## BlsWalletWrapper\n\nWraps a BLS wallet, storing the private key and providing `.sign(...)` to\nproduce a `Bundle`, that can be used with `aggregator.add(...)`. Make sure the bls wallet you're trying to use has enough ETH to send transactions. You can either fund a wallet before it's created, or after the wallet is lazily created from its first transaction (bundle).\n\n```ts\nimport { BlsWalletWrapper } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    {\n      ethValue: 0,\n      contractAddress: someToken.address, // An ethers.Contract\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(1).pow(18),\n      ]),\n    },\n    // Additional actions can go here. When using multiple actions, they'll\n    // either all succeed or all fail.\n  ],\n});\n\nawait aggregator.add(bundle);\n```\n\n### Sending a regular ETH transaction\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst amountToTransfer = ethers.utils.parseUnits(\"1\");\nconst reciever = \"0x1234...\";\n\nconst bundle = wallet.sign({\n  nonce,\n  actions: [\n    {\n      ethValue: amountToTransfer, // amount of ETH you want to transfer\n      contractAddress: reciever, // receiver address. Can be a contract address or an EOA\n      encodedFunction: \"0x\", // leave this as \"0x\" when just sending ETH\n    },\n  ],\n});\n```\n\n### Constructing actions to be agnostic to both ETH transfers and contract interactions\n\n```ts\n// Follow the same steps as the first BlsWalletWrapper example, but construct the bundle actions like so:\nconst transactions = [\n  {\n    value: ethers.utils.parseUnits(\"1\"), // amount of ETH you want to transfer\n    to: \"0x1234...\", // to address. Can be a contract address or an EOA\n  },\n];\n\nconst actions: ActionData[] = transactions.map((tx) => ({\n  ethValue: tx.value ?? \"0\",\n  contractAddress: tx.to,\n  encodedFunction: tx.data ?? \"0x\", // in this example, there is no data property on the tx object, so \"0x\" will be used\n}));\n\nconst bundle = wallet.sign({\n  nonce,\n  actions,\n});\n```\n\n## Estimating and paying fees\n\nUser bundles must pay fees to compensate the aggregator. Fees can be paid by adding an additional action to the users bundle that pays tx.origin. For more info on how fees work, see [aggregator fees](../../aggregator/README.md#fees).\n\nPractically, this means you have to first estimate the fee using `aggregator.estimateFee`, and then add an additional action to a user bundle that pays the aggregator with the amount returned from `estimateFee`. When estimating a payment, you should include this additional action with a payment of zero wei, otherwise the additional action will increase the fee that needs to be paid. Additionally, the `feeRequired` value returned from `estimateFee` is the absolute minimum fee required at the time of estimation, therefore, you should pay slightly extra to ensure the bundle has a good chance of being submitted successfully.\n\n### Paying aggregator fees with native currency (ETH)\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 1,\n      // Provide 1 wei with this action so that the fee transfer to\n      // tx.origin can be included in the gas estimate.\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: safeFee, // fee amount\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction:\n        aggregatorUtilitiesContract.interface.encodeFunctionData(\n          \"sendEthToTxOrigin\",\n        ),\n    },\n  ],\n});\n```\n\n### Paying aggregator fees with custom currency (ERC20)\n\nThe aggregator must be set up to accept ERC20 tokens in order for this to work.\n\n```ts\nimport { BlsWalletWrapper, Aggregator } from \"bls-wallet-clients\";\n\nconst wallet = await BlsWalletWrapper.connect(\n  privateKey,\n  verificationGatewayAddress,\n  provider,\n);\nconst aggregator = new Aggregator(\"https://arbitrum-goerli.blswallet.org\");\n\n// Create a fee estimate bundle\nconst estimateFeeBundle = wallet.sign({\n  nonce,\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        1,\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [tokenContract.address, 1],\n      ),\n    },\n  ],\n});\n\nconst feeEstimate = await aggregator.estimateFee(estimateFeeBundle);\n\n// Add a safety premium to the fee to account for fluctuations in gas estimation\nconst safetyDivisor = 5;\nconst feeRequired = BigNumber.from(feeEstimate.feeRequired);\nconst safetyPremium = feeRequired.div(safetyDivisor);\nconst safeFee = feeRequired.add(safetyPremium);\n\nconst bundle = wallet.sign({\n  nonce: await wallet.Nonce(),\n  actions: [\n    ...actions, // ... add your user actions here (approve, transfer, etc.)\n\n    // Note the additional approve action when transfering ERC20 tokens\n    {\n      ethValue: 0,\n      contractAddress: tokenContract.address,\n      encodedFunction: tokenContract.interface.encodeFunctionData(\"approve\", [\n        aggregatorUtilitiesContract.address,\n        safeFee, // fee amount\n      ]),\n    },\n    {\n      ethValue: 0,\n      contractAddress: aggregatorUtilitiesContract.address,\n      encodedFunction: aggregatorUtilitiesContract.interface.encodeFunctionData(\n        \"sendTokenToTxOrigin\",\n        [\n          tokenContract.address,\n          safeFee, // fee amount\n        ],\n      ),\n    },\n  ],\n});\n```\n\n## VerificationGateway\n\nExposes `VerificationGateway` and `VerificationGateway__factory` generated by\n[typechain](https://github.com/dethcrypto/TypeChain) to enable typed\ninteractions with the `VerificationGateway`.\n\n```ts\nimport { VerificationGateway__factory } from \"bls-wallet-clients\";\n\nconst verificationGateway = VerificationGateway__factory.connect(\n  verificationGatewayAddress,\n  signer, // An ethers signer\n);\n\nawait verificationGateway.processBundle(bundle);\n```\n\nYou can get the results of the operations in a bundle using `getOperationResults`.\n\n```ts\nimport { getOperationResults, decodeError } from 'bls-wallet-clients';\n\n...\n\nconst txn = await verificationGateway.processBundle(bundle);\nconst txnReceipt = txn.wait();\nconst opResults = getOperationResults(txnReceipt);\n\n// Includes data from WalletOperationProcessed event,\n// as well as parsed errors with action index\nconst { error } = opResults[0];\nconsole.log(error?.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(error?.message); // ex. \"some require failure message\"\n\n// If you want more granular ability to decode an error message\n// you can use the decodeError function.\nconst errorData = '0x5c66760100000000.............000000000000';\nconst opResultError = decodeError(errorData);\nconsole.log(opResultError.actionIndex); // ex. 0 (as BigNumber)\nconsole.log(opResultError.message); // ex. \"ERC20: insufficient allowance\"\n```\n\n## Signer\n\nUtilities for signing, aggregating and verifying transaction bundles using the\nbls signature scheme. Bundles are actioned in\n[contracts](https://github.com/jzaki/bls-wallet/tree/main/contracts).\n\nUseful in the [aggregator](https://github.com/jzaki/bls-wallet/tree/main/aggregator)\nfor verification and aggregation, and in the\n[extension](https://github.com/jzaki/bls-wallet/tree/main/extension) for signing\nand aggregation.\n\n```ts\nimport ethers from \"ethers\";\nimport { initBlsWalletSigner } from \"bls-wallet-clients\";\n\n(async () => {\n  const privateKey = \"0x...256 bits of private hex data here\";\n\n  const signer = await initBlsWalletSigner({ chainId: 10, privateKey });\n\n  const someToken = new ethers.Contract(\n    ...\n    // See https://docs.ethers.io/v5/getting-started/\n  );\n\n  const bundle = signer.sign(\n    {\n      nonce: ethers.BigNumber.from(0),\n      ethValue: ethers.BigNumber.from(0),\n      contractAddress: someToken.address,\n\n      // If you don't want to call a function and just send `ethValue` above,\n      // use '0x' to signify an empty byte array here\n      encodedFunction: someToken.interface.encodeFunctionData(\"transfer\", [\n        \"0x...some address...\",\n        ethers.BigNumber.from(10).pow(18),\n      ]),\n    },\n  );\n\n  // Send bundle to an aggregator or use it with VerificationGateway directly.\n})();\n```\n\n## Local Development\n\n### Setup\n\n```sh\nyarn install\n```\n\n### Build\n\n```sh\nyarn build\n```\n\n### Tests\n\n```sh\nyarn test\n```\n\n### Use in Extension or another project\n\n```sh\nyarn build\nyarn link\ncd other/project/dir\nyarn \"link bls-wallet-clients\"\n```\n\n## Troubleshooting tips\n\n- Make sure your bls-wallet-clients package is up-to-date and check out our [releases page](https://github.com/web3well/bls-wallet/releases) for info on breaking changes.\n- Check network values such as the verification gateway address or the aggregator url are up-to-date. The most up-to-date values are located in the relevant [network config](./../contracts/networks) file. If you're deploying to a custom network, you'll have to check these against your own records as these won't be in the network directory.\n","readmeFilename":"README.md","gitHead":"405e23a7a0ca8b11b394c9a06758e7f1656d4879","bugs":{"url":"https://github.com/web3well/bls-wallet/issues"},"homepage":"https://github.com/web3well/bls-wallet/tree/main#readme","_id":"bls-wallet-clients@0.9.0-405e23a","_nodeVersion":"18.16.0","_npmVersion":"9.5.1","dist":{"integrity":"sha512-cMm6pq35VU30veCAHt6ArSavlqzXu+olQg+dzUH28fvqSeQsfWz2qiuBekGxSWOCfn8gX1j/8jHEhrGxXS509Q==","shasum":"b66121f9ec0cb4e821965606ada203e6601b773d","tarball":"https://registry.npmjs.org/bls-wallet-clients/-/bls-wallet-clients-0.9.0-405e23a.tgz","fileCount":846,"unpackedSize":2308875,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlX7f4lyhWKwZY62fPJRMzb740GHwM2rhUBkvjJR8HqAIhAO2bcaxRo06Ja3zgOlLNrOIs1P2X3XhHUH0TqkswiYrl"}]},"_npmUser":{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},"directories":{},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/bls-wallet-clients_0.9.0-405e23a_1687991288538_0.21122691330496557"},"_hasShrinkwrap":false}},"time":{"created":"2021-10-19T23:35:47.192Z","0.1.0":"2021-10-19T23:35:47.357Z","modified":"2023-06-28T22:28:08.988Z","0.2.0-rc.1":"2021-10-21T02:59:02.686Z","0.2.0-rc.2":"2021-10-21T05:19:33.893Z","0.2.0-rc.3":"2021-10-21T05:43:41.700Z","0.2.0-rc.4":"2021-10-21T05:50:16.958Z","0.2.0-rc.5":"2021-10-21T23:57:50.257Z","0.2.0-rc.6":"2021-10-22T00:38:32.736Z","0.2.0":"2021-10-22T03:34:28.128Z","0.2.1":"2021-10-22T03:49:13.562Z","0.2.2-rc.1":"2021-10-31T23:30:30.796Z","0.2.2-rc.2":"2021-10-31T23:46:51.107Z","0.2.2":"2021-11-01T04:18:49.738Z","0.2.3":"2021-11-03T00:22:47.376Z","0.2.4":"2021-11-03T04:30:02.409Z","0.2.5-rc.1":"2021-11-14T23:14:07.013Z","0.3.0-rc.1":"2021-11-16T05:26:34.872Z","0.3.0-rc.2":"2021-11-16T05:45:30.832Z","0.3.0-rc.3":"2021-11-16T05:47:15.381Z","0.3.0":"2021-11-18T00:53:28.906Z","0.3.0-3ceb94e":"2021-11-18T01:00:29.972Z","0.3.0-eec9d49":"2021-11-18T02:43:32.353Z","0.3.0-07ac8dc":"2021-11-18T03:06:57.206Z","0.3.0-9bdca2f":"2021-11-18T04:00:13.574Z","0.3.0-590deda":"2021-11-19T01:20:39.053Z","0.4.0-225dfbd":"2021-11-29T04:53:50.583Z","0.4.0-48ba9bf":"2021-11-29T04:57:55.893Z","0.4.0-b74e369":"2021-11-29T05:09:29.138Z","0.4.0-3439ba0":"2021-11-29T05:36:03.248Z","0.4.0":"2021-11-30T02:27:53.444Z","0.4.1-3f27d83":"2021-11-30T04:32:54.714Z","0.5.0-405ec15":"2021-11-30T05:02:24.152Z","0.5.0-3fbaed7":"2021-12-01T00:08:02.188Z","0.5.0-01c3b96":"2021-12-01T00:15:34.634Z","0.5.0-5dbc9f9":"2021-12-01T00:17:38.425Z","0.5.0-3c4c29a":"2021-12-14T22:49:07.907Z","0.5.0-32ca69b":"2021-12-14T22:58:38.715Z","0.5.0-d6d7dd4":"2021-12-17T00:36:49.413Z","0.5.0":"2021-12-23T01:41:40.196Z","0.5.1":"2021-12-24T00:11:21.540Z","0.5.1-d38148c":"2021-12-24T02:32:22.222Z","0.5.2":"2021-12-24T02:39:00.683Z","0.5.3-2151ea7":"2021-12-30T21:51:51.708Z","0.5.3-8da99e2":"2021-12-31T00:08:28.543Z","0.5.3-c4cc426":"2021-12-31T05:48:08.219Z","0.5.3":"2022-01-06T21:11:27.633Z","0.5.4-68ca9ae":"2022-01-11T23:11:41.437Z","0.5.4-94d2be0":"2022-01-11T23:56:32.572Z","0.5.4-35e1f71":"2022-01-12T00:04:39.987Z","0.5.4-a9dd6c8":"2022-01-12T00:21:28.414Z","0.5.4-ae1b035":"2022-01-12T00:29:13.203Z","0.5.4-38130e8":"2022-01-12T00:36:09.406Z","0.5.4-90687e3":"2022-01-12T00:53:36.990Z","0.5.4-c47077f":"2022-01-12T01:13:46.071Z","0.5.4-0ada8d0":"2022-01-12T01:40:47.195Z","0.5.4-d697f5f":"2022-01-19T06:22:03.913Z","0.5.4-68d5a81":"2022-01-19T06:56:03.475Z","0.5.4-05c23aa":"2022-01-22T00:08:15.151Z","0.5.4-5c120cc":"2022-02-08T06:12:01.301Z","0.5.4-b991dbf":"2022-02-09T03:31:56.889Z","0.5.4-bb3f98e":"2022-02-09T05:46:12.837Z","0.5.4-2563e2c":"2022-02-10T00:53:03.637Z","0.5.4-f6926ca":"2022-02-11T01:19:56.365Z","0.5.4-1d458de":"2022-02-11T03:01:57.037Z","0.5.4-2c78bc0":"2022-02-21T05:14:06.289Z","0.5.4-73ba8e7":"2022-02-22T23:30:23.165Z","0.5.4-8402c55":"2022-02-24T03:56:59.161Z","0.5.4-0d31a34":"2022-02-24T03:57:51.668Z","0.5.4-8c9c0ef":"2022-02-24T05:31:18.159Z","0.5.4-5f7be70":"2022-03-07T07:13:33.663Z","0.5.4-3dc82be":"2022-03-07T07:18:11.648Z","0.5.4-50dbd9f":"2022-03-08T00:25:53.600Z","0.5.4-7209856":"2022-03-11T01:09:31.250Z","0.5.4-62c545f":"2022-03-12T00:12:09.509Z","0.5.4-11b7d61":"2022-03-15T19:48:57.233Z","0.5.4-f2bad77":"2022-03-15T21:53:43.077Z","0.5.4-3b87263":"2022-04-06T01:47:47.413Z","0.6.0-3b87263":"2022-04-06T01:48:13.708Z","0.6.0-45def92":"2022-04-06T01:48:34.896Z","0.6.0-aadc14a":"2022-04-08T10:23:33.647Z","0.6.0-5e2b347":"2022-04-08T10:35:07.040Z","0.6.0-40b8479":"2022-04-11T14:59:07.387Z","0.6.0-6abef92":"2022-04-15T12:21:22.599Z","0.6.0":"2022-04-15T13:16:42.607Z","0.6.0-bfada65":"2022-07-14T07:09:05.324Z","0.6.0-26686cd":"2022-07-15T01:30:36.542Z","0.6.0-2f62a6d":"2022-09-03T19:31:43.180Z","0.6.0-87eb0b5":"2022-09-08T23:44:02.231Z","0.7.0":"2022-09-13T01:29:37.251Z","0.6.0-576802a":"2022-09-13T23:54:27.868Z","0.6.0-60be9d6":"2022-09-14T20:28:51.984Z","0.7.1":"2022-09-15T03:44:40.023Z","0.7.1-2790596":"2022-09-15T19:42:42.559Z","0.7.2":"2022-09-16T16:52:04.479Z","0.7.3":"2022-09-16T17:11:14.333Z","0.7.3-d193dff":"2022-09-17T00:25:50.678Z","0.7.3-c3e79a7":"2022-10-05T22:06:16.309Z","0.7.3-92b9b13":"2022-10-05T23:01:53.922Z","0.8.0-2d28b7b":"2022-10-05T23:14:37.023Z","0.8.0-bc3d146":"2022-11-11T00:58:07.869Z","0.8.0-940dd11":"2022-11-14T06:47:17.405Z","0.8.0":"2022-11-16T00:46:54.910Z","0.8.0-72b546c":"2022-11-29T15:25:01.950Z","0.8.0-69a1a19":"2022-11-30T09:58:05.126Z","0.8.0-035891a":"2022-11-30T10:02:27.908Z","0.8.0-045c675":"2022-11-30T10:22:13.954Z","0.8.0-56f33ec":"2022-11-30T13:13:12.454Z","0.8.0-efa2e06":"2022-12-02T10:35:20.054Z","0.8.1-980039":"2022-12-12T18:47:52.084Z","0.8.1-bfdcf0f":"2022-12-12T19:09:58.051Z","0.8.1-28894cb":"2022-12-12T19:23:31.721Z","0.8.1-036d05e":"2022-12-12T20:47:33.370Z","0.8.1-d7f4b6c":"2022-12-12T21:01:20.948Z","0.8.1-a2c1805":"2022-12-12T22:51:21.330Z","0.8.1-f8acbf3":"2022-12-12T22:52:17.121Z","0.8.1-83d2f28":"2022-12-12T23:00:30.713Z","0.8.1-0ba7441":"2022-12-14T23:41:09.263Z","0.8.1-1995bbc":"2022-12-15T00:08:50.349Z","0.8.1-758c7c4":"2022-12-15T00:44:32.060Z","0.8.1":"2022-12-15T18:40:58.888Z","0.8.2-a3a7cc6":"2022-12-20T02:30:10.255Z","0.8.2-add1351":"2022-12-20T02:37:00.219Z","0.8.2":"2022-12-23T19:16:30.074Z","0.8.2-05f8972":"2023-01-24T10:49:34.280Z","0.8.2-4f9ddac":"2023-01-26T09:58:50.718Z","0.8.2-d39c16b":"2023-01-26T12:43:37.675Z","0.8.2-f1af837":"2023-01-26T16:38:39.873Z","0.8.2-f1af838":"2023-01-26T17:14:59.775Z","0.8.2-f1af839":"2023-01-26T17:37:10.682Z","0.8.2-f1af810":"2023-01-26T17:53:29.178Z","0.8.2-4322d96":"2023-01-26T19:54:00.707Z","0.8.2-821654":"2023-01-27T14:42:45.676Z","0.8.2-77f1638":"2023-02-01T14:48:01.500Z","0.8.2-c963d62":"2023-03-06T12:31:01.115Z","0.8.2-1452ef5":"2023-03-06T17:20:43.262Z","0.8.2-1fb4a55":"2023-03-28T14:28:03.568Z","0.8.2-b988fbc":"2023-03-29T10:57:16.166Z","0.8.2-de12b3c":"2023-03-29T12:04:18.043Z","0.8.2-4557e03":"2023-04-04T05:53:35.447Z","0.8.3":"2023-04-04T18:09:34.479Z","0.8.3-f6ab5d9":"2023-04-11T23:14:38.952Z","0.8.3-c34db60":"2023-04-13T04:47:46.536Z","0.8.3-c624ff9":"2023-04-21T03:35:14.722Z","0.8.3-c534a05":"2023-04-21T03:37:13.924Z","0.8.3-bee2034":"2023-04-21T04:59:21.821Z","0.8.3-dc488ec":"2023-04-27T00:06:03.620Z","0.8.3-0d52ddb":"2023-05-03T02:17:04.761Z","0.8.3-a9c0b22":"2023-05-05T09:32:15.336Z","0.8.3-1945961":"2023-05-05T10:35:50.732Z","0.9.0":"2023-05-05T15:43:06.101Z","0.9.0-4b76bb5":"2023-05-08T12:16:16.245Z","0.9.0-1620721":"2023-05-08T12:48:17.756Z","0.9.0-2a20bfe":"2023-05-09T16:20:17.826Z","0.9.0-3251dec":"2023-06-27T19:43:58.064Z","0.9.0-5d98448":"2023-06-27T20:46:09.603Z","0.9.0-405e23a":"2023-06-28T22:28:08.833Z"},"maintainers":[{"name":"voltrevo","email":"voltrevo@gmail.com"},{"name":"kkautuk","email":"kautukkundan@gmail.com"},{"name":"jameszaki","email":"james.zaki@gmail.com"},{"name":"jacque006","email":"3ptt7pfsggjw@blurtoday.com"},{"name":"blakecduncan","email":"blakecduncan@gmail.com"},{"name":"johnguilding","email":"jwguilding@gmail.com"}],"description":"Client libraries for interacting with BLS Wallet components","repository":{"type":"git","url":"https://github.com/web3well/bls-wallet/tree/main/contracts/clients"},"author":{"name":"Andrew Morris"},"license":"MIT","readme":"","readmeFilename":""}