@rango-dev/provider-default 0.33.0 → 0.33.1-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # [0.33.0](https://github.com/rango-exchange/rango-client/compare/provider-default@0.32.1...provider-default@0.33.0) (2024-08-11)
2
+
3
+
4
+
1
5
  ## [0.32.1](https://github.com/rango-exchange/rango-client/compare/provider-default@0.32.0...provider-default@0.32.1) (2024-07-14)
2
6
 
3
7
 
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { CanEagerConnect, CanSwitchNetwork, Connect, Subscribe, SwitchNetwork, WalletInfo } from '@rango-dev/wallets-shared';
2
2
  import type { BlockchainMeta, SignerFactory } from 'rango-types';
3
3
  import { WalletTypes } from '@rango-dev/wallets-shared';
4
- import { defaultInjected } from './helpers';
4
+ import { defaultInjected } from './helpers.js';
5
5
  export declare const config: {
6
6
  type: WalletTypes;
7
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAML,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAK5C,eAAO,MAAM,MAAM;;CAElB,CAAC;AAEF,eAAO,MAAM,WAAW,wBAAkB,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAE,OAarB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SAA0B,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,aAAmC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,EAAE,gBAAwC,CAAC;AAE1E,eAAO,MAAM,UAAU,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,aAAsB,CAAC;AAEnE,eAAO,MAAM,eAAe,EAAE,eAAwC,CAAC;AAEvE,eAAO,MAAM,aAAa,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,UAajE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,OAAO,EACP,SAAS,EACT,aAAa,EACb,UAAU,EACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEjE,OAAO,EAML,WAAW,EACZ,MAAM,2BAA2B,CAAC;AAGnC,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAK/C,eAAO,MAAM,MAAM;;CAElB,CAAC;AAEF,eAAO,MAAM,WAAW,wBAAkB,CAAC;AAC3C,eAAO,MAAM,OAAO,EAAE,OAarB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,SAA0B,CAAC;AAEnD,eAAO,MAAM,aAAa,EAAE,aAAmC,CAAC;AAEhE,eAAO,MAAM,kBAAkB,EAAE,gBAAwC,CAAC;AAE1E,eAAO,MAAM,UAAU,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,aAAsB,CAAC;AAEnE,eAAO,MAAM,eAAe,EAAE,eAAwC,CAAC;AAEvE,eAAO,MAAM,aAAa,EAAE,CAAC,cAAc,EAAE,cAAc,EAAE,KAAK,UAajE,CAAC"}
package/dist/index.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../src/index.ts", "../src/helpers.ts", "../src/signer.ts"],
4
- "sourcesContent": ["import type {\n CanEagerConnect,\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\n\nimport {\n canEagerlyConnectToEvm,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n WalletTypes,\n} from '@rango-dev/wallets-shared';\nimport { evmBlockchains } from 'rango-types';\n\nimport { defaultInjected } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletTypes.DEFAULT;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const getInstance = defaultInjected;\nexport const connect: Connect = async ({ instance }) => {\n /*\n * Note: We need to get `chainId` here, because for the first time\n * after opening the browser, wallet is locked, and don't give us accounts and chainId\n * on `check` phase, so `network` will be null. For this case we need to get chainId\n * whenever we are requesting accounts.\n */\n const { accounts, chainId } = await getEvmAccounts(instance);\n\n return {\n accounts,\n chainId,\n };\n};\n\nexport const subscribe: Subscribe = subscribeToEvm;\n\nexport const switchNetwork: SwitchNetwork = switchNetworkForEvm;\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;\n\nexport const getSigners: (provider: any) => SignerFactory = signer;\n\nexport const canEagerConnect: CanEagerConnect = canEagerlyConnectToEvm;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const evms = evmBlockchains(allBlockChains);\n return {\n name: 'Default',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/default/icon.svg',\n installLink: {\n DEFAULT: 'https://metamask.io/download/',\n },\n color: '#dac7ae',\n supportedChains: evms,\n };\n};\n", "export function defaultInjected() {\n const { ethereum } = window;\n return ethereum ?? null;\n}\n", "import type { SignerFactory } from 'rango-types';\n\nimport { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new DefaultSignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n"],
4
+ "sourcesContent": ["import type {\n CanEagerConnect,\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport type { BlockchainMeta, SignerFactory } from 'rango-types';\n\nimport {\n canEagerlyConnectToEvm,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n WalletTypes,\n} from '@rango-dev/wallets-shared';\nimport { evmBlockchains } from 'rango-types';\n\nimport { defaultInjected } from './helpers.js';\nimport signer from './signer.js';\n\nconst WALLET = WalletTypes.DEFAULT;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const getInstance = defaultInjected;\nexport const connect: Connect = async ({ instance }) => {\n /*\n * Note: We need to get `chainId` here, because for the first time\n * after opening the browser, wallet is locked, and don't give us accounts and chainId\n * on `check` phase, so `network` will be null. For this case we need to get chainId\n * whenever we are requesting accounts.\n */\n const { accounts, chainId } = await getEvmAccounts(instance);\n\n return {\n accounts,\n chainId,\n };\n};\n\nexport const subscribe: Subscribe = subscribeToEvm;\n\nexport const switchNetwork: SwitchNetwork = switchNetworkForEvm;\n\nexport const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;\n\nexport const getSigners: (provider: any) => SignerFactory = signer;\n\nexport const canEagerConnect: CanEagerConnect = canEagerlyConnectToEvm;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const evms = evmBlockchains(allBlockChains);\n return {\n name: 'Default',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/default/icon.svg',\n installLink: {\n DEFAULT: 'https://metamask.io/download/',\n },\n color: '#dac7ae',\n supportedChains: evms,\n };\n};\n", "export function defaultInjected() {\n const { ethereum } = window;\n return ethereum ?? null;\n}\n", "import type { SignerFactory } from 'rango-types';\n\nimport { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const signers = new DefaultSignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(provider));\n return signers;\n}\n"],
5
5
  "mappings": "+EAUA,OACE,0BAAAA,EACA,yBAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACA,eAAAC,MACK,4BACP,OAAS,kBAAAC,MAAsB,cClBxB,SAASC,GAAkB,CAChC,GAAM,CAAE,SAAAC,CAAS,EAAI,OACrB,OAAOA,GAAY,IACrB,CAHgBC,EAAAF,EAAA,mBCEhB,OAAS,oBAAAG,MAAwB,wBACjC,OAAS,wBAAAC,EAAsB,mBAAmBC,MAAc,cAEjD,SAARC,EAA4BC,EAA8B,CAC/D,IAAMC,EAAU,IAAIC,EACpB,OAAAD,EAAQ,eAAeE,EAAO,IAAK,IAAIC,EAAiBJ,CAAQ,CAAC,EAC1DC,CACT,CAJwBI,EAAAN,EAAA,cFkBxB,IAAMO,EAASC,EAAY,QAEdC,EAAS,CACpB,KAAMF,CACR,EAEaG,EAAcC,EACdC,EAAmBC,EAAA,MAAO,CAAE,SAAAC,CAAS,IAAM,CAOtD,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAI,MAAMC,EAAeH,CAAQ,EAE3D,MAAO,CACL,SAAAC,EACA,QAAAC,CACF,CACF,EAbgC,WAenBE,EAAuBC,EAEvBC,EAA+BC,EAE/BC,EAAuCC,EAEvCC,EAA+CA,EAE/CC,EAAmCC,EAEnCC,EAAkEd,EAC7Ee,GACG,CACH,IAAMC,EAAOC,EAAeF,CAAc,EAC1C,MAAO,CACL,KAAM,UACN,IAAK,wFACL,YAAa,CACX,QAAS,+BACX,EACA,MAAO,UACP,gBAAiBC,CACnB,CACF,EAb+E",
6
6
  "names": ["canEagerlyConnectToEvm", "canSwitchNetworkToEvm", "getEvmAccounts", "subscribeToEvm", "switchNetworkForEvm", "WalletTypes", "evmBlockchains", "defaultInjected", "ethereum", "__name", "DefaultEvmSigner", "DefaultSignerFactory", "TxType", "getSigners", "provider", "signers", "DefaultSignerFactory", "TxType", "DefaultEvmSigner", "__name", "WALLET", "WalletTypes", "config", "getInstance", "defaultInjected", "connect", "__name", "instance", "accounts", "chainId", "getEvmAccounts", "subscribe", "subscribeToEvm", "switchNetwork", "switchNetworkForEvm", "canSwitchNetworkTo", "canSwitchNetworkToEvm", "getSigners", "canEagerConnect", "canEagerlyConnectToEvm", "getWalletInfo", "allBlockChains", "evms", "evmBlockchains"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"src/helpers.ts":{"bytes":96,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signer.ts":{"bytes":392,"imports":[{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1848,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/signer.ts","kind":"import-statement","original":"./signer"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4131},"dist/index.js":{"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true}],"exports":["canEagerConnect","canSwitchNetworkTo","config","connect","getInstance","getSigners","getWalletInfo","subscribe","switchNetwork"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":616},"src/helpers.ts":{"bytesInOutput":74},"src/signer.ts":{"bytesInOutput":215}},"bytes":1183}}}
1
+ {"inputs":{"src/helpers.ts":{"bytes":96,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signer.ts":{"bytes":392,"imports":[{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1854,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers.js"},{"path":"src/signer.ts","kind":"import-statement","original":"./signer.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4137},"dist/index.js":{"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true}],"exports":["canEagerConnect","canSwitchNetworkTo","config","connect","getInstance","getSigners","getWalletInfo","subscribe","switchNetwork"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":616},"src/helpers.ts":{"bytesInOutput":74},"src/signer.ts":{"bytesInOutput":215}},"bytes":1183}}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/provider-default",
3
- "version": "0.33.0",
3
+ "version": "0.33.1-next.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -21,7 +21,7 @@
21
21
  "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
22
22
  },
23
23
  "dependencies": {
24
- "@rango-dev/signer-evm": "^0.29.0",
24
+ "@rango-dev/signer-evm": "^0.29.1-next.0",
25
25
  "@rango-dev/wallets-shared": "^0.36.0",
26
26
  "rango-types": "^0.1.69"
27
27
  },
package/src/index.ts CHANGED
@@ -18,8 +18,8 @@ import {
18
18
  } from '@rango-dev/wallets-shared';
19
19
  import { evmBlockchains } from 'rango-types';
20
20
 
21
- import { defaultInjected } from './helpers';
22
- import signer from './signer';
21
+ import { defaultInjected } from './helpers.js';
22
+ import signer from './signer.js';
23
23
 
24
24
  const WALLET = WalletTypes.DEFAULT;
25
25