diff --git a/wallets/provider-all/package.json b/wallets/provider-all/package.json index 4e25ece57c..4d66eb6f52 100644 --- a/wallets/provider-all/package.json +++ b/wallets/provider-all/package.json @@ -36,6 +36,7 @@ "@rango-dev/provider-leap-cosmos": "^0.21.1-next.3", "@rango-dev/provider-math-wallet": "^0.21.1-next.3", "@rango-dev/provider-metamask": "^0.21.1-next.3", + "@rango-dev/provider-starknet-snap": "^0.21.1-next.3", "@rango-dev/provider-okx": "^0.21.1-next.3", "@rango-dev/provider-phantom": "^0.21.1-next.3", "@rango-dev/provider-safe": "^0.14.1-next.4", diff --git a/wallets/provider-all/src/index.ts b/wallets/provider-all/src/index.ts index 448419e0cf..6caa71cad7 100644 --- a/wallets/provider-all/src/index.ts +++ b/wallets/provider-all/src/index.ts @@ -18,6 +18,7 @@ import * as okx from '@rango-dev/provider-okx'; import * as phantom from '@rango-dev/provider-phantom'; import * as safe from '@rango-dev/provider-safe'; import * as safepal from '@rango-dev/provider-safepal'; +import * as starknetSnap from '@rango-dev/provider-starknet-snap'; import * as taho from '@rango-dev/provider-taho'; import * as tokenpocket from '@rango-dev/provider-tokenpocket'; import * as tronLink from '@rango-dev/provider-tron-link'; @@ -57,5 +58,6 @@ export const allProviders = (enviroments?: Enviroments) => { frontier, taho, braavos, + starknetSnap, ]; }; diff --git a/wallets/provider-braavos/src/helpers.ts b/wallets/provider-braavos/src/helpers.ts index 180825f6eb..ceace0334b 100644 --- a/wallets/provider-braavos/src/helpers.ts +++ b/wallets/provider-braavos/src/helpers.ts @@ -1,5 +1,7 @@ export function getBraavosInstance() { const { starknet_braavos } = window; - if (!!starknet_braavos) return starknet_braavos; + if (!!starknet_braavos) { + return starknet_braavos; + } return null; } diff --git a/wallets/provider-metamask/src/signer.ts b/wallets/provider-metamask/src/signer.ts index d53ed39e5c..375d8864dd 100644 --- a/wallets/provider-metamask/src/signer.ts +++ b/wallets/provider-metamask/src/signer.ts @@ -1,9 +1,7 @@ +import type { SignerFactory } from 'rango-types'; + import { DefaultEvmSigner } from '@rango-dev/signer-evm'; -import { - DefaultSignerFactory, - SignerFactory, - TransactionType as TxType, -} from 'rango-types'; +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; export default function getSigners(provider: any): SignerFactory { const signers = new DefaultSignerFactory(); diff --git a/wallets/provider-starknet-snap/CHANGELOG.md b/wallets/provider-starknet-snap/CHANGELOG.md new file mode 100644 index 0000000000..752d5d4d48 --- /dev/null +++ b/wallets/provider-starknet-snap/CHANGELOG.md @@ -0,0 +1,51 @@ +# [0.14.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.13.0...provider-metamask@0.14.0) (2023-08-03) + + + +# [0.13.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.12.0...provider-metamask@0.13.0) (2023-08-01) + + + +# [0.9.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.8.0...provider-metamask@0.9.0) (2023-07-31) + + + +# [0.7.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.6.0...provider-metamask@0.7.0) (2023-07-11) + + + +# [0.6.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.5.0...provider-metamask@0.6.0) (2023-07-11) + + +### Reverts + +* Revert "support for rango-types cjs format" ([ed4e050](https://github.com/rango-exchange/rango-client/commit/ed4e050bfc0dcde7aeffa6b0d73b02080a5721eb)) +* Revert "support for rango-types cjs format" ([4f5f55f](https://github.com/rango-exchange/rango-client/commit/4f5f55f96e8daa329588b932b19c291c30f339c4)) + + + +# [0.5.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.4.0...provider-metamask@0.5.0) (2023-05-31) + + + +# [0.4.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.3.0...provider-metamask@0.4.0) (2023-05-31) + + + +# [0.3.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.2.0...provider-metamask@0.3.0) (2023-05-30) + + + +# [0.2.0](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.1.15...provider-metamask@0.2.0) (2023-05-30) + + + +## [0.1.14](https://github.com/rango-exchange/rango-client/compare/provider-metamask@0.1.13...provider-metamask@0.1.14) (2023-05-15) + + +### Bug Fixes + +* update rango-types and fix notification bugs ([993f185](https://github.com/rango-exchange/rango-client/commit/993f185e0b8c5e5e15a2c65ba2d85d1f9c8daa90)) + + + diff --git a/wallets/provider-starknet-snap/package.json b/wallets/provider-starknet-snap/package.json new file mode 100644 index 0000000000..ef185267b8 --- /dev/null +++ b/wallets/provider-starknet-snap/package.json @@ -0,0 +1,29 @@ +{ + "name": "@rango-dev/provider-starknet-snap", + "version": "0.21.1-next.3", + "license": "MIT", + "type": "module", + "module": "./dist/index.js", + "main": "./dist/index.js", + "exports": { + ".": "./dist/index.js" + }, + "typings": "dist/index.d.ts", + "files": [ + "dist", + "src" + ], + "scripts": { + "build": "node ../../scripts/build/command.mjs --path wallets/provider-starknet-snap", + "clean": "rimraf dist", + "format": "prettier --write '{.,src}/**/*.{ts,tsx}'", + "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore" + }, + "dependencies": { + "@rango-dev/wallets-shared": "^0.21.1-next.3", + "rango-types": "^0.1.46" + }, + "publishConfig": { + "access": "public" + } +} diff --git a/wallets/provider-starknet-snap/readme.md b/wallets/provider-starknet-snap/readme.md new file mode 100644 index 0000000000..c8de85d7a3 --- /dev/null +++ b/wallets/provider-starknet-snap/readme.md @@ -0,0 +1 @@ +# @rango-dev/provider-metamask diff --git a/wallets/provider-starknet-snap/src/helpers.ts b/wallets/provider-starknet-snap/src/helpers.ts new file mode 100644 index 0000000000..bd572ed6c4 --- /dev/null +++ b/wallets/provider-starknet-snap/src/helpers.ts @@ -0,0 +1,77 @@ +import type { AccContract } from './types'; + +import { getCoinbaseInstance } from '@rango-dev/wallets-shared'; + +export const DEFAULT_SNAP_ID = 'npm:@consensys/starknet-snap'; +export const SNAP_VERSION = '2.2.0'; + +export function metamask() { + const isCoinbaseWalletAvailable = !!getCoinbaseInstance(); + const { ethereum } = window; + + // Some wallets overriding the metamask. So we need to get it properly. + if (isCoinbaseWalletAvailable) { + // Getting intance from overrided structure from coinbase. + return getCoinbaseInstance('metamask'); + } + if (!!ethereum && ethereum.isMetaMask) { + return ethereum; + } + + return null; +} +export const isStarknetSnapInstalled = async (instance: any) => + instance + .request({ + method: 'wallet_invokeSnap', + params: { + snapId: DEFAULT_SNAP_ID, + request: { + method: 'ping', + }, + }, + }) + .then(() => { + return true; + }) + .catch((err: any) => { + console.log(err); + return false; + }); + +export const installStarknetSnap = async (instance: any) => { + const installed = await isStarknetSnapInstalled(instance); + if (!installed) { + instance.request({ + method: 'wallet_requestSnaps', + params: { + [DEFAULT_SNAP_ID]: { version: SNAP_VERSION }, //Snap's version + }, + }); + } +}; + +export const getAccounts = async ( + instance: any, + chainId: string +): Promise => { + const START_SCAN_INDEX = 0; + const MAX_SCANNED = 1; + const MAX_MISSED = 1; + const scannedAccounts = await instance.request({ + method: 'wallet_invokeSnap', + params: { + snapId: DEFAULT_SNAP_ID, + request: { + method: 'starkNet_recoverAccounts', + params: { + startScanIndex: START_SCAN_INDEX, + maxScanned: MAX_SCANNED, + maxMissed: MAX_MISSED, + chainId, + }, + }, + }, + }); + return scannedAccounts; +}; diff --git a/wallets/provider-starknet-snap/src/index.ts b/wallets/provider-starknet-snap/src/index.ts new file mode 100644 index 0000000000..ff6ef5f49b --- /dev/null +++ b/wallets/provider-starknet-snap/src/index.ts @@ -0,0 +1,86 @@ +import type { + CanEagerConnect, + CanSwitchNetwork, + Connect, + ProviderConnectResult, + Subscribe, + WalletInfo, +} from '@rango-dev/wallets-shared'; +import type { BlockchainMeta, SignerFactory } from 'rango-types'; + +import { + canEagerlyConnectToEvm, + subscribeToEvm, + WalletTypes, +} from '@rango-dev/wallets-shared'; +import { starknetBlockchain } from 'rango-types'; + +import { + getAccounts, + installStarknetSnap, + isStarknetSnapInstalled, + metamask as metamask_instance, +} from './helpers'; +import signer from './signer'; + +const WALLET = WalletTypes.STARKNET_SNAP; + +export const config = { + type: WALLET, +}; + +export const getInstance = metamask_instance; +export const connect: Connect = async ({ instance, meta }) => { + /* + * cosmos snap (It's optional) + * If the user approves to install Snap, we take the Cosmos addresses and add them to the accounts. + */ + await installStarknetSnap(instance); + const installed = await isStarknetSnapInstalled(instance); + let accounts: ProviderConnectResult[] = []; + if (installed) { + for (const item of meta) { + const addresses = await getAccounts(instance, item.chainId || ''); + console.log({ addresses }); + + accounts = [ + ...accounts, + ...addresses.map((item) => ({ + accounts: [item.address], + chainId: item.chainId, + })), + ]; + } + } + return accounts; +}; + +export const subscribe: Subscribe = subscribeToEvm; + +export const canSwitchNetworkTo: CanSwitchNetwork = () => false; + +export const getSigners: (provider: any) => SignerFactory = signer; + +export const canEagerConnect: CanEagerConnect = canEagerlyConnectToEvm; + +export const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = ( + allBlockChains +) => { + const starknet = starknetBlockchain(allBlockChains); + return { + name: 'Starknet Snap', + img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/metamask/icon.svg', + installLink: { + CHROME: + 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en', + BRAVE: + 'https://chrome.google.com/webstore/detail/metamask/nkbihfbeogaeaoehlefnkodbefgpgknn?hl=en', + + FIREFOX: 'https://addons.mozilla.org/en-US/firefox/addon/ether-metamask', + EDGE: 'https://microsoftedge.microsoft.com/addons/detail/metamask/ejbalbakoplchlghecdalmeeeajnimhm?hl=en-US', + DEFAULT: 'https://metamask.io/download/', + }, + color: '#dac7ae', + supportedChains: starknet, + }; +}; diff --git a/wallets/provider-starknet-snap/src/signer.ts b/wallets/provider-starknet-snap/src/signer.ts new file mode 100644 index 0000000000..29cae8b1d0 --- /dev/null +++ b/wallets/provider-starknet-snap/src/signer.ts @@ -0,0 +1,11 @@ +import type { SignerFactory } from 'rango-types'; + +import { DefaultSignerFactory, TransactionType as TxType } from 'rango-types'; + +import StarknetSigner from './signers/starknet'; + +export default function getSigners(provider: any): SignerFactory { + const signers = new DefaultSignerFactory(); + signers.registerSigner(TxType.STARKNET, new StarknetSigner(provider)); + return signers; +} diff --git a/wallets/provider-starknet-snap/src/signers/helpers.ts b/wallets/provider-starknet-snap/src/signers/helpers.ts new file mode 100644 index 0000000000..358e6d26ad --- /dev/null +++ b/wallets/provider-starknet-snap/src/signers/helpers.ts @@ -0,0 +1,36 @@ +import { DEFAULT_SNAP_ID } from '../helpers'; + +export async function sendTransaction( + provider: any, + contractAddress: string, + contractFuncName: string, + contractCallData: string, + senderAddress: string, + chainId: string | null, + maxFee?: string +) { + try { + const response = await provider.request({ + method: 'wallet_invokeSnap', + params: { + snapId: DEFAULT_SNAP_ID, + request: { + method: 'starkNet_sendTransaction', + params: { + contractAddress, + contractFuncName, + contractCallData, + senderAddress, + maxFee, + chainId, + }, + }, + }, + }); + return response; + } catch (err) { + //eslint-disable-next-line no-console + console.error(err); + throw err; + } +} diff --git a/wallets/provider-starknet-snap/src/signers/starknet.ts b/wallets/provider-starknet-snap/src/signers/starknet.ts new file mode 100644 index 0000000000..48b29715dd --- /dev/null +++ b/wallets/provider-starknet-snap/src/signers/starknet.ts @@ -0,0 +1,51 @@ +import type { GenericSigner, StarknetTransaction } from 'rango-types'; + +import { SignerError, SignerErrorCode } from 'rango-types'; + +import { sendTransaction } from './helpers'; + +class StarknetSigner implements GenericSigner { + private provider: any; + + constructor(provider: any) { + this.provider = provider; + } + + public async signMessage(): Promise { + throw SignerError.UnimplementedError('signMessage'); + } + + async signAndSendTx( + tx: StarknetTransaction, + address: string, + chainId: string | null + ): Promise<{ hash: string }> { + const { calls } = tx; + + try { + for (const call of calls) { + const res = await sendTransaction( + this.provider, + call.contractAddress, + call.entrypoint, + (call.calldata as string[]).toString(), + address, + chainId + ); + console.log({ res }); + } + + return { hash: '' }; + } catch (err) { + console.log({ err }); + + if (SignerError.isSignerError(err)) { + throw err; + } else { + throw new SignerError(SignerErrorCode.SEND_TX_ERROR, undefined, err); + } + } + } +} + +export default StarknetSigner; diff --git a/wallets/provider-starknet-snap/src/types.ts b/wallets/provider-starknet-snap/src/types.ts new file mode 100644 index 0000000000..e798b78d28 --- /dev/null +++ b/wallets/provider-starknet-snap/src/types.ts @@ -0,0 +1,9 @@ +export interface AccContract { + addressSalt: string; + publicKey: string; // in hex + address: string; // in hex + addressIndex: number; + derivationPath: string; + deployTxnHash: string; // in hex + chainId: string; // in hex +} diff --git a/wallets/provider-starknet-snap/tsconfig.json b/wallets/provider-starknet-snap/tsconfig.json new file mode 100644 index 0000000000..7f49cdfc54 --- /dev/null +++ b/wallets/provider-starknet-snap/tsconfig.json @@ -0,0 +1,11 @@ +{ + // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs + "extends": "../../tsconfig.lib.json", + "include": ["src", "types", "../../global-wallets-env.d.ts"], + "compilerOptions": { + "outDir": "dist", + "rootDir": "./src", + "lib": ["dom", "esnext"] + // match output dir to input dir. e.g. dist/index instead of dist/src/index + } +} diff --git a/wallets/shared/src/rango.ts b/wallets/shared/src/rango.ts index 46cb0c1baa..8498d8d419 100644 --- a/wallets/shared/src/rango.ts +++ b/wallets/shared/src/rango.ts @@ -78,6 +78,7 @@ export enum WalletTypes { ENKRYPT = 'enkrypt', TAHO = 'taho', MY_TON_WALLET = 'mytonwallet', + STARKNET_SNAP = 'starknetSnap', } export enum Networks { diff --git a/yarn.lock b/yarn.lock index c0ed240832..9ae5107447 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2592,6 +2592,14 @@ crc-32 "^1.2.0" ethereumjs-util "^7.1.5" +"@ethereumjs/common@^3.2.0": + version "3.2.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/common/-/common-3.2.0.tgz#b71df25845caf5456449163012074a55f048e0a0" + integrity sha512-pksvzI0VyLgmuEF2FA/JR/4/y6hcPq8OUail3/AvycBaW1d5VSauOZzqGvJ3RTmR4MU35lWE8KseKOsEhrFRBA== + dependencies: + "@ethereumjs/util" "^8.1.0" + crc-32 "^1.2.0" + "@ethereumjs/ethash@^1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@ethereumjs/ethash/-/ethash-1.1.0.tgz#7c5918ffcaa9cb9c1dc7d12f77ef038c11fb83fb" @@ -2603,6 +2611,11 @@ ethereumjs-util "^7.1.1" miller-rabin "^4.0.0" +"@ethereumjs/rlp@^4.0.1": + version "4.0.1" + resolved "https://registry.yarnpkg.com/@ethereumjs/rlp/-/rlp-4.0.1.tgz#626fabfd9081baab3d0a3074b0c7ecaf674aaa41" + integrity sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw== + "@ethereumjs/tx@3.4.0": version "3.4.0" resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-3.4.0.tgz#7eb1947eefa55eb9cf05b3ca116fb7a3dbd0bce7" @@ -2619,6 +2632,25 @@ "@ethereumjs/common" "^2.6.4" ethereumjs-util "^7.1.5" +"@ethereumjs/tx@^4.1.2": + version "4.2.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/tx/-/tx-4.2.0.tgz#5988ae15daf5a3b3c815493bc6b495e76009e853" + integrity sha512-1nc6VO4jtFd172BbSnTnDQVr9IYBFl1y4xPzZdtkrkKIncBCkdbgfdRV+MiTkJYAtTxvV12GRZLqBFT1PNK6Yw== + dependencies: + "@ethereumjs/common" "^3.2.0" + "@ethereumjs/rlp" "^4.0.1" + "@ethereumjs/util" "^8.1.0" + ethereum-cryptography "^2.0.0" + +"@ethereumjs/util@^8.1.0": + version "8.1.0" + resolved "https://registry.yarnpkg.com/@ethereumjs/util/-/util-8.1.0.tgz#299df97fb6b034e0577ce9f94c7d9d1004409ed4" + integrity sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA== + dependencies: + "@ethereumjs/rlp" "^4.0.1" + ethereum-cryptography "^2.0.0" + micro-ftch "^0.3.1" + "@ethereumjs/vm@5.6.0": version "5.6.0" resolved "https://registry.yarnpkg.com/@ethereumjs/vm/-/vm-5.6.0.tgz#e0ca62af07de820143674c30b776b86c1983a464" @@ -2711,7 +2743,7 @@ "@ethersproject/logger" "^5.7.0" bn.js "^5.2.1" -"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.7.0": +"@ethersproject/bytes@5.7.0", "@ethersproject/bytes@^5.6.1", "@ethersproject/bytes@^5.7.0": version "5.7.0" resolved "https://registry.yarnpkg.com/@ethersproject/bytes/-/bytes-5.7.0.tgz#a00f6ea8d7e7534d6d87f47188af1148d71f155d" integrity sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A== @@ -3714,6 +3746,38 @@ dependencies: moo "^0.5.1" +"@metamask/key-tree@^7.0.0": + version "7.1.1" + resolved "https://registry.yarnpkg.com/@metamask/key-tree/-/key-tree-7.1.1.tgz#559a76bf8fe0a3495c4a7aa41ed90f5475a7e2a2" + integrity sha512-D9mvbb7M/wGyC26TKzeS29rif4UX0yMN2Ws8/YdxY1wYE6udDvmyE6fFR7UGwJx9EGsPrqLmtqrbs5qKoyDNow== + dependencies: + "@metamask/scure-bip39" "^2.1.0" + "@metamask/utils" "^6.0.1" + "@noble/ed25519" "^1.6.0" + "@noble/hashes" "^1.0.0" + "@noble/secp256k1" "^1.5.5" + "@scure/base" "^1.0.0" + +"@metamask/scure-bip39@^2.1.0": + version "2.1.1" + resolved "https://registry.yarnpkg.com/@metamask/scure-bip39/-/scure-bip39-2.1.1.tgz#071ddbaea7afe13886996c3bec22f472d79a4d34" + integrity sha512-1K8aBsAqr6+8jWhguVl06n8e+zjV9sUnys+5PLyVU4mb8LbulQ60F6cq7iQys3xX/yCwKt1+7c7j2nuTEpW+ZQ== + dependencies: + "@noble/hashes" "~1.3.2" + "@scure/base" "~1.1.3" + +"@metamask/utils@^6.0.1": + version "6.2.0" + resolved "https://registry.yarnpkg.com/@metamask/utils/-/utils-6.2.0.tgz#7e63ad2db33117df6fef89449db3a86dcd6b42b5" + integrity sha512-nM5CujDd4STfwx4ic/gim9G1W9oZcWUGKN4WbAT4waEkqNSIluVmZeHgxUKvdajZ7iCFDnjDLajkD4sP7c/ClQ== + dependencies: + "@ethereumjs/tx" "^4.1.2" + "@noble/hashes" "^1.3.1" + "@types/debug" "^4.1.7" + debug "^4.3.4" + semver "^7.3.8" + superstruct "^1.0.3" + "@mischnic/json-sourcemap@^0.1.0": version "0.1.0" resolved "https://registry.yarnpkg.com/@mischnic/json-sourcemap/-/json-sourcemap-0.1.0.tgz#38af657be4108140a548638267d02a2ea3336507" @@ -3838,18 +3902,30 @@ dependencies: "@noble/hashes" "1.3.0" -"@noble/curves@^1.0.0": +"@noble/curves@1.1.0", "@noble/curves@^1.0.0", "@noble/curves@~1.1.0": version "1.1.0" resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.1.0.tgz#f13fc667c89184bc04cccb9b11e8e7bae27d8c3d" integrity sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA== dependencies: "@noble/hashes" "1.3.1" -"@noble/ed25519@^1.7.0": +"@noble/curves@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/curves/-/curves-1.2.0.tgz#92d7e12e4e49b23105a2555c6984d41733d65c35" + integrity sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw== + dependencies: + "@noble/hashes" "1.3.2" + +"@noble/ed25519@^1.6.0", "@noble/ed25519@^1.7.0": version "1.7.3" resolved "https://registry.yarnpkg.com/@noble/ed25519/-/ed25519-1.7.3.tgz#57e1677bf6885354b466c38e2b620c62f45a7123" integrity sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ== +"@noble/hashes@1.2.0", "@noble/hashes@~1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.2.0.tgz#a3150eeb09cc7ab207ebf6d7b9ad311a9bdbed12" + integrity sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ== + "@noble/hashes@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" @@ -3860,12 +3936,12 @@ resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.1.tgz#8831ef002114670c603c458ab8b11328406953a9" integrity sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA== -"@noble/hashes@^1.1.2": +"@noble/hashes@1.3.2", "@noble/hashes@^1.1.2", "@noble/hashes@^1.3.1", "@noble/hashes@~1.3.1", "@noble/hashes@~1.3.2": version "1.3.2" resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.2.tgz#6f26dbc8fbc7205873ce3cee2f690eba0d421b39" integrity sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ== -"@noble/secp256k1@^1.6.3": +"@noble/secp256k1@1.7.1", "@noble/secp256k1@^1.5.5", "@noble/secp256k1@^1.6.3", "@noble/secp256k1@~1.7.0": version "1.7.1" resolved "https://registry.yarnpkg.com/@noble/secp256k1/-/secp256k1-1.7.1.tgz#b251c70f824ce3ca7f8dc3df08d58f005cc0507c" integrity sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw== @@ -5424,11 +5500,25 @@ dependencies: cross-fetch "^3.1.5" +"@scure/base@^1.0.0", "@scure/base@^1.1.3", "@scure/base@~1.1.3": + version "1.1.3" + resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.3.tgz#8584115565228290a6c6c4961973e0903bb3df2f" + integrity sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q== + "@scure/base@~1.1.0": version "1.1.1" resolved "https://registry.yarnpkg.com/@scure/base/-/base-1.1.1.tgz#ebb651ee52ff84f420097055f4bf46cfba403938" integrity sha512-ZxOhsSyxYwLJj3pLZCefNitxsj093tb2vq90mp2txoYeBqbcjDjqFhyM8eUjq/uFm6zJ+mUuqxlS2FkuSY1MTA== +"@scure/bip32@1.1.5": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.1.5.tgz#d2ccae16dcc2e75bc1d75f5ef3c66a338d1ba300" + integrity sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw== + dependencies: + "@noble/hashes" "~1.2.0" + "@noble/secp256k1" "~1.7.0" + "@scure/base" "~1.1.0" + "@scure/bip32@1.3.0": version "1.3.0" resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.0.tgz#6c8d980ef3f290987736acd0ee2e0f0d50068d87" @@ -5438,6 +5528,23 @@ "@noble/hashes" "~1.3.0" "@scure/base" "~1.1.0" +"@scure/bip32@1.3.1": + version "1.3.1" + resolved "https://registry.yarnpkg.com/@scure/bip32/-/bip32-1.3.1.tgz#7248aea723667f98160f593d621c47e208ccbb10" + integrity sha512-osvveYtyzdEVbt3OfwwXFr4P2iVBL5u1Q3q4ONBfDY/UpOuXmOlbgwc1xECEboY8wIays8Yt6onaWMUdUbfl0A== + dependencies: + "@noble/curves" "~1.1.0" + "@noble/hashes" "~1.3.1" + "@scure/base" "~1.1.0" + +"@scure/bip39@1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.1.1.tgz#b54557b2e86214319405db819c4b6a370cf340c5" + integrity sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg== + dependencies: + "@noble/hashes" "~1.2.0" + "@scure/base" "~1.1.0" + "@scure/bip39@1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.0.tgz#a207e2ef96de354de7d0002292ba1503538fc77b" @@ -5446,6 +5553,22 @@ "@noble/hashes" "~1.3.0" "@scure/base" "~1.1.0" +"@scure/bip39@1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@scure/bip39/-/bip39-1.2.1.tgz#5cee8978656b272a917b7871c981e0541ad6ac2a" + integrity sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg== + dependencies: + "@noble/hashes" "~1.3.0" + "@scure/base" "~1.1.0" + +"@scure/starknet@~0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@scure/starknet/-/starknet-0.3.0.tgz#b8273a42fc721025f8098b1f1d96368a7067e1c4" + integrity sha512-Ma66yZlwa5z00qI5alSxdWtIpky5LBhy22acVFdoC5kwwbd9uDyMWEYzWHdNyKmQg9t5Y2UOXzINMeb3yez+Gw== + dependencies: + "@noble/curves" "~1.2.0" + "@noble/hashes" "~1.3.2" + "@sentry/browser@^6.12.0": version "6.19.7" resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-6.19.7.tgz#a40b6b72d911b5f1ed70ed3b4e7d4d4e625c0b5f" @@ -7084,6 +7207,13 @@ dependencies: "@types/ms" "*" +"@types/debug@^4.1.7": + version "4.1.12" + resolved "https://registry.yarnpkg.com/@types/debug/-/debug-4.1.12.tgz#a155f21690871953410df4b6b6f53187f0500917" + integrity sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ== + dependencies: + "@types/ms" "*" + "@types/detect-port@^1.3.0": version "1.3.3" resolved "https://registry.yarnpkg.com/@types/detect-port/-/detect-port-1.3.3.tgz#124c5d4c283f48a21f80826bcf39433b3e64aa81" @@ -12704,6 +12834,26 @@ ethereum-cryptography@^0.1.3: secp256k1 "^4.0.1" setimmediate "^1.0.5" +ethereum-cryptography@^1.0.3: + version "1.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz#5ccfa183e85fdaf9f9b299a79430c044268c9b3a" + integrity sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw== + dependencies: + "@noble/hashes" "1.2.0" + "@noble/secp256k1" "1.7.1" + "@scure/bip32" "1.1.5" + "@scure/bip39" "1.1.1" + +ethereum-cryptography@^2.0.0: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-2.1.2.tgz#18fa7108622e56481157a5cb7c01c0c6a672eb67" + integrity sha512-Z5Ba0T0ImZ8fqXrJbpHcbpAvIswRte2wGNR/KePnu8GbbvgJ47lMxT/ZZPG6i9Jaht4azPDop4HaM00J0J59ug== + dependencies: + "@noble/curves" "1.1.0" + "@noble/hashes" "1.3.1" + "@scure/bip32" "1.3.1" + "@scure/bip39" "1.2.1" + ethereum-waffle@^4.0.10: version "4.0.10" resolved "https://registry.yarnpkg.com/ethereum-waffle/-/ethereum-waffle-4.0.10.tgz#f1ef1564c0155236f1a66c6eae362a5d67c9f64c" @@ -12759,7 +12909,7 @@ ethereumjs-util@^7.1.1, ethereumjs-util@^7.1.3, ethereumjs-util@^7.1.4, ethereum ethereum-cryptography "^0.1.3" rlp "^2.2.4" -ethers@^5.7.2: +ethers@^5.5.1, ethers@^5.7.2: version "5.7.2" resolved "https://registry.yarnpkg.com/ethers/-/ethers-5.7.2.tgz#3a7deeabbb8c030d4126b24f84e525466145872e" integrity sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg== @@ -15209,6 +15359,14 @@ isomorphic-fetch@^2.1.1: node-fetch "^1.0.1" whatwg-fetch ">=0.10.0" +isomorphic-fetch@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/isomorphic-fetch/-/isomorphic-fetch-3.0.0.tgz#0267b005049046d2421207215d45d6a262b8b8b4" + integrity sha512-qvUtwJ3j6qwsF3jLxkZ72qCgjMysPzDfeV240JHiGZsANBYd+EEuu35v7dfrJ9Up0Ak07D7GGSkGhCHTqg/5wA== + dependencies: + node-fetch "^2.6.1" + whatwg-fetch "^3.4.1" + isomorphic-ws@5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-5.0.0.tgz#e5529148912ecb9b451b46ed44d53dae1ce04bbf" @@ -16679,6 +16837,11 @@ loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.3.1, loose-envify@^1.4 dependencies: js-tokens "^3.0.0 || ^4.0.0" +lossless-json@^2.0.8: + version "2.0.11" + resolved "https://registry.yarnpkg.com/lossless-json/-/lossless-json-2.0.11.tgz#3137684c93fd99481c6f99c985efc9c9c5cc76a5" + integrity sha512-BP0vn+NGYvzDielvBZaFain/wgeJ1hTvURCqtKvhr1SCPePdaaTanmmcplrHfEJSJOUql7hk4FHwToNJjWRY3g== + loupe@^2.3.1, loupe@^2.3.6: version "2.3.6" resolved "https://registry.yarnpkg.com/loupe/-/loupe-2.3.6.tgz#76e4af498103c532d1ecc9be102036a21f787b53" @@ -17144,6 +17307,11 @@ methods@~1.1.2: resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" integrity sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w== +micro-ftch@^0.3.1: + version "0.3.1" + resolved "https://registry.yarnpkg.com/micro-ftch/-/micro-ftch-0.3.1.tgz#6cb83388de4c1f279a034fb0cf96dfc050853c5f" + integrity sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg== + micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: version "1.1.0" resolved "https://registry.yarnpkg.com/micromark-core-commonmark/-/micromark-core-commonmark-1.1.0.tgz#1386628df59946b2d39fb2edfd10f3e8e0a75bb8" @@ -17932,7 +18100,7 @@ node-fetch-native@^1.4.0, node-fetch-native@^1.4.1: resolved "https://registry.yarnpkg.com/node-fetch-native/-/node-fetch-native-1.4.1.tgz#5a336e55b4e1b1e72b9927da09fecd2b374c9be5" integrity sha512-NsXBU0UgBxo2rQLOeWNZqS3fvflWePMECr8CoSWoSTqCqGbVVsvl9vZu1HfQicYN0g5piV9Gh8RTEvo/uP752w== -node-fetch@2: +node-fetch@2, node-fetch@^2.6.1: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" integrity sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A== @@ -18593,6 +18761,11 @@ pako@1.0.11: resolved "https://registry.yarnpkg.com/pako/-/pako-1.0.11.tgz#6c9599d340d54dfd3946380252a35705a6b992bf" integrity sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw== +pako@^2.0.4: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + pako@~0.2.0: version "0.2.9" resolved "https://registry.yarnpkg.com/pako/-/pako-0.2.9.tgz#f3f7522f4ef782348da8161bad9ecfd51bf83a75" @@ -21342,6 +21515,36 @@ standard-as-callback@^2.1.0: resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45" integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A== +starknet@^5.24.3: + version "5.24.3" + resolved "https://registry.yarnpkg.com/starknet/-/starknet-5.24.3.tgz#1d8a84047783ea122a6cf4f2dac59bfa6d628154" + integrity sha512-v0TuaNc9iNtHdbIRzX372jfQH1vgx2rwBHQDMqK4DqjJbwFEE5dog8Go6rGiZVW750NqRSWrZ7ahqyRNc3bscg== + dependencies: + "@noble/curves" "~1.2.0" + "@scure/base" "^1.1.3" + "@scure/starknet" "~0.3.0" + isomorphic-fetch "^3.0.0" + lossless-json "^2.0.8" + pako "^2.0.4" + url-join "^4.0.1" + +"starknet_v4.22.0@npm:starknet@4.22.0": + version "4.22.0" + resolved "https://registry.yarnpkg.com/starknet/-/starknet-4.22.0.tgz#8d0c628e2a8e868ee9b4757afe89f07b05ec55ff" + integrity sha512-jC9Taxb6a/ht9zmS1LU/DSLfwJKpgCJnE9AktVksc5SE/+jQMpqxsq6fm7PRiqupjiqRC1DOS8N47cj+KaGv4Q== + dependencies: + "@ethersproject/bytes" "^5.6.1" + bn.js "^5.2.1" + elliptic "^6.5.4" + ethereum-cryptography "^1.0.3" + hash.js "^1.1.7" + isomorphic-fetch "^3.0.0" + json-bigint "^1.0.0" + minimalistic-assert "^1.0.1" + pako "^2.0.4" + ts-custom-error "^3.3.1" + url-join "^4.0.1" + static-extend@^0.1.1: version "0.1.2" resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6" @@ -21654,6 +21857,11 @@ superstruct@^0.14.2: resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-0.14.2.tgz#0dbcdf3d83676588828f1cf5ed35cda02f59025b" integrity sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ== +superstruct@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/superstruct/-/superstruct-1.0.3.tgz#de626a5b49c6641ff4d37da3c7598e7a87697046" + integrity sha512-8iTn3oSS8nRGn+C2pgXSKPI3jmpm6FExNazNpjvqS6ZUJQCej3PUXEKM8NjHBOs54ExM+LPW/FBRhymrdcCiSg== + supports-color@^5.3.0: version "5.5.0" resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" @@ -22140,6 +22348,11 @@ ts-command-line-args@^2.2.0: command-line-usage "^6.1.0" string-format "^2.0.0" +ts-custom-error@^3.3.1: + version "3.3.1" + resolved "https://registry.yarnpkg.com/ts-custom-error/-/ts-custom-error-3.3.1.tgz#8bd3c8fc6b8dc8e1cb329267c45200f1e17a65d1" + integrity sha512-5OX1tzOjxWEgsr/YEUWSuPrQ00deKLh6D7OTWcvNHm12/7QPyRh8SYpyWvA4IZv8H/+GQWQEh/kwo95Q9OVW1A== + ts-dedent@^1.1.0: version "1.2.0" resolved "https://registry.yarnpkg.com/ts-dedent/-/ts-dedent-1.2.0.tgz#6aa2229d837159bb6d635b6b233002423b91e0b0" @@ -22818,6 +23031,11 @@ urix@^0.1.0: resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72" integrity sha512-Am1ousAhSLBeB9cG/7k7r2R0zj50uDRlZHPGbazid5s9rlF1F/QKYObEKSIunSjIOkJZqwRRLpvewjEkM7pSqg== +url-join@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/url-join/-/url-join-4.0.1.tgz#b642e21a2646808ffa178c4c5fda39844e12cde7" + integrity sha512-jk1+QP6ZJqyOiuEI9AEWQfju/nB2Pw466kbA0LEZljHwKeMgd9WrAEgEGxjPDD2+TNbbb37rTyhEfrCXfuKXnA== + url@^0.11.0: version "0.11.1" resolved "https://registry.yarnpkg.com/url/-/url-0.11.1.tgz#26f90f615427eca1b9f4d6a28288c147e2302a32" @@ -23271,6 +23489,11 @@ whatwg-fetch@>=0.10.0: resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.17.tgz#009bbbfc122b227b74ba1ff31536b3a1a0e0e212" integrity sha512-c4ghIvG6th0eudYwKZY5keb81wtFz9/WeAHAoy8+r18kcWlitUIrmGFQ2rWEl4UCKUilD3zCLHOIPheHx5ypRQ== +whatwg-fetch@^3.4.1: + version "3.6.19" + resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.6.19.tgz#caefd92ae630b91c07345537e67f8354db470973" + integrity sha512-d67JP4dHSbm2TrpFj8AbO8DnL1JXL5J9u0Kq2xW6d0TFDbCA3Muhdt8orXC22utleTVj7Prqt82baN6RBvnEgw== + whatwg-mimetype@^2.2.0, whatwg-mimetype@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"