From 8a8350432568c5c2c8b410554459cc353c3dc30f Mon Sep 17 00:00:00 2001 From: smgv Date: Thu, 28 Nov 2024 15:57:19 +0530 Subject: [PATCH] checkout plugin --- .vscode/settings.json | 2 +- demo/vue-app-new/package-lock.json | 238 ++++++++++-------- demo/vue-app-new/package.json | 1 + .../src/components/AppSettings.vue | 154 +++++++++++- demo/vue-app-new/src/translations/en.json | 130 +++++----- package-lock.json | 27 ++ packages/plugins/checkout-plugin/README.md | 41 +++ packages/plugins/checkout-plugin/package.json | 68 +++++ packages/plugins/checkout-plugin/src/enums.ts | 15 ++ packages/plugins/checkout-plugin/src/index.ts | 1 + .../plugins/checkout-plugin/src/plugin.ts | 180 +++++++++++++ packages/plugins/checkout-plugin/src/utils.ts | 14 ++ .../plugins/checkout-plugin/torus.config.js | 1 + .../checkout-plugin/tsconfig.build.json | 3 + .../plugins/checkout-plugin/tsconfig.json | 8 + .../plugins/checkout-plugin/webpack.config.js | 15 ++ 16 files changed, 735 insertions(+), 163 deletions(-) create mode 100644 packages/plugins/checkout-plugin/README.md create mode 100644 packages/plugins/checkout-plugin/package.json create mode 100644 packages/plugins/checkout-plugin/src/enums.ts create mode 100644 packages/plugins/checkout-plugin/src/index.ts create mode 100644 packages/plugins/checkout-plugin/src/plugin.ts create mode 100644 packages/plugins/checkout-plugin/src/utils.ts create mode 100644 packages/plugins/checkout-plugin/torus.config.js create mode 100644 packages/plugins/checkout-plugin/tsconfig.build.json create mode 100644 packages/plugins/checkout-plugin/tsconfig.json create mode 100644 packages/plugins/checkout-plugin/webpack.config.js diff --git a/.vscode/settings.json b/.vscode/settings.json index 863270840..ad1853459 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,5 @@ "changeProcessCWD": true } ], - "cSpell.words": ["JRPC","Solana"] + "cSpell.words": ["JRPC", "Solana", "toruslabs"] } diff --git a/demo/vue-app-new/package-lock.json b/demo/vue-app-new/package-lock.json index 386ddab07..9f9398e89 100644 --- a/demo/vue-app-new/package-lock.json +++ b/demo/vue-app-new/package-lock.json @@ -20,6 +20,7 @@ "@web3auth/base-evm-adapter": "file:../../packages/adapters/base-evm-adapter", "@web3auth/base-provider": "file:../../packages/providers/base-provider", "@web3auth/base-solana-adapter": "file:../../packages/adapters/base-solana-adapter", + "@web3auth/checkout-plugin": "file:../../packages/plugins/checkout-plugin", "@web3auth/coinbase-adapter": "file:../../packages/adapters/coinbase-adapter", "@web3auth/default-evm-adapter": "file:../../packages/adapters/default-evm-adapter", "@web3auth/default-solana-adapter": "file:../../packages/adapters/default-solana-adapter", @@ -56,12 +57,12 @@ }, "../../packages/adapters/auth-adapter": { "name": "@web3auth/auth-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", "deepmerge": "^4.3.1" }, "engines": { @@ -74,11 +75,11 @@ }, "../../packages/adapters/base-evm-adapter": { "name": "@web3auth/base-evm-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/base": "^9.3.0" + "@toruslabs/base-controllers": "^6.3.1", + "@web3auth/base": "^9.4.4" }, "engines": { "node": ">=18.x", @@ -90,11 +91,11 @@ }, "../../packages/adapters/base-solana-adapter": { "name": "@web3auth/base-solana-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/base": "^9.3.0", + "@toruslabs/base-controllers": "^6.3.1", + "@web3auth/base": "^9.4.4", "bs58": "^5.0.0" }, "devDependencies": { @@ -110,14 +111,14 @@ }, "../../packages/adapters/coinbase-adapter": { "name": "@web3auth/coinbase-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/base": "^9.3.0", - "@web3auth/base-evm-adapter": "^9.3.0" + "@web3auth/base": "^9.4.4", + "@web3auth/base-evm-adapter": "^9.4.4" }, "devDependencies": { - "@coinbase/wallet-sdk": "^4.1.0" + "@coinbase/wallet-sdk": "^4.2.3" }, "engines": { "node": ">=18.x", @@ -130,12 +131,12 @@ }, "../../packages/adapters/default-evm-adapter": { "name": "@web3auth/default-evm-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/base": "^9.3.0", - "@web3auth/base-evm-adapter": "^9.3.0", - "@web3auth/wallet-connect-v2-adapter": "^9.3.0", + "@web3auth/base": "^9.4.4", + "@web3auth/base-evm-adapter": "^9.4.4", + "@web3auth/wallet-connect-v2-adapter": "^9.4.4", "mipd": "^0.0.7" }, "engines": { @@ -148,19 +149,19 @@ }, "../../packages/adapters/default-solana-adapter": { "name": "@web3auth/default-solana-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { "@solana/wallet-standard-features": "^1.2.0", - "@solana/web3.js": "^1.95.4", - "@wallet-standard/app": "^1.0.1", - "@wallet-standard/base": "^1.0.1", - "@wallet-standard/features": "^1.0.3", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-solana-adapter": "^9.3.0", - "@web3auth/solana-provider": "^9.3.0", - "@web3auth/wallet-connect-v2-adapter": "^9.3.0", + "@solana/web3.js": "^1.95.5", + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/features": "^1.1.0", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-solana-adapter": "^9.4.4", + "@web3auth/solana-provider": "^9.4.4", + "@web3auth/wallet-connect-v2-adapter": "^9.4.4", "bn.js": "^5.2.1" }, "engines": { @@ -173,12 +174,12 @@ }, "../../packages/adapters/torus-evm-adapter": { "name": "@web3auth/torus-evm-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { "@toruslabs/torus-embed": "^5.0.0", - "@web3auth/base": "^9.3.0", - "@web3auth/base-evm-adapter": "^9.3.0" + "@web3auth/base": "^9.4.4", + "@web3auth/base-evm-adapter": "^9.4.4" }, "engines": { "node": ">=18.x", @@ -190,14 +191,14 @@ }, "../../packages/adapters/torus-solana-adapter": { "name": "@web3auth/torus-solana-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { "@toruslabs/solana-embed": "^2.1.0", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/base-solana-adapter": "^9.3.0", - "@web3auth/solana-provider": "^9.3.0" + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", + "@web3auth/base-solana-adapter": "^9.4.4", + "@web3auth/solana-provider": "^9.4.4" }, "engines": { "node": ">=18.x", @@ -210,19 +211,19 @@ }, "../../packages/adapters/wallet-connect-v2-adapter": { "name": "@web3auth/wallet-connect-v2-adapter", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@solana/web3.js": "^1.95.4", - "@toruslabs/base-controllers": "^6.2.2", - "@walletconnect/sign-client": "^2.17.1", - "@walletconnect/types": "^2.17.1", - "@walletconnect/utils": "^2.17.1", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/ethereum-provider": "^9.3.0", - "@web3auth/solana-provider": "^9.3.0", + "@solana/web3.js": "^1.95.5", + "@toruslabs/base-controllers": "^6.3.1", + "@walletconnect/sign-client": "^2.17.2", + "@walletconnect/types": "^2.17.2", + "@walletconnect/utils": "^2.17.2", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", + "@web3auth/ethereum-provider": "^9.4.4", + "@web3auth/solana-provider": "^9.4.4", "bs58": "^5.0.0", "deepmerge": "^4.3.1" }, @@ -239,13 +240,13 @@ }, "../../packages/base": { "name": "@web3auth/base", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@toruslabs/constants": "^14.0.0", + "@toruslabs/base-controllers": "^6.3.1", + "@toruslabs/constants": "^14.1.1", "@toruslabs/http-helpers": "^7.0.0", - "@web3auth/auth": "^9.4.1", + "@web3auth/auth": "^9.5.3", "jwt-decode": "^4.0.0", "loglevel": "^1.9.2", "ts-custom-error": "^3.3.1" @@ -260,15 +261,15 @@ }, "../../packages/composables/modal-vue-composables": { "name": "@web3auth/modal-vue-composables", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/base": "^9.3.0", - "@web3auth/modal": "^9.3.1" + "@web3auth/base": "^9.4.4", + "@web3auth/modal": "^9.4.4" }, "devDependencies": { - "@web3auth/auth": "^9.4.1", - "@web3auth/auth-adapter": "^9.3.0" + "@web3auth/auth": "^9.5.3", + "@web3auth/auth-adapter": "^9.4.4" }, "engines": { "node": ">=18.x", @@ -281,22 +282,22 @@ }, "../../packages/modal": { "name": "@web3auth/modal", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/auth-adapter": "^9.3.0", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/no-modal": "^9.3.1", - "@web3auth/ui": "^9.3.1", + "@web3auth/auth-adapter": "^9.4.4", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", + "@web3auth/no-modal": "^9.4.4", + "@web3auth/ui": "^9.4.4", "deepmerge": "^4.3.1" }, "devDependencies": { "@svgr/webpack": "^8.1.0", "@toruslabs/isomorphic-style-loader": "^5.3.3", - "@web3auth/account-abstraction-provider": "^9.3.1", - "@web3auth/auth": "^9.4.1", - "@web3auth/wallet-connect-v2-adapter": "^9.3.0", + "@web3auth/account-abstraction-provider": "^9.4.4", + "@web3auth/auth": "^9.5.3", + "@web3auth/wallet-connect-v2-adapter": "^9.4.4", "css-loader": "^7.1.2", "postcss-prefix-selector": "^2.1.0", "style-loader": "^4.0.0", @@ -318,18 +319,18 @@ }, "../../packages/no-modal": { "name": "@web3auth/no-modal", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", "deepmerge": "^4.3.1" }, "devDependencies": { - "@web3auth/account-abstraction-provider": "^9.3.1", - "@web3auth/auth-adapter": "^9.3.0", - "@web3auth/wallet-connect-v2-adapter": "^9.3.0" + "@web3auth/account-abstraction-provider": "^9.4.4", + "@web3auth/auth-adapter": "^9.4.4", + "@web3auth/wallet-connect-v2-adapter": "^9.4.4" }, "engines": { "node": ">=18.x", @@ -349,15 +350,38 @@ } } }, + "../../packages/plugins/checkout-plugin": { + "name": "@web3auth/checkout-plugin", + "version": "9.4.4", + "license": "ISC", + "dependencies": { + "@toruslabs/base-controllers": "^6.2.4", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/no-modal": "^9.4.4", + "@web3auth/ws-embed": "^3.1.0", + "loglevel": "^1.9.2" + }, + "devDependencies": { + "@toruslabs/ethereum-controllers": "^6.3.1" + }, + "engines": { + "node": ">=18.x", + "npm": ">=9.x" + }, + "peerDependencies": { + "@babel/runtime": "^7.x" + } + }, "../../packages/plugins/solana-wallet-connector-plugin": { "name": "@web3auth/solana-wallet-connector-plugin", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { "@toruslabs/solana-embed": "^2.1.0", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/no-modal": "^9.3.1", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/no-modal": "^9.4.4", "loglevel": "^1.9.2" }, "engines": { @@ -370,17 +394,17 @@ }, "../../packages/plugins/wallet-services-plugin": { "name": "@web3auth/wallet-services-plugin", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/no-modal": "^9.3.1", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/no-modal": "^9.4.4", "@web3auth/ws-embed": "^3.1.0", "loglevel": "^1.9.2" }, "devDependencies": { - "@toruslabs/ethereum-controllers": "^6.2.2" + "@toruslabs/ethereum-controllers": "^6.3.1" }, "engines": { "node": ">=18.x", @@ -392,18 +416,18 @@ }, "../../packages/providers/account-abstraction-provider": { "name": "@web3auth/account-abstraction-provider", - "version": "9.3.1", + "version": "9.4.4", "license": "ISC", "dependencies": { "@ethereumjs/util": "^9.1.0", - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", - "@web3auth/ethereum-provider": "^9.3.0", + "@toruslabs/base-controllers": "^6.3.1", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", + "@web3auth/ethereum-provider": "^9.4.4", "ethers": "^6.13.4", - "permissionless": "^0.2.15", - "viem": "^2.21.40" + "permissionless": "^0.2.18", + "viem": "^2.21.49" }, "engines": { "node": ">=18.x", @@ -477,12 +501,12 @@ }, "../../packages/providers/base-provider": { "name": "@web3auth/base-provider", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", + "@toruslabs/base-controllers": "^6.3.1", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", "json-rpc-random-id": "^1.0.1" }, "devDependencies": { @@ -498,16 +522,16 @@ }, "../../packages/providers/ethereum-provider": { "name": "@web3auth/ethereum-provider", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { "@ethereumjs/util": "^9.1.0", - "@toruslabs/base-controllers": "^6.2.2", + "@toruslabs/base-controllers": "^6.3.1", "@toruslabs/eccrypto": "^5.0.4", "@toruslabs/http-helpers": "^7.0.0", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", "assert": "^2.1.0", "bignumber.js": "^9.1.2", "bn.js": "^5.2.1", @@ -517,7 +541,7 @@ "devDependencies": { "@types/bn.js": "^5.1.6", "@types/json-rpc-random-id": "^1.0.3", - "@walletconnect/types": "^2.17.1" + "@walletconnect/types": "^2.17.2" }, "engines": { "node": ">=18.x", @@ -529,20 +553,20 @@ }, "../../packages/providers/solana-provider": { "name": "@web3auth/solana-provider", - "version": "9.3.0", + "version": "9.4.4", "license": "ISC", "dependencies": { - "@toruslabs/base-controllers": "^6.2.2", + "@toruslabs/base-controllers": "^6.3.1", "@toruslabs/tweetnacl-js": "^1.0.4", - "@web3auth/auth": "^9.4.1", - "@web3auth/base": "^9.3.0", - "@web3auth/base-provider": "^9.3.0", + "@web3auth/auth": "^9.5.3", + "@web3auth/base": "^9.4.4", + "@web3auth/base-provider": "^9.4.4", "bn.js": "^5.2.1", "bs58": "^5.0.0", "json-rpc-random-id": "^1.0.1" }, "devDependencies": { - "@solana/web3.js": "^1.95.4", + "@solana/web3.js": "^1.95.5", "@types/bn.js": "^5.1.6", "@types/bs58": "^4.0.4", "@types/json-rpc-random-id": "^1.0.3" @@ -2501,6 +2525,10 @@ "resolved": "../../packages/adapters/base-solana-adapter", "link": true }, + "node_modules/@web3auth/checkout-plugin": { + "resolved": "../../packages/plugins/checkout-plugin", + "link": true + }, "node_modules/@web3auth/coinbase-adapter": { "resolved": "../../packages/adapters/coinbase-adapter", "link": true diff --git a/demo/vue-app-new/package.json b/demo/vue-app-new/package.json index 895ec478e..5e1758a53 100644 --- a/demo/vue-app-new/package.json +++ b/demo/vue-app-new/package.json @@ -22,6 +22,7 @@ "@web3auth/base-evm-adapter": "file:../../packages/adapters/base-evm-adapter", "@web3auth/base-provider": "file:../../packages/providers/base-provider", "@web3auth/base-solana-adapter": "file:../../packages/adapters/base-solana-adapter", + "@web3auth/checkout-plugin": "file:../../packages/plugins/checkout-plugin", "@web3auth/coinbase-adapter": "file:../../packages/adapters/coinbase-adapter", "@web3auth/default-evm-adapter": "file:../../packages/adapters/default-evm-adapter", "@web3auth/default-solana-adapter": "file:../../packages/adapters/default-solana-adapter", diff --git a/demo/vue-app-new/src/components/AppSettings.vue b/demo/vue-app-new/src/components/AppSettings.vue index 465fc8d42..c950b7003 100644 --- a/demo/vue-app-new/src/components/AppSettings.vue +++ b/demo/vue-app-new/src/components/AppSettings.vue @@ -1,6 +1,7 @@