@rango-dev/provider-trezor 0.4.2-next.3 → 0.4.2-next.5
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.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var i=Object.defineProperty;var r=(t,e)=>i(t,"name",{value:e,configurable:!0});var n="";function g(t){n=t}r(g,"setDerivationPath");function o(){return n}r(o,"getDerivationPath");import{ETHEREUM_CHAIN_ID as s,Networks as a}from"@rango-dev/wallets-shared";var E={Failure_ActionCancelled:"User rejected the transaction."};async function c(){let t=await import("@trezor/connect-web");return t.default.default?t.default.default:t.default}r(c,"getTrezorModule");function h(){let t=new Map;return t.set(a.ETHEREUM,{chainId:s}),t}r(h,"getTrezorInstance");async function x(){let e=await(await c()).ethereumGetAddress({path:o()});if(!e.success)throw new Error(e.payload.error);return{accounts:[e.payload.address],chainId:s}}r(x,"getEthereumAccounts");var I=r(t=>{let e=BigInt(0);return BigInt(t)>e?`0x${BigInt(t).toString(16)}`:"0x0"},"valueToHex"),T=r(t=>t&&!t.startsWith("m/")?"m/"+t:t,"getTrezorNormalizedDerivationPath");export{r as a,g as b,o as c,E as d,c as e,h as f,x as g,I as h,T as i};
|
|
2
|
+
//# sourceMappingURL=chunk-VKZ2HTGF.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/state.ts", "../src/helpers.ts"],
|
|
4
|
+
"sourcesContent": ["// We keep derivationPath here because we need to maintain it for signing transactions after it is set in connect method\nlet derivationPath = '';\n\nexport function setDerivationPath(path: string) {\n derivationPath = path;\n}\n\nexport function getDerivationPath() {\n return derivationPath;\n}\n", "import type { TrezorConnect } from '@trezor/connect-web';\n\nimport { ETHEREUM_CHAIN_ID, Networks } from '@rango-dev/wallets-shared';\n\nimport { getDerivationPath } from './state.js';\n\nexport const trezorErrorMessages: { [statusCode: string]: string } = {\n Failure_ActionCancelled: 'User rejected the transaction.',\n};\n\n// `@trezor/connect-web` is commonjs, when we are importing it dynamically, it has some differences in different tooling. for example vite (you can check widget-examples), goes throw error. this is a workaround for solving this interop issue.\nexport async function getTrezorModule() {\n const mod = await import('@trezor/connect-web');\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n if (mod.default.default) {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n return mod.default.default as unknown as TrezorConnect;\n }\n\n return mod.default;\n}\n\nexport function getTrezorInstance() {\n /*\n * Instances have a required property which is `chainId` and is using in swap execution.\n * Here we are setting it as Ethereum always since we are supporting only eth for now.\n */\n const instances = new Map();\n\n instances.set(Networks.ETHEREUM, { chainId: ETHEREUM_CHAIN_ID });\n\n return instances;\n}\n\nexport async function getEthereumAccounts(): Promise<{\n accounts: string[];\n chainId: string;\n}> {\n const TrezorConnect = await getTrezorModule();\n const result = await TrezorConnect.ethereumGetAddress({\n path: getDerivationPath(),\n });\n\n if (!result.success) {\n throw new Error(result.payload.error);\n }\n\n return {\n accounts: [result.payload.address],\n chainId: ETHEREUM_CHAIN_ID,\n };\n}\n\n/*\n * Using BigInt in the valueToHex function ensures that the function\n * can handle very large integer values that exceed the range of standard JavaScript number types.\n */\nexport const valueToHex = (value: string) => {\n const ZERO_BIGINT = BigInt(0);\n const HEX_BASE = 16;\n return BigInt(value) > ZERO_BIGINT\n ? `0x${BigInt(value).toString(HEX_BASE)}`\n : '0x0';\n};\n\nexport const getTrezorNormalizedDerivationPath = (\n path: string // TrezorConnect needs master node to be added to derivation path\n) => (path && !path.startsWith('m/') ? 'm/' + path : path);\n"],
|
|
5
|
+
"mappings": "+EACA,IAAIA,EAAiB,GAEd,SAASC,EAAkBC,EAAc,CAC9CF,EAAiBE,CACnB,CAFgBC,EAAAF,EAAA,qBAIT,SAASG,GAAoB,CAClC,OAAOJ,CACT,CAFgBG,EAAAC,EAAA,qBCLhB,OAAS,qBAAAC,EAAmB,YAAAC,MAAgB,4BAIrC,IAAMC,EAAwD,CACnE,wBAAyB,gCAC3B,EAGA,eAAsBC,GAAkB,CACtC,IAAMC,EAAM,KAAM,QAAO,qBAAqB,EAG9C,OAAIA,EAAI,QAAQ,QAGPA,EAAI,QAAQ,QAGdA,EAAI,OACb,CAXsBC,EAAAF,EAAA,mBAaf,SAASG,GAAoB,CAKlC,IAAMC,EAAY,IAAI,IAEtB,OAAAA,EAAU,IAAIC,EAAS,SAAU,CAAE,QAASC,CAAkB,CAAC,EAExDF,CACT,CAVgBF,EAAAC,EAAA,qBAYhB,eAAsBI,GAGnB,CAED,IAAMC,EAAS,MADO,MAAMR,EAAgB,GACT,mBAAmB,CACpD,KAAMS,EAAkB,CAC1B,CAAC,EAED,GAAI,CAACD,EAAO,QACV,MAAM,IAAI,MAAMA,EAAO,QAAQ,KAAK,EAGtC,MAAO,CACL,SAAU,CAACA,EAAO,QAAQ,OAAO,EACjC,QAASF,CACX,CACF,CAjBsBJ,EAAAK,EAAA,uBAuBf,IAAMG,EAAaR,EAACS,GAAkB,CAC3C,IAAMC,EAAc,OAAO,CAAC,EAE5B,OAAO,OAAOD,CAAK,EAAIC,EACnB,KAAK,OAAOD,CAAK,EAAE,SAFN,EAEuB,CAAC,GACrC,KACN,EAN0B,cAQbE,EAAoCX,EAC/CY,GACIA,GAAQ,CAACA,EAAK,WAAW,IAAI,EAAI,KAAOA,EAAOA,EAFJ",
|
|
6
|
+
"names": ["derivationPath", "setDerivationPath", "path", "__name", "getDerivationPath", "ETHEREUM_CHAIN_ID", "Networks", "trezorErrorMessages", "getTrezorModule", "mod", "__name", "getTrezorInstance", "instances", "Networks", "ETHEREUM_CHAIN_ID", "getEthereumAccounts", "result", "getDerivationPath", "valueToHex", "value", "ZERO_BIGINT", "getTrezorNormalizedDerivationPath", "path"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as p,c as u,d as P,e as d,h as e}from"./chunk-VKZ2HTGF.js";import{cleanEvmError as G}from"@rango-dev/signer-evm";import{DEFAULT_ETHEREUM_RPC_URL as z}from"@rango-dev/wallets-shared";import{JsonRpcProvider as R,Transaction as S}from"ethers";import"rango-types";function b(t){return t?.shortMessage?new Error(t.shortMessage,{cause:t}):G(t)}p(b,"getTrezorErrorMessage");var E=class{static{p(this,"EthereumSigner")}async signMessage(r){let o=await d(),{success:n,payload:s}=await o.signMessage({message:r,path:u()});if(!n)throw new Error(s.error);return s.signature}async signAndSendTx(r,o,n){try{let s=await d(),{gasPrice:h,maxFeePerGas:i,maxPriorityFeePerGas:c}=r,a=i&&c;if(a&&!i)throw new Error("Missing maxFeePerGas");if(a&&!c)throw new Error("Missing maxPriorityFeePerGas");if(!a&&!h)throw new Error("Missing gasPrice");let w=new R(z),T=await w.getTransactionCount(o),f=a?{maxFeePerGas:e(i||"0"),maxPriorityFeePerGas:e(c||"0")}:{gasPrice:e(h||"0")},g={to:r.to,data:r.data||"0x",value:e(r.value?.toString()||"0"),gasLimit:e(r.gasLimit?.toString()||"0"),chainId:Number.parseInt(n),nonce:e(T.toString()),...f},{success:l,payload:m}=await s.ethereumSignTransaction({path:u(),transaction:g});if(!l){let F=P[m?.code||""]||m.error;throw new Error(F)}let{r:y,s:v,v:M}=m,x=S.from({...g,nonce:Number.parseInt(g.nonce),type:a?2:0,signature:{r:y,s:v,v:parseInt(M)}}).serialized;return{hash:(await w.broadcastTransaction(x)).hash}}catch(s){throw b(s)}}};export{E as EthereumSigner,b as getTrezorErrorMessage};
|
|
2
|
+
//# sourceMappingURL=ethereum-UW5V3C7D.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/signers/ethereum.ts"],
|
|
4
|
+
"sourcesContent": ["import type { EvmTransaction } from 'rango-types/mainApi';\n\nimport { cleanEvmError } from '@rango-dev/signer-evm';\nimport { DEFAULT_ETHEREUM_RPC_URL } from '@rango-dev/wallets-shared';\nimport { JsonRpcProvider, Transaction } from 'ethers';\nimport { type GenericSigner } from 'rango-types';\n\nimport {\n getTrezorModule,\n trezorErrorMessages,\n valueToHex,\n} from '../helpers.js';\nimport { getDerivationPath } from '../state.js';\n\nexport function getTrezorErrorMessage(error: any) {\n if (error?.shortMessage) {\n /*\n * Some error signs have lengthy, challenging-to-read messages.\n * shortMessage is used because it is shorter and easier to understand.\n */\n return new Error(error.shortMessage, { cause: error });\n }\n return cleanEvmError(error);\n}\n\nexport class EthereumSigner implements GenericSigner<EvmTransaction> {\n async signMessage(msg: string): Promise<string> {\n const TrezorConnect = await getTrezorModule();\n\n const { success, payload } = await TrezorConnect.signMessage({\n message: msg,\n path: getDerivationPath(),\n });\n if (!success) {\n throw new Error(payload.error);\n }\n return payload.signature;\n }\n\n async signAndSendTx(\n tx: EvmTransaction,\n fromAddress: string,\n chainId: string\n ): Promise<{ hash: string }> {\n try {\n const TrezorConnect = await getTrezorModule();\n const { gasPrice, maxFeePerGas, maxPriorityFeePerGas } = tx;\n const isEIP1559 = maxFeePerGas && maxPriorityFeePerGas;\n\n if (isEIP1559 && !maxFeePerGas) {\n throw new Error('Missing maxFeePerGas');\n }\n if (isEIP1559 && !maxPriorityFeePerGas) {\n throw new Error('Missing maxPriorityFeePerGas');\n }\n if (!isEIP1559 && !gasPrice) {\n throw new Error('Missing gasPrice');\n }\n const provider = new JsonRpcProvider(DEFAULT_ETHEREUM_RPC_URL); // Provider to broadcast transaction\n const transactionCount = await provider.getTransactionCount(fromAddress); // Get nonce\n const additionalFields = isEIP1559\n ? {\n maxFeePerGas: valueToHex(maxFeePerGas || '0'),\n maxPriorityFeePerGas: valueToHex(maxPriorityFeePerGas || '0'),\n }\n : {\n gasPrice: valueToHex(gasPrice || '0'),\n };\n\n const transaction = {\n to: tx.to,\n data: tx.data || '0x',\n value: valueToHex(tx.value?.toString() || '0'),\n gasLimit: valueToHex(tx.gasLimit?.toString() || '0'),\n chainId: Number.parseInt(chainId),\n nonce: valueToHex(transactionCount.toString()),\n ...additionalFields,\n };\n\n const { success, payload } = await TrezorConnect.ethereumSignTransaction({\n path: getDerivationPath(),\n transaction,\n });\n\n if (!success) {\n const errorMessage =\n trezorErrorMessages[payload?.code || ''] || payload.error;\n throw new Error(errorMessage);\n }\n const { r, s, v } = payload;\n\n const serializedTx = Transaction.from({\n ...transaction,\n nonce: Number.parseInt(transaction.nonce),\n /*\n * Type 0: This refers to the legacy transaction type that has been used since Ethereum's inception.\n * Type 2: This refers to the new transaction type introduced with the EIP-1559 (Ethereum Improvement Proposal 1559) update,\n * which was part of the London hard fork.\n */\n type: isEIP1559 ? 2 : 0,\n signature: { r, s, v: parseInt(v) },\n }).serialized;\n const broadcastResult = await provider.broadcastTransaction(serializedTx);\n\n return { hash: broadcastResult.hash };\n } catch (error) {\n throw getTrezorErrorMessage(error);\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "oEAEA,OAAS,iBAAAA,MAAqB,wBAC9B,OAAS,4BAAAC,MAAgC,4BACzC,OAAS,mBAAAC,EAAiB,eAAAC,MAAmB,SAC7C,MAAmC,cAS5B,SAASC,EAAsBC,EAAY,CAChD,OAAIA,GAAO,aAKF,IAAI,MAAMA,EAAM,aAAc,CAAE,MAAOA,CAAM,CAAC,EAEhDC,EAAcD,CAAK,CAC5B,CATgBE,EAAAH,EAAA,yBAWT,IAAMI,EAAN,KAA8D,CAzBrE,MAyBqE,CAAAD,EAAA,uBACnE,MAAM,YAAYE,EAA8B,CAC9C,IAAMC,EAAgB,MAAMC,EAAgB,EAEtC,CAAE,QAAAC,EAAS,QAAAC,CAAQ,EAAI,MAAMH,EAAc,YAAY,CAC3D,QAASD,EACT,KAAMK,EAAkB,CAC1B,CAAC,EACD,GAAI,CAACF,EACH,MAAM,IAAI,MAAMC,EAAQ,KAAK,EAE/B,OAAOA,EAAQ,SACjB,CAEA,MAAM,cACJE,EACAC,EACAC,EAC2B,CAC3B,GAAI,CACF,IAAMP,EAAgB,MAAMC,EAAgB,EACtC,CAAE,SAAAO,EAAU,aAAAC,EAAc,qBAAAC,CAAqB,EAAIL,EACnDM,EAAYF,GAAgBC,EAElC,GAAIC,GAAa,CAACF,EAChB,MAAM,IAAI,MAAM,sBAAsB,EAExC,GAAIE,GAAa,CAACD,EAChB,MAAM,IAAI,MAAM,8BAA8B,EAEhD,GAAI,CAACC,GAAa,CAACH,EACjB,MAAM,IAAI,MAAM,kBAAkB,EAEpC,IAAMI,EAAW,IAAIC,EAAgBC,CAAwB,EACvDC,EAAmB,MAAMH,EAAS,oBAAoBN,CAAW,EACjEU,EAAmBL,EACrB,CACE,aAAcM,EAAWR,GAAgB,GAAG,EAC5C,qBAAsBQ,EAAWP,GAAwB,GAAG,CAC9D,EACA,CACE,SAAUO,EAAWT,GAAY,GAAG,CACtC,EAEEU,EAAc,CAClB,GAAIb,EAAG,GACP,KAAMA,EAAG,MAAQ,KACjB,MAAOY,EAAWZ,EAAG,OAAO,SAAS,GAAK,GAAG,EAC7C,SAAUY,EAAWZ,EAAG,UAAU,SAAS,GAAK,GAAG,EACnD,QAAS,OAAO,SAASE,CAAO,EAChC,MAAOU,EAAWF,EAAiB,SAAS,CAAC,EAC7C,GAAGC,CACL,EAEM,CAAE,QAAAd,EAAS,QAAAC,CAAQ,EAAI,MAAMH,EAAc,wBAAwB,CACvE,KAAMI,EAAkB,EACxB,YAAAc,CACF,CAAC,EAED,GAAI,CAAChB,EAAS,CACZ,IAAMiB,EACJC,EAAoBjB,GAAS,MAAQ,EAAE,GAAKA,EAAQ,MACtD,MAAM,IAAI,MAAMgB,CAAY,CAC9B,CACA,GAAM,CAAE,EAAAE,EAAG,EAAAC,EAAG,EAAAC,CAAE,EAAIpB,EAEdqB,EAAeC,EAAY,KAAK,CACpC,GAAGP,EACH,MAAO,OAAO,SAASA,EAAY,KAAK,EAMxC,KAAMP,EAAY,EAAI,EACtB,UAAW,CAAE,EAAAU,EAAG,EAAAC,EAAG,EAAG,SAASC,CAAC,CAAE,CACpC,CAAC,EAAE,WAGH,MAAO,CAAE,MAFe,MAAMX,EAAS,qBAAqBY,CAAY,GAEzC,IAAK,CACtC,OAAS7B,EAAO,CACd,MAAMD,EAAsBC,CAAK,CACnC,CACF,CACF",
|
|
6
|
+
"names": ["cleanEvmError", "DEFAULT_ETHEREUM_RPC_URL", "JsonRpcProvider", "Transaction", "getTrezorErrorMessage", "error", "cleanEvmError", "__name", "EthereumSigner", "msg", "TrezorConnect", "getTrezorModule", "success", "payload", "getDerivationPath", "tx", "fromAddress", "chainId", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "isEIP1559", "provider", "JsonRpcProvider", "DEFAULT_ETHEREUM_RPC_URL", "transactionCount", "additionalFields", "valueToHex", "transaction", "errorMessage", "trezorErrorMessages", "r", "s", "v", "serializedTx", "Transaction"]
|
|
7
|
+
}
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import{a as r,b as s,e as c,f as p,g as m,i as l}from"./chunk-VKZ2HTGF.js";import{Namespace as g,Networks as d,WalletTypes as v}from"@rango-dev/wallets-shared";import"rango-types";import{DefaultSignerFactory as h,TransactionType as y}from"rango-types";async function i(){let e=new h,{EthereumSigner:t}=await import("./ethereum-UW5V3C7D.js");return e.registerSigner(y.EVM,new t),e}r(i,"getSigners");var u={appUrl:"",email:""},M={type:v.TREZOR},C=r(e=>{u=e.manifest},"init"),I=p,f=!1,D=r(async({namespaces:e})=>{let t=[],a=await c(),n=e?.find(o=>o.namespace===g.Evm);if(n)if(n.derivationPath){s(l(n.derivationPath)),f||(await a.init({lazyLoad:!0,manifest:u}),f=!0);let o=await m();t.push(o)}else throw new Error("Derivation Path can not be empty.");else throw new Error(`It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${e?.map(o=>o.namespace)}`);return t},"connect"),F=i,b=r(e=>{let t=[],a=e.find(n=>n.name===d.ETHEREUM);return a&&t.push(a),{name:"Trezor",img:"https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/trezor/icon.svg",installLink:{DEFAULT:"https://trezor.io/learn/a/download-verify-trezor-suite"},color:"black",supportedChains:t,namespaces:[g.Evm],singleNamespace:!0,showOnMobile:!1,needsDerivationPath:!0}},"getWalletInfo");export{M as config,D as connect,I as getInstance,F as getSigners,b as getWalletInfo,C as init};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../src/
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../src/index.ts", "../src/signer.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Environments } from './types.js';\nimport type {\n Connect,\n ProviderConnectResult,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\n\nimport { Namespace, Networks, WalletTypes } from '@rango-dev/wallets-shared';\nimport { type BlockchainMeta, type SignerFactory } from 'rango-types';\n\nimport {\n getEthereumAccounts,\n getTrezorInstance,\n getTrezorModule,\n getTrezorNormalizedDerivationPath,\n} from './helpers.js';\nimport signer from './signer.js';\nimport { setDerivationPath } from './state.js';\n\nlet trezorManifest: Environments['manifest'] = {\n appUrl: '',\n email: '',\n};\nexport const config = {\n type: WalletTypes.TREZOR,\n};\n\nexport type { Environments };\n\nexport const init = (environments: Environments) => {\n trezorManifest = environments.manifest;\n};\n\nexport const getInstance = getTrezorInstance;\n\nlet isTrezorInitialized = false;\nexport const connect: Connect = async ({ namespaces }) => {\n const results: ProviderConnectResult[] = [];\n\n const TrezorConnect = await getTrezorModule();\n\n const evmNamespace = namespaces?.find(\n (namespaceItem) => namespaceItem.namespace === Namespace.Evm\n );\n\n if (evmNamespace) {\n if (evmNamespace.derivationPath) {\n setDerivationPath(\n getTrezorNormalizedDerivationPath(evmNamespace.derivationPath)\n );\n\n if (!isTrezorInitialized) {\n await TrezorConnect.init({\n lazyLoad: true, // this param will prevent iframe injection until TrezorConnect.method will be called\n manifest: trezorManifest,\n });\n\n isTrezorInitialized = true;\n }\n\n const accounts = await getEthereumAccounts();\n results.push(accounts);\n } else {\n throw new Error('Derivation Path can not be empty.');\n }\n } else {\n throw new Error(\n `It appears that you have selected a namespace that is not yet supported by our system. Your namespaces: ${namespaces?.map(\n (namespaceItem) => namespaceItem.namespace\n )}`\n );\n }\n\n return results;\n};\n\nexport const getSigners: (provider: any) => Promise<SignerFactory> = signer;\n\nexport const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (\n allBlockChains\n) => {\n const supportedChains: BlockchainMeta[] = [];\n\n const ethereumBlockchain = allBlockChains.find(\n (chain) => chain.name === Networks.ETHEREUM\n );\n if (ethereumBlockchain) {\n supportedChains.push(ethereumBlockchain);\n }\n return {\n name: 'Trezor',\n img: 'https://raw.githubusercontent.com/rango-exchange/assets/main/wallets/trezor/icon.svg',\n installLink: {\n DEFAULT: 'https://trezor.io/learn/a/download-verify-trezor-suite',\n },\n color: 'black',\n supportedChains,\n namespaces: [Namespace.Evm],\n singleNamespace: true,\n showOnMobile: false,\n needsDerivationPath: true,\n };\n};\n", "import type { SignerFactory } from 'rango-types';\n\nimport { DefaultSignerFactory, TransactionType as TxType } from 'rango-types';\n\nexport default async function getSigners(): Promise<SignerFactory> {\n const signers = new DefaultSignerFactory();\n const { EthereumSigner } = await import('./signers/ethereum.js');\n signers.registerSigner(TxType.EVM, new EthereumSigner());\n return signers;\n}\n"],
|
|
5
|
+
"mappings": "2EAOA,OAAS,aAAAA,EAAW,YAAAC,EAAU,eAAAC,MAAmB,4BACjD,MAAwD,cCNxD,OAAS,wBAAAC,EAAsB,mBAAmBC,MAAc,cAEhE,eAAOC,GAA4D,CACjE,IAAMC,EAAU,IAAIC,EACd,CAAE,eAAAC,CAAe,EAAI,KAAM,QAAO,wBAAuB,EAC/D,OAAAF,EAAQ,eAAeG,EAAO,IAAK,IAAID,CAAgB,EAChDF,CACT,CAL8BI,EAAAL,EAAA,cDe9B,IAAIM,EAA2C,CAC7C,OAAQ,GACR,MAAO,EACT,EACaC,EAAS,CACpB,KAAMC,EAAY,MACpB,EAIaC,EAAOC,EAACC,GAA+B,CAClDL,EAAiBK,EAAa,QAChC,EAFoB,QAIPC,EAAcC,EAEvBC,EAAsB,GACbC,EAAmBL,EAAA,MAAO,CAAE,WAAAM,CAAW,IAAM,CACxD,IAAMC,EAAmC,CAAC,EAEpCC,EAAgB,MAAMC,EAAgB,EAEtCC,EAAeJ,GAAY,KAC9BK,GAAkBA,EAAc,YAAcC,EAAU,GAC3D,EAEA,GAAIF,EACF,GAAIA,EAAa,eAAgB,CAC/BG,EACEC,EAAkCJ,EAAa,cAAc,CAC/D,EAEKN,IACH,MAAMI,EAAc,KAAK,CACvB,SAAU,GACV,SAAUZ,CACZ,CAAC,EAEDQ,EAAsB,IAGxB,IAAMW,EAAW,MAAMC,EAAoB,EAC3CT,EAAQ,KAAKQ,CAAQ,CACvB,KACE,OAAM,IAAI,MAAM,mCAAmC,MAGrD,OAAM,IAAI,MACR,2GAA2GT,GAAY,IACpHK,GAAkBA,EAAc,SACnC,CAAC,EACH,EAGF,OAAOJ,CACT,EAtCgC,WAwCnBU,EAAwDA,EAExDC,EAAkElB,EAC7EmB,GACG,CACH,IAAMC,EAAoC,CAAC,EAErCC,EAAqBF,EAAe,KACvCG,GAAUA,EAAM,OAASC,EAAS,QACrC,EACA,OAAIF,GACFD,EAAgB,KAAKC,CAAkB,EAElC,CACL,KAAM,SACN,IAAK,uFACL,YAAa,CACX,QAAS,wDACX,EACA,MAAO,QACP,gBAAAD,EACA,WAAY,CAACR,EAAU,GAAG,EAC1B,gBAAiB,GACjB,aAAc,GACd,oBAAqB,EACvB,CACF,EAxB+E",
|
|
6
|
+
"names": ["Namespace", "Networks", "WalletTypes", "DefaultSignerFactory", "TxType", "getSigners", "signers", "DefaultSignerFactory", "EthereumSigner", "TxType", "__name", "trezorManifest", "config", "WalletTypes", "init", "__name", "environments", "getInstance", "getTrezorInstance", "isTrezorInitialized", "connect", "namespaces", "results", "TrezorConnect", "getTrezorModule", "evmNamespace", "namespaceItem", "Namespace", "setDerivationPath", "getTrezorNormalizedDerivationPath", "accounts", "getEthereumAccounts", "getSigners", "getWalletInfo", "allBlockChains", "supportedChains", "ethereumBlockchain", "chain", "Networks"]
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/state.ts":{"bytes":290,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/helpers.ts":{"bytes":2270,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"src/state.ts","kind":"import-statement","original":"./state.js"},{"path":"@trezor/connect-web","kind":"dynamic-import","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signers/ethereum.ts":{"bytes":3688,"imports":[{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"ethers","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/state.ts","kind":"import-statement","original":"../state.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signer.ts":{"bytes":394,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/signers/ethereum.ts","kind":"dynamic-import","original":"./signers/ethereum.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":2795,"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":"src/state.ts","kind":"import-statement","original":"./state.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":
|
|
1
|
+
{"inputs":{"src/state.ts":{"bytes":290,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/helpers.ts":{"bytes":2270,"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"src/state.ts","kind":"import-statement","original":"./state.js"},{"path":"@trezor/connect-web","kind":"dynamic-import","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signers/ethereum.ts":{"bytes":3688,"imports":[{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"ethers","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/state.ts","kind":"import-statement","original":"../state.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/signer.ts":{"bytes":394,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/signers/ethereum.ts","kind":"dynamic-import","original":"./signers/ethereum.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":2795,"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":"src/state.ts","kind":"import-statement","original":"./state.js"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":5238},"dist/index.js":{"imports":[{"path":"dist/chunk-VKZ2HTGF.js","kind":"import-statement"},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"dist/ethereum-UW5V3C7D.js","kind":"dynamic-import"}],"exports":["config","connect","getInstance","getSigners","getWalletInfo","init"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":1016},"src/signer.ts":{"bytesInOutput":218}},"bytes":1439},"dist/ethereum-UW5V3C7D.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":6212},"dist/ethereum-UW5V3C7D.js":{"imports":[{"path":"dist/chunk-VKZ2HTGF.js","kind":"import-statement"},{"path":"@rango-dev/signer-evm","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"ethers","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true}],"exports":["EthereumSigner","getTrezorErrorMessage"],"entryPoint":"src/signers/ethereum.ts","inputs":{"src/signers/ethereum.ts":{"bytesInOutput":1383}},"bytes":1553},"dist/chunk-VKZ2HTGF.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":4059},"dist/chunk-VKZ2HTGF.js":{"imports":[{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"@trezor/connect-web","kind":"dynamic-import","external":true}],"exports":["a","b","c","d","e","f","g","h","i"],"inputs":{"src/state.ts":{"bytesInOutput":99},"src/helpers.ts":{"bytesInOutput":737}},"bytes":1030}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/provider-trezor",
|
|
3
|
-
"version": "0.4.2-next.
|
|
3
|
+
"version": "0.4.2-next.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "./src/index.ts",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"src"
|
|
18
18
|
],
|
|
19
19
|
"scripts": {
|
|
20
|
-
"build": "node ../../scripts/build/command.mjs --path wallets/provider-trezor",
|
|
20
|
+
"build": "node ../../scripts/build/command.mjs --path wallets/provider-trezor --splitting",
|
|
21
21
|
"ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
|
|
22
22
|
"clean": "rimraf dist",
|
|
23
23
|
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@rango-dev/signer-evm": "^0.30.0",
|
|
28
|
-
"@rango-dev/wallets-shared": "^0.37.1-next.
|
|
28
|
+
"@rango-dev/wallets-shared": "^0.37.1-next.3",
|
|
29
29
|
"@trezor/connect-web": "^9.2.4",
|
|
30
30
|
"ethers": "^6.13.2",
|
|
31
31
|
"rango-types": "^0.1.59"
|
|
@@ -33,4 +33,4 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
}
|
|
36
|
-
}
|
|
36
|
+
}
|