@rango-dev/provider-trustwallet 0.1.11-next.69

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 @@
1
+ export declare function trustWallet(): any;
@@ -0,0 +1,12 @@
1
+ import { WalletType, CanSwitchNetwork, Connect, Subscribe, SwitchNetwork, WalletSigners, BlockchainMeta, WalletInfo } from '@rango-dev/wallets-shared';
2
+ import { trustWallet as trustwallet_instance } from './helpers';
3
+ export declare const config: {
4
+ type: WalletType;
5
+ };
6
+ export declare const getInstance: typeof trustwallet_instance;
7
+ export declare const connect: Connect;
8
+ export declare const subscribe: Subscribe;
9
+ export declare const switchNetwork: SwitchNetwork;
10
+ export declare const canSwitchNetworkTo: CanSwitchNetwork;
11
+ export declare const getSigners: (provider: any) => WalletSigners;
12
+ export declare const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo;
package/dist/index.js ADDED
@@ -0,0 +1,8 @@
1
+
2
+ 'use strict'
3
+
4
+ if (process.env.NODE_ENV === 'production') {
5
+ module.exports = require('./provider-trustwallet.cjs.production.min.js')
6
+ } else {
7
+ module.exports = require('./provider-trustwallet.cjs.development.js')
8
+ }
@@ -0,0 +1,416 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var walletsShared = require('@rango-dev/wallets-shared');
6
+
7
+ function _regeneratorRuntime() {
8
+ _regeneratorRuntime = function () {
9
+ return exports;
10
+ };
11
+ var exports = {},
12
+ Op = Object.prototype,
13
+ hasOwn = Op.hasOwnProperty,
14
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
15
+ obj[key] = desc.value;
16
+ },
17
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
18
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
19
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
20
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
21
+ function define(obj, key, value) {
22
+ return Object.defineProperty(obj, key, {
23
+ value: value,
24
+ enumerable: !0,
25
+ configurable: !0,
26
+ writable: !0
27
+ }), obj[key];
28
+ }
29
+ try {
30
+ define({}, "");
31
+ } catch (err) {
32
+ define = function (obj, key, value) {
33
+ return obj[key] = value;
34
+ };
35
+ }
36
+ function wrap(innerFn, outerFn, self, tryLocsList) {
37
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
38
+ generator = Object.create(protoGenerator.prototype),
39
+ context = new Context(tryLocsList || []);
40
+ return defineProperty(generator, "_invoke", {
41
+ value: makeInvokeMethod(innerFn, self, context)
42
+ }), generator;
43
+ }
44
+ function tryCatch(fn, obj, arg) {
45
+ try {
46
+ return {
47
+ type: "normal",
48
+ arg: fn.call(obj, arg)
49
+ };
50
+ } catch (err) {
51
+ return {
52
+ type: "throw",
53
+ arg: err
54
+ };
55
+ }
56
+ }
57
+ exports.wrap = wrap;
58
+ var ContinueSentinel = {};
59
+ function Generator() {}
60
+ function GeneratorFunction() {}
61
+ function GeneratorFunctionPrototype() {}
62
+ var IteratorPrototype = {};
63
+ define(IteratorPrototype, iteratorSymbol, function () {
64
+ return this;
65
+ });
66
+ var getProto = Object.getPrototypeOf,
67
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
68
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
69
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
70
+ function defineIteratorMethods(prototype) {
71
+ ["next", "throw", "return"].forEach(function (method) {
72
+ define(prototype, method, function (arg) {
73
+ return this._invoke(method, arg);
74
+ });
75
+ });
76
+ }
77
+ function AsyncIterator(generator, PromiseImpl) {
78
+ function invoke(method, arg, resolve, reject) {
79
+ var record = tryCatch(generator[method], generator, arg);
80
+ if ("throw" !== record.type) {
81
+ var result = record.arg,
82
+ value = result.value;
83
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
84
+ invoke("next", value, resolve, reject);
85
+ }, function (err) {
86
+ invoke("throw", err, resolve, reject);
87
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
88
+ result.value = unwrapped, resolve(result);
89
+ }, function (error) {
90
+ return invoke("throw", error, resolve, reject);
91
+ });
92
+ }
93
+ reject(record.arg);
94
+ }
95
+ var previousPromise;
96
+ defineProperty(this, "_invoke", {
97
+ value: function (method, arg) {
98
+ function callInvokeWithMethodAndArg() {
99
+ return new PromiseImpl(function (resolve, reject) {
100
+ invoke(method, arg, resolve, reject);
101
+ });
102
+ }
103
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
104
+ }
105
+ });
106
+ }
107
+ function makeInvokeMethod(innerFn, self, context) {
108
+ var state = "suspendedStart";
109
+ return function (method, arg) {
110
+ if ("executing" === state) throw new Error("Generator is already running");
111
+ if ("completed" === state) {
112
+ if ("throw" === method) throw arg;
113
+ return doneResult();
114
+ }
115
+ for (context.method = method, context.arg = arg;;) {
116
+ var delegate = context.delegate;
117
+ if (delegate) {
118
+ var delegateResult = maybeInvokeDelegate(delegate, context);
119
+ if (delegateResult) {
120
+ if (delegateResult === ContinueSentinel) continue;
121
+ return delegateResult;
122
+ }
123
+ }
124
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
125
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
126
+ context.dispatchException(context.arg);
127
+ } else "return" === context.method && context.abrupt("return", context.arg);
128
+ state = "executing";
129
+ var record = tryCatch(innerFn, self, context);
130
+ if ("normal" === record.type) {
131
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
132
+ return {
133
+ value: record.arg,
134
+ done: context.done
135
+ };
136
+ }
137
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
138
+ }
139
+ };
140
+ }
141
+ function maybeInvokeDelegate(delegate, context) {
142
+ var methodName = context.method,
143
+ method = delegate.iterator[methodName];
144
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
145
+ var record = tryCatch(method, delegate.iterator, context.arg);
146
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
147
+ var info = record.arg;
148
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
149
+ }
150
+ function pushTryEntry(locs) {
151
+ var entry = {
152
+ tryLoc: locs[0]
153
+ };
154
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
155
+ }
156
+ function resetTryEntry(entry) {
157
+ var record = entry.completion || {};
158
+ record.type = "normal", delete record.arg, entry.completion = record;
159
+ }
160
+ function Context(tryLocsList) {
161
+ this.tryEntries = [{
162
+ tryLoc: "root"
163
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
164
+ }
165
+ function values(iterable) {
166
+ if (iterable) {
167
+ var iteratorMethod = iterable[iteratorSymbol];
168
+ if (iteratorMethod) return iteratorMethod.call(iterable);
169
+ if ("function" == typeof iterable.next) return iterable;
170
+ if (!isNaN(iterable.length)) {
171
+ var i = -1,
172
+ next = function next() {
173
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
174
+ return next.value = undefined, next.done = !0, next;
175
+ };
176
+ return next.next = next;
177
+ }
178
+ }
179
+ return {
180
+ next: doneResult
181
+ };
182
+ }
183
+ function doneResult() {
184
+ return {
185
+ value: undefined,
186
+ done: !0
187
+ };
188
+ }
189
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
190
+ value: GeneratorFunctionPrototype,
191
+ configurable: !0
192
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
193
+ value: GeneratorFunction,
194
+ configurable: !0
195
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
196
+ var ctor = "function" == typeof genFun && genFun.constructor;
197
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
198
+ }, exports.mark = function (genFun) {
199
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
200
+ }, exports.awrap = function (arg) {
201
+ return {
202
+ __await: arg
203
+ };
204
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
205
+ return this;
206
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
207
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
208
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
209
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
210
+ return result.done ? result.value : iter.next();
211
+ });
212
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
213
+ return this;
214
+ }), define(Gp, "toString", function () {
215
+ return "[object Generator]";
216
+ }), exports.keys = function (val) {
217
+ var object = Object(val),
218
+ keys = [];
219
+ for (var key in object) keys.push(key);
220
+ return keys.reverse(), function next() {
221
+ for (; keys.length;) {
222
+ var key = keys.pop();
223
+ if (key in object) return next.value = key, next.done = !1, next;
224
+ }
225
+ return next.done = !0, next;
226
+ };
227
+ }, exports.values = values, Context.prototype = {
228
+ constructor: Context,
229
+ reset: function (skipTempReset) {
230
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
231
+ },
232
+ stop: function () {
233
+ this.done = !0;
234
+ var rootRecord = this.tryEntries[0].completion;
235
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
236
+ return this.rval;
237
+ },
238
+ dispatchException: function (exception) {
239
+ if (this.done) throw exception;
240
+ var context = this;
241
+ function handle(loc, caught) {
242
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
243
+ }
244
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
245
+ var entry = this.tryEntries[i],
246
+ record = entry.completion;
247
+ if ("root" === entry.tryLoc) return handle("end");
248
+ if (entry.tryLoc <= this.prev) {
249
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
250
+ hasFinally = hasOwn.call(entry, "finallyLoc");
251
+ if (hasCatch && hasFinally) {
252
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
253
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
254
+ } else if (hasCatch) {
255
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
256
+ } else {
257
+ if (!hasFinally) throw new Error("try statement without catch or finally");
258
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
259
+ }
260
+ }
261
+ }
262
+ },
263
+ abrupt: function (type, arg) {
264
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
265
+ var entry = this.tryEntries[i];
266
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
267
+ var finallyEntry = entry;
268
+ break;
269
+ }
270
+ }
271
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
272
+ var record = finallyEntry ? finallyEntry.completion : {};
273
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
274
+ },
275
+ complete: function (record, afterLoc) {
276
+ if ("throw" === record.type) throw record.arg;
277
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
278
+ },
279
+ finish: function (finallyLoc) {
280
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
281
+ var entry = this.tryEntries[i];
282
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
283
+ }
284
+ },
285
+ catch: function (tryLoc) {
286
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
287
+ var entry = this.tryEntries[i];
288
+ if (entry.tryLoc === tryLoc) {
289
+ var record = entry.completion;
290
+ if ("throw" === record.type) {
291
+ var thrown = record.arg;
292
+ resetTryEntry(entry);
293
+ }
294
+ return thrown;
295
+ }
296
+ }
297
+ throw new Error("illegal catch attempt");
298
+ },
299
+ delegateYield: function (iterable, resultName, nextLoc) {
300
+ return this.delegate = {
301
+ iterator: values(iterable),
302
+ resultName: resultName,
303
+ nextLoc: nextLoc
304
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
305
+ }
306
+ }, exports;
307
+ }
308
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
309
+ try {
310
+ var info = gen[key](arg);
311
+ var value = info.value;
312
+ } catch (error) {
313
+ reject(error);
314
+ return;
315
+ }
316
+ if (info.done) {
317
+ resolve(value);
318
+ } else {
319
+ Promise.resolve(value).then(_next, _throw);
320
+ }
321
+ }
322
+ function _asyncToGenerator(fn) {
323
+ return function () {
324
+ var self = this,
325
+ args = arguments;
326
+ return new Promise(function (resolve, reject) {
327
+ var gen = fn.apply(self, args);
328
+ function _next(value) {
329
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
330
+ }
331
+ function _throw(err) {
332
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
333
+ }
334
+ _next(undefined);
335
+ });
336
+ };
337
+ }
338
+
339
+ function trustWallet() {
340
+ var _window = window,
341
+ trustwallet = _window.trustwallet;
342
+ if (!!trustwallet && (trustwallet != null && trustwallet.isTrust || trustwallet != null && trustwallet.isTrustWallet)) {
343
+ return trustwallet;
344
+ }
345
+ return null;
346
+ }
347
+
348
+ function getSigners(provider) {
349
+ return walletsShared.defaultSigners({
350
+ provider: provider,
351
+ walletType: walletsShared.WalletType.TRUST_WALLET,
352
+ supportEvm: true
353
+ });
354
+ }
355
+
356
+ var WALLET = walletsShared.WalletType.TRUST_WALLET;
357
+ var config = {
358
+ type: WALLET
359
+ };
360
+ var getInstance = trustWallet;
361
+ // doc: https://developer.trustwallet.com/trust-wallet-browser-extension/extension-guide
362
+ var connect = /*#__PURE__*/function () {
363
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
364
+ var instance, _yield$getEvmAccounts, accounts, chainId;
365
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
366
+ while (1) switch (_context.prev = _context.next) {
367
+ case 0:
368
+ instance = _ref.instance;
369
+ _context.next = 3;
370
+ return walletsShared.getEvmAccounts(instance);
371
+ case 3:
372
+ _yield$getEvmAccounts = _context.sent;
373
+ accounts = _yield$getEvmAccounts.accounts;
374
+ chainId = _yield$getEvmAccounts.chainId;
375
+ return _context.abrupt("return", {
376
+ accounts: accounts,
377
+ chainId: chainId
378
+ });
379
+ case 7:
380
+ case "end":
381
+ return _context.stop();
382
+ }
383
+ }, _callee);
384
+ }));
385
+ return function connect(_x) {
386
+ return _ref2.apply(this, arguments);
387
+ };
388
+ }();
389
+ var subscribe = walletsShared.subscribeToEvm;
390
+ var switchNetwork = walletsShared.switchNetworkForEvm;
391
+ var canSwitchNetworkTo = walletsShared.canSwitchNetworkToEvm;
392
+ var getSigners$1 = getSigners;
393
+ var getWalletInfo = function getWalletInfo(allBlockChains) {
394
+ var evms = walletsShared.evmBlockchains(allBlockChains);
395
+ return {
396
+ name: 'Trust Wallet',
397
+ img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/trust.png',
398
+ installLink: {
399
+ CHROME: 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
400
+ BRAVE: 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
401
+ DEFAULT: 'https://trustwallet.com/browser-extension'
402
+ },
403
+ color: '#ffffff',
404
+ supportedChains: evms
405
+ };
406
+ };
407
+
408
+ exports.canSwitchNetworkTo = canSwitchNetworkTo;
409
+ exports.config = config;
410
+ exports.connect = connect;
411
+ exports.getInstance = getInstance;
412
+ exports.getSigners = getSigners$1;
413
+ exports.getWalletInfo = getWalletInfo;
414
+ exports.subscribe = subscribe;
415
+ exports.switchNetwork = switchNetwork;
416
+ //# sourceMappingURL=provider-trustwallet.cjs.development.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-trustwallet.cjs.development.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["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 {\n WalletType,\n defaultSigners,\n WalletSigners,\n} from '@rango-dev/wallets-shared';\n\nexport default function getSigners(provider: any): WalletSigners {\n return defaultSigners({\n provider,\n walletType: WalletType.TRUST_WALLET,\n supportEvm: true,\n });\n}\n","import {\n WalletType,\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletSigners,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n evmBlockchains,\n BlockchainMeta,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport { trustWallet as trustwallet_instance } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletType.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) => WalletSigners = signer;\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-types/main/assets/icons/wallets/trust.png',\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"],"names":["trustWallet","window","trustwallet","isTrust","isTrustWallet","getSigners","provider","defaultSigners","walletType","WalletType","TRUST_WALLET","supportEvm","WALLET","config","type","getInstance","trustwallet_instance","connect","instance","getEvmAccounts","accounts","chainId","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkTo","canSwitchNetworkToEvm","signer","getWalletInfo","allBlockChains","evms","evmBlockchains","name","img","installLink","CHROME","BRAVE","DEFAULT","color","supportedChains"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAgBA,WAAW;EACzB,cAAwBC,MAAM;IAAtBC,WAAW,WAAXA,WAAW;EAEnB,IAAI,CAAC,CAACA,WAAW,KAAKA,WAAW,YAAXA,WAAW,CAAEC,OAAO,IAAID,WAAW,YAAXA,WAAW,CAAEE,aAAa,CAAC,EAAE;IACzE,OAAOF,WAAW;;EAEpB,OAAO,IAAI;AACb;;SCDwBG,UAAU,CAACC,QAAa;EAC9C,OAAOC,4BAAc,CAAC;IACpBD,QAAQ,EAARA,QAAQ;IACRE,UAAU,EAAEC,wBAAU,CAACC,YAAY;IACnCC,UAAU,EAAE;GACb,CAAC;AACJ;;ACMA,IAAMC,MAAM,GAAGH,wBAAU,CAACC,YAAY;AAEtC,IAAaG,MAAM,GAAG;EACpBC,IAAI,EAAEF;CACP;AAED,IAAaG,WAAW,GAAGC;AAE3B;AACA,IAAaC,OAAO;EAAA,oFAAY;IAAA;IAAA;MAAA;QAAA;UAASC,QAAQ,QAARA,QAAQ;UAAA;UAAA,OACXC,4BAAc,CAACD,QAAQ,CAAC;QAAA;UAAA;UAApDE,QAAQ,yBAARA,QAAQ;UAAEC,OAAO,yBAAPA,OAAO;UAAA,iCAClB;YACLD,QAAQ,EAARA,QAAQ;YACRC,OAAO,EAAPA;WACD;QAAA;QAAA;UAAA;;;GACF;EAAA,gBANYJ,OAAO;IAAA;;AAAA,GAMnB;AAED,IAAaK,SAAS,GAAcC;AAEpC,IAAaC,aAAa,GAAkBC;AAE5C,IAAaC,kBAAkB,GAAqBC;AAEpD,IAAatB,YAAU,GAAqCuB;AAE5D,IAAaC,aAAa,GAAqD,SAAlEA,aAAa,CACxBC,cAAc;EAEd,IAAMC,IAAI,GAAGC,4BAAc,CAACF,cAAc,CAAC;EAC3C,OAAO;IACLG,IAAI,EAAE,cAAc;IACpBC,GAAG,EAAE,kGAAkG;IACvGC,WAAW,EAAE;MACXC,MAAM,EACJ,0FAA0F;MAC5FC,KAAK,EACH,0FAA0F;MAC5FC,OAAO,EAAE;KACV;IACDC,KAAK,EAAE,SAAS;IAChBC,eAAe,EAAET;GAClB;AACH,CAAC;;;;;;;;;;;"}
@@ -0,0 +1,2 @@
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("@rango-dev/wallets-shared");function e(){e=function(){return t};var t={},r=Object.prototype,n=r.hasOwnProperty,o=Object.defineProperty||function(t,e,r){t[e]=r.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",u=i.toStringTag||"@@toStringTag";function s(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,r){return t[e]=r}}function l(t,e,r,n){var i=Object.create((e&&e.prototype instanceof p?e:p).prototype),a=new j(n||[]);return o(i,"_invoke",{value:L(t,r,a)}),i}function h(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=l;var f={};function p(){}function v(){}function d(){}var y={};s(y,a,(function(){return this}));var g=Object.getPrototypeOf,w=g&&g(g(O([])));w&&w!==r&&n.call(w,a)&&(y=w);var m=d.prototype=p.prototype=Object.create(y);function b(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){var r;o(this,"_invoke",{value:function(o,i){function a(){return new e((function(r,a){!function r(o,i,a,c){var u=h(t[o],t,i);if("throw"!==u.type){var s=u.arg,l=s.value;return l&&"object"==typeof l&&n.call(l,"__await")?e.resolve(l.__await).then((function(t){r("next",t,a,c)}),(function(t){r("throw",t,a,c)})):e.resolve(l).then((function(t){s.value=t,a(s)}),(function(t){return r("throw",t,a,c)}))}c(u.arg)}(o,i,r,a)}))}return r=r?r.then(a,a):a()}})}function L(t,e,r){var n="suspendedStart";return function(o,i){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw i;return{value:void 0,done:!0}}for(r.method=o,r.arg=i;;){var a=r.delegate;if(a){var c=E(a,r);if(c){if(c===f)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(t,e,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===f)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}function E(t,e){var r=e.method,n=t.iterator[r];if(void 0===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=void 0,E(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=h(n,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,f;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,f):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,f)}function T(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function _(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function j(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function O(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:k}}function k(){return{value:void 0,done:!0}}return v.prototype=d,o(m,"constructor",{value:d,configurable:!0}),o(d,"constructor",{value:v,configurable:!0}),v.displayName=s(d,u,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,s(t,u,"GeneratorFunction")),t.prototype=Object.create(m),t},t.awrap=function(t){return{__await:t}},b(x.prototype),s(x.prototype,c,(function(){return this})),t.AsyncIterator=x,t.async=function(e,r,n,o,i){void 0===i&&(i=Promise);var a=new x(l(e,r,n,o),i);return t.isGeneratorFunction(r)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},b(m),s(m,u,"Generator"),s(m,a,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},t.values=O,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,n){return a.type="throw",a.arg=t,e.next=r,n&&(e.method="next",e.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),u=n.call(i,"finallyLoc");if(c&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=e&&e<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=e,i?(this.method="next",this.next=i.finallyLoc,f):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),_(r),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;_(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},t}function r(t,e,r,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void r(t)}c.done?e(u):Promise.resolve(u).then(n,o)}function n(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))}}var o={type:t.WalletType.TRUST_WALLET},i=function(){var r=n(e().mark((function r(n){var o,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=n.instance,e.next=3,t.getEvmAccounts(o);case 3:return e.abrupt("return",{accounts:(i=e.sent).accounts,chainId:i.chainId});case 7:case"end":return e.stop()}}),r)})));return function(t){return r.apply(this,arguments)}}(),a=t.subscribeToEvm,c=t.switchNetworkForEvm;exports.canSwitchNetworkTo=t.canSwitchNetworkToEvm,exports.config=o,exports.connect=i,exports.getInstance=function(){var t=window.trustwallet;return t&&(null!=t&&t.isTrust||null!=t&&t.isTrustWallet)?t:null},exports.getSigners=function(e){return t.defaultSigners({provider:e,walletType:t.WalletType.TRUST_WALLET,supportEvm:!0})},exports.getWalletInfo=function(e){return{name:"Trust Wallet",img:"https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/trust.png",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:t.evmBlockchains(e)}},exports.subscribe=a,exports.switchNetwork=c;
2
+ //# sourceMappingURL=provider-trustwallet.cjs.production.min.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-trustwallet.cjs.production.min.js","sources":["../src/index.ts","../src/helpers.ts","../src/signer.ts"],"sourcesContent":["import {\n WalletType,\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletSigners,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n evmBlockchains,\n BlockchainMeta,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport { trustWallet as trustwallet_instance } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletType.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) => WalletSigners = signer;\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-types/main/assets/icons/wallets/trust.png',\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 {\n WalletType,\n defaultSigners,\n WalletSigners,\n} from '@rango-dev/wallets-shared';\n\nexport default function getSigners(provider: any): WalletSigners {\n return defaultSigners({\n provider,\n walletType: WalletType.TRUST_WALLET,\n supportEvm: true,\n });\n}\n"],"names":["config","type","WalletType","TRUST_WALLET","connect","instance","_context","getEvmAccounts","accounts","_yield$getEvmAccounts","chainId","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkToEvm","trustwallet","window","isTrust","isTrustWallet","provider","defaultSigners","walletType","supportEvm","allBlockChains","name","img","installLink","CHROME","BRAVE","DEFAULT","color","supportedChains","evmBlockchains"],"mappings":"k3NAkBA,IAEaA,EAAS,CACpBC,KAHaC,aAAWC,cASbC,aAAO,kBAAY,cAAA,QAAA,6BAAA,6BAAA,OAAiB,OAARC,IAAAA,SAAQC,SACXC,iBAAeF,GAAS,OAAnC,yBAClB,CACLG,UAF0DC,UAApDD,SAGNE,UAHgBA,UAIjB,OAAA,UAAA,0BACF,mBANmB,mCAQPC,EAAuBC,iBAEvBC,EAA+BC,iDAEQC,0FCtClD,IAAQC,EAAgBC,OAAhBD,YAER,OAAMA,UAAgBA,GAAAA,EAAaE,eAAWF,GAAAA,EAAaG,eAClDH,EAEF,kCCA0BI,GACjC,OAAOC,iBAAe,CACpBD,SAAAA,EACAE,WAAYpB,aAAWC,aACvBoB,YAAY,2BFiC+D,SAC7EC,GAGA,MAAO,CACLC,KAAM,eACNC,IAAK,mGACLC,YAAa,CACXC,OACE,2FACFC,MACE,2FACFC,QAAS,6CAEXC,MAAO,UACPC,gBAZWC,iBAAeT"}
@@ -0,0 +1,405 @@
1
+ import { defaultSigners, WalletType, subscribeToEvm, switchNetworkForEvm, canSwitchNetworkToEvm, evmBlockchains, getEvmAccounts } from '@rango-dev/wallets-shared';
2
+
3
+ function _regeneratorRuntime() {
4
+ _regeneratorRuntime = function () {
5
+ return exports;
6
+ };
7
+ var exports = {},
8
+ Op = Object.prototype,
9
+ hasOwn = Op.hasOwnProperty,
10
+ defineProperty = Object.defineProperty || function (obj, key, desc) {
11
+ obj[key] = desc.value;
12
+ },
13
+ $Symbol = "function" == typeof Symbol ? Symbol : {},
14
+ iteratorSymbol = $Symbol.iterator || "@@iterator",
15
+ asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
16
+ toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
17
+ function define(obj, key, value) {
18
+ return Object.defineProperty(obj, key, {
19
+ value: value,
20
+ enumerable: !0,
21
+ configurable: !0,
22
+ writable: !0
23
+ }), obj[key];
24
+ }
25
+ try {
26
+ define({}, "");
27
+ } catch (err) {
28
+ define = function (obj, key, value) {
29
+ return obj[key] = value;
30
+ };
31
+ }
32
+ function wrap(innerFn, outerFn, self, tryLocsList) {
33
+ var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
34
+ generator = Object.create(protoGenerator.prototype),
35
+ context = new Context(tryLocsList || []);
36
+ return defineProperty(generator, "_invoke", {
37
+ value: makeInvokeMethod(innerFn, self, context)
38
+ }), generator;
39
+ }
40
+ function tryCatch(fn, obj, arg) {
41
+ try {
42
+ return {
43
+ type: "normal",
44
+ arg: fn.call(obj, arg)
45
+ };
46
+ } catch (err) {
47
+ return {
48
+ type: "throw",
49
+ arg: err
50
+ };
51
+ }
52
+ }
53
+ exports.wrap = wrap;
54
+ var ContinueSentinel = {};
55
+ function Generator() {}
56
+ function GeneratorFunction() {}
57
+ function GeneratorFunctionPrototype() {}
58
+ var IteratorPrototype = {};
59
+ define(IteratorPrototype, iteratorSymbol, function () {
60
+ return this;
61
+ });
62
+ var getProto = Object.getPrototypeOf,
63
+ NativeIteratorPrototype = getProto && getProto(getProto(values([])));
64
+ NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
65
+ var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
66
+ function defineIteratorMethods(prototype) {
67
+ ["next", "throw", "return"].forEach(function (method) {
68
+ define(prototype, method, function (arg) {
69
+ return this._invoke(method, arg);
70
+ });
71
+ });
72
+ }
73
+ function AsyncIterator(generator, PromiseImpl) {
74
+ function invoke(method, arg, resolve, reject) {
75
+ var record = tryCatch(generator[method], generator, arg);
76
+ if ("throw" !== record.type) {
77
+ var result = record.arg,
78
+ value = result.value;
79
+ return value && "object" == typeof value && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
80
+ invoke("next", value, resolve, reject);
81
+ }, function (err) {
82
+ invoke("throw", err, resolve, reject);
83
+ }) : PromiseImpl.resolve(value).then(function (unwrapped) {
84
+ result.value = unwrapped, resolve(result);
85
+ }, function (error) {
86
+ return invoke("throw", error, resolve, reject);
87
+ });
88
+ }
89
+ reject(record.arg);
90
+ }
91
+ var previousPromise;
92
+ defineProperty(this, "_invoke", {
93
+ value: function (method, arg) {
94
+ function callInvokeWithMethodAndArg() {
95
+ return new PromiseImpl(function (resolve, reject) {
96
+ invoke(method, arg, resolve, reject);
97
+ });
98
+ }
99
+ return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
100
+ }
101
+ });
102
+ }
103
+ function makeInvokeMethod(innerFn, self, context) {
104
+ var state = "suspendedStart";
105
+ return function (method, arg) {
106
+ if ("executing" === state) throw new Error("Generator is already running");
107
+ if ("completed" === state) {
108
+ if ("throw" === method) throw arg;
109
+ return doneResult();
110
+ }
111
+ for (context.method = method, context.arg = arg;;) {
112
+ var delegate = context.delegate;
113
+ if (delegate) {
114
+ var delegateResult = maybeInvokeDelegate(delegate, context);
115
+ if (delegateResult) {
116
+ if (delegateResult === ContinueSentinel) continue;
117
+ return delegateResult;
118
+ }
119
+ }
120
+ if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
121
+ if ("suspendedStart" === state) throw state = "completed", context.arg;
122
+ context.dispatchException(context.arg);
123
+ } else "return" === context.method && context.abrupt("return", context.arg);
124
+ state = "executing";
125
+ var record = tryCatch(innerFn, self, context);
126
+ if ("normal" === record.type) {
127
+ if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
128
+ return {
129
+ value: record.arg,
130
+ done: context.done
131
+ };
132
+ }
133
+ "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
134
+ }
135
+ };
136
+ }
137
+ function maybeInvokeDelegate(delegate, context) {
138
+ var methodName = context.method,
139
+ method = delegate.iterator[methodName];
140
+ if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
141
+ var record = tryCatch(method, delegate.iterator, context.arg);
142
+ if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
143
+ var info = record.arg;
144
+ return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
145
+ }
146
+ function pushTryEntry(locs) {
147
+ var entry = {
148
+ tryLoc: locs[0]
149
+ };
150
+ 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
151
+ }
152
+ function resetTryEntry(entry) {
153
+ var record = entry.completion || {};
154
+ record.type = "normal", delete record.arg, entry.completion = record;
155
+ }
156
+ function Context(tryLocsList) {
157
+ this.tryEntries = [{
158
+ tryLoc: "root"
159
+ }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
160
+ }
161
+ function values(iterable) {
162
+ if (iterable) {
163
+ var iteratorMethod = iterable[iteratorSymbol];
164
+ if (iteratorMethod) return iteratorMethod.call(iterable);
165
+ if ("function" == typeof iterable.next) return iterable;
166
+ if (!isNaN(iterable.length)) {
167
+ var i = -1,
168
+ next = function next() {
169
+ for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
170
+ return next.value = undefined, next.done = !0, next;
171
+ };
172
+ return next.next = next;
173
+ }
174
+ }
175
+ return {
176
+ next: doneResult
177
+ };
178
+ }
179
+ function doneResult() {
180
+ return {
181
+ value: undefined,
182
+ done: !0
183
+ };
184
+ }
185
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
186
+ value: GeneratorFunctionPrototype,
187
+ configurable: !0
188
+ }), defineProperty(GeneratorFunctionPrototype, "constructor", {
189
+ value: GeneratorFunction,
190
+ configurable: !0
191
+ }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
192
+ var ctor = "function" == typeof genFun && genFun.constructor;
193
+ return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
194
+ }, exports.mark = function (genFun) {
195
+ return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
196
+ }, exports.awrap = function (arg) {
197
+ return {
198
+ __await: arg
199
+ };
200
+ }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
201
+ return this;
202
+ }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
203
+ void 0 === PromiseImpl && (PromiseImpl = Promise);
204
+ var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
205
+ return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
206
+ return result.done ? result.value : iter.next();
207
+ });
208
+ }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
209
+ return this;
210
+ }), define(Gp, "toString", function () {
211
+ return "[object Generator]";
212
+ }), exports.keys = function (val) {
213
+ var object = Object(val),
214
+ keys = [];
215
+ for (var key in object) keys.push(key);
216
+ return keys.reverse(), function next() {
217
+ for (; keys.length;) {
218
+ var key = keys.pop();
219
+ if (key in object) return next.value = key, next.done = !1, next;
220
+ }
221
+ return next.done = !0, next;
222
+ };
223
+ }, exports.values = values, Context.prototype = {
224
+ constructor: Context,
225
+ reset: function (skipTempReset) {
226
+ if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
227
+ },
228
+ stop: function () {
229
+ this.done = !0;
230
+ var rootRecord = this.tryEntries[0].completion;
231
+ if ("throw" === rootRecord.type) throw rootRecord.arg;
232
+ return this.rval;
233
+ },
234
+ dispatchException: function (exception) {
235
+ if (this.done) throw exception;
236
+ var context = this;
237
+ function handle(loc, caught) {
238
+ return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
239
+ }
240
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
241
+ var entry = this.tryEntries[i],
242
+ record = entry.completion;
243
+ if ("root" === entry.tryLoc) return handle("end");
244
+ if (entry.tryLoc <= this.prev) {
245
+ var hasCatch = hasOwn.call(entry, "catchLoc"),
246
+ hasFinally = hasOwn.call(entry, "finallyLoc");
247
+ if (hasCatch && hasFinally) {
248
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
249
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
250
+ } else if (hasCatch) {
251
+ if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
252
+ } else {
253
+ if (!hasFinally) throw new Error("try statement without catch or finally");
254
+ if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
255
+ }
256
+ }
257
+ }
258
+ },
259
+ abrupt: function (type, arg) {
260
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
261
+ var entry = this.tryEntries[i];
262
+ if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
263
+ var finallyEntry = entry;
264
+ break;
265
+ }
266
+ }
267
+ finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
268
+ var record = finallyEntry ? finallyEntry.completion : {};
269
+ return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
270
+ },
271
+ complete: function (record, afterLoc) {
272
+ if ("throw" === record.type) throw record.arg;
273
+ return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
274
+ },
275
+ finish: function (finallyLoc) {
276
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
277
+ var entry = this.tryEntries[i];
278
+ if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
279
+ }
280
+ },
281
+ catch: function (tryLoc) {
282
+ for (var i = this.tryEntries.length - 1; i >= 0; --i) {
283
+ var entry = this.tryEntries[i];
284
+ if (entry.tryLoc === tryLoc) {
285
+ var record = entry.completion;
286
+ if ("throw" === record.type) {
287
+ var thrown = record.arg;
288
+ resetTryEntry(entry);
289
+ }
290
+ return thrown;
291
+ }
292
+ }
293
+ throw new Error("illegal catch attempt");
294
+ },
295
+ delegateYield: function (iterable, resultName, nextLoc) {
296
+ return this.delegate = {
297
+ iterator: values(iterable),
298
+ resultName: resultName,
299
+ nextLoc: nextLoc
300
+ }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
301
+ }
302
+ }, exports;
303
+ }
304
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
305
+ try {
306
+ var info = gen[key](arg);
307
+ var value = info.value;
308
+ } catch (error) {
309
+ reject(error);
310
+ return;
311
+ }
312
+ if (info.done) {
313
+ resolve(value);
314
+ } else {
315
+ Promise.resolve(value).then(_next, _throw);
316
+ }
317
+ }
318
+ function _asyncToGenerator(fn) {
319
+ return function () {
320
+ var self = this,
321
+ args = arguments;
322
+ return new Promise(function (resolve, reject) {
323
+ var gen = fn.apply(self, args);
324
+ function _next(value) {
325
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
326
+ }
327
+ function _throw(err) {
328
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
329
+ }
330
+ _next(undefined);
331
+ });
332
+ };
333
+ }
334
+
335
+ function trustWallet() {
336
+ var _window = window,
337
+ trustwallet = _window.trustwallet;
338
+ if (!!trustwallet && (trustwallet != null && trustwallet.isTrust || trustwallet != null && trustwallet.isTrustWallet)) {
339
+ return trustwallet;
340
+ }
341
+ return null;
342
+ }
343
+
344
+ function getSigners(provider) {
345
+ return defaultSigners({
346
+ provider: provider,
347
+ walletType: WalletType.TRUST_WALLET,
348
+ supportEvm: true
349
+ });
350
+ }
351
+
352
+ var WALLET = WalletType.TRUST_WALLET;
353
+ var config = {
354
+ type: WALLET
355
+ };
356
+ var getInstance = trustWallet;
357
+ // doc: https://developer.trustwallet.com/trust-wallet-browser-extension/extension-guide
358
+ var connect = /*#__PURE__*/function () {
359
+ var _ref2 = /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(_ref) {
360
+ var instance, _yield$getEvmAccounts, accounts, chainId;
361
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
362
+ while (1) switch (_context.prev = _context.next) {
363
+ case 0:
364
+ instance = _ref.instance;
365
+ _context.next = 3;
366
+ return getEvmAccounts(instance);
367
+ case 3:
368
+ _yield$getEvmAccounts = _context.sent;
369
+ accounts = _yield$getEvmAccounts.accounts;
370
+ chainId = _yield$getEvmAccounts.chainId;
371
+ return _context.abrupt("return", {
372
+ accounts: accounts,
373
+ chainId: chainId
374
+ });
375
+ case 7:
376
+ case "end":
377
+ return _context.stop();
378
+ }
379
+ }, _callee);
380
+ }));
381
+ return function connect(_x) {
382
+ return _ref2.apply(this, arguments);
383
+ };
384
+ }();
385
+ var subscribe = subscribeToEvm;
386
+ var switchNetwork = switchNetworkForEvm;
387
+ var canSwitchNetworkTo = canSwitchNetworkToEvm;
388
+ var getSigners$1 = getSigners;
389
+ var getWalletInfo = function getWalletInfo(allBlockChains) {
390
+ var evms = evmBlockchains(allBlockChains);
391
+ return {
392
+ name: 'Trust Wallet',
393
+ img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/trust.png',
394
+ installLink: {
395
+ CHROME: 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
396
+ BRAVE: 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
397
+ DEFAULT: 'https://trustwallet.com/browser-extension'
398
+ },
399
+ color: '#ffffff',
400
+ supportedChains: evms
401
+ };
402
+ };
403
+
404
+ export { canSwitchNetworkTo, config, connect, getInstance, getSigners$1 as getSigners, getWalletInfo, subscribe, switchNetwork };
405
+ //# sourceMappingURL=provider-trustwallet.esm.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"provider-trustwallet.esm.js","sources":["../src/helpers.ts","../src/signer.ts","../src/index.ts"],"sourcesContent":["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 {\n WalletType,\n defaultSigners,\n WalletSigners,\n} from '@rango-dev/wallets-shared';\n\nexport default function getSigners(provider: any): WalletSigners {\n return defaultSigners({\n provider,\n walletType: WalletType.TRUST_WALLET,\n supportEvm: true,\n });\n}\n","import {\n WalletType,\n CanSwitchNetwork,\n Connect,\n Subscribe,\n SwitchNetwork,\n WalletSigners,\n canSwitchNetworkToEvm,\n getEvmAccounts,\n subscribeToEvm,\n switchNetworkForEvm,\n evmBlockchains,\n BlockchainMeta,\n WalletInfo,\n} from '@rango-dev/wallets-shared';\nimport { trustWallet as trustwallet_instance } from './helpers';\nimport signer from './signer';\n\nconst WALLET = WalletType.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) => WalletSigners = signer;\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-types/main/assets/icons/wallets/trust.png',\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"],"names":["trustWallet","window","trustwallet","isTrust","isTrustWallet","getSigners","provider","defaultSigners","walletType","WalletType","TRUST_WALLET","supportEvm","WALLET","config","type","getInstance","trustwallet_instance","connect","instance","getEvmAccounts","accounts","chainId","subscribe","subscribeToEvm","switchNetwork","switchNetworkForEvm","canSwitchNetworkTo","canSwitchNetworkToEvm","signer","getWalletInfo","allBlockChains","evms","evmBlockchains","name","img","installLink","CHROME","BRAVE","DEFAULT","color","supportedChains"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAgBA,WAAW;EACzB,cAAwBC,MAAM;IAAtBC,WAAW,WAAXA,WAAW;EAEnB,IAAI,CAAC,CAACA,WAAW,KAAKA,WAAW,YAAXA,WAAW,CAAEC,OAAO,IAAID,WAAW,YAAXA,WAAW,CAAEE,aAAa,CAAC,EAAE;IACzE,OAAOF,WAAW;;EAEpB,OAAO,IAAI;AACb;;SCDwBG,UAAU,CAACC,QAAa;EAC9C,OAAOC,cAAc,CAAC;IACpBD,QAAQ,EAARA,QAAQ;IACRE,UAAU,EAAEC,UAAU,CAACC,YAAY;IACnCC,UAAU,EAAE;GACb,CAAC;AACJ;;ACMA,IAAMC,MAAM,GAAGH,UAAU,CAACC,YAAY;AAEtC,IAAaG,MAAM,GAAG;EACpBC,IAAI,EAAEF;CACP;AAED,IAAaG,WAAW,GAAGC;AAE3B;AACA,IAAaC,OAAO;EAAA,oFAAY;IAAA;IAAA;MAAA;QAAA;UAASC,QAAQ,QAARA,QAAQ;UAAA;UAAA,OACXC,cAAc,CAACD,QAAQ,CAAC;QAAA;UAAA;UAApDE,QAAQ,yBAARA,QAAQ;UAAEC,OAAO,yBAAPA,OAAO;UAAA,iCAClB;YACLD,QAAQ,EAARA,QAAQ;YACRC,OAAO,EAAPA;WACD;QAAA;QAAA;UAAA;;;GACF;EAAA,gBANYJ,OAAO;IAAA;;AAAA,GAMnB;AAED,IAAaK,SAAS,GAAcC,cAAc;AAElD,IAAaC,aAAa,GAAkBC,mBAAmB;AAE/D,IAAaC,kBAAkB,GAAqBC,qBAAqB;AAEzE,IAAatB,YAAU,GAAqCuB;AAE5D,IAAaC,aAAa,GAAqD,SAAlEA,aAAa,CACxBC,cAAc;EAEd,IAAMC,IAAI,GAAGC,cAAc,CAACF,cAAc,CAAC;EAC3C,OAAO;IACLG,IAAI,EAAE,cAAc;IACpBC,GAAG,EAAE,kGAAkG;IACvGC,WAAW,EAAE;MACXC,MAAM,EACJ,0FAA0F;MAC5FC,KAAK,EACH,0FAA0F;MAC5FC,OAAO,EAAE;KACV;IACDC,KAAK,EAAE,SAAS;IAChBC,eAAe,EAAET;GAClB;AACH,CAAC;;;;"}
@@ -0,0 +1,2 @@
1
+ import { WalletSigners } from '@rango-dev/wallets-shared';
2
+ export default function getSigners(provider: any): WalletSigners;
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@rango-dev/provider-trustwallet",
3
+ "version": "0.1.11-next.69",
4
+ "license": "MIT",
5
+ "module": "dist/provider-trustwallet.esm.js",
6
+ "main": "dist/index.js",
7
+ "typings": "dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "src"
11
+ ],
12
+ "engines": {
13
+ "node": ">=10"
14
+ },
15
+ "scripts": {
16
+ "start": "tsdx watch",
17
+ "build": "tsdx build",
18
+ "test": "tsdx test --passWithNoTests",
19
+ "lint": "tsdx lint",
20
+ "size": "size-limit",
21
+ "analyze": "size-limit --why"
22
+ },
23
+ "peerDependencies": {
24
+ "react": ">=16"
25
+ },
26
+ "husky": {
27
+ "hooks": {
28
+ "pre-commit": "tsdx lint"
29
+ }
30
+ },
31
+ "prettier": {
32
+ "printWidth": 80,
33
+ "semi": true,
34
+ "singleQuote": true,
35
+ "trailingComma": "es5"
36
+ },
37
+ "size-limit": [
38
+ {
39
+ "path": "dist/provider-trustwallet.cjs.production.min.js",
40
+ "limit": "10 KB"
41
+ },
42
+ {
43
+ "path": "dist/provider-trustwallet.esm.js",
44
+ "limit": "10 KB"
45
+ }
46
+ ],
47
+ "dependencies": {
48
+ "@rango-dev/wallets-shared": "^0.1.11-next.69"
49
+ },
50
+ "publishConfig": {
51
+ "access": "public"
52
+ },
53
+ "gitHead": "35fad4db1d491a9589a8215b0c4a4e2f541d07f2"
54
+ }
package/src/helpers.ts ADDED
@@ -0,0 +1,8 @@
1
+ export function trustWallet() {
2
+ const { trustwallet } = window;
3
+
4
+ if (!!trustwallet && (trustwallet?.isTrust || trustwallet?.isTrustWallet)) {
5
+ return trustwallet;
6
+ }
7
+ return null;
8
+ }
package/src/index.ts ADDED
@@ -0,0 +1,61 @@
1
+ import {
2
+ WalletType,
3
+ CanSwitchNetwork,
4
+ Connect,
5
+ Subscribe,
6
+ SwitchNetwork,
7
+ WalletSigners,
8
+ canSwitchNetworkToEvm,
9
+ getEvmAccounts,
10
+ subscribeToEvm,
11
+ switchNetworkForEvm,
12
+ evmBlockchains,
13
+ BlockchainMeta,
14
+ WalletInfo,
15
+ } from '@rango-dev/wallets-shared';
16
+ import { trustWallet as trustwallet_instance } from './helpers';
17
+ import signer from './signer';
18
+
19
+ const WALLET = WalletType.TRUST_WALLET;
20
+
21
+ export const config = {
22
+ type: WALLET,
23
+ };
24
+
25
+ export const getInstance = trustwallet_instance;
26
+
27
+ // doc: https://developer.trustwallet.com/trust-wallet-browser-extension/extension-guide
28
+ export const connect: Connect = async ({ instance }) => {
29
+ const { accounts, chainId } = await getEvmAccounts(instance);
30
+ return {
31
+ accounts,
32
+ chainId,
33
+ };
34
+ };
35
+
36
+ export const subscribe: Subscribe = subscribeToEvm;
37
+
38
+ export const switchNetwork: SwitchNetwork = switchNetworkForEvm;
39
+
40
+ export const canSwitchNetworkTo: CanSwitchNetwork = canSwitchNetworkToEvm;
41
+
42
+ export const getSigners: (provider: any) => WalletSigners = signer;
43
+
44
+ export const getWalletInfo: (allBlockChains: BlockchainMeta[]) => WalletInfo = (
45
+ allBlockChains
46
+ ) => {
47
+ const evms = evmBlockchains(allBlockChains);
48
+ return {
49
+ name: 'Trust Wallet',
50
+ img: 'https://raw.githubusercontent.com/rango-exchange/rango-types/main/assets/icons/wallets/trust.png',
51
+ installLink: {
52
+ CHROME:
53
+ 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
54
+ BRAVE:
55
+ 'https://chrome.google.com/webstore/detail/trust-wallet/egjidjbpglichdcondbcbdnbeeppgdph/',
56
+ DEFAULT: 'https://trustwallet.com/browser-extension',
57
+ },
58
+ color: '#ffffff',
59
+ supportedChains: evms,
60
+ };
61
+ };
package/src/signer.ts ADDED
@@ -0,0 +1,13 @@
1
+ import {
2
+ WalletType,
3
+ defaultSigners,
4
+ WalletSigners,
5
+ } from '@rango-dev/wallets-shared';
6
+
7
+ export default function getSigners(provider: any): WalletSigners {
8
+ return defaultSigners({
9
+ provider,
10
+ walletType: WalletType.TRUST_WALLET,
11
+ supportEvm: true,
12
+ });
13
+ }