@rango-dev/provider-trustwallet 0.15.1-next.2 → 0.15.1-next.4

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/dist/index.js CHANGED
@@ -1,2 +1,2 @@
1
- var s=Object.defineProperty;var o=(t,e)=>s(t,"name",{value:e,configurable:!0});import{canEagerlyConnectToEvm as m,canSwitchNetworkToEvm as w,getEvmAccounts as u,subscribeToEvm as h,switchNetworkForEvm as f,WalletTypes as b}from"@rango-dev/wallets-shared";import{evmBlockchains as d}from"rango-types";function c(){let{trustwallet:t}=window;return t&&(t?.isTrust||t?.isTrustWallet)?t:null}o(c,"trustWallet");import{DefaultEvmSigner as a}from"@rango-dev/signer-evm";import{Networks as i,getNetworkInstance as l}from"@rango-dev/wallets-shared";import{DefaultSignerFactory as p,TransactionType as g}from"rango-types";function n(t){let e=l(t,i.ETHEREUM),r=new p;return r.registerSigner(g.EVM,new a(e)),r}o(n,"getSigners");var E=b.TRUST_WALLET,B={type:E},M=c,j=o(async({instance:t})=>{let{accounts:e,chainId:r}=await u(t);return{accounts:e,chainId:r}},"connect"),R=h,D=f,U=w,H=n,V=m,_=o(t=>{let e=d(t);return{name:"Trust Wallet",img:"https://raw.githubusercontent.com/rango-exchange/rango-assets/main/wallets/trustwallet/icon.svg",installLink:{CHROME:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/",BRAVE:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/",DEFAULT:"https://trustwallet.com/browser-extension"},color:"#ffffff",supportedChains:e}},"getWalletInfo");export{V as canEagerConnect,U as canSwitchNetworkTo,B as config,j as connect,M as getInstance,H as getSigners,_ as getWalletInfo,R as subscribe,D as switchNetwork};
1
+ var s=Object.defineProperty;var o=(t,e)=>s(t,"name",{value:e,configurable:!0});import{canEagerlyConnectToEvm as m,canSwitchNetworkToEvm as w,getEvmAccounts as u,subscribeToEvm as h,switchNetworkForEvm as f,WalletTypes as b}from"@rango-dev/wallets-shared";import{evmBlockchains as d}from"rango-types";function c(){let{trustwallet:t}=window;return t&&(t?.isTrust||t?.isTrustWallet)?t:null}o(c,"trustWallet");import{DefaultEvmSigner as a}from"@rango-dev/signer-evm";import{Networks as i,getNetworkInstance as l}from"@rango-dev/wallets-shared";import{DefaultSignerFactory as p,TransactionType as g}from"rango-types";function n(t){let e=l(t,i.ETHEREUM),r=new p;return r.registerSigner(g.EVM,new a(e)),r}o(n,"getSigners");var E=b.TRUST_WALLET,B={type:E},M=c,j=o(async({instance:t})=>{let{accounts:e,chainId:r}=await u(t);return{accounts:e,chainId:r}},"connect"),R=h,D=f,U=w,H=n,V=m,_=o(t=>{let e=d(t);return{name:"Trust Wallet",img:"https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/trustwallet/icon.svg",installLink:{CHROME:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/",BRAVE:"https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/",DEFAULT:"https://trustwallet.com/browser-extension"},color:"#ffffff",supportedChains:e}},"getWalletInfo");export{V as canEagerConnect,U as canSwitchNetworkTo,B as config,j as connect,M as getInstance,H as getSigners,_ as getWalletInfo,R as subscribe,D as switchNetwork};
2
2
  //# sourceMappingURL=index.js.map
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 { trustWallet as trustwallet_instance } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletTypes.TRUST_WALLET;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const getInstance = trustwallet_instance;\n\n// doc: https://developer.trustwallet.com/trust-wallet-browser-extension/extension-guide\nexport const connect: Connect = async ({ instance }) => {\n const { accounts, chainId } = await getEvmAccounts(instance);\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: 'Trust Wallet',\n img: 'https://raw.githubusercontent.com/rango-exchange/rango-assets/main/wallets/trustwallet/icon.svg',\n installLink: {\n CHROME:\n 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',\n BRAVE:\n 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',\n DEFAULT: 'https://trustwallet.com/browser-extension',\n },\n color: '#ffffff',\n supportedChains: evms,\n };\n};\n", "export function trustWallet() {\n const { trustwallet } = window;\n \n if (!!trustwallet && (trustwallet?.isTrust || trustwallet?.isTrustWallet)) {\n return trustwallet;\n }\n return null;\n}\n", "import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { Networks, getNetworkInstance } from '@rango-dev/wallets-shared';\nimport {\n DefaultSignerFactory,\n SignerFactory,\n TransactionType as TxType,\n} from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM);\n const signers = new DefaultSignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(ethProvider));\n return signers;\n}\n"],
5
- "mappings": "+EAUA,OACE,0BAAAA,EACA,yBAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACA,eAAAC,MACK,4BACP,OAAS,kBAAAC,MAAsB,cClBxB,SAASC,GAAc,CAC5B,GAAM,CAAE,YAAAC,CAAY,EAAI,OAExB,OAAMA,IAAgBA,GAAa,SAAWA,GAAa,eAClDA,EAEF,IACT,CAPgBC,EAAAF,EAAA,eCAhB,OAAS,oBAAAG,MAAwB,wBACjC,OAAS,YAAAC,EAAU,sBAAAC,MAA0B,4BAC7C,OACE,wBAAAC,EAEA,mBAAmBC,MACd,cAEQ,SAARC,EAA4BC,EAA8B,CAC/D,IAAMC,EAAcC,EAAmBF,EAAUG,EAAS,QAAQ,EAC5DC,EAAU,IAAIC,EACpB,OAAAD,EAAQ,eAAeE,EAAO,IAAK,IAAIC,EAAiBN,CAAW,CAAC,EAC7DG,CACT,CALwBI,EAAAT,EAAA,cFexB,IAAMU,EAASC,EAAY,aAEdC,EAAS,CACpB,KAAMF,CACR,EAEaG,EAAcC,EAGdC,EAAmBC,EAAA,MAAO,CAAE,SAAAC,CAAS,IAAM,CACtD,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAI,MAAMC,EAAeH,CAAQ,EAC3D,MAAO,CACL,SAAAC,EACA,QAAAC,CACF,CACF,EANgC,WAQnBE,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,eACN,IAAK,kGACL,YAAa,CACX,OACE,2FACF,MACE,2FACF,QAAS,2CACX,EACA,MAAO,UACP,gBAAiBC,CACnB,CACF,EAjB+E",
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 { trustWallet as trustwallet_instance } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletTypes.TRUST_WALLET;\n\nexport const config = {\n type: WALLET,\n};\n\nexport const getInstance = trustwallet_instance;\n\n// doc: https://developer.trustwallet.com/trust-wallet-browser-extension/extension-guide\nexport const connect: Connect = async ({ instance }) => {\n const { accounts, chainId } = await getEvmAccounts(instance);\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: 'Trust Wallet',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/trustwallet/icon.svg',\n installLink: {\n CHROME:\n 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',\n BRAVE:\n 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',\n DEFAULT: 'https://trustwallet.com/browser-extension',\n },\n color: '#ffffff',\n supportedChains: evms,\n };\n};\n", "export function trustWallet() {\n const { trustwallet } = window;\n \n if (!!trustwallet && (trustwallet?.isTrust || trustwallet?.isTrustWallet)) {\n return trustwallet;\n }\n return null;\n}\n", "import { DefaultEvmSigner } from '@rango-dev/signer-evm';\nimport { Networks, getNetworkInstance } from '@rango-dev/wallets-shared';\nimport {\n DefaultSignerFactory,\n SignerFactory,\n TransactionType as TxType,\n} from 'rango-types';\n\nexport default function getSigners(provider: any): SignerFactory {\n const ethProvider = getNetworkInstance(provider, Networks.ETHEREUM);\n const signers = new DefaultSignerFactory();\n signers.registerSigner(TxType.EVM, new DefaultEvmSigner(ethProvider));\n return signers;\n}\n"],
5
+ "mappings": "+EAUA,OACE,0BAAAA,EACA,yBAAAC,EACA,kBAAAC,EACA,kBAAAC,EACA,uBAAAC,EACA,eAAAC,MACK,4BACP,OAAS,kBAAAC,MAAsB,cClBxB,SAASC,GAAc,CAC5B,GAAM,CAAE,YAAAC,CAAY,EAAI,OAExB,OAAMA,IAAgBA,GAAa,SAAWA,GAAa,eAClDA,EAEF,IACT,CAPgBC,EAAAF,EAAA,eCAhB,OAAS,oBAAAG,MAAwB,wBACjC,OAAS,YAAAC,EAAU,sBAAAC,MAA0B,4BAC7C,OACE,wBAAAC,EAEA,mBAAmBC,MACd,cAEQ,SAARC,EAA4BC,EAA8B,CAC/D,IAAMC,EAAcC,EAAmBF,EAAUG,EAAS,QAAQ,EAC5DC,EAAU,IAAIC,EACpB,OAAAD,EAAQ,eAAeE,EAAO,IAAK,IAAIC,EAAiBN,CAAW,CAAC,EAC7DG,CACT,CALwBI,EAAAT,EAAA,cFexB,IAAMU,EAASC,EAAY,aAEdC,EAAS,CACpB,KAAMF,CACR,EAEaG,EAAcC,EAGdC,EAAmBC,EAAA,MAAO,CAAE,SAAAC,CAAS,IAAM,CACtD,GAAM,CAAE,SAAAC,EAAU,QAAAC,CAAQ,EAAI,MAAMC,EAAeH,CAAQ,EAC3D,MAAO,CACL,SAAAC,EACA,QAAAC,CACF,CACF,EANgC,WAQnBE,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,eACN,IAAK,4FACL,YAAa,CACX,OACE,2FACF,MACE,2FACF,QAAS,2CACX,EACA,MAAO,UACP,gBAAiBC,CACnB,CACF,EAjB+E",
6
6
  "names": ["canEagerlyConnectToEvm", "canSwitchNetworkToEvm", "getEvmAccounts", "subscribeToEvm", "switchNetworkForEvm", "WalletTypes", "evmBlockchains", "trustWallet", "trustwallet", "__name", "DefaultEvmSigner", "Networks", "getNetworkInstance", "DefaultSignerFactory", "TxType", "getSigners", "provider", "ethProvider", "getNetworkInstance", "Networks", "signers", "DefaultSignerFactory", "TxType", "DefaultEvmSigner", "__name", "WALLET", "WalletTypes", "config", "getInstance", "trustWallet", "connect", "__name", "instance", "accounts", "chainId", "getEvmAccounts", "subscribe", "subscribeToEvm", "switchNetwork", "switchNetworkForEvm", "canSwitchNetworkTo", "canSwitchNetworkToEvm", "getSigners", "canEagerConnect", "canEagerlyConnectToEvm", "getWalletInfo", "allBlockChains", "evms", "evmBlockchains"]
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/provider-trustwallet",
3
- "version": "0.15.1-next.2",
3
+ "version": "0.15.1-next.4",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
21
21
  },
22
22
  "dependencies": {
23
- "@rango-dev/signer-evm": "^0.15.0",
24
- "@rango-dev/wallets-shared": "^0.15.1-next.1",
23
+ "@rango-dev/signer-evm": "^0.15.1-next.1",
24
+ "@rango-dev/wallets-shared": "^0.15.1-next.2",
25
25
  "rango-types": "^0.1.46"
26
26
  },
27
27
  "publishConfig": {
package/src/index.ts CHANGED
@@ -54,7 +54,7 @@ export const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (
54
54
  const evms = evmBlockchains(allBlockChains);
55
55
  return {
56
56
  name: 'Trust Wallet',
57
- img: 'https://raw.githubusercontent.com/rango-exchange/rango-assets/main/wallets/trustwallet/icon.svg',
57
+ img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/trustwallet/icon.svg',
58
58
  installLink: {
59
59
  CHROME:
60
60
  'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',