From ef8b0187b74f9b383c0fde907c8bf71c39480e34 Mon Sep 17 00:00:00 2001 From: Justin Zhu Date: Mon, 16 Oct 2023 10:04:03 +0800 Subject: [PATCH 01/13] chore: add umd format dist and cdn usage demo --- demos/cdn-demo/.eslintrc | 18 + demos/cdn-demo/.gitignore | 24 + demos/cdn-demo/.npmrc | 1 + demos/cdn-demo/.prettierrc.json | 7 + demos/cdn-demo/bitkeep/index.html | 101 ++ demos/cdn-demo/ledger/events.umd.js | 489 ++++++++ demos/cdn-demo/ledger/index.html | 108 ++ demos/cdn-demo/metamask/index.html | 90 ++ demos/cdn-demo/okxwallet/index.html | 102 ++ demos/cdn-demo/package.json | 20 + demos/cdn-demo/tokenpocket/index.html | 100 ++ demos/cdn-demo/tronlink/index.html | 99 ++ package.json | 6 + .../abstract-adapter-evm/package.json | 3 +- .../adapters/abstract-adapter/package.json | 3 +- packages/adapters/bitkeep/package.json | 3 +- packages/adapters/ledger/package.json | 3 +- packages/adapters/metamask/package.json | 3 +- packages/adapters/okxwallet/package.json | 3 +- packages/adapters/tokenpocket/package.json | 3 +- packages/adapters/tronlink/package.json | 3 +- pnpm-lock.yaml | 1002 ++++++----------- pnpm-workspace.yaml | 1 + scripts/build-umd.js | 77 ++ 24 files changed, 1592 insertions(+), 677 deletions(-) create mode 100644 demos/cdn-demo/.eslintrc create mode 100644 demos/cdn-demo/.gitignore create mode 100644 demos/cdn-demo/.npmrc create mode 100644 demos/cdn-demo/.prettierrc.json create mode 100644 demos/cdn-demo/bitkeep/index.html create mode 100644 demos/cdn-demo/ledger/events.umd.js create mode 100644 demos/cdn-demo/ledger/index.html create mode 100644 demos/cdn-demo/metamask/index.html create mode 100644 demos/cdn-demo/okxwallet/index.html create mode 100644 demos/cdn-demo/package.json create mode 100644 demos/cdn-demo/tokenpocket/index.html create mode 100644 demos/cdn-demo/tronlink/index.html create mode 100644 scripts/build-umd.js diff --git a/demos/cdn-demo/.eslintrc b/demos/cdn-demo/.eslintrc new file mode 100644 index 0000000..753bea2 --- /dev/null +++ b/demos/cdn-demo/.eslintrc @@ -0,0 +1,18 @@ +{ + // "extends": [], + "parser": "@typescript-eslint/parser", + "env": { + "node": true + }, + "rules": { + "require-extensions/require-extensions": "off" + }, + "overrides": [ + { + "files": "./scripts/*.cjs", + "rules": { + "@typescript-eslint/no-var-requires": "off" + } + } + ] +} diff --git a/demos/cdn-demo/.gitignore b/demos/cdn-demo/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/demos/cdn-demo/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/demos/cdn-demo/.npmrc b/demos/cdn-demo/.npmrc new file mode 100644 index 0000000..9cf9495 --- /dev/null +++ b/demos/cdn-demo/.npmrc @@ -0,0 +1 @@ +package-lock=false \ No newline at end of file diff --git a/demos/cdn-demo/.prettierrc.json b/demos/cdn-demo/.prettierrc.json new file mode 100644 index 0000000..b37b482 --- /dev/null +++ b/demos/cdn-demo/.prettierrc.json @@ -0,0 +1,7 @@ +{ + "printWidth": 180, + "trailingComma": "es5", + "tabWidth": 4, + "semi": true, + "singleQuote": true +} diff --git a/demos/cdn-demo/bitkeep/index.html b/demos/cdn-demo/bitkeep/index.html new file mode 100644 index 0000000..d86cdb8 --- /dev/null +++ b/demos/cdn-demo/bitkeep/index.html @@ -0,0 +1,101 @@ + + + + + + BitkeepAdapter Test Demo + + + + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/ledger/events.umd.js b/demos/cdn-demo/ledger/events.umd.js new file mode 100644 index 0000000..0081d2e --- /dev/null +++ b/demos/cdn-demo/ledger/events.umd.js @@ -0,0 +1,489 @@ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : + typeof define === 'function' && define.amd ? define(factory) : + (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventEmitter = factory()); +})(this, (function () { 'use strict'; + + function getDefaultExportFromCjs (x) { + return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; + } + + var R = typeof Reflect === 'object' ? Reflect : null; + var ReflectApply = R && typeof R.apply === 'function' + ? R.apply + : function ReflectApply(target, receiver, args) { + return Function.prototype.apply.call(target, receiver, args); + }; + + var ReflectOwnKeys; + if (R && typeof R.ownKeys === 'function') { + ReflectOwnKeys = R.ownKeys; + } else if (Object.getOwnPropertySymbols) { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target) + .concat(Object.getOwnPropertySymbols(target)); + }; + } else { + ReflectOwnKeys = function ReflectOwnKeys(target) { + return Object.getOwnPropertyNames(target); + }; + } + + function ProcessEmitWarning(warning) { + if (console && console.warn) console.warn(warning); + } + + var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { + return value !== value; + }; + + function EventEmitter() { + EventEmitter.init.call(this); + } + EventEmitter.once = once; + var events = EventEmitter; + + // Backwards-compat with node 0.10.x + EventEmitter.EventEmitter = EventEmitter; + + EventEmitter.prototype._events = undefined; + EventEmitter.prototype._eventsCount = 0; + EventEmitter.prototype._maxListeners = undefined; + + // By default EventEmitters will print a warning if more than 10 listeners are + // added to it. This is a useful default which helps finding memory leaks. + var defaultMaxListeners = 10; + + function checkListener(listener) { + if (typeof listener !== 'function') { + throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); + } + } + + Object.defineProperty(EventEmitter, 'defaultMaxListeners', { + enumerable: true, + get: function() { + return defaultMaxListeners; + }, + set: function(arg) { + if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { + throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); + } + defaultMaxListeners = arg; + } + }); + + EventEmitter.init = function() { + + if (this._events === undefined || + this._events === Object.getPrototypeOf(this)._events) { + this._events = Object.create(null); + this._eventsCount = 0; + } + + this._maxListeners = this._maxListeners || undefined; + }; + + // Obviously not all Emitters should be limited to 10. This function allows + // that to be increased. Set to zero for unlimited. + EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { + if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { + throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); + } + this._maxListeners = n; + return this; + }; + + function _getMaxListeners(that) { + if (that._maxListeners === undefined) + return EventEmitter.defaultMaxListeners; + return that._maxListeners; + } + + EventEmitter.prototype.getMaxListeners = function getMaxListeners() { + return _getMaxListeners(this); + }; + + EventEmitter.prototype.emit = function emit(type) { + var args = []; + for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); + var doError = (type === 'error'); + + var events = this._events; + if (events !== undefined) + doError = (doError && events.error === undefined); + else if (!doError) + return false; + + // If there is no 'error' event listener then throw. + if (doError) { + var er; + if (args.length > 0) + er = args[0]; + if (er instanceof Error) { + // Note: The comments on the `throw` lines are intentional, they show + // up in Node's output if this results in an unhandled exception. + throw er; // Unhandled 'error' event + } + // At least give some kind of context to the user + var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); + err.context = er; + throw err; // Unhandled 'error' event + } + + var handler = events[type]; + + if (handler === undefined) + return false; + + if (typeof handler === 'function') { + ReflectApply(handler, this, args); + } else { + var len = handler.length; + var listeners = arrayClone(handler, len); + for (var i = 0; i < len; ++i) + ReflectApply(listeners[i], this, args); + } + + return true; + }; + + function _addListener(target, type, listener, prepend) { + var m; + var events; + var existing; + + checkListener(listener); + + events = target._events; + if (events === undefined) { + events = target._events = Object.create(null); + target._eventsCount = 0; + } else { + // To avoid recursion in the case that type === "newListener"! Before + // adding it to the listeners, first emit "newListener". + if (events.newListener !== undefined) { + target.emit('newListener', type, + listener.listener ? listener.listener : listener); + + // Re-assign `events` because a newListener handler could have caused the + // this._events to be assigned to a new object + events = target._events; + } + existing = events[type]; + } + + if (existing === undefined) { + // Optimize the case of one listener. Don't need the extra array object. + existing = events[type] = listener; + ++target._eventsCount; + } else { + if (typeof existing === 'function') { + // Adding the second element, need to change to array. + existing = events[type] = + prepend ? [listener, existing] : [existing, listener]; + // If we've already got an array, just append. + } else if (prepend) { + existing.unshift(listener); + } else { + existing.push(listener); + } + + // Check for listener leak + m = _getMaxListeners(target); + if (m > 0 && existing.length > m && !existing.warned) { + existing.warned = true; + // No error code for this since it is a Warning + // eslint-disable-next-line no-restricted-syntax + var w = new Error('Possible EventEmitter memory leak detected. ' + + existing.length + ' ' + String(type) + ' listeners ' + + 'added. Use emitter.setMaxListeners() to ' + + 'increase limit'); + w.name = 'MaxListenersExceededWarning'; + w.emitter = target; + w.type = type; + w.count = existing.length; + ProcessEmitWarning(w); + } + } + + return target; + } + + EventEmitter.prototype.addListener = function addListener(type, listener) { + return _addListener(this, type, listener, false); + }; + + EventEmitter.prototype.on = EventEmitter.prototype.addListener; + + EventEmitter.prototype.prependListener = + function prependListener(type, listener) { + return _addListener(this, type, listener, true); + }; + + function onceWrapper() { + if (!this.fired) { + this.target.removeListener(this.type, this.wrapFn); + this.fired = true; + if (arguments.length === 0) + return this.listener.call(this.target); + return this.listener.apply(this.target, arguments); + } + } + + function _onceWrap(target, type, listener) { + var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; + var wrapped = onceWrapper.bind(state); + wrapped.listener = listener; + state.wrapFn = wrapped; + return wrapped; + } + + EventEmitter.prototype.once = function once(type, listener) { + checkListener(listener); + this.on(type, _onceWrap(this, type, listener)); + return this; + }; + + EventEmitter.prototype.prependOnceListener = + function prependOnceListener(type, listener) { + checkListener(listener); + this.prependListener(type, _onceWrap(this, type, listener)); + return this; + }; + + // Emits a 'removeListener' event if and only if the listener was removed. + EventEmitter.prototype.removeListener = + function removeListener(type, listener) { + var list, events, position, i, originalListener; + + checkListener(listener); + + events = this._events; + if (events === undefined) + return this; + + list = events[type]; + if (list === undefined) + return this; + + if (list === listener || list.listener === listener) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else { + delete events[type]; + if (events.removeListener) + this.emit('removeListener', type, list.listener || listener); + } + } else if (typeof list !== 'function') { + position = -1; + + for (i = list.length - 1; i >= 0; i--) { + if (list[i] === listener || list[i].listener === listener) { + originalListener = list[i].listener; + position = i; + break; + } + } + + if (position < 0) + return this; + + if (position === 0) + list.shift(); + else { + spliceOne(list, position); + } + + if (list.length === 1) + events[type] = list[0]; + + if (events.removeListener !== undefined) + this.emit('removeListener', type, originalListener || listener); + } + + return this; + }; + + EventEmitter.prototype.off = EventEmitter.prototype.removeListener; + + EventEmitter.prototype.removeAllListeners = + function removeAllListeners(type) { + var listeners, events, i; + + events = this._events; + if (events === undefined) + return this; + + // not listening for removeListener, no need to emit + if (events.removeListener === undefined) { + if (arguments.length === 0) { + this._events = Object.create(null); + this._eventsCount = 0; + } else if (events[type] !== undefined) { + if (--this._eventsCount === 0) + this._events = Object.create(null); + else + delete events[type]; + } + return this; + } + + // emit removeListener for all listeners on all events + if (arguments.length === 0) { + var keys = Object.keys(events); + var key; + for (i = 0; i < keys.length; ++i) { + key = keys[i]; + if (key === 'removeListener') continue; + this.removeAllListeners(key); + } + this.removeAllListeners('removeListener'); + this._events = Object.create(null); + this._eventsCount = 0; + return this; + } + + listeners = events[type]; + + if (typeof listeners === 'function') { + this.removeListener(type, listeners); + } else if (listeners !== undefined) { + // LIFO order + for (i = listeners.length - 1; i >= 0; i--) { + this.removeListener(type, listeners[i]); + } + } + + return this; + }; + + function _listeners(target, type, unwrap) { + var events = target._events; + + if (events === undefined) + return []; + + var evlistener = events[type]; + if (evlistener === undefined) + return []; + + if (typeof evlistener === 'function') + return unwrap ? [evlistener.listener || evlistener] : [evlistener]; + + return unwrap ? + unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); + } + + EventEmitter.prototype.listeners = function listeners(type) { + return _listeners(this, type, true); + }; + + EventEmitter.prototype.rawListeners = function rawListeners(type) { + return _listeners(this, type, false); + }; + + EventEmitter.listenerCount = function(emitter, type) { + if (typeof emitter.listenerCount === 'function') { + return emitter.listenerCount(type); + } else { + return listenerCount.call(emitter, type); + } + }; + + EventEmitter.prototype.listenerCount = listenerCount; + function listenerCount(type) { + var events = this._events; + + if (events !== undefined) { + var evlistener = events[type]; + + if (typeof evlistener === 'function') { + return 1; + } else if (evlistener !== undefined) { + return evlistener.length; + } + } + + return 0; + } + + EventEmitter.prototype.eventNames = function eventNames() { + return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; + }; + + function arrayClone(arr, n) { + var copy = new Array(n); + for (var i = 0; i < n; ++i) + copy[i] = arr[i]; + return copy; + } + + function spliceOne(list, index) { + for (; index + 1 < list.length; index++) + list[index] = list[index + 1]; + list.pop(); + } + + function unwrapListeners(arr) { + var ret = new Array(arr.length); + for (var i = 0; i < ret.length; ++i) { + ret[i] = arr[i].listener || arr[i]; + } + return ret; + } + + function once(emitter, name) { + return new Promise(function (resolve, reject) { + function errorListener(err) { + emitter.removeListener(name, resolver); + reject(err); + } + + function resolver() { + if (typeof emitter.removeListener === 'function') { + emitter.removeListener('error', errorListener); + } + resolve([].slice.call(arguments)); + } + eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); + if (name !== 'error') { + addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); + } + }); + } + + function addErrorHandlerIfEventEmitter(emitter, handler, flags) { + if (typeof emitter.on === 'function') { + eventTargetAgnosticAddListener(emitter, 'error', handler, flags); + } + } + + function eventTargetAgnosticAddListener(emitter, name, listener, flags) { + if (typeof emitter.on === 'function') { + if (flags.once) { + emitter.once(name, listener); + } else { + emitter.on(name, listener); + } + } else if (typeof emitter.addEventListener === 'function') { + // EventTarget does not have `error` event semantics like Node + // EventEmitters, we do not listen for `error` events here. + emitter.addEventListener(name, function wrapListener(arg) { + // IE does not have builtin `{ once: true }` support so we + // have to do it manually. + if (flags.once) { + emitter.removeEventListener(name, wrapListener); + } + listener(arg); + }); + } else { + throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); + } + } + + var events$1 = /*@__PURE__*/getDefaultExportFromCjs(events); + + return events$1; + +})); diff --git a/demos/cdn-demo/ledger/index.html b/demos/cdn-demo/ledger/index.html new file mode 100644 index 0000000..2a0f2e4 --- /dev/null +++ b/demos/cdn-demo/ledger/index.html @@ -0,0 +1,108 @@ + + + + + + LedgerAdapter Test Demo + + + + + + + + + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/metamask/index.html b/demos/cdn-demo/metamask/index.html new file mode 100644 index 0000000..d4a7db0 --- /dev/null +++ b/demos/cdn-demo/metamask/index.html @@ -0,0 +1,90 @@ + + + + + + MetamaskAdapter Test Demo + + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/okxwallet/index.html b/demos/cdn-demo/okxwallet/index.html new file mode 100644 index 0000000..a540181 --- /dev/null +++ b/demos/cdn-demo/okxwallet/index.html @@ -0,0 +1,102 @@ + + + + + + OkxwalletAdapter Test Demo + + + + + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/package.json b/demos/cdn-demo/package.json new file mode 100644 index 0000000..02aa0e9 --- /dev/null +++ b/demos/cdn-demo/package.json @@ -0,0 +1,20 @@ +{ + "name": "dev-demo", + "private": true, + "version": "0.0.0", + "type": "module", + "scripts": { + "dev": "serve" + }, + "dependencies": { + "@tronweb3/abstract-adapter-evm": "^1.0.0", + "@tronweb3/tronwallet-abstract-adapter": "^1.1.5", + "@tronweb3/tronwallet-adapter-bitkeep": "^1.0.1", + "@tronweb3/tronwallet-adapter-ledger": "^1.1.7", + "@tronweb3/tronwallet-adapter-metamask": "^1.0.0", + "@tronweb3/tronwallet-adapter-okxwallet": "^1.0.1", + "@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.1", + "@tronweb3/tronwallet-adapter-tronlink": "^1.1.8", + "serve": "^14.2.1" + } +} diff --git a/demos/cdn-demo/tokenpocket/index.html b/demos/cdn-demo/tokenpocket/index.html new file mode 100644 index 0000000..024bd13 --- /dev/null +++ b/demos/cdn-demo/tokenpocket/index.html @@ -0,0 +1,100 @@ + + + + + + TokenPocketAdapter Test Demo + + + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/tronlink/index.html b/demos/cdn-demo/tronlink/index.html new file mode 100644 index 0000000..45f2160 --- /dev/null +++ b/demos/cdn-demo/tronlink/index.html @@ -0,0 +1,99 @@ + + + + + + TronLinkAdapter Test Demo + + + + + +
+ + + + +
+ + + diff --git a/package.json b/package.json index 503b45e..1e96061 100644 --- a/package.json +++ b/package.json @@ -24,6 +24,7 @@ "build:ts": "tsc --build --verbose tsconfig.all.json", "build:other": "pnpm --recursive --filter \"@tronweb3/*\" run build", "build:clean": "pnpm run clean && pnpm run build && pnpm run package", + "build:umd": "pnpm --recursive run build:umd", "build-dev-demo": "pnpm build && pnpm run --filter {demos/dev-demo} build", "package": "pnpm --recursive run package", "release": "pnpm prerelease && pnpm build:clean && pnpm test && changeset publish", @@ -43,6 +44,10 @@ "@changesets/cli": "^2.26.0", "@commitlint/cli": "^17.3.0", "@commitlint/config-conventional": "^17.3.0", + "@rollup/plugin-commonjs": "^25.0.5", + "@rollup/plugin-json": "^6.0.1", + "@rollup/plugin-node-resolve": "^15.2.2", + "@rollup/plugin-terser": "^0.4.4", "@testing-library/jest-dom": "^5.16.5", "@testing-library/react": "^13.4.0", "@types/jest": "^27.5.2", @@ -62,6 +67,7 @@ "lint-staged": "^13.1.0", "pnpm": "^7.12.1", "prettier": "2.7.1", + "rollup": "^4.0.2", "shx": "^0.3.4", "ts-jest": "^29.0.3", "typedoc": "^0.23.15", diff --git a/packages/adapters/abstract-adapter-evm/package.json b/packages/adapters/abstract-adapter-evm/package.json index 3e17be4..bfab3c1 100644 --- a/packages/adapters/abstract-adapter-evm/package.json +++ b/packages/adapters/abstract-adapter-evm/package.json @@ -34,7 +34,8 @@ "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", "test": "jest", - "test:coverage": "jest --coverage" + "test:coverage": "jest --coverage", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "eventemitter3": "^4.0.0", diff --git a/packages/adapters/abstract-adapter/package.json b/packages/adapters/abstract-adapter/package.json index b49b03e..b472af6 100644 --- a/packages/adapters/abstract-adapter/package.json +++ b/packages/adapters/abstract-adapter/package.json @@ -32,7 +32,8 @@ }, "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", - "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json" + "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "eventemitter3": "^4.0.0" diff --git a/packages/adapters/bitkeep/package.json b/packages/adapters/bitkeep/package.json index a5cd4c3..a4fdbb9 100644 --- a/packages/adapters/bitkeep/package.json +++ b/packages/adapters/bitkeep/package.json @@ -38,7 +38,8 @@ "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", - "test": "jest" + "test": "jest", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-abstract-adapter": "workspace:^", diff --git a/packages/adapters/ledger/package.json b/packages/adapters/ledger/package.json index 34359d4..48eb932 100644 --- a/packages/adapters/ledger/package.json +++ b/packages/adapters/ledger/package.json @@ -38,7 +38,8 @@ "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", - "test": "jest" + "test": "jest", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@ledgerhq/hw-app-trx": "^6.27.8", diff --git a/packages/adapters/metamask/package.json b/packages/adapters/metamask/package.json index 57ef3f4..7c34127 100644 --- a/packages/adapters/metamask/package.json +++ b/packages/adapters/metamask/package.json @@ -39,7 +39,8 @@ "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", "test": "jest", - "test:coverage": "jest --coverage" + "test:coverage": "jest --coverage", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/abstract-adapter-evm": "workspace:^" diff --git a/packages/adapters/okxwallet/package.json b/packages/adapters/okxwallet/package.json index 9362452..04bb97c 100644 --- a/packages/adapters/okxwallet/package.json +++ b/packages/adapters/okxwallet/package.json @@ -39,7 +39,8 @@ "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", "test": "jest", - "test:coverage": "jest --coverage" + "test:coverage": "jest --coverage", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-abstract-adapter": "workspace:^", diff --git a/packages/adapters/tokenpocket/package.json b/packages/adapters/tokenpocket/package.json index 39ee878..5f8d245 100644 --- a/packages/adapters/tokenpocket/package.json +++ b/packages/adapters/tokenpocket/package.json @@ -38,7 +38,8 @@ "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", - "test": "jest" + "test": "jest", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-abstract-adapter": "workspace:^", diff --git a/packages/adapters/tronlink/package.json b/packages/adapters/tronlink/package.json index 7dc8ed4..8325d9d 100644 --- a/packages/adapters/tronlink/package.json +++ b/packages/adapters/tronlink/package.json @@ -39,7 +39,8 @@ "clean": "shx mkdir -p lib && shx rm -rf lib", "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", "test": "jest", - "test:coverage": "jest --coverage" + "test:coverage": "jest --coverage", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-abstract-adapter": "workspace:^" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4474298..a5a5b9c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,10 @@ importers: '@changesets/cli': ^2.26.0 '@commitlint/cli': ^17.3.0 '@commitlint/config-conventional': ^17.3.0 + '@rollup/plugin-commonjs': ^25.0.5 + '@rollup/plugin-json': ^6.0.1 + '@rollup/plugin-node-resolve': ^15.2.2 + '@rollup/plugin-terser': ^0.4.4 '@testing-library/jest-dom': ^5.16.5 '@testing-library/react': ^13.4.0 '@types/jest': ^27.5.2 @@ -31,6 +35,7 @@ importers: lint-staged: ^13.1.0 pnpm: ^7.12.1 prettier: 2.7.1 + rollup: ^4.0.2 shx: ^0.3.4 ts-jest: ^29.0.3 typedoc: ^0.23.15 @@ -39,6 +44,10 @@ importers: '@changesets/cli': 2.26.0 '@commitlint/cli': 17.4.2 '@commitlint/config-conventional': 17.4.2 + '@rollup/plugin-commonjs': 25.0.5_rollup@4.0.2 + '@rollup/plugin-json': 6.0.1_rollup@4.0.2 + '@rollup/plugin-node-resolve': 15.2.2_rollup@4.0.2 + '@rollup/plugin-terser': 0.4.4_rollup@4.0.2 '@testing-library/jest-dom': 5.16.5 '@testing-library/react': 13.4.0 '@types/jest': 27.5.2 @@ -58,6 +67,7 @@ importers: lint-staged: 13.1.1 pnpm: 7.27.0 prettier: 2.7.1 + rollup: 4.0.2 shx: 0.3.4 ts-jest: 29.0.5_gelezmms3va3pnkofxaadhcvma typedoc: 0.23.24_typescript@4.9.5 @@ -69,16 +79,16 @@ importers: '@emotion/styled': ^11.10.4 '@metamask/eth-sig-util': ^6.0.0 '@mui/material': ^5.10.10 - '@tronweb3/abstract-adapter-evm': ^1.0.0 - '@tronweb3/tronwallet-abstract-adapter': ^1.1.0 - '@tronweb3/tronwallet-adapter-bitkeep': ^1.0.0 - '@tronweb3/tronwallet-adapter-ledger': ^1.1.2 - '@tronweb3/tronwallet-adapter-metamask': ^1.0.0 - '@tronweb3/tronwallet-adapter-okxwallet': ^1.0.0 - '@tronweb3/tronwallet-adapter-react-hooks': ^1.0.0 - '@tronweb3/tronwallet-adapter-react-ui': ^1.1.0 - '@tronweb3/tronwallet-adapter-tokenpocket': ^1.0.0 - '@tronweb3/tronwallet-adapters': ^1.1.2 + '@tronweb3/abstract-adapter-evm': latest + '@tronweb3/tronwallet-abstract-adapter': latest + '@tronweb3/tronwallet-adapter-bitkeep': latest + '@tronweb3/tronwallet-adapter-ledger': latest + '@tronweb3/tronwallet-adapter-metamask': latest + '@tronweb3/tronwallet-adapter-okxwallet': latest + '@tronweb3/tronwallet-adapter-react-hooks': latest + '@tronweb3/tronwallet-adapter-react-ui': latest + '@tronweb3/tronwallet-adapter-tokenpocket': latest + '@tronweb3/tronwallet-adapters': latest '@types/react': ^18.0.26 '@types/react-dom': ^18.0.8 '@vitejs/plugin-legacy': ^2.3.0 @@ -104,10 +114,10 @@ importers: '@tronweb3/tronwallet-adapter-ledger': link:../../packages/adapters/ledger '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/metamask '@tronweb3/tronwallet-adapter-okxwallet': link:../../packages/adapters/okxwallet - '@tronweb3/tronwallet-adapter-react-hooks': 1.1.5_biqbaboplfbrettd7655fr4n2y - '@tronweb3/tronwallet-adapter-react-ui': 1.1.6_biqbaboplfbrettd7655fr4n2y + '@tronweb3/tronwallet-adapter-react-hooks': link:../../packages/react/react-hooks + '@tronweb3/tronwallet-adapter-react-ui': link:../../packages/react/react-ui '@tronweb3/tronwallet-adapter-tokenpocket': link:../../packages/adapters/tokenpocket - '@tronweb3/tronwallet-adapters': 1.1.7_j5ip3o3v6sktjzl5cxtjyfbuo4 + '@tronweb3/tronwallet-adapters': link:../../packages/adapters/adapters events: 3.3.0 ganache: 7.9.0 react: 18.2.0 @@ -171,10 +181,10 @@ importers: '@testing-library/user-event': 13.5.0 '@tronweb3/tronwallet-abstract-adapter': link:../../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-ledger': link:../../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-react-hooks': 1.1.5_biqbaboplfbrettd7655fr4n2y - '@tronweb3/tronwallet-adapter-react-ui': 1.1.6_biqbaboplfbrettd7655fr4n2y + '@tronweb3/tronwallet-adapter-react-hooks': link:../../../packages/react/react-hooks + '@tronweb3/tronwallet-adapter-react-ui': link:../../../packages/react/react-ui '@tronweb3/tronwallet-adapter-walletconnect': link:../../../packages/adapters/walletconnect - '@tronweb3/tronwallet-adapters': 1.1.7_j5ip3o3v6sktjzl5cxtjyfbuo4 + '@tronweb3/tronwallet-adapters': link:../../../packages/adapters/adapters '@types/jest': 27.5.2 '@types/node': 16.18.12 '@types/react': 18.0.27 @@ -234,10 +244,10 @@ importers: '@tronweb3/tronwallet-abstract-adapter': link:../../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-bitkeep': link:../../../packages/adapters/bitkeep '@tronweb3/tronwallet-adapter-ledger': link:../../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-react-hooks': 1.1.5_biqbaboplfbrettd7655fr4n2y - '@tronweb3/tronwallet-adapter-react-ui': 1.1.6_biqbaboplfbrettd7655fr4n2y + '@tronweb3/tronwallet-adapter-react-hooks': link:../../../packages/react/react-hooks + '@tronweb3/tronwallet-adapter-react-ui': link:../../../packages/react/react-ui '@tronweb3/tronwallet-adapter-tokenpocket': link:../../../packages/adapters/tokenpocket - '@tronweb3/tronwallet-adapters': 1.1.7_gs54vy7ddzyteyvodybdnk6y7e + '@tronweb3/tronwallet-adapters': link:../../../packages/adapters/adapters '@types/node': 18.11.9 '@types/react': 18.0.26 '@types/react-dom': 18.0.9 @@ -285,10 +295,10 @@ importers: '@mui/material': 5.11.8_rqh7qj4464ntrqrt6banhaqg4q '@tronweb3/tronwallet-abstract-adapter': link:../../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-ledger': link:../../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-react-hooks': 1.1.5_biqbaboplfbrettd7655fr4n2y - '@tronweb3/tronwallet-adapter-react-ui': 1.1.6_biqbaboplfbrettd7655fr4n2y + '@tronweb3/tronwallet-adapter-react-hooks': link:../../../packages/react/react-hooks + '@tronweb3/tronwallet-adapter-react-ui': link:../../../packages/react/react-ui '@tronweb3/tronwallet-adapter-walletconnect': link:../../../packages/adapters/walletconnect - '@tronweb3/tronwallet-adapters': 1.1.7_j5ip3o3v6sktjzl5cxtjyfbuo4 + '@tronweb3/tronwallet-adapters': link:../../../packages/adapters/adapters buffer: 6.0.3 events: 3.3.0 react: 18.2.0 @@ -3972,6 +3982,13 @@ packages: '@jridgewell/gen-mapping': 0.3.2 '@jridgewell/trace-mapping': 0.3.17 + /@jridgewell/source-map/0.3.5: + resolution: {integrity: sha512-UTYAUj/wviwdsMfzoSJspJxbkH5o1snzwX0//0ENX1u/55kkZZkcTZP6u9bwKGkv+dkk9at4m1Cpt0uY80kcpQ==} + dependencies: + '@jridgewell/gen-mapping': 0.3.2 + '@jridgewell/trace-mapping': 0.3.19 + dev: true + /@jridgewell/sourcemap-codec/1.4.14: resolution: {integrity: sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==} @@ -4399,8 +4416,8 @@ packages: dependencies: '@babel/runtime': 7.20.13 '@emotion/cache': 11.10.5 - '@emotion/react': 11.10.5_kzbn2opkn2327fwg5yzwzya5o4 - '@emotion/styled': 11.10.5_qvatmowesywn4ye42qoh247szu + '@emotion/react': 11.10.5_3stiutgnnbnfnf3uowm5cip22i + '@emotion/styled': 11.10.5_jrh5enlbqfbnumycmktdqgd6se csstype: 3.1.1 prop-types: 15.8.1 react: 18.2.0 @@ -4803,6 +4820,24 @@ packages: rollup: 2.79.1 dev: false + /@rollup/plugin-commonjs/25.0.5_rollup@4.0.2: + resolution: {integrity: sha512-xY8r/A9oisSeSuLCTfhssyDjo9Vp/eDiRLXkg1MXCcEEgEjPmLU+ZyDB20OOD0NlyDa/8SGbK5uIggF5XTx77w==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.68.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@4.0.2 + commondir: 1.0.1 + estree-walker: 2.0.2 + glob: 8.1.0 + is-reference: 1.2.1 + magic-string: 0.27.0 + rollup: 4.0.2 + dev: true + /@rollup/plugin-inject/5.0.3: resolution: {integrity: sha512-411QlbL+z2yXpRWFXSmw/teQRMkXcAAC8aYTemc15gwJRpvEVDQwoe+N/HTFD8RFG8+88Bme9DK2V9CVm7hJdA==} engines: {node: '>=14.0.0'} @@ -4817,6 +4852,19 @@ packages: magic-string: 0.27.0 dev: true + /@rollup/plugin-json/6.0.1_rollup@4.0.2: + resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@4.0.2 + rollup: 4.0.2 + dev: true + /@rollup/plugin-node-resolve/11.2.1_rollup@2.79.1: resolution: {integrity: sha512-yc2n43jcqVyGE2sqV5/YCmocy9ArjVAP/BeXyTtADTBBX6V0e5UMqwO8CdQ0kzjb6zu5P1qMzsScCMRvE9OlVg==} engines: {node: '>= 10.0.0'} @@ -4832,6 +4880,24 @@ packages: rollup: 2.79.1 dev: false + /@rollup/plugin-node-resolve/15.2.2_rollup@4.0.2: + resolution: {integrity: sha512-f64bU4OKqV0yihtxFemmuf0oj37pToCFMISCA+sJbbIAl5wcpbRO9XgWNWb1tDiWQJUcPxo6V0l59hcuZOQ3kw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.78.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@4.0.2 + '@types/resolve': 1.20.2 + deepmerge: 4.3.0 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.1 + rollup: 4.0.2 + dev: true + /@rollup/plugin-replace/2.4.2_rollup@2.79.1: resolution: {integrity: sha512-IGcu+cydlUMZ5En85jxHH4qj2hta/11BHq95iHEyb2sbgiN0eCdzvUcHw5gt9pBL5lTi4JDYJ1acCoMGpTvEZg==} peerDependencies: @@ -4842,6 +4908,21 @@ packages: rollup: 2.79.1 dev: false + /@rollup/plugin-terser/0.4.4_rollup@4.0.2: + resolution: {integrity: sha512-XHeJC5Bgvs8LfukDwWZp7yeqin6ns8RTl2B9avbejt6tZqsqvVoWI7ZTQrcNsfKEDWBTnTxM8nMDkO2IFFbd0A==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + rollup: 4.0.2 + serialize-javascript: 6.0.1 + smob: 1.4.1 + terser: 5.21.0 + dev: true + /@rollup/pluginutils/3.1.0_rollup@2.79.1: resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} engines: {node: '>= 8.0.0'} @@ -4868,6 +4949,117 @@ packages: picomatch: 2.3.1 dev: true + /@rollup/pluginutils/5.0.2_rollup@4.0.2: + resolution: {integrity: sha512-pTd9rIsP92h+B6wWwFbW8RkZv4hiR/xKsqre4SIuAOaOEQRxi0lqLke9k2/7WegC85GgUs9pjmOjCUi3In4vwA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.0 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 4.0.2 + dev: true + + /@rollup/rollup-android-arm-eabi/4.0.2: + resolution: {integrity: sha512-xDvk1pT4vaPU2BOLy0MqHMdYZyntqpaBf8RhBiezlqG9OjY8F50TyctHo8znigYKd+QCFhCmlmXHOL/LoaOl3w==} + cpu: [arm] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-android-arm64/4.0.2: + resolution: {integrity: sha512-lqCglytY3E6raze27DD9VQJWohbwCxzqs9aSHcj5X/8hJpzZfNdbsr4Ja9Hqp6iPyF53+5PtPx0pKRlkSvlHZg==} + cpu: [arm64] + os: [android] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-arm64/4.0.2: + resolution: {integrity: sha512-nkBKItS6E6CCzvRwgiKad+j+1ibmL7SIInj7oqMWmdkCjiSX6VeVZw2mLlRKIUL+JjsBgpATTfo7BiAXc1v0jA==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-darwin-x64/4.0.2: + resolution: {integrity: sha512-vX2C8xvWPIbpEgQht95+dY6BReKAvtDgPDGi0XN0kWJKkm4WdNmq5dnwscv/zxvi+n6jUTBhs6GtpkkWT4q8Gg==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm-gnueabihf/4.0.2: + resolution: {integrity: sha512-DVFIfcHOjgmeHOAqji4xNz2wczt1Bmzy9MwBZKBa83SjBVO/i38VHDR+9ixo8QpBOiEagmNw12DucG+v55tCrg==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-gnu/4.0.2: + resolution: {integrity: sha512-GCK/a9ItUxPI0V5hQEJjH4JtOJO90GF2Hja7TO+EZ8rmkGvEi8/ZDMhXmcuDpQT7/PWrTT9RvnG8snMd5SrhBQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-arm64-musl/4.0.2: + resolution: {integrity: sha512-cLuBp7rOjIB1R2j/VazjCmHC7liWUur2e9mFflLJBAWCkrZ+X0+QwHLvOQakIwDymungzAKv6W9kHZnTp/Mqrg==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-gnu/4.0.2: + resolution: {integrity: sha512-Zqw4iVnJr2naoyQus0yLy7sLtisCQcpdMKUCeXPBjkJtpiflRime/TMojbnl8O3oxUAj92mxr+t7im/RbgA20w==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-linux-x64-musl/4.0.2: + resolution: {integrity: sha512-jJRU9TyUD/iMqjf8aLAp7XiN3pIj5v6Qcu+cdzBfVTKDD0Fvua4oUoK8eVJ9ZuKBEQKt3WdlcwJXFkpmMLk6kg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-arm64-msvc/4.0.2: + resolution: {integrity: sha512-ZkS2NixCxHKC4zbOnw64ztEGGDVIYP6nKkGBfOAxEPW71Sji9v8z3yaHNuae/JHPwXA+14oDefnOuVfxl59SmQ==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-ia32-msvc/4.0.2: + resolution: {integrity: sha512-3SKjj+tvnZ0oZq2BKB+fI+DqYI83VrRzk7eed8tJkxeZ4zxJZcLSE8YDQLYGq1tZAnAX+H076RHHB4gTZXsQzw==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@rollup/rollup-win32-x64-msvc/4.0.2: + resolution: {integrity: sha512-MBdJIOxRauKkry7t2q+rTHa3aWjVez2eioWg+etRVS3dE4tChhmt5oqZYr48R6bPmcwEhxQr96gVRfeQrLbqng==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@rushstack/eslint-patch/1.2.0: resolution: {integrity: sha512-sXo/qW2/pAcmT43VoRKOJbDOfV3cYpq3szSVfIThQXNt+E4DfKj361vaAt3c88U5tPUxzEswam7GW48PJqtKAg==} dev: false @@ -5330,181 +5522,6 @@ packages: resolution: {integrity: sha512-IVcT2GfWX3K6tHUVhs14NP5uzKhQt4KeDya1g9ACxuZsUzsaoGUIGzceK2Ltu7xp1YV94AaHOf4yxLAivlvEkQ==} dev: false - /@tronweb3/tronwallet-abstract-adapter/1.1.5: - resolution: {integrity: sha512-hkZPlvv1ZemzNZ0kLR+isooaqLbOpG2JI+l/my+Io1ZOF0lh5hu6AVtCV7/OkkekX4qRH5jZ20GlSSkvQ4kchg==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - eventemitter3: 4.0.7 - dev: false - - /@tronweb3/tronwallet-adapter-bitkeep/1.0.1: - resolution: {integrity: sha512-Es8KkoZ9amSQZB3EjxAULCsUxyingdqziJNdzH1bGS7H0NpNnmj7dhul/2C1pXFKMY7DwRPrUpDxfotIZ57wKg==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - dev: false - - /@tronweb3/tronwallet-adapter-ledger/1.1.7: - resolution: {integrity: sha512-xBr8IX6XAzd3qEmpzPiuFQ8F1G0LpkxnZMCPMCQkzhbBFVEfj6dIrzG7n8S58CareniqZtAmEwYhUaCPtozhHg==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@ledgerhq/hw-app-trx': 6.27.11 - '@ledgerhq/hw-transport': 6.27.1 - '@ledgerhq/hw-transport-webhid': 6.27.1 - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - buffer: 6.0.3 - eventemitter3: 4.0.7 - preact: 10.12.1 - dev: false - - /@tronweb3/tronwallet-adapter-okxwallet/1.0.1: - resolution: {integrity: sha512-Sch5VVXYoEe21abWniFpou15oU4fLL4nrYPAVlowZ3h8aHJCMsTuQRh5ASS9PG8zRwnw3SxwPtFEtWjSRE/rOQ==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - dev: false - - /@tronweb3/tronwallet-adapter-react-hooks/1.1.5_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-o+KeVatg2NcP1QCXmY797QkDNMeXw+p2Fs60WkJR6oswv6PHp5y5wW2zAD1zIDfQ/ffCQUN/8i8BsE2txL/FqQ==} - engines: {node: '>=16', pnpm: '>=7'} - peerDependencies: - react: '*' - react-dom: '*' - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - dev: false - - /@tronweb3/tronwallet-adapter-react-ui/1.1.6_biqbaboplfbrettd7655fr4n2y: - resolution: {integrity: sha512-1Cs+WM+FuuId8ctmvCTrGDKxgNZhJMFn8K1Z7Y5+dwIUKt6YfsflMeHROhhGqAZgBlr1xnxmsEVPuXJ7xyKWag==} - engines: {node: '>=16', pnpm: '>=7'} - peerDependencies: - react: '*' - react-dom: '*' - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/tronwallet-adapter-react-hooks': 1.1.5_biqbaboplfbrettd7655fr4n2y - react: 18.2.0 - react-dom: 18.2.0_react@18.2.0 - dev: false - - /@tronweb3/tronwallet-adapter-tokenpocket/1.0.1: - resolution: {integrity: sha512-fz8aBLd6NTBLWZfrN6xnVDClKJxwsEj7VkokghL5EmdUnwH8RSHFWNSuQ7ECiVDO3eKJtM6FHh4+PTEPw14fyg==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - dev: false - - /@tronweb3/tronwallet-adapter-tronlink/1.1.7: - resolution: {integrity: sha512-tIIAGqPBm4O+dx51/p/8RIIf1XiSrspOuakijW5CgYztQpfa/lXPrObTbns/MhuyY/R/blJR4WDSLtGsBQ/5xg==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - dev: false - - /@tronweb3/tronwallet-adapter-walletconnect/1.0.4_gs54vy7ddzyteyvodybdnk6y7e: - resolution: {integrity: sha512-ryGItC8qMHjSTNXfrAkxQ4U5oxr0jx9zjBqUtfc+AGtBF05bSqVVosE5CL1ug90u0CXtsGUejgH5WbPBBZrf2w==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/walletconnect-tron': 2.0.0_lokijs@1.5.12+react@18.2.0 - '@wagmi/core': 1.1.0_kcw4xzi5p6fmxdxkxcyd7hvevi - '@walletconnect/sign-client': 2.7.7_lokijs@1.5.12 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@web3modal/ethereum': 2.4.2_4yqj3wxh7itmwcbsrv43ezfuau - viem: 0.3.50_typescript@4.9.3 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - typescript - - utf-8-validate - - zod - dev: false - - /@tronweb3/tronwallet-adapter-walletconnect/1.0.4_j5ip3o3v6sktjzl5cxtjyfbuo4: - resolution: {integrity: sha512-ryGItC8qMHjSTNXfrAkxQ4U5oxr0jx9zjBqUtfc+AGtBF05bSqVVosE5CL1ug90u0CXtsGUejgH5WbPBBZrf2w==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-abstract-adapter': 1.1.5 - '@tronweb3/walletconnect-tron': 2.0.0_react@18.2.0 - '@wagmi/core': 1.1.0_fivdkur5hwgpp45yi65gbqhb5i - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/types': 2.7.7 - '@web3modal/ethereum': 2.4.2_4yqj3wxh7itmwcbsrv43ezfuau - viem: 0.3.50_typescript@4.9.5 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - typescript - - utf-8-validate - - zod - dev: false - - /@tronweb3/tronwallet-adapters/1.1.7_gs54vy7ddzyteyvodybdnk6y7e: - resolution: {integrity: sha512-QFhoA7AOdhzyJaJC7CVpmf/wtrx42GGOkzWT+VoSJugL4hBUJ884GhRMzrIR6HjW155npkYr0mFjMJkTOf/eyQ==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-adapter-bitkeep': 1.0.1 - '@tronweb3/tronwallet-adapter-ledger': 1.1.7 - '@tronweb3/tronwallet-adapter-okxwallet': 1.0.1 - '@tronweb3/tronwallet-adapter-tokenpocket': 1.0.1 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - '@tronweb3/tronwallet-adapter-walletconnect': 1.0.4_gs54vy7ddzyteyvodybdnk6y7e - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - typescript - - utf-8-validate - - zod - dev: false - - /@tronweb3/tronwallet-adapters/1.1.7_j5ip3o3v6sktjzl5cxtjyfbuo4: - resolution: {integrity: sha512-QFhoA7AOdhzyJaJC7CVpmf/wtrx42GGOkzWT+VoSJugL4hBUJ884GhRMzrIR6HjW155npkYr0mFjMJkTOf/eyQ==} - engines: {node: '>=16', pnpm: '>=7'} - dependencies: - '@tronweb3/tronwallet-adapter-bitkeep': 1.0.1 - '@tronweb3/tronwallet-adapter-ledger': 1.1.7 - '@tronweb3/tronwallet-adapter-okxwallet': 1.0.1 - '@tronweb3/tronwallet-adapter-tokenpocket': 1.0.1 - '@tronweb3/tronwallet-adapter-tronlink': 1.1.7 - '@tronweb3/tronwallet-adapter-walletconnect': 1.0.4_j5ip3o3v6sktjzl5cxtjyfbuo4 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - typescript - - utf-8-validate - - zod - dev: false - /@tronweb3/walletconnect-tron/2.0.0: resolution: {integrity: sha512-COAm1zOnCUHKU+rMFsTDYn5PX9fD8z1/QItHNpWo33BBDPk+nZfz0mK7orGpVOpO5IcOG33AsyGxqv/C/gJnTQ==} dependencies: @@ -5519,32 +5536,12 @@ packages: - utf-8-validate dev: false - /@tronweb3/walletconnect-tron/2.0.0_lokijs@1.5.12+react@18.2.0: - resolution: {integrity: sha512-COAm1zOnCUHKU+rMFsTDYn5PX9fD8z1/QItHNpWo33BBDPk+nZfz0mK7orGpVOpO5IcOG33AsyGxqv/C/gJnTQ==} - dependencies: - '@walletconnect/sign-client': 2.7.7_lokijs@1.5.12 - '@walletconnect/utils': 2.7.7_lokijs@1.5.12 - '@web3modal/standalone': 2.4.2_react@18.2.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs - - react - - utf-8-validate - dev: false - - /@tronweb3/walletconnect-tron/2.0.0_react@18.2.0: - resolution: {integrity: sha512-COAm1zOnCUHKU+rMFsTDYn5PX9fD8z1/QItHNpWo33BBDPk+nZfz0mK7orGpVOpO5IcOG33AsyGxqv/C/gJnTQ==} + /@trufflesuite/bigint-buffer/1.1.10: + resolution: {integrity: sha512-pYIQC5EcMmID74t26GCC67946mgTJFiLXOT/BYozgrd4UEY2JHEGLhWi9cMiQCt5BSqFEvKkCHNnoj82SRjiEw==} + engines: {node: '>= 14.0.0'} + requiresBuild: true dependencies: - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/utils': 2.7.7 - '@web3modal/standalone': 2.4.2_react@18.2.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs - - react - - utf-8-validate + node-gyp-build: 4.4.0 dev: false /@trufflesuite/uws-js-unofficial/20.10.0-unofficial.2: @@ -5659,7 +5656,7 @@ packages: resolution: {integrity: sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz} /@types/estree/1.0.0: - resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz} + resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} /@types/express-serve-static-core/4.17.33: resolution: {integrity: sha512-TPBqmR/HRYI3eC2E5hmiivIzv+bidAfXofM+sbonAGvyDhySGw9/PQZFt2BLOrjUUR++4eJVpx6KnLQK1Fk9tA==} @@ -5844,6 +5841,10 @@ packages: '@types/node': 18.13.0 dev: false + /@types/resolve/1.20.2: + resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} + dev: true + /@types/retry/0.12.0: resolution: {integrity: sha512-wWKOClTTiizcZhXnPY4wikVAwmdYHp8q6DmC+EJUzAMsycb7HB32Kh9RN4+0gExjmPmZSAQjgURXIGATPegAvA==} dev: false @@ -6173,28 +6174,6 @@ packages: optional: true dev: false - /@wagmi/chains/1.0.0_typescript@4.9.3: - resolution: {integrity: sha512-eNbqRWyHbivcMNq5tbXJks4NaOzVLHnNQauHPeE/EDT9AlpqzcrMc+v2T1/2Iw8zN4zgqB86NCsxeJHJs7+xng==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 4.9.3 - dev: false - - /@wagmi/chains/1.0.0_typescript@4.9.5: - resolution: {integrity: sha512-eNbqRWyHbivcMNq5tbXJks4NaOzVLHnNQauHPeE/EDT9AlpqzcrMc+v2T1/2Iw8zN4zgqB86NCsxeJHJs7+xng==} - peerDependencies: - typescript: '>=5.0.4' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - typescript: 4.9.5 - dev: false - /@wagmi/connectors/2.1.0_ci2f4e66izr4onw4rlqk6h23fy: resolution: {integrity: sha512-bmBMHOEeLQsv9YedDkZwbmYIh82x9CsvSUjD7kAHeSHLOO8Fod6/sBuVKMrAAjoTOaCpliTqKit6TUlZxw8yOg==} peerDependencies: @@ -6230,136 +6209,6 @@ packages: - zod dev: false - /@wagmi/connectors/2.1.0_ilqczmunl2chnoqfmaulxgqaqu: - resolution: {integrity: sha512-bmBMHOEeLQsv9YedDkZwbmYIh82x9CsvSUjD7kAHeSHLOO8Fod6/sBuVKMrAAjoTOaCpliTqKit6TUlZxw8yOg==} - peerDependencies: - '@wagmi/chains': '>=1.0.0' - typescript: '>=5.0.4' - viem: ~0.3.35 - peerDependenciesMeta: - '@wagmi/chains': - optional: true - typescript: - optional: true - dependencies: - '@coinbase/wallet-sdk': 3.6.6 - '@ledgerhq/connect-kit-loader': 1.0.2 - '@safe-global/safe-apps-provider': 0.15.2 - '@safe-global/safe-apps-sdk': 7.11.0 - '@wagmi/chains': 1.0.0_typescript@4.9.3 - '@walletconnect/ethereum-provider': 2.7.7_6mu4bj3zn4mzkqhhaiv4y7kvee - '@walletconnect/legacy-provider': 2.0.0 - '@web3modal/standalone': 2.4.2_react@18.2.0 - abitype: 0.8.7_typescript@4.9.3 - eventemitter3: 4.0.7 - typescript: 4.9.3 - viem: 0.3.50_typescript@4.9.3 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - lokijs - - react - - supports-color - - utf-8-validate - - zod - dev: false - - /@wagmi/connectors/2.1.0_lql7xgplfpy4emqajl2zhm3pta: - resolution: {integrity: sha512-bmBMHOEeLQsv9YedDkZwbmYIh82x9CsvSUjD7kAHeSHLOO8Fod6/sBuVKMrAAjoTOaCpliTqKit6TUlZxw8yOg==} - peerDependencies: - '@wagmi/chains': '>=1.0.0' - typescript: '>=5.0.4' - viem: ~0.3.35 - peerDependenciesMeta: - '@wagmi/chains': - optional: true - typescript: - optional: true - dependencies: - '@coinbase/wallet-sdk': 3.6.6 - '@ledgerhq/connect-kit-loader': 1.0.2 - '@safe-global/safe-apps-provider': 0.15.2 - '@safe-global/safe-apps-sdk': 7.11.0 - '@wagmi/chains': 1.0.0_typescript@4.9.5 - '@walletconnect/ethereum-provider': 2.7.7_5jpohlzmviehayqpe253dhbiw4 - '@walletconnect/legacy-provider': 2.0.0 - '@web3modal/standalone': 2.4.2_react@18.2.0 - abitype: 0.8.7_typescript@4.9.5 - eventemitter3: 4.0.7 - typescript: 4.9.5 - viem: 0.3.50_typescript@4.9.5 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - lokijs - - react - - supports-color - - utf-8-validate - - zod - dev: false - - /@wagmi/core/1.1.0_fivdkur5hwgpp45yi65gbqhb5i: - resolution: {integrity: sha512-4EB/Huw4SEXZk45IypPlTj1b7g48fFHk9C5bipdtgD14EwMTdk+z774ViWAI8C+MHPsGBE1rrGMxlDZohdAmPA==} - peerDependencies: - typescript: '>=5.0.4' - viem: ~0.3.35 - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@wagmi/chains': 1.0.0_typescript@4.9.5 - '@wagmi/connectors': 2.1.0_lql7xgplfpy4emqajl2zhm3pta - abitype: 0.8.7_typescript@4.9.5 - eventemitter3: 4.0.7 - typescript: 4.9.5 - viem: 0.3.50_typescript@4.9.5 - zustand: 4.3.8_react@18.2.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - utf-8-validate - - zod - dev: false - - /@wagmi/core/1.1.0_kcw4xzi5p6fmxdxkxcyd7hvevi: - resolution: {integrity: sha512-4EB/Huw4SEXZk45IypPlTj1b7g48fFHk9C5bipdtgD14EwMTdk+z774ViWAI8C+MHPsGBE1rrGMxlDZohdAmPA==} - peerDependencies: - typescript: '>=5.0.4' - viem: ~0.3.35 - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@wagmi/chains': 1.0.0_typescript@4.9.3 - '@wagmi/connectors': 2.1.0_ilqczmunl2chnoqfmaulxgqaqu - abitype: 0.8.7_typescript@4.9.3 - eventemitter3: 4.0.7 - typescript: 4.9.3 - viem: 0.3.50_typescript@4.9.3 - zustand: 4.3.8_react@18.2.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - immer - - lokijs - - react - - supports-color - - utf-8-validate - - zod - dev: false - /@wagmi/core/1.1.0_viem@0.3.50: resolution: {integrity: sha512-4EB/Huw4SEXZk45IypPlTj1b7g48fFHk9C5bipdtgD14EwMTdk+z774ViWAI8C+MHPsGBE1rrGMxlDZohdAmPA==} peerDependencies: @@ -6444,32 +6293,6 @@ packages: - utf-8-validate dev: false - /@walletconnect/core/2.7.7_lokijs@1.5.12: - resolution: {integrity: sha512-/Tmrjx9XDG8qylsUFU2fWvMoxlDwW+zzUcCgTaebMAmssCZ8NSknbBdjAdAKiey1TaLEgFkaCxXgXfioinWNYg==} - dependencies: - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/jsonrpc-ws-connection': 1.0.11 - '@walletconnect/keyvaluestorage': 1.0.2_lokijs@1.5.12 - '@walletconnect/logger': 2.0.1 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/relay-auth': 1.0.4 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@walletconnect/utils': 2.7.7_lokijs@1.5.12 - events: 3.3.0 - lodash.isequal: 4.5.0 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs - - utf-8-validate - dev: false - /@walletconnect/crypto/1.0.3: resolution: {integrity: sha512-+2jdORD7XQs76I2Odgr3wwrtyuLUXD/kprNVsjWRhhhdO9Mt6WqVzOPu0/t7OHSmgal8k7SoBQzUc5hu/8zL/g==} dependencies: @@ -6489,40 +6312,13 @@ packages: typedarray-to-buffer: 3.1.5 dev: false - /@walletconnect/environment/1.0.1: - resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} - dependencies: - tslib: 1.14.1 - dev: false - - /@walletconnect/ethereum-provider/2.7.7_5jpohlzmviehayqpe253dhbiw4: - resolution: {integrity: sha512-wVVMgpMMcPySBKHAPu7QfL18TMrjAgOePz/mfuOjWal+vT9yVSPA34oFyHlzJKvcQ/abP7Zj3AzDtZbyXWRxwQ==} - peerDependencies: - '@web3modal/standalone': '>=2' - peerDependenciesMeta: - '@web3modal/standalone': - optional: true - dependencies: - '@walletconnect/jsonrpc-http-connection': 1.0.7 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/sign-client': 2.7.7 - '@walletconnect/types': 2.7.7 - '@walletconnect/universal-provider': 2.7.7 - '@walletconnect/utils': 2.7.7 - '@web3modal/standalone': 2.4.2 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - lokijs - - utf-8-validate - dev: false - - /@walletconnect/ethereum-provider/2.7.7_6mu4bj3zn4mzkqhhaiv4y7kvee: + /@walletconnect/environment/1.0.1: + resolution: {integrity: sha512-T426LLZtHj8e8rYnKfzsw1aG6+M0BT1ZxayMdv/p8yM0MU+eJDISqNY3/bccxRr4LrF9csq02Rhqt08Ibl0VRg==} + dependencies: + tslib: 1.14.1 + dev: false + + /@walletconnect/ethereum-provider/2.7.7_5jpohlzmviehayqpe253dhbiw4: resolution: {integrity: sha512-wVVMgpMMcPySBKHAPu7QfL18TMrjAgOePz/mfuOjWal+vT9yVSPA34oFyHlzJKvcQ/abP7Zj3AzDtZbyXWRxwQ==} peerDependencies: '@web3modal/standalone': '>=2' @@ -6534,11 +6330,11 @@ packages: '@walletconnect/jsonrpc-provider': 1.0.13 '@walletconnect/jsonrpc-types': 1.0.3 '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/sign-client': 2.7.7_lokijs@1.5.12 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@walletconnect/universal-provider': 2.7.7_lokijs@1.5.12 - '@walletconnect/utils': 2.7.7_lokijs@1.5.12 - '@web3modal/standalone': 2.4.2_react@18.2.0 + '@walletconnect/sign-client': 2.7.7 + '@walletconnect/types': 2.7.7 + '@walletconnect/universal-provider': 2.7.7 + '@walletconnect/utils': 2.7.7 + '@web3modal/standalone': 2.4.2 events: 3.3.0 transitivePeerDependencies: - '@react-native-async-storage/async-storage' @@ -6676,22 +6472,6 @@ packages: tslib: 1.14.1 dev: false - /@walletconnect/keyvaluestorage/1.0.2_lokijs@1.5.12: - resolution: {integrity: sha512-U/nNG+VLWoPFdwwKx0oliT4ziKQCEoQ27L5Hhw8YOFGA2Po9A9pULUYNWhDgHkrb0gYDNt//X7wABcEWWBd3FQ==} - peerDependencies: - '@react-native-async-storage/async-storage': 1.x - lokijs: 1.x - peerDependenciesMeta: - '@react-native-async-storage/async-storage': - optional: true - lokijs: - optional: true - dependencies: - lokijs: 1.5.12 - safe-json-utils: 1.1.1 - tslib: 1.14.1 - dev: false - /@walletconnect/legacy-client/2.0.0: resolution: {integrity: sha512-v5L7rYk9loVnfvUf0mF+76bUPFaU5/Vh7mzL6/950CD/yoGdzYZ3Kj+L7mkC6HPMEGeQsBP1+sqBuiVGZ/aODA==} dependencies: @@ -6846,25 +6626,6 @@ packages: - utf-8-validate dev: false - /@walletconnect/sign-client/2.7.7_lokijs@1.5.12: - resolution: {integrity: sha512-lTyF8ZEp+HwPNBW/Fw5iWnMm9O5tC1qwf5YfhNczZ7+q6+UUopOoRrsAvwqftJIkgKmfC8lHT52G/XM2JGVjbQ==} - dependencies: - '@walletconnect/core': 2.7.7_lokijs@1.5.12 - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.0.1 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@walletconnect/utils': 2.7.7_lokijs@1.5.12 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - lokijs - - utf-8-validate - dev: false - /@walletconnect/time/1.0.2: resolution: {integrity: sha512-uzdd9woDcJ1AaBZRhqy5rNC9laqWGErfc4dxA9a87mPdKOgWMD85mcFo9dIYIts/Jwocfwn07EC6EzclKubk/g==} dependencies: @@ -6903,20 +6664,6 @@ packages: - lokijs dev: false - /@walletconnect/types/2.7.7_lokijs@1.5.12: - resolution: {integrity: sha512-Z4Y+BKPX7X1UBCf7QV35mVy2QU9CS+5G+EthCaJwpieirZNHamHEwNXUjuUUb3PrYOLwlfRYUT5edeFW9wvoeQ==} - dependencies: - '@walletconnect/events': 1.0.1 - '@walletconnect/heartbeat': 1.2.1 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/keyvaluestorage': 1.0.2_lokijs@1.5.12 - '@walletconnect/logger': 2.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: false - /@walletconnect/universal-provider/2.7.7: resolution: {integrity: sha512-MY+R1sLmIKjFYjanWUM6bOM077+SnShSUfSjCTrsoZE2RDddcSz9EtcATovBSPfzPwUTS20mgcgrkRT4zrFRyQ==} dependencies: @@ -6939,28 +6686,6 @@ packages: - utf-8-validate dev: false - /@walletconnect/universal-provider/2.7.7_lokijs@1.5.12: - resolution: {integrity: sha512-MY+R1sLmIKjFYjanWUM6bOM077+SnShSUfSjCTrsoZE2RDddcSz9EtcATovBSPfzPwUTS20mgcgrkRT4zrFRyQ==} - dependencies: - '@walletconnect/jsonrpc-http-connection': 1.0.7 - '@walletconnect/jsonrpc-provider': 1.0.13 - '@walletconnect/jsonrpc-types': 1.0.3 - '@walletconnect/jsonrpc-utils': 1.0.8 - '@walletconnect/logger': 2.0.1 - '@walletconnect/sign-client': 2.7.7_lokijs@1.5.12 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@walletconnect/utils': 2.7.7_lokijs@1.5.12 - eip1193-provider: 1.0.1 - events: 3.3.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - bufferutil - - debug - - encoding - - lokijs - - utf-8-validate - dev: false - /@walletconnect/utils/2.4.0: resolution: {integrity: sha512-wXmy35hCpCNQLr21uFYM0+Wu1ON5J8bKTZ5x4FKaaw5qL24gjHridqUwdepjjkMpU1l3JX2OJGpmmKMyCBSu0g==} dependencies: @@ -7010,28 +6735,6 @@ packages: - lokijs dev: false - /@walletconnect/utils/2.7.7_lokijs@1.5.12: - resolution: {integrity: sha512-ozh9gvRAdXkiu+6nOAkoDCokDVPXK/tNATrrYuOhhR+EmGDjlZU2d27HT+HiGREdza0b1HdZN4XneGm0gERV5w==} - dependencies: - '@stablelib/chacha20poly1305': 1.0.1 - '@stablelib/hkdf': 1.0.1 - '@stablelib/random': 1.0.2 - '@stablelib/sha256': 1.0.1 - '@stablelib/x25519': 1.0.3 - '@walletconnect/relay-api': 1.0.9 - '@walletconnect/safe-json': 1.0.2 - '@walletconnect/time': 1.0.2 - '@walletconnect/types': 2.7.7_lokijs@1.5.12 - '@walletconnect/window-getters': 1.0.1 - '@walletconnect/window-metadata': 1.0.1 - detect-browser: 5.3.0 - query-string: 7.1.3 - uint8arrays: 3.1.0 - transitivePeerDependencies: - - '@react-native-async-storage/async-storage' - - lokijs - dev: false - /@walletconnect/window-getters/1.0.1: resolution: {integrity: sha512-vHp+HqzGxORPAN8gY03qnbTMnhqIwjeRJNOMOAzePRg4xVEEE2WvYsI9G2NMjOknA8hnuYbU3/hwLcKbjhc8+Q==} dependencies: @@ -7054,15 +6757,6 @@ packages: - react dev: false - /@web3modal/core/2.4.2_react@18.2.0: - resolution: {integrity: sha512-/pQjARcyaGsGuYWDa+1Pygk0T52mweyrmkL9WAbBtB9eY40sYg5Xg46dn77Nvr8lf+dwJyDrv5hKMe7Ya6mu0g==} - dependencies: - buffer: 6.0.3 - valtio: 1.10.5_react@18.2.0 - transitivePeerDependencies: - - react - dev: false - /@web3modal/ethereum/2.4.2_4yqj3wxh7itmwcbsrv43ezfuau: resolution: {integrity: sha512-+Az66aERwJNTFKg1HDl/QW2c0i9zL+7pUDuycKwCNTnMcrotRKBYwIMdUFr3ff02+nFQtexHX/Bj9JOX5LhPbA==} peerDependencies: @@ -7082,15 +6776,6 @@ packages: - react dev: false - /@web3modal/standalone/2.4.2_react@18.2.0: - resolution: {integrity: sha512-0j6MfI4jHdJ7w3WrwVJLPuFH9sIwFg+Qwj6GYtU8xdL/IyHxlkkzYzTbZTneuk3XIK1ZZFkMxx5pa947Arm+PQ==} - dependencies: - '@web3modal/core': 2.4.2_react@18.2.0 - '@web3modal/ui': 2.4.2_react@18.2.0 - transitivePeerDependencies: - - react - dev: false - /@web3modal/ui/2.4.2: resolution: {integrity: sha512-35USuKCSXVIdQqn83/MBq8cpcjD3kCxPUOeQmX9MVDJUCbz3l3AX+Iimf2hBe5comoxkVUjlKT1cx4y184/aOA==} dependencies: @@ -7102,17 +6787,6 @@ packages: - react dev: false - /@web3modal/ui/2.4.2_react@18.2.0: - resolution: {integrity: sha512-35USuKCSXVIdQqn83/MBq8cpcjD3kCxPUOeQmX9MVDJUCbz3l3AX+Iimf2hBe5comoxkVUjlKT1cx4y184/aOA==} - dependencies: - '@web3modal/core': 2.4.2_react@18.2.0 - lit: 2.7.4 - motion: 10.16.2 - qrcode: 1.5.3 - transitivePeerDependencies: - - react - dev: false - /@webassemblyjs/ast/1.11.1: resolution: {integrity: sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz} dependencies: @@ -7264,30 +6938,6 @@ packages: optional: true dev: false - /abitype/0.8.7_typescript@4.9.3: - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - zod: - optional: true - dependencies: - typescript: 4.9.3 - dev: false - - /abitype/0.8.7_typescript@4.9.5: - resolution: {integrity: sha512-wQ7hV8Yg/yKmGyFpqrNZufCxbszDe5es4AZGYPBitocfSqXtjrTG9JMWFcc4N30ukl2ve48aBTwt7NJxVQdU3w==} - peerDependencies: - typescript: '>=5.0.4' - zod: ^3 >=3.19.1 - peerDependenciesMeta: - zod: - optional: true - dependencies: - typescript: 4.9.5 - dev: false - /abort-controller/3.0.0: resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} engines: {node: '>=6.5'} @@ -8281,7 +7931,6 @@ packages: /builtin-modules/3.3.0: resolution: {integrity: sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==} engines: {node: '>=6'} - dev: false /builtin-status-codes/3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} @@ -11099,6 +10748,7 @@ packages: resolution: {integrity: sha512-KdsTZaAKqDXTNDMKnLzg0ngX8wnZKyVGm7HD03GIyUMVRuXI83s0CUEaGIDWRUWTQP7BE8sDh7QtbW+NoX4zrQ==} hasBin: true dependencies: + '@trufflesuite/bigint-buffer': 1.1.10 '@trufflesuite/uws-js-unofficial': 20.10.0-unofficial.2 '@types/bn.js': 5.1.1 '@types/lru-cache': 5.1.1 @@ -11107,6 +10757,9 @@ packages: abstract-leveldown: 7.2.0 async-eventemitter: 0.2.4 emittery: 0.10.0 + keccak: 3.0.2 + leveldown: 6.1.0 + secp256k1: 4.0.3 optionalDependencies: bufferutil: 4.0.5 utf-8-validate: 5.0.7 @@ -11794,6 +11447,13 @@ packages: engines: {node: '>=4'} dev: false + /is-builtin-module/3.2.1: + resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} + engines: {node: '>=6'} + dependencies: + builtin-modules: 3.3.0 + dev: true + /is-callable/1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -11862,7 +11522,6 @@ packages: /is-module/1.0.0: resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==} - dev: false /is-negative-zero/2.0.2: resolution: {integrity: sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==} @@ -11917,6 +11576,12 @@ packages: /is-potential-custom-element-name/1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} + /is-reference/1.2.1: + resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} + dependencies: + '@types/estree': 1.0.0 + dev: true + /is-regex/1.1.4: resolution: {integrity: sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==} engines: {node: '>= 0.4'} @@ -14306,6 +13971,16 @@ packages: array-includes: 3.1.6 object.assign: 4.1.4 + /keccak/3.0.2: + resolution: {integrity: sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + node-addon-api: 2.0.2 + node-gyp-build: 4.6.0 + readable-stream: 3.6.0 + dev: false + /keccak/3.0.3: resolution: {integrity: sha512-JZrLIAJWuZxKbCilMpNz5Vj7Vtb4scDG3dMXLOsbzBmQGyjwE61BbW7bJkfKKCShXiQZt3T6sBgALRtmd+nZaQ==} engines: {node: '>=10.0.0'} @@ -14373,6 +14048,16 @@ packages: module-error: 1.0.2 dev: false + /leveldown/6.1.0: + resolution: {integrity: sha512-8C7oJDT44JXxh04aSSsfcMI8YiaGRhOFI9/pMEL7nWJLVsWajDPTRxsSHTM2WcTVY5nXM+SuRHzPPi0GbnDX+w==} + engines: {node: '>=10.12.0'} + requiresBuild: true + dependencies: + abstract-leveldown: 7.2.0 + napi-macros: 2.0.0 + node-gyp-build: 4.6.0 + dev: false + /leven/3.1.0: resolution: {integrity: sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==} engines: {node: '>=6'} @@ -14586,6 +14271,7 @@ packages: /lokijs/1.5.12: resolution: {integrity: sha512-Q5ALD6JiS6xAUWCwX3taQmgwxyveCtIIuL08+ml0nHwT3k0S/GIFJN+Hd38b1qYIMaE5X++iqsqWVksz7SYW+Q==} + dev: true /loose-envify/1.4.0: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} @@ -14836,7 +14522,7 @@ packages: dev: false /minimatch/5.1.6: - resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz} + resolution: {integrity: sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==} engines: {node: '>=10'} dependencies: brace-expansion: 2.0.1 @@ -14947,6 +14633,10 @@ packages: engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} hasBin: true + /napi-macros/2.0.0: + resolution: {integrity: sha512-A0xLykHtARfueITVDernsAWdtIMbOJgKgcluwENp3AlsKN/PloyO10HtmoqnFAQAcxPkgZN7wdfPfEd0zNGxbg==} + dev: false + /natural-compare-lite/1.4.0: resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} @@ -15033,6 +14723,11 @@ packages: engines: {node: '>= 6.13.0'} dev: false + /node-gyp-build/4.4.0: + resolution: {integrity: sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==} + hasBin: true + dev: false + /node-gyp-build/4.6.0: resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} hasBin: true @@ -17168,6 +16863,26 @@ packages: optionalDependencies: fsevents: 2.3.2 + /rollup/4.0.2: + resolution: {integrity: sha512-MCScu4usMPCeVFaiLcgMDaBQeYi1z6vpWxz0r0hq0Hv77Y2YuOTZldkuNJ54BdYBH3e+nkrk6j0Rre/NLDBYzg==} + engines: {node: '>=18.0.0', npm: '>=8.0.0'} + hasBin: true + optionalDependencies: + '@rollup/rollup-android-arm-eabi': 4.0.2 + '@rollup/rollup-android-arm64': 4.0.2 + '@rollup/rollup-darwin-arm64': 4.0.2 + '@rollup/rollup-darwin-x64': 4.0.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.0.2 + '@rollup/rollup-linux-arm64-gnu': 4.0.2 + '@rollup/rollup-linux-arm64-musl': 4.0.2 + '@rollup/rollup-linux-x64-gnu': 4.0.2 + '@rollup/rollup-linux-x64-musl': 4.0.2 + '@rollup/rollup-win32-arm64-msvc': 4.0.2 + '@rollup/rollup-win32-ia32-msvc': 4.0.2 + '@rollup/rollup-win32-x64-msvc': 4.0.2 + fsevents: 2.3.2 + dev: true + /rpc-websockets/7.5.1: resolution: {integrity: sha512-kGFkeTsmd37pHPMaHIgN1LVKXMi0JD782v4Ds9ZKtLlwdTKjn+CxM9A9/gLT2LaOuEcEFGL98h1QWQtlOIdW0w==} dependencies: @@ -17312,6 +17027,16 @@ packages: /scrypt-js/3.0.1: resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} + /secp256k1/4.0.3: + resolution: {integrity: sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==} + engines: {node: '>=10.0.0'} + requiresBuild: true + dependencies: + elliptic: 6.5.4 + node-addon-api: 2.0.2 + node-gyp-build: 4.6.0 + dev: false + /secure-json-parse/2.7.0: resolution: {integrity: sha512-6aU+Rwsezw7VR8/nyvKTx8QpWH9FrcYiXXlqC4z5d5XQBDRqtbfsRjnwGyqbi3gddNtWHuEk9OANUotL26qKUw==} dev: true @@ -17383,7 +17108,7 @@ packages: dev: false /serialize-javascript/6.0.1: - resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.1.tgz} + resolution: {integrity: sha512-owoXEFjWRllis8/M1Q+Cw5k8ZH40e3zhp/ovX+Xr/vi1qj6QesbyXXViFbpNvWvPNAD62SutwEXavefrLJWj7w==} dependencies: randombytes: 2.1.0 @@ -17554,6 +17279,10 @@ packages: yargs: 15.4.1 dev: true + /smob/1.4.1: + resolution: {integrity: sha512-9LK+E7Hv5R9u4g4C3p+jjLstaLe11MDsL21UpYaCNmapvMkYhqCV4A/f/3gyH8QjMyh6l68q9xC85vihY9ahMQ==} + dev: true + /sockjs/0.3.24: resolution: {integrity: sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==} dependencies: @@ -17601,7 +17330,7 @@ packages: source-map: 0.6.1 /source-map-support/0.5.21: - resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz} + resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: buffer-from: 1.1.2 source-map: 0.6.1 @@ -18150,6 +17879,17 @@ packages: commander: 2.20.3 source-map-support: 0.5.21 + /terser/5.21.0: + resolution: {integrity: sha512-WtnFKrxu9kaoXuiZFSGrcAvvBqAdmKx0SFNmVNYdJamMu9yyN3I/QF0FbH4QcqJQ+y1CJnzxGIKH0cSj+FGYRw==} + engines: {node: '>=10'} + hasBin: true + dependencies: + '@jridgewell/source-map': 0.3.5 + acorn: 8.8.2 + commander: 2.20.3 + source-map-support: 0.5.21 + dev: true + /test-exclude/6.0.0: resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} engines: {node: '>=8'} @@ -18657,14 +18397,6 @@ packages: react: ^16.8.0 || ^17.0.0 || ^18.0.0 dev: false - /use-sync-external-store/1.2.0_react@18.2.0: - resolution: {integrity: sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA==} - peerDependencies: - react: ^16.8.0 || ^17.0.0 || ^18.0.0 - dependencies: - react: 18.2.0 - dev: false - /utf-8-validate/5.0.10: resolution: {integrity: sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==} engines: {node: '>=6.14.2'} @@ -18761,20 +18493,6 @@ packages: use-sync-external-store: 1.2.0 dev: false - /valtio/1.10.5_react@18.2.0: - resolution: {integrity: sha512-jTp0k63VXf4r5hPoaC6a6LCG4POkVSh629WLi1+d5PlajLsbynTMd7qAgEiOSPxzoX5iNvbN7iZ/k/g29wrNiQ==} - engines: {node: '>=12.20.0'} - peerDependencies: - react: '>=16.8' - peerDependenciesMeta: - react: - optional: true - dependencies: - proxy-compare: 2.5.1 - react: 18.2.0 - use-sync-external-store: 1.2.0_react@18.2.0 - dev: false - /vary/1.1.2: resolution: {integrity: sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==} engines: {node: '>= 0.8'} @@ -18808,44 +18526,6 @@ packages: - zod dev: false - /viem/0.3.50_typescript@4.9.3: - resolution: {integrity: sha512-s+LxCYZTR9F/qPk1/n1YDVAX9vSeVz7GraqBZWGrDuenCJxo9ArCoIceJ6ksI0WwSeNzcZ0VVbD/kWRzTxkipw==} - dependencies: - '@adraffy/ens-normalize': 1.9.0 - '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 - '@scure/bip32': 1.3.0 - '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.0.0_typescript@4.9.3 - abitype: 0.8.7_typescript@4.9.3 - isomorphic-ws: 5.0.0_ws@8.12.0 - ws: 8.12.0 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - dev: false - - /viem/0.3.50_typescript@4.9.5: - resolution: {integrity: sha512-s+LxCYZTR9F/qPk1/n1YDVAX9vSeVz7GraqBZWGrDuenCJxo9ArCoIceJ6ksI0WwSeNzcZ0VVbD/kWRzTxkipw==} - dependencies: - '@adraffy/ens-normalize': 1.9.0 - '@noble/curves': 1.0.0 - '@noble/hashes': 1.3.0 - '@scure/bip32': 1.3.0 - '@scure/bip39': 1.2.0 - '@wagmi/chains': 1.0.0_typescript@4.9.5 - abitype: 0.8.7_typescript@4.9.5 - isomorphic-ws: 5.0.0_ws@8.12.0 - ws: 8.12.0 - transitivePeerDependencies: - - bufferutil - - typescript - - utf-8-validate - - zod - dev: false - /vite/3.1.0: resolution: {integrity: sha512-YBg3dUicDpDWFCGttmvMbVyS9ydjntwEjwXRj2KBFwSB8SxmGcudo1yb8FW5+M/G86aS8x828ujnzUVdsLjs9g==} engines: {node: ^14.18.0 || >=16.0.0} @@ -19705,19 +19385,3 @@ packages: dependencies: use-sync-external-store: 1.2.0 dev: false - - /zustand/4.3.8_react@18.2.0: - resolution: {integrity: sha512-4h28KCkHg5ii/wcFFJ5Fp+k1J3gJoasaIbppdgZFO4BPJnsNxL0mQXBSFgOgAdCdBj35aDTPvdAJReTMntFPGg==} - engines: {node: '>=12.7.0'} - peerDependencies: - immer: '>=9.0' - react: '>=16.8' - peerDependenciesMeta: - immer: - optional: true - react: - optional: true - dependencies: - react: 18.2.0 - use-sync-external-store: 1.2.0_react@18.2.0 - dev: false diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index ec46cc8..0dbcec7 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,3 +2,4 @@ packages: - 'packages/*/*' - 'demos/*/*' - 'demos/dev-demo' + - 'demos/cdn-demo' diff --git a/scripts/build-umd.js b/scripts/build-umd.js new file mode 100644 index 0000000..3c6a76c --- /dev/null +++ b/scripts/build-umd.js @@ -0,0 +1,77 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/* eslint-disable no-undef */ +const { rollup } = require('rollup'); +const nodeResolve = require('@rollup/plugin-node-resolve'); +const commonjs = require('@rollup/plugin-commonjs'); +const terser = require('@rollup/plugin-terser'); +const json = require('@rollup/plugin-json'); +const { cwd } = require('process'); +const { resolve } = require('path'); + +const inputOptions = { + input: './lib/cjs/index.js', + plugins: [commonjs(), nodeResolve(), json()], + external: [ + 'eventemitter3', + 'buffer', + 'events', + 'react', + 'react-dom', + '@tronweb3/tronwallet-abstract-adapter', + '@tronweb3/tronwallet-adapter-tronlink', + ], +}; +const commonOptions = { + format: 'umd', + name: getOutputName(), + globals: { + buffer: 'buffer.Buffer', + events: 'EventEmitter', + eventemitter3: 'EventEmitter3', + react: 'React', + 'react-dom': 'ReactDOM', + '@tronweb3/tronwallet-abstract-adapter': 'TronwalletAbstractAdapter', + '@tronweb3/tronwallet-adapter-tronlink': 'TronwalletAdapterTronlink', + }, +}; +const outputOptionsList = [ + { + ...commonOptions, + file: './lib/umd/index.js', + }, + { + ...commonOptions, + file: './lib/umd/index.min.js', + plugins: [terser()], + }, +]; +build(); + +async function build() { + let bundle; + let bundleFailed = false; + try { + bundle = await rollup(inputOptions); + await generateOutputs(bundle); + } catch (e) { + bundleFailed = true; + console.error(e); + } + if (bundle) { + bundle.close(); + } + process.exit(bundleFailed ? 1 : 0); +} + +async function generateOutputs(bundle) { + for (const outputOptions of outputOptionsList) { + await bundle.write(outputOptions); + } +} + +function getOutputName() { + const packageJson = require(resolve(cwd(), 'package.json')); + const name = packageJson.name.split('/')[1].replaceAll(/(?:^|-)([a-z])/g, ($0, $1) => $1.toUpperCase()); + console.log('[build:umd] current name: ' + name); + return name; +} From cd45403300d9a376b98f7a31d202a5a415bd1dd0 Mon Sep 17 00:00:00 2001 From: Justin Zhu Date: Mon, 16 Oct 2023 18:04:27 +0800 Subject: [PATCH 02/13] feat: add tronlink-evm adapter --- README.md | 1 + demos/cdn-demo/package.json | 2 +- demos/dev-demo/package.json | 1 + demos/dev-demo/src/Metamask.tsx | 11 +- .../adapters/abstract-adapter-evm/README.md | 2 +- packages/adapters/metamask/src/adapter.ts | 2 - packages/adapters/tronlink-evm/LICENSE | 20 ++ packages/adapters/tronlink-evm/README.md | 39 +++ packages/adapters/tronlink-evm/jest.config.js | 17 ++ packages/adapters/tronlink-evm/package.json | 54 ++++ packages/adapters/tronlink-evm/src/adapter.ts | 145 +++++++++ packages/adapters/tronlink-evm/src/index.ts | 1 + packages/adapters/tronlink-evm/src/utils.ts | 8 + .../tronlink-evm/tests/units/adapter.test.ts | 14 + .../adapters/tronlink-evm/tsconfig.all.json | 14 + .../adapters/tronlink-evm/tsconfig.cjs.json | 7 + .../adapters/tronlink-evm/tsconfig.esm.json | 8 + pnpm-lock.yaml | 274 +++++++++++++++++- tsconfig.all.json | 3 + 19 files changed, 598 insertions(+), 25 deletions(-) create mode 100644 packages/adapters/tronlink-evm/LICENSE create mode 100644 packages/adapters/tronlink-evm/README.md create mode 100644 packages/adapters/tronlink-evm/jest.config.js create mode 100644 packages/adapters/tronlink-evm/package.json create mode 100644 packages/adapters/tronlink-evm/src/adapter.ts create mode 100644 packages/adapters/tronlink-evm/src/index.ts create mode 100644 packages/adapters/tronlink-evm/src/utils.ts create mode 100644 packages/adapters/tronlink-evm/tests/units/adapter.test.ts create mode 100644 packages/adapters/tronlink-evm/tsconfig.all.json create mode 100644 packages/adapters/tronlink-evm/tsconfig.cjs.json create mode 100644 packages/adapters/tronlink-evm/tsconfig.esm.json diff --git a/README.md b/README.md index be4712b..2aeacfa 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,7 @@ tronwallet-adapter | | ├─vite-app # demo for vitejs | | ├─next-app # demo for nextjs | ├─dev-demo # demo for development +| ├─cdn-demo # demo for cdn usage of adapters ``` ### TronWallet Adapters diff --git a/demos/cdn-demo/package.json b/demos/cdn-demo/package.json index 02aa0e9..3bbb8a3 100644 --- a/demos/cdn-demo/package.json +++ b/demos/cdn-demo/package.json @@ -1,5 +1,5 @@ { - "name": "dev-demo", + "name": "cdn-demo", "private": true, "version": "0.0.0", "type": "module", diff --git a/demos/dev-demo/package.json b/demos/dev-demo/package.json index 4e8fb63..c67630e 100644 --- a/demos/dev-demo/package.json +++ b/demos/dev-demo/package.json @@ -23,6 +23,7 @@ "@tronweb3/tronwallet-adapter-react-hooks": "^1.0.0", "@tronweb3/tronwallet-adapter-react-ui": "^1.1.0", "@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.0", + "@tronweb3/tronwallet-adapter-tronlink-evm": "^1.0.0", "@tronweb3/tronwallet-adapters": "^1.1.2", "events": "^3.3.0", "ganache": "^7.9.0", diff --git a/demos/dev-demo/src/Metamask.tsx b/demos/dev-demo/src/Metamask.tsx index 91217b9..8be0f2f 100644 --- a/demos/dev-demo/src/Metamask.tsx +++ b/demos/dev-demo/src/Metamask.tsx @@ -1,7 +1,7 @@ import type { ReactNode } from 'react'; import { useEffect, useMemo, useState, useCallback } from 'react'; import { Box, Button, Typography, Alert, TextField } from '@mui/material'; -import { MetaMaskAdapter } from '@tronweb3/tronwallet-adapter-metamask' +import { TronLinkEvmAdapter } from '@tronweb3/tronwallet-adapter-tronlink-evm' import { Detail } from './TronLinkAdapterDemo.js'; import { recoverPersonalSignature, recoverTypedSignature, SignTypedDataVersion } from '@metamask/eth-sig-util' function toHex(val: number): `0x${string}` { @@ -14,7 +14,7 @@ export function MetamaskAdapterDemo() { const [chainId, setChainId] = useState(''); const [messageToSign, setMessageToSign] = useState('Hello, Adapter'); const [signedHash, setSignedHash] = useState(''); - const adapter = useMemo(() => new MetaMaskAdapter(), []); + const adapter = useMemo(() => new TronLinkEvmAdapter(), []); const [lastSignType, setLastSignType] = useState('') useEffect(() => { @@ -71,9 +71,9 @@ export function MetamaskAdapterDemo() { } async function handleSwitchChain() { - console.log('switch chain to: ', toHex(1337)) + console.log('switch chain to: ', toHex(1)) try { - await adapter.switchChain(toHex(1337)); + await adapter.switchChain(toHex(1)); alert('Switch chain successfully.') } catch(e) { console.log('switchChain error: ', e); @@ -119,7 +119,8 @@ export function MetamaskAdapterDemo() { data: messageToSign, signature: signedHash }); - valid = address === adapter.address; + console.log('recoveredAddress', address); + valid = address.toLowerCase() === adapter.address!.toLowerCase(); } else { const address = recoverTypedSignature({ version: SignTypedDataVersion.V4, diff --git a/packages/adapters/abstract-adapter-evm/README.md b/packages/adapters/abstract-adapter-evm/README.md index 9b7a508..9957a06 100644 --- a/packages/adapters/abstract-adapter-evm/README.md +++ b/packages/adapters/abstract-adapter-evm/README.md @@ -216,7 +216,7 @@ All errors are as follows: Following exmaple shows how to get original error info with `WalletError`: ```js -const adapter = new TronLinkAdapter(); +const adapter = new MetaMaskAdapter(); try { await adapter.connect(); } catch (e: any) { diff --git a/packages/adapters/metamask/src/adapter.ts b/packages/adapters/metamask/src/adapter.ts index deb0a21..14d4d99 100644 --- a/packages/adapters/metamask/src/adapter.ts +++ b/packages/adapters/metamask/src/adapter.ts @@ -40,10 +40,8 @@ export class MetaMaskAdapter extends Adapter { this.autoConnect(provider); } else { this.getProvider().then((res) => { - console.log('contructor getProvider then', res); if (res) { this.readyState = WalletReadyState.Found; - console.log('readyState', this.readyState); this.listenEvents(res); this.autoConnect(res); } else { diff --git a/packages/adapters/tronlink-evm/LICENSE b/packages/adapters/tronlink-evm/LICENSE new file mode 100644 index 0000000..f8c1348 --- /dev/null +++ b/packages/adapters/tronlink-evm/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) +Copyright (c) 2022-Present, tronprotocol + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/adapters/tronlink-evm/README.md b/packages/adapters/tronlink-evm/README.md new file mode 100644 index 0000000..b33f31d --- /dev/null +++ b/packages/adapters/tronlink-evm/README.md @@ -0,0 +1,39 @@ +# `@tronweb3/tronwallet-adapter-tronlink-evm` + +This package provides an adapter to enable TRON DApps to connect to the [TronLink Wallet extension]() and [TronLink Wallet App](https://tronlink.org/). + +## Demo + +```typescript +import { TronLinkEvmAdapter } from '@tronweb3/tronwallet-adapter-tronlink-evm'; + +const adapter = new TronLinkEvmAdapter(); +// connect +await adapter.connect(); + +// then you can get address +console.log(adapter.address); + +// just use the sendTransaction method to send a transfer transaction. +const transaction = { + value: '0x' + Number(0.01 * Math.pow(10, 18)).toString(16), // 0.01 is 0.01ETH + to: 'your target address', + from: adapter.address, +}; +await adapter.sendTransaction(transaction); +``` + +## Documentation + +### API + +- `Constructor()` + + ```typescript + import { TronLinkEvmAdapter } from '@tronweb3/tronwallet-adapter-tronlink-evm'; + const tronLinkEvmAdapter = new TronLinkEvmAdapter(); + ``` + +**Caveat** Currently TronLink wallet does not support `addChain()` and `signTypedData()`. + +More detailed API can be found in [Abstract Adapter](https://github.com/tronprotocol/tronwallet-adapter/blob/main/packages/adapters/abstract-adapter-evm/README.md). diff --git a/packages/adapters/tronlink-evm/jest.config.js b/packages/adapters/tronlink-evm/jest.config.js new file mode 100644 index 0000000..2a76755 --- /dev/null +++ b/packages/adapters/tronlink-evm/jest.config.js @@ -0,0 +1,17 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +export default { + preset: 'ts-jest', + testEnvironment: 'jsdom', + transform: { + '\\.tsx?$': [ + 'ts-jest', + { + useESM: true, + }, + ], + }, + moduleNameMapper: { + '(.+)\\.js': '$1', + }, + extensionsToTreatAsEsm: ['.ts'], +}; diff --git a/packages/adapters/tronlink-evm/package.json b/packages/adapters/tronlink-evm/package.json new file mode 100644 index 0000000..12bee53 --- /dev/null +++ b/packages/adapters/tronlink-evm/package.json @@ -0,0 +1,54 @@ +{ + "name": "@tronweb3/tronwallet-adapter-tronlink-evm", + "version": "1.0.0", + "description": "Wallet adapter for TronLink wallet extension and app.", + "keywords": [ + "EVM", + "Ethereum Wallet", + "TronLink wallet" + ], + "author": "tronprotocol", + "repository": { + "type": "git", + "url": "https://github.com/tronprotocol/tronwallet-adapter" + }, + "license": "MIT", + "type": "module", + "sideEffects": false, + "engines": { + "node": ">=16", + "pnpm": ">=7" + }, + "main": "./lib/cjs/index.js", + "module": "./lib/esm/index.js", + "types": "./lib/types/index.d.ts", + "exports": { + "require": "./lib/cjs/index.js", + "import": "./lib/esm/index.js", + "types": "./lib/types/index.d.ts" + }, + "files": [ + "lib", + "src", + "LICENSE" + ], + "publishConfig": { + "access": "public" + }, + "scripts": { + "clean": "shx mkdir -p lib && shx rm -rf lib", + "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", + "test": "jest", + "test:coverage": "jest --coverage", + "build:umd": "node ../../../scripts/build-umd.js" + }, + "dependencies": { + "@tronweb3/abstract-adapter-evm": "workspace:^" + }, + "devDependencies": { + "@testing-library/dom": "^8.20.0", + "jest": "28", + "jest-environment-jsdom": "28", + "shx": "^0.3.4" + } +} diff --git a/packages/adapters/tronlink-evm/src/adapter.ts b/packages/adapters/tronlink-evm/src/adapter.ts new file mode 100644 index 0000000..9dc7b8e --- /dev/null +++ b/packages/adapters/tronlink-evm/src/adapter.ts @@ -0,0 +1,145 @@ +import type { AdapterName, Chain, EIP1193Provider, TypedData } from '@tronweb3/abstract-adapter-evm'; +import { + Adapter, + WalletReadyState, + WalletNotFoundError, + WalletConnectionError, + isInMobileBrowser, + WalletError, +} from '@tronweb3/abstract-adapter-evm'; +import { getTronLinkEvmProvider } from './utils.js'; + +declare global { + interface Window { + TronLinkEVM: EIP1193Provider; + } +} + +export const TronLinkEvmAdapterName = 'TronLinkEvm' as AdapterName<'TronLinkEvm'>; +export class TronLinkEvmAdapter extends Adapter { + name = TronLinkEvmAdapterName; + // @prettier-ignore + icon = + 'data:image/png;base64,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'; + url = 'https://www.tronlink.org/'; + readyState = WalletReadyState.Loading; + address: string | null = null; + connecting = false; + + constructor() { + super(); + const provider = getTronLinkEvmProvider(); + if (provider) { + this.readyState = WalletReadyState.Found; + this.listenEvents(provider); + this.autoConnect(provider); + } else { + this.getProvider().then((res) => { + if (res) { + this.readyState = WalletReadyState.Found; + this.listenEvents(res); + this.autoConnect(res); + } else { + this.readyState = WalletReadyState.NotFound; + } + this.emit('readyStateChanged', this.readyState); + }); + } + } + + async connect() { + this.connecting = true; + + const provider = await this.getProvider(); + if (!provider) { + throw new WalletNotFoundError(); + } + const accounts = await provider.request({ method: 'eth_requestAccounts' }); + if (!accounts.length) { + throw new WalletConnectionError('No accounts is avaliable.'); + } + this.address = accounts[0]; + this.connecting = false; + return this.address as string; + } + + async signTypedData(params: { typedData: TypedData; address?: string }): Promise { + throw new WalletError('[TronLinkEvm] The wallet does not support signTypedData() currently.'); + } + + async addChain(chainInfo: Chain): Promise { + throw new WalletError('[TronLinkEvm] The wallet does not support addChain() currently.'); + } + + private getProviderPromise: Promise | null = null; + async getProvider(): Promise { + if (isInMobileBrowser()) { + // Currently only extension support EVM + return null; + } + if (this.getProviderPromise !== null) { + return this.getProviderPromise; + } + this.getProviderPromise = new Promise((resolve) => { + const provider = getTronLinkEvmProvider(); + if (provider) { + return resolve(provider); + } + let handled = false; + let interval: null | ReturnType = null; + const handleEthereum = () => { + if (handled) { + return; + } + handled = true; + const provider = getTronLinkEvmProvider(); + if (provider) { + resolve(provider); + } else { + console.error('[TronLinkEvmAdapter]: Unable to detect window.TronLinkEVM.'); + resolve(null); + } + }; + interval = setInterval(() => { + const provider = getTronLinkEvmProvider(); + if (provider) { + handleEthereum(); + interval && clearInterval(interval); + } + }, 100); + setTimeout(() => { + interval && clearInterval(interval); + handleEthereum(); + }, 3000); + }); + return this.getProviderPromise; + } + private listenEvents(provider: EIP1193Provider) { + provider.on('connect', (connectInfo) => { + this.emit('connect', connectInfo); + }); + provider.on('disconnect', (error) => { + this.emit('disconnect', error); + }); + provider.on('accountsChanged', this.onAccountsChanged); + provider.on('chainChanged', (chainId) => { + this.emit('chainChanged', (chainId as any).chainId); + }); + } + private onAccountsChanged = (accounts: string[]) => { + if (accounts.length === 0) { + this.address = null; + } else { + this.address = accounts[0]; + } + this.emit('accountsChanged', accounts); + }; + private async autoConnect(provider: EIP1193Provider) { + setTimeout(() => { + this.address = (provider as any).selectedAddress || null; + if (this.address) { + this.emit('accountsChanged', [this.address]); + } + }, 200); + } +} diff --git a/packages/adapters/tronlink-evm/src/index.ts b/packages/adapters/tronlink-evm/src/index.ts new file mode 100644 index 0000000..ddec7b5 --- /dev/null +++ b/packages/adapters/tronlink-evm/src/index.ts @@ -0,0 +1 @@ +export * from './adapter.js'; diff --git a/packages/adapters/tronlink-evm/src/utils.ts b/packages/adapters/tronlink-evm/src/utils.ts new file mode 100644 index 0000000..ad0773e --- /dev/null +++ b/packages/adapters/tronlink-evm/src/utils.ts @@ -0,0 +1,8 @@ +import type { EIP1193Provider } from '@tronweb3/abstract-adapter-evm'; + +export function getTronLinkEvmProvider(): null | EIP1193Provider { + if (window.TronLinkEVM && (window.TronLinkEVM as any).isTronLink) { + return window.TronLinkEVM; + } + return null; +} diff --git a/packages/adapters/tronlink-evm/tests/units/adapter.test.ts b/packages/adapters/tronlink-evm/tests/units/adapter.test.ts new file mode 100644 index 0000000..4354f60 --- /dev/null +++ b/packages/adapters/tronlink-evm/tests/units/adapter.test.ts @@ -0,0 +1,14 @@ +import { TronLinkEvmAdapter } from '../../src/adapter.js'; + +describe('TronLinkEvmAdapter', () => { + test('base props should be valid', () => { + const adapter = new TronLinkEvmAdapter(); + expect(adapter.name).toEqual('TronLinkEvm'); + expect(adapter.url).toEqual('https://www.tronlink.org/'); + expect(adapter.readyState).toEqual('Loading'); + expect(adapter.address).toEqual(null); + expect(adapter.connected).toEqual(false); + jest.advanceTimersByTime(4000); + expect(adapter.readyState).toEqual('Loading'); + }); +}); diff --git a/packages/adapters/tronlink-evm/tsconfig.all.json b/packages/adapters/tronlink-evm/tsconfig.all.json new file mode 100644 index 0000000..2f57563 --- /dev/null +++ b/packages/adapters/tronlink-evm/tsconfig.all.json @@ -0,0 +1,14 @@ +{ + "extends": "../../../tsconfig.root.json", + "references": [ + { + "path": "../abstract-adapter/tsconfig.all.json" + }, + { + "path": "./tsconfig.cjs.json" + }, + { + "path": "./tsconfig.esm.json" + } + ] +} diff --git a/packages/adapters/tronlink-evm/tsconfig.cjs.json b/packages/adapters/tronlink-evm/tsconfig.cjs.json new file mode 100644 index 0000000..099b9aa --- /dev/null +++ b/packages/adapters/tronlink-evm/tsconfig.cjs.json @@ -0,0 +1,7 @@ +{ + "extends": "../../../tsconfig.cjs.json", + "include": ["src"], + "compilerOptions": { + "outDir": "lib/cjs" + } +} diff --git a/packages/adapters/tronlink-evm/tsconfig.esm.json b/packages/adapters/tronlink-evm/tsconfig.esm.json new file mode 100644 index 0000000..4900d2f --- /dev/null +++ b/packages/adapters/tronlink-evm/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "extends": "../../../tsconfig.esm.json", + "include": ["src"], + "compilerOptions": { + "outDir": "lib/esm", + "declarationDir": "lib/types" + } +} diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a5a5b9c..216b7d7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -73,22 +73,44 @@ importers: typedoc: 0.23.24_typescript@4.9.5 typescript: 4.9.5 + demos/cdn-demo: + specifiers: + '@tronweb3/abstract-adapter-evm': ^1.0.0 + '@tronweb3/tronwallet-abstract-adapter': ^1.1.5 + '@tronweb3/tronwallet-adapter-bitkeep': ^1.0.1 + '@tronweb3/tronwallet-adapter-ledger': ^1.1.7 + '@tronweb3/tronwallet-adapter-metamask': ^1.0.0 + '@tronweb3/tronwallet-adapter-okxwallet': ^1.0.1 + '@tronweb3/tronwallet-adapter-tokenpocket': ^1.0.1 + '@tronweb3/tronwallet-adapter-tronlink': ^1.1.8 + serve: ^14.2.1 + dependencies: + '@tronweb3/abstract-adapter-evm': link:../../packages/adapters/abstract-adapter-evm + '@tronweb3/tronwallet-abstract-adapter': link:../../packages/adapters/abstract-adapter + '@tronweb3/tronwallet-adapter-bitkeep': link:../../packages/adapters/bitkeep + '@tronweb3/tronwallet-adapter-ledger': link:../../packages/adapters/ledger + '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/tronlink-evm + '@tronweb3/tronwallet-adapter-okxwallet': link:../../packages/adapters/okxwallet + '@tronweb3/tronwallet-adapter-tokenpocket': link:../../packages/adapters/tokenpocket + '@tronweb3/tronwallet-adapter-tronlink': link:../../packages/adapters/tronlink + serve: 14.2.1 + demos/dev-demo: specifiers: '@emotion/react': ^11.10.4 '@emotion/styled': ^11.10.4 '@metamask/eth-sig-util': ^6.0.0 '@mui/material': ^5.10.10 - '@tronweb3/abstract-adapter-evm': latest - '@tronweb3/tronwallet-abstract-adapter': latest - '@tronweb3/tronwallet-adapter-bitkeep': latest - '@tronweb3/tronwallet-adapter-ledger': latest - '@tronweb3/tronwallet-adapter-metamask': latest - '@tronweb3/tronwallet-adapter-okxwallet': latest - '@tronweb3/tronwallet-adapter-react-hooks': latest - '@tronweb3/tronwallet-adapter-react-ui': latest - '@tronweb3/tronwallet-adapter-tokenpocket': latest - '@tronweb3/tronwallet-adapters': latest + '@tronweb3/abstract-adapter-evm': ^1.0.0 + '@tronweb3/tronwallet-abstract-adapter': ^1.1.0 + '@tronweb3/tronwallet-adapter-bitkeep': ^1.0.0 + '@tronweb3/tronwallet-adapter-ledger': ^1.1.2 + '@tronweb3/tronwallet-adapter-metamask': ^1.0.0 + '@tronweb3/tronwallet-adapter-okxwallet': ^1.0.0 + '@tronweb3/tronwallet-adapter-react-hooks': ^1.0.0 + '@tronweb3/tronwallet-adapter-react-ui': ^1.1.0 + '@tronweb3/tronwallet-adapter-tokenpocket': ^1.0.0 + '@tronweb3/tronwallet-adapters': ^1.1.2 '@types/react': ^18.0.26 '@types/react-dom': ^18.0.8 '@vitejs/plugin-legacy': ^2.3.0 @@ -112,7 +134,7 @@ importers: '@tronweb3/tronwallet-abstract-adapter': link:../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-bitkeep': link:../../packages/adapters/bitkeep '@tronweb3/tronwallet-adapter-ledger': link:../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/metamask + '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/tronlink-evm '@tronweb3/tronwallet-adapter-okxwallet': link:../../packages/adapters/okxwallet '@tronweb3/tronwallet-adapter-react-hooks': link:../../packages/react/react-hooks '@tronweb3/tronwallet-adapter-react-ui': link:../../packages/react/react-ui @@ -458,6 +480,21 @@ importers: jest-environment-jsdom: 29.4.2 shx: 0.3.4 + packages/adapters/tronlink-evm: + specifiers: + '@testing-library/dom': ^8.20.0 + '@tronweb3/abstract-adapter-evm': workspace:^ + jest: '28' + jest-environment-jsdom: '28' + shx: ^0.3.4 + dependencies: + '@tronweb3/abstract-adapter-evm': link:../abstract-adapter-evm + devDependencies: + '@testing-library/dom': 8.20.0 + jest: 28.1.3 + jest-environment-jsdom: 28.1.3 + shx: 0.3.4 + packages/adapters/walletconnect: specifiers: '@tronweb3/tronwallet-abstract-adapter': workspace:^ @@ -6918,6 +6955,10 @@ packages: /@xtuc/long/4.2.2: resolution: {integrity: sha512-NuHqBY1PB/D8xU6s/thBgOAiAP7HOYDQ32+BFZILJ8ivkUkAHQnWfn6WhL79Owj1qmUnoN/YPhktdIoucipkAQ==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/@xtuc/long/-/long-4.2.2.tgz} + /@zeit/schemas/2.29.0: + resolution: {integrity: sha512-g5QiLIfbg3pLuYUJPlisNKY+epQJTcMDsOnVNkscrDP1oi7vmJnzOANYJI/1pZcVJ6umUkBv3aFtlg1UvUHGzA==} + dev: false + /JSONStream/1.3.5: resolution: {integrity: sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==} hasBin: true @@ -7110,6 +7151,15 @@ packages: json-schema-traverse: 0.4.1 uri-js: 4.4.1 + /ajv/8.11.0: + resolution: {integrity: sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 + dev: false + /ajv/8.12.0: resolution: {integrity: sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==} dependencies: @@ -7118,6 +7168,12 @@ packages: require-from-string: 2.0.2 uri-js: 4.4.1 + /ansi-align/3.0.1: + resolution: {integrity: sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==} + dependencies: + string-width: 4.2.3 + dev: false + /ansi-colors/4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} engines: {node: '>=6'} @@ -7167,7 +7223,6 @@ packages: /ansi-styles/6.2.1: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - dev: true /anymatch/3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -7176,6 +7231,10 @@ packages: normalize-path: 3.0.0 picomatch: 2.3.1 + /arch/2.2.0: + resolution: {integrity: sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==} + dev: false + /arg/4.1.3: resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} @@ -7783,6 +7842,20 @@ packages: text-encoding-utf-8: 1.0.2 dev: false + /boxen/7.0.0: + resolution: {integrity: sha512-j//dBVuyacJbvW+tvZ9HuH03fZ46QcaKvvhZickZqtB271DxJ7SNRSNxrV/dZX0085m7hISRZWbzWlJvx/rHSg==} + engines: {node: '>=14.16'} + dependencies: + ansi-align: 3.0.1 + camelcase: 7.0.1 + chalk: 5.0.1 + cli-boxes: 3.0.0 + string-width: 5.1.2 + type-fest: 2.19.0 + widest-line: 4.0.1 + wrap-ansi: 8.1.0 + dev: false + /brace-expansion/1.1.11: resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==} dependencies: @@ -7985,6 +8058,11 @@ packages: resolution: {integrity: sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==} engines: {node: '>=10'} + /camelcase/7.0.1: + resolution: {integrity: sha512-xlx1yCK2Oc1APsPXDL2LdlNP6+uu8OCDdhOBSVT279M/S+y75O30C2VuD8T2ogdePBBl7PfPF4504tnLgX3zfw==} + engines: {node: '>=14.16'} + dev: false + /caniuse-api/3.0.0: resolution: {integrity: sha512-bsTwuIg/BZZK/vreVTYYbSWoe2F+71P7K5QGEX+pT250DZbfU1MQ5prOKpPR+LL6uWKK3KMwMCAS74QB3Um1uw==} dependencies: @@ -8020,6 +8098,13 @@ packages: type-detect: 4.0.8 dev: false + /chalk-template/0.4.0: + resolution: {integrity: sha512-/ghrgmhfY8RaSdeo43hNXxpoHAtxdbskUHjPpfqUWGttFgycUhYPGx3YZBCnUCvOa7Doivn1IZec3DEGFoMgLg==} + engines: {node: '>=12'} + dependencies: + chalk: 4.1.2 + dev: false + /chalk/2.4.2: resolution: {integrity: sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==} engines: {node: '>=4'} @@ -8042,6 +8127,11 @@ packages: ansi-styles: 4.3.0 supports-color: 7.2.0 + /chalk/5.0.1: + resolution: {integrity: sha512-Fo07WOYGqMfCWHOzSXOt2CxDbC6skS/jO9ynEcmpANMoPrD+W1r1K6Vx7iNm+AQmETU1Xr2t+n8nzkV9t6xh3w==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: false + /char-regex/1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -8108,6 +8198,11 @@ packages: engines: {node: '>=6'} dev: true + /cli-boxes/3.0.0: + resolution: {integrity: sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==} + engines: {node: '>=10'} + dev: false + /cli-cursor/3.1.0: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} @@ -8135,6 +8230,15 @@ packages: resolution: {integrity: sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==} dev: false + /clipboardy/3.0.0: + resolution: {integrity: sha512-Su+uU5sr1jkUy1sGRpLKjKrvEOVXgSgiSInwa/qeID6aJ07yh+5NWc3h2QfjHjBnfX4LhtFcuAWKUsJ3r+fjbg==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dependencies: + arch: 2.2.0 + execa: 5.1.1 + is-wsl: 2.2.0 + dev: false + /cliui/6.0.0: resolution: {integrity: sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==} dependencies: @@ -8299,6 +8403,11 @@ packages: engines: {node: '>=0.8'} dev: false + /content-disposition/0.5.2: + resolution: {integrity: sha512-kRGRZw3bLlFISDBgwTSA1TMBFN6J6GWDeubmDE3AF+3+yXL8hTWv8r5rkLbqYXY4RjPk/EzHnClI3zQf1cFmHA==} + engines: {node: '>= 0.6'} + dev: false + /content-disposition/0.5.4: resolution: {integrity: sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==} engines: {node: '>= 0.6'} @@ -8905,6 +9014,11 @@ packages: which-collection: 1.0.1 which-typed-array: 1.1.9 + /deep-extend/0.6.0: + resolution: {integrity: sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==} + engines: {node: '>=4.0.0'} + dev: false + /deep-is/0.1.4: resolution: {integrity: sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==} @@ -9204,7 +9318,6 @@ packages: /eastasianwidth/0.2.0: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} - dev: true /ee-first/1.1.1: resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} @@ -10443,6 +10556,12 @@ packages: resolution: {integrity: sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==} dev: false + /fast-url-parser/1.1.3: + resolution: {integrity: sha512-5jOCVXADYNuRkKFzNJ0dCCewsZiYo0dz8QNYljkOpFC6r2U4OBmKtvm/Tsuh4w1YYdDqDb31a8TVhBJ2OJKdqQ==} + dependencies: + punycode: 1.4.1 + dev: false + /fastest-levenshtein/1.0.16: resolution: {integrity: sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==} engines: {node: '>= 4.9.1'} @@ -11573,6 +11692,11 @@ packages: isobject: 3.0.1 dev: true + /is-port-reachable/4.0.0: + resolution: {integrity: sha512-9UoipoxYmSk6Xy7QFgRv2HDyaysmgSG75TFQs6S+3pDM7ZhKTF/bskZV+0UlABHzKjNVhPjYCLfeZUEg1wXxig==} + engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + dev: false + /is-potential-custom-element-name/1.0.1: resolution: {integrity: sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==} @@ -13910,7 +14034,7 @@ packages: dev: false /json-schema-traverse/0.4.1: - resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz} + resolution: {integrity: sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==} /json-schema-traverse/1.0.0: resolution: {integrity: sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==} @@ -14464,10 +14588,22 @@ packages: brorand: 1.1.0 dev: false + /mime-db/1.33.0: + resolution: {integrity: sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==} + engines: {node: '>= 0.6'} + dev: false + /mime-db/1.52.0: resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==} engines: {node: '>= 0.6'} + /mime-types/2.1.18: + resolution: {integrity: sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==} + engines: {node: '>= 0.6'} + dependencies: + mime-db: 1.33.0 + dev: false + /mime-types/2.1.35: resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==} engines: {node: '>= 0.6'} @@ -15089,6 +15225,10 @@ packages: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} engines: {node: '>=0.10.0'} + /path-is-inside/1.0.2: + resolution: {integrity: sha512-DUWJr3+ULp4zXmol/SZkFf3JGsS9/SIv+Y3Rt93/UjPpDpklB5f1er4O3POIbUuUJ3FXgqte2Q7SrU6zAqwk8w==} + dev: false + /path-key/3.1.1: resolution: {integrity: sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==} engines: {node: '>=8'} @@ -15105,6 +15245,10 @@ packages: resolution: {integrity: sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==} dev: false + /path-to-regexp/2.2.1: + resolution: {integrity: sha512-gu9bD6Ta5bwGrrU8muHzVOBFFREpp2iRkVfhBJahwJ6p6Xw20SjT0MxLnwkjOibQmGSYhiUnf2FLe7k+jcFmGQ==} + dev: false + /path-type/4.0.0: resolution: {integrity: sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==} engines: {node: '>=8'} @@ -16195,6 +16339,10 @@ packages: once: 1.4.0 dev: true + /punycode/1.4.1: + resolution: {integrity: sha512-jmYNElW7yvO7TV33CjSmvSiE2yco3bV2czu/OzDKdMNVZQWfxCblURLhf+47syQRBntjfLdd/H0egrzIG+oaFQ==} + dev: false + /punycode/2.3.0: resolution: {integrity: sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==} engines: {node: '>=6'} @@ -16299,6 +16447,11 @@ packages: safe-buffer: 5.2.1 dev: false + /range-parser/1.2.0: + resolution: {integrity: sha512-kA5WQoNVo4t9lNx2kQNFCxKeBl5IbbSNBl1M/tLkw9WCn+hxNBAW5Qh8gdhs63CJnhjJ2zQWFoqPJP2sK1AV5A==} + engines: {node: '>= 0.6'} + dev: false + /range-parser/1.2.1: resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} engines: {node: '>= 0.6'} @@ -16314,6 +16467,16 @@ packages: unpipe: 1.0.0 dev: false + /rc/1.2.8: + resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} + hasBin: true + dependencies: + deep-extend: 0.6.0 + ini: 1.3.8 + minimist: 1.2.8 + strip-json-comments: 2.0.1 + dev: false + /react-app-polyfill/3.0.0: resolution: {integrity: sha512-sZ41cxiU5llIB003yxxQBYrARBqe0repqPTTYBTmMqTz9szeBbE37BehCE891NZsmdZqqP+xWKdT3eo3vOzN8w==} engines: {node: '>=14'} @@ -16693,6 +16856,20 @@ packages: unicode-match-property-value-ecmascript: 2.1.0 dev: false + /registry-auth-token/3.3.2: + resolution: {integrity: sha512-JL39c60XlzCVgNrO+qq68FoNb56w/m7JYvGR2jT5iR1xBrUA3Mfx5Twk5rqTThPmQKMWydGmq8oFtDlxfrmxnQ==} + dependencies: + rc: 1.2.8 + safe-buffer: 5.2.1 + dev: false + + /registry-url/3.1.0: + resolution: {integrity: sha512-ZbgR5aZEdf4UKZVBPYIgaglBmSF2Hi94s2PcIHhRGFjKYu+chjJdYfHn4rt3hB6eCKLJ8giVIIfgMa1ehDfZKA==} + engines: {node: '>=0.10.0'} + dependencies: + rc: 1.2.8 + dev: false + /regjsparser/0.9.1: resolution: {integrity: sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ==} hasBin: true @@ -17112,6 +17289,19 @@ packages: dependencies: randombytes: 2.1.0 + /serve-handler/6.1.5: + resolution: {integrity: sha512-ijPFle6Hwe8zfmBxJdE+5fta53fdIY0lHISJvuikXB3VYFafRjMRpOffSPvCYsbKyBA7pvy9oYr/BT1O3EArlg==} + dependencies: + bytes: 3.0.0 + content-disposition: 0.5.2 + fast-url-parser: 1.1.3 + mime-types: 2.1.18 + minimatch: 3.1.2 + path-is-inside: 1.0.2 + path-to-regexp: 2.2.1 + range-parser: 1.2.0 + dev: false + /serve-index/1.9.1: resolution: {integrity: sha512-pXHfKNP4qujrtteMrSBb0rc8HJ9Ms/GrXwcUtUtD5s4ewDJI8bT3Cz2zTVRMKtri49pLx2e0Ya8ziP5Ya2pZZw==} engines: {node: '>= 0.8.0'} @@ -17139,6 +17329,26 @@ packages: - supports-color dev: false + /serve/14.2.1: + resolution: {integrity: sha512-48er5fzHh7GCShLnNyPBRPEjs2I6QBozeGr02gaacROiyS/8ARADlj595j39iZXAqBbJHH/ivJJyPRWY9sQWZA==} + engines: {node: '>= 14'} + hasBin: true + dependencies: + '@zeit/schemas': 2.29.0 + ajv: 8.11.0 + arg: 5.0.2 + boxen: 7.0.0 + chalk: 5.0.1 + chalk-template: 0.4.0 + clipboardy: 3.0.0 + compression: 1.7.4 + is-port-reachable: 4.0.0 + serve-handler: 6.1.5 + update-check: 1.5.4 + transitivePeerDependencies: + - supports-color + dev: false + /set-blocking/2.0.0: resolution: {integrity: sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==} @@ -17535,7 +17745,6 @@ packages: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 strip-ansi: 7.0.1 - dev: true /string.prototype.matchall/4.0.8: resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} @@ -17630,6 +17839,11 @@ packages: dependencies: min-indent: 1.0.1 + /strip-json-comments/2.0.1: + resolution: {integrity: sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==} + engines: {node: '>=0.10.0'} + dev: false + /strip-json-comments/3.1.1: resolution: {integrity: sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==} engines: {node: '>=8'} @@ -18253,6 +18467,11 @@ packages: engines: {node: '>=8'} dev: true + /type-fest/2.19.0: + resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} + engines: {node: '>=12.20'} + dev: false + /type-is/1.6.18: resolution: {integrity: sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==} engines: {node: '>= 0.6'} @@ -18380,8 +18599,15 @@ packages: escalade: 3.1.1 picocolors: 1.0.0 + /update-check/1.5.4: + resolution: {integrity: sha512-5YHsflzHP4t1G+8WGPlvKbJEbAJGCgw+Em+dGR1KmBUbr1J36SJBqlHLjR7oob7sco5hWHGQVcr9B2poIVDDTQ==} + dependencies: + registry-auth-token: 3.3.2 + registry-url: 3.1.0 + dev: false + /uri-js/4.4.1: - resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==, registry: https://registry.yarnpkg.com/, tarball: https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz} + resolution: {integrity: sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==} dependencies: punycode: 2.3.0 @@ -18970,6 +19196,13 @@ packages: dependencies: isexe: 2.0.0 + /widest-line/4.0.1: + resolution: {integrity: sha512-o0cyEG0e8GPzT4iGHphIOh0cJOV8fivsXxddQasHPHfoZf1ZexrfeA21w2NaEN1RHE+fXlfISmOE8R9N3u3Qig==} + engines: {node: '>=12'} + dependencies: + string-width: 5.1.2 + dev: false + /wildcard/2.0.1: resolution: {integrity: sha512-CC1bOL87PIWSBhDcTrdeLo6eGT7mCFtrg0uIJtqJUFyK+eJnzl8A1niH56uu7KMa5XFrtiV+AQuHO3n7DsHnLQ==} dev: true @@ -19161,6 +19394,15 @@ packages: string-width: 4.2.3 strip-ansi: 6.0.1 + /wrap-ansi/8.1.0: + resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} + engines: {node: '>=12'} + dependencies: + ansi-styles: 6.2.1 + string-width: 5.1.2 + strip-ansi: 7.0.1 + dev: false + /wrappy/1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} diff --git a/tsconfig.all.json b/tsconfig.all.json index 1173cd0..da2abf6 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -31,6 +31,9 @@ { "path": "./packages/adapters/metamask/tsconfig.all.json" }, + { + "path": "./packages/adapters/tronlink-evm/tsconfig.all.json" + }, { "path": "./packages/react/react-hooks/tsconfig.all.json" }, From d41d4e9ef210bead5d996368f3281177a0b01db3 Mon Sep 17 00:00:00 2001 From: Justin Zhu Date: Tue, 17 Oct 2023 10:06:08 +0800 Subject: [PATCH 03/13] fix(tronlink): fix disconnection error when first connection --- demos/dev-demo/src/TronLinkAdapterDemo.tsx | 2 +- packages/adapters/tronlink/src/adapter.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/dev-demo/src/TronLinkAdapterDemo.tsx b/demos/dev-demo/src/TronLinkAdapterDemo.tsx index 95d311e..eee7fd0 100644 --- a/demos/dev-demo/src/TronLinkAdapterDemo.tsx +++ b/demos/dev-demo/src/TronLinkAdapterDemo.tsx @@ -47,7 +47,7 @@ export function TronLinkAdapterDemo() { console.log(res); setChainId(res.chainId) }).catch(e => { - console.log(e) + console.error('network() error:',e) }) }); adapter.on('stateChanged', (state) => { diff --git a/packages/adapters/tronlink/src/adapter.ts b/packages/adapters/tronlink/src/adapter.ts index 43cf2ce..457f6fa 100644 --- a/packages/adapters/tronlink/src/adapter.ts +++ b/packages/adapters/tronlink/src/adapter.ts @@ -163,10 +163,10 @@ export class TronLinkAdapter extends Adapter { try { await this._checkWallet(); if (this.state !== AdapterState.Connected) throw new WalletDisconnectedError(); - const wallet = this._wallet; - if (!wallet || !wallet.tronWeb) throw new WalletDisconnectedError(); + const tronWeb = this._wallet?.tronWeb || window.tronWeb; + if (!tronWeb) throw new WalletDisconnectedError(); try { - return await getNetworkInfoByTronWeb(wallet.tronWeb); + return await getNetworkInfoByTronWeb(tronWeb); } catch (e: any) { throw new WalletGetNetworkError(e?.message, e); } From 684d10d9f687cd9e6d412fd9b0ae2bbaafefee32 Mon Sep 17 00:00:00 2001 From: Justin Zhu Date: Wed, 18 Oct 2023 09:58:34 +0800 Subject: [PATCH 04/13] chore: update rollup config --- demos/cdn-demo/README.md | 41 ++ demos/cdn-demo/adapters/index.html | 129 +++++ demos/cdn-demo/bitkeep/index.html | 6 +- demos/cdn-demo/ledger/events.umd.js | 489 ------------------- demos/cdn-demo/ledger/index.html | 13 +- demos/cdn-demo/metamask/index.html | 4 +- demos/cdn-demo/okxwallet/index.html | 8 +- demos/cdn-demo/package.json | 4 + demos/cdn-demo/tokenpocket/index.html | 5 +- demos/cdn-demo/tronlink-evm/index.html | 87 ++++ demos/cdn-demo/tronlink/index.html | 4 +- demos/cdn-demo/walletconnect/index.html | 113 +++++ package.json | 3 + packages/adapters/adapters/package.json | 3 +- packages/adapters/walletconnect/package.json | 3 +- pnpm-lock.yaml | 49 +- scripts/build-umd.js | 25 +- 17 files changed, 426 insertions(+), 560 deletions(-) create mode 100644 demos/cdn-demo/README.md create mode 100644 demos/cdn-demo/adapters/index.html delete mode 100644 demos/cdn-demo/ledger/events.umd.js create mode 100644 demos/cdn-demo/tronlink-evm/index.html create mode 100644 demos/cdn-demo/walletconnect/index.html diff --git a/demos/cdn-demo/README.md b/demos/cdn-demo/README.md new file mode 100644 index 0000000..558f3fe --- /dev/null +++ b/demos/cdn-demo/README.md @@ -0,0 +1,41 @@ +# TronWallet CND Demo +This project shows how to use Tronwallet Adapter with vanilla js. + +## Usage +1. Installation +First you should install the npm package to use the `umd` format file: +```bash +npm i @tronweb3/tronwallet-adapters +``` + +2. Add script in your HTML file +Put the script in your `head` tag: +```html + +``` + +**Note**: You should adjust the relative path according to the position of your HTML file. + +3. Get specified adapter +```js +const { TronLinkAdapter, BitKeepAdapter, WalletConnectAdapter, OkxWalletAdapter } = window['@tronweb3/tronwallet-adapters']; +const tronlinkAdapter = new TronLinkAdapter({ + openTronLinkAppOnMobile: true, + openUrlWhenWalletNotFound: false, + checkTimeout: 3000, +}); +``` + +Please refer [here](https://developers.tron.network/docs/tronwallet-adapter) for more detailed documentation. + +## WalletConnectAdapter +If you want to use `WalletConnectAdapter`, you should install another dependency in addition: +```bash +npm i @walletconnect/sign-client +``` + +And add a script tag for `@walletconnect/sign-client`: +```diff ++ + +``` \ No newline at end of file diff --git a/demos/cdn-demo/adapters/index.html b/demos/cdn-demo/adapters/index.html new file mode 100644 index 0000000..06a52fc --- /dev/null +++ b/demos/cdn-demo/adapters/index.html @@ -0,0 +1,129 @@ + + + + + + Adapters Test Demo + + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/bitkeep/index.html b/demos/cdn-demo/bitkeep/index.html index d86cdb8..eac9ae2 100644 --- a/demos/cdn-demo/bitkeep/index.html +++ b/demos/cdn-demo/bitkeep/index.html @@ -4,10 +4,6 @@ BitkeepAdapter Test Demo - - - - @@ -23,7 +19,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { BitKeepAdapter } = window.TronwalletAdapterBitkeep; + const { BitKeepAdapter } = window['@tronweb3/tronwallet-adapter-bitkeep']; const adapter = new BitKeepAdapter({ openTronLinkAppOnMobile: true, openUrlWhenWalletNotFound: false, diff --git a/demos/cdn-demo/ledger/events.umd.js b/demos/cdn-demo/ledger/events.umd.js deleted file mode 100644 index 0081d2e..0000000 --- a/demos/cdn-demo/ledger/events.umd.js +++ /dev/null @@ -1,489 +0,0 @@ -(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : - typeof define === 'function' && define.amd ? define(factory) : - (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.EventEmitter = factory()); -})(this, (function () { 'use strict'; - - function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; - } - - var R = typeof Reflect === 'object' ? Reflect : null; - var ReflectApply = R && typeof R.apply === 'function' - ? R.apply - : function ReflectApply(target, receiver, args) { - return Function.prototype.apply.call(target, receiver, args); - }; - - var ReflectOwnKeys; - if (R && typeof R.ownKeys === 'function') { - ReflectOwnKeys = R.ownKeys; - } else if (Object.getOwnPropertySymbols) { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target) - .concat(Object.getOwnPropertySymbols(target)); - }; - } else { - ReflectOwnKeys = function ReflectOwnKeys(target) { - return Object.getOwnPropertyNames(target); - }; - } - - function ProcessEmitWarning(warning) { - if (console && console.warn) console.warn(warning); - } - - var NumberIsNaN = Number.isNaN || function NumberIsNaN(value) { - return value !== value; - }; - - function EventEmitter() { - EventEmitter.init.call(this); - } - EventEmitter.once = once; - var events = EventEmitter; - - // Backwards-compat with node 0.10.x - EventEmitter.EventEmitter = EventEmitter; - - EventEmitter.prototype._events = undefined; - EventEmitter.prototype._eventsCount = 0; - EventEmitter.prototype._maxListeners = undefined; - - // By default EventEmitters will print a warning if more than 10 listeners are - // added to it. This is a useful default which helps finding memory leaks. - var defaultMaxListeners = 10; - - function checkListener(listener) { - if (typeof listener !== 'function') { - throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener); - } - } - - Object.defineProperty(EventEmitter, 'defaultMaxListeners', { - enumerable: true, - get: function() { - return defaultMaxListeners; - }, - set: function(arg) { - if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) { - throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + '.'); - } - defaultMaxListeners = arg; - } - }); - - EventEmitter.init = function() { - - if (this._events === undefined || - this._events === Object.getPrototypeOf(this)._events) { - this._events = Object.create(null); - this._eventsCount = 0; - } - - this._maxListeners = this._maxListeners || undefined; - }; - - // Obviously not all Emitters should be limited to 10. This function allows - // that to be increased. Set to zero for unlimited. - EventEmitter.prototype.setMaxListeners = function setMaxListeners(n) { - if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) { - throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n + '.'); - } - this._maxListeners = n; - return this; - }; - - function _getMaxListeners(that) { - if (that._maxListeners === undefined) - return EventEmitter.defaultMaxListeners; - return that._maxListeners; - } - - EventEmitter.prototype.getMaxListeners = function getMaxListeners() { - return _getMaxListeners(this); - }; - - EventEmitter.prototype.emit = function emit(type) { - var args = []; - for (var i = 1; i < arguments.length; i++) args.push(arguments[i]); - var doError = (type === 'error'); - - var events = this._events; - if (events !== undefined) - doError = (doError && events.error === undefined); - else if (!doError) - return false; - - // If there is no 'error' event listener then throw. - if (doError) { - var er; - if (args.length > 0) - er = args[0]; - if (er instanceof Error) { - // Note: The comments on the `throw` lines are intentional, they show - // up in Node's output if this results in an unhandled exception. - throw er; // Unhandled 'error' event - } - // At least give some kind of context to the user - var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : '')); - err.context = er; - throw err; // Unhandled 'error' event - } - - var handler = events[type]; - - if (handler === undefined) - return false; - - if (typeof handler === 'function') { - ReflectApply(handler, this, args); - } else { - var len = handler.length; - var listeners = arrayClone(handler, len); - for (var i = 0; i < len; ++i) - ReflectApply(listeners[i], this, args); - } - - return true; - }; - - function _addListener(target, type, listener, prepend) { - var m; - var events; - var existing; - - checkListener(listener); - - events = target._events; - if (events === undefined) { - events = target._events = Object.create(null); - target._eventsCount = 0; - } else { - // To avoid recursion in the case that type === "newListener"! Before - // adding it to the listeners, first emit "newListener". - if (events.newListener !== undefined) { - target.emit('newListener', type, - listener.listener ? listener.listener : listener); - - // Re-assign `events` because a newListener handler could have caused the - // this._events to be assigned to a new object - events = target._events; - } - existing = events[type]; - } - - if (existing === undefined) { - // Optimize the case of one listener. Don't need the extra array object. - existing = events[type] = listener; - ++target._eventsCount; - } else { - if (typeof existing === 'function') { - // Adding the second element, need to change to array. - existing = events[type] = - prepend ? [listener, existing] : [existing, listener]; - // If we've already got an array, just append. - } else if (prepend) { - existing.unshift(listener); - } else { - existing.push(listener); - } - - // Check for listener leak - m = _getMaxListeners(target); - if (m > 0 && existing.length > m && !existing.warned) { - existing.warned = true; - // No error code for this since it is a Warning - // eslint-disable-next-line no-restricted-syntax - var w = new Error('Possible EventEmitter memory leak detected. ' + - existing.length + ' ' + String(type) + ' listeners ' + - 'added. Use emitter.setMaxListeners() to ' + - 'increase limit'); - w.name = 'MaxListenersExceededWarning'; - w.emitter = target; - w.type = type; - w.count = existing.length; - ProcessEmitWarning(w); - } - } - - return target; - } - - EventEmitter.prototype.addListener = function addListener(type, listener) { - return _addListener(this, type, listener, false); - }; - - EventEmitter.prototype.on = EventEmitter.prototype.addListener; - - EventEmitter.prototype.prependListener = - function prependListener(type, listener) { - return _addListener(this, type, listener, true); - }; - - function onceWrapper() { - if (!this.fired) { - this.target.removeListener(this.type, this.wrapFn); - this.fired = true; - if (arguments.length === 0) - return this.listener.call(this.target); - return this.listener.apply(this.target, arguments); - } - } - - function _onceWrap(target, type, listener) { - var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener }; - var wrapped = onceWrapper.bind(state); - wrapped.listener = listener; - state.wrapFn = wrapped; - return wrapped; - } - - EventEmitter.prototype.once = function once(type, listener) { - checkListener(listener); - this.on(type, _onceWrap(this, type, listener)); - return this; - }; - - EventEmitter.prototype.prependOnceListener = - function prependOnceListener(type, listener) { - checkListener(listener); - this.prependListener(type, _onceWrap(this, type, listener)); - return this; - }; - - // Emits a 'removeListener' event if and only if the listener was removed. - EventEmitter.prototype.removeListener = - function removeListener(type, listener) { - var list, events, position, i, originalListener; - - checkListener(listener); - - events = this._events; - if (events === undefined) - return this; - - list = events[type]; - if (list === undefined) - return this; - - if (list === listener || list.listener === listener) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else { - delete events[type]; - if (events.removeListener) - this.emit('removeListener', type, list.listener || listener); - } - } else if (typeof list !== 'function') { - position = -1; - - for (i = list.length - 1; i >= 0; i--) { - if (list[i] === listener || list[i].listener === listener) { - originalListener = list[i].listener; - position = i; - break; - } - } - - if (position < 0) - return this; - - if (position === 0) - list.shift(); - else { - spliceOne(list, position); - } - - if (list.length === 1) - events[type] = list[0]; - - if (events.removeListener !== undefined) - this.emit('removeListener', type, originalListener || listener); - } - - return this; - }; - - EventEmitter.prototype.off = EventEmitter.prototype.removeListener; - - EventEmitter.prototype.removeAllListeners = - function removeAllListeners(type) { - var listeners, events, i; - - events = this._events; - if (events === undefined) - return this; - - // not listening for removeListener, no need to emit - if (events.removeListener === undefined) { - if (arguments.length === 0) { - this._events = Object.create(null); - this._eventsCount = 0; - } else if (events[type] !== undefined) { - if (--this._eventsCount === 0) - this._events = Object.create(null); - else - delete events[type]; - } - return this; - } - - // emit removeListener for all listeners on all events - if (arguments.length === 0) { - var keys = Object.keys(events); - var key; - for (i = 0; i < keys.length; ++i) { - key = keys[i]; - if (key === 'removeListener') continue; - this.removeAllListeners(key); - } - this.removeAllListeners('removeListener'); - this._events = Object.create(null); - this._eventsCount = 0; - return this; - } - - listeners = events[type]; - - if (typeof listeners === 'function') { - this.removeListener(type, listeners); - } else if (listeners !== undefined) { - // LIFO order - for (i = listeners.length - 1; i >= 0; i--) { - this.removeListener(type, listeners[i]); - } - } - - return this; - }; - - function _listeners(target, type, unwrap) { - var events = target._events; - - if (events === undefined) - return []; - - var evlistener = events[type]; - if (evlistener === undefined) - return []; - - if (typeof evlistener === 'function') - return unwrap ? [evlistener.listener || evlistener] : [evlistener]; - - return unwrap ? - unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length); - } - - EventEmitter.prototype.listeners = function listeners(type) { - return _listeners(this, type, true); - }; - - EventEmitter.prototype.rawListeners = function rawListeners(type) { - return _listeners(this, type, false); - }; - - EventEmitter.listenerCount = function(emitter, type) { - if (typeof emitter.listenerCount === 'function') { - return emitter.listenerCount(type); - } else { - return listenerCount.call(emitter, type); - } - }; - - EventEmitter.prototype.listenerCount = listenerCount; - function listenerCount(type) { - var events = this._events; - - if (events !== undefined) { - var evlistener = events[type]; - - if (typeof evlistener === 'function') { - return 1; - } else if (evlistener !== undefined) { - return evlistener.length; - } - } - - return 0; - } - - EventEmitter.prototype.eventNames = function eventNames() { - return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : []; - }; - - function arrayClone(arr, n) { - var copy = new Array(n); - for (var i = 0; i < n; ++i) - copy[i] = arr[i]; - return copy; - } - - function spliceOne(list, index) { - for (; index + 1 < list.length; index++) - list[index] = list[index + 1]; - list.pop(); - } - - function unwrapListeners(arr) { - var ret = new Array(arr.length); - for (var i = 0; i < ret.length; ++i) { - ret[i] = arr[i].listener || arr[i]; - } - return ret; - } - - function once(emitter, name) { - return new Promise(function (resolve, reject) { - function errorListener(err) { - emitter.removeListener(name, resolver); - reject(err); - } - - function resolver() { - if (typeof emitter.removeListener === 'function') { - emitter.removeListener('error', errorListener); - } - resolve([].slice.call(arguments)); - } - eventTargetAgnosticAddListener(emitter, name, resolver, { once: true }); - if (name !== 'error') { - addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true }); - } - }); - } - - function addErrorHandlerIfEventEmitter(emitter, handler, flags) { - if (typeof emitter.on === 'function') { - eventTargetAgnosticAddListener(emitter, 'error', handler, flags); - } - } - - function eventTargetAgnosticAddListener(emitter, name, listener, flags) { - if (typeof emitter.on === 'function') { - if (flags.once) { - emitter.once(name, listener); - } else { - emitter.on(name, listener); - } - } else if (typeof emitter.addEventListener === 'function') { - // EventTarget does not have `error` event semantics like Node - // EventEmitters, we do not listen for `error` events here. - emitter.addEventListener(name, function wrapListener(arg) { - // IE does not have builtin `{ once: true }` support so we - // have to do it manually. - if (flags.once) { - emitter.removeEventListener(name, wrapListener); - } - listener(arg); - }); - } else { - throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter); - } - } - - var events$1 = /*@__PURE__*/getDefaultExportFromCjs(events); - - return events$1; - -})); diff --git a/demos/cdn-demo/ledger/index.html b/demos/cdn-demo/ledger/index.html index 2a0f2e4..cbeca4c 100644 --- a/demos/cdn-demo/ledger/index.html +++ b/demos/cdn-demo/ledger/index.html @@ -4,17 +4,6 @@ LedgerAdapter Test Demo - - - - - - - - - @@ -30,7 +19,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { LedgerAdapter } = window.TronwalletAdapterLedger; + const { LedgerAdapter } = window['@tronweb3/tronwallet-adapter-ledger']; const adapter = new LedgerAdapter({ openTronLinkAppOnMobile: true, openUrlWhenWalletNotFound: false, diff --git a/demos/cdn-demo/metamask/index.html b/demos/cdn-demo/metamask/index.html index d4a7db0..0244428 100644 --- a/demos/cdn-demo/metamask/index.html +++ b/demos/cdn-demo/metamask/index.html @@ -4,8 +4,6 @@ MetamaskAdapter Test Demo - - @@ -21,7 +19,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { MetaMaskAdapter } = window.TronwalletAdapterMetamask; + const { MetaMaskAdapter } = window['@tronweb3/tronwallet-adapter-metamask']; console.log(); const adapter = new MetaMaskAdapter(); diff --git a/demos/cdn-demo/okxwallet/index.html b/demos/cdn-demo/okxwallet/index.html index a540181..86eb152 100644 --- a/demos/cdn-demo/okxwallet/index.html +++ b/demos/cdn-demo/okxwallet/index.html @@ -4,11 +4,7 @@ OkxwalletAdapter Test Demo - - - - - + @@ -24,7 +20,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { OkxWalletAdapter } = window.TronwalletAdapterOkxwallet; + const { OkxWalletAdapter } = window['@tronweb3/tronwallet-adapter-okxwallet']; const adapter = new OkxWalletAdapter({ openTronLinkAppOnMobile: true, openUrlWhenWalletNotFound: false, diff --git a/demos/cdn-demo/package.json b/demos/cdn-demo/package.json index 3bbb8a3..20d28a0 100644 --- a/demos/cdn-demo/package.json +++ b/demos/cdn-demo/package.json @@ -15,6 +15,10 @@ "@tronweb3/tronwallet-adapter-okxwallet": "^1.0.1", "@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.1", "@tronweb3/tronwallet-adapter-tronlink": "^1.1.8", + "@tronweb3/tronwallet-adapter-tronlink-evm": "^1.0.0", + "@tronweb3/tronwallet-adapter-walletconnect": "^1.0.4", + "@tronweb3/tronwallet-adapters": "^1.1.8", + "@walletconnect/sign-client": "^2.1.4", "serve": "^14.2.1" } } diff --git a/demos/cdn-demo/tokenpocket/index.html b/demos/cdn-demo/tokenpocket/index.html index 024bd13..b1136a9 100644 --- a/demos/cdn-demo/tokenpocket/index.html +++ b/demos/cdn-demo/tokenpocket/index.html @@ -4,9 +4,6 @@ TokenPocketAdapter Test Demo - - - @@ -22,7 +19,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { TokenPocketAdapter } = window.TronwalletAdapterTokenpocket; + const { TokenPocketAdapter } = window['@tronweb3/tronwallet-adapter-tokenpocket']; const adapter = new TokenPocketAdapter({ openTronLinkAppOnMobile: true, openUrlWhenWalletNotFound: false, diff --git a/demos/cdn-demo/tronlink-evm/index.html b/demos/cdn-demo/tronlink-evm/index.html new file mode 100644 index 0000000..45957e2 --- /dev/null +++ b/demos/cdn-demo/tronlink-evm/index.html @@ -0,0 +1,87 @@ + + + + + + MetamaskAdapter Test Demo + + + +
+ + + + +
+ + + diff --git a/demos/cdn-demo/tronlink/index.html b/demos/cdn-demo/tronlink/index.html index 45f2160..fd0fd72 100644 --- a/demos/cdn-demo/tronlink/index.html +++ b/demos/cdn-demo/tronlink/index.html @@ -4,8 +4,6 @@ TronLinkAdapter Test Demo - - @@ -21,7 +19,7 @@ }; let address; const receiver = 'TMDKznuDWaZwfZHcM61FVFstyYNmK6Njk1'; - const { TronLinkAdapter } = window.TronwalletAdapterTronlink; + const { TronLinkAdapter } = window['@tronweb3/tronwallet-adapter-tronlink']; const adapter = new TronLinkAdapter({ openTronLinkAppOnMobile: true, openUrlWhenWalletNotFound: false, diff --git a/demos/cdn-demo/walletconnect/index.html b/demos/cdn-demo/walletconnect/index.html new file mode 100644 index 0000000..3134de0 --- /dev/null +++ b/demos/cdn-demo/walletconnect/index.html @@ -0,0 +1,113 @@ + + + + + + TokenPocketAdapter Test Demo + + + + +
+ + + + +
+ + + diff --git a/package.json b/package.json index 1e96061..60a775c 100644 --- a/package.json +++ b/package.json @@ -91,5 +91,8 @@ "extends": [ "@commitlint/config-conventional" ] + }, + "dependencies": { + "rollup-plugin-polyfill-node": "^0.11.0" } } diff --git a/packages/adapters/adapters/package.json b/packages/adapters/adapters/package.json index e04a9f5..ebac87c 100644 --- a/packages/adapters/adapters/package.json +++ b/packages/adapters/adapters/package.json @@ -37,7 +37,8 @@ }, "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", - "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json" + "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-adapter-bitkeep": "workspace:^", diff --git a/packages/adapters/walletconnect/package.json b/packages/adapters/walletconnect/package.json index 41eb60f..e498a76 100644 --- a/packages/adapters/walletconnect/package.json +++ b/packages/adapters/walletconnect/package.json @@ -37,7 +37,8 @@ }, "scripts": { "clean": "shx mkdir -p lib && shx rm -rf lib", - "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json" + "package": "shx echo '{ \"type\": \"commonjs\" }' > lib/cjs/package.json", + "build:umd": "node ../../../scripts/build-umd.js" }, "dependencies": { "@tronweb3/tronwallet-abstract-adapter": "workspace:^", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 216b7d7..97d3239 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -36,10 +36,13 @@ importers: pnpm: ^7.12.1 prettier: 2.7.1 rollup: ^4.0.2 + rollup-plugin-polyfill-node: ^0.11.0 shx: ^0.3.4 ts-jest: ^29.0.3 typedoc: ^0.23.15 typescript: ^4.8.3 + dependencies: + rollup-plugin-polyfill-node: 0.11.0_rollup@4.0.2 devDependencies: '@changesets/cli': 2.26.0 '@commitlint/cli': 17.4.2 @@ -89,7 +92,7 @@ importers: '@tronweb3/tronwallet-abstract-adapter': link:../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-bitkeep': link:../../packages/adapters/bitkeep '@tronweb3/tronwallet-adapter-ledger': link:../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/tronlink-evm + '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/metamask '@tronweb3/tronwallet-adapter-okxwallet': link:../../packages/adapters/okxwallet '@tronweb3/tronwallet-adapter-tokenpocket': link:../../packages/adapters/tokenpocket '@tronweb3/tronwallet-adapter-tronlink': link:../../packages/adapters/tronlink @@ -110,6 +113,7 @@ importers: '@tronweb3/tronwallet-adapter-react-hooks': ^1.0.0 '@tronweb3/tronwallet-adapter-react-ui': ^1.1.0 '@tronweb3/tronwallet-adapter-tokenpocket': ^1.0.0 + '@tronweb3/tronwallet-adapter-tronlink-evm': ^1.0.0 '@tronweb3/tronwallet-adapters': ^1.1.2 '@types/react': ^18.0.26 '@types/react-dom': ^18.0.8 @@ -134,11 +138,12 @@ importers: '@tronweb3/tronwallet-abstract-adapter': link:../../packages/adapters/abstract-adapter '@tronweb3/tronwallet-adapter-bitkeep': link:../../packages/adapters/bitkeep '@tronweb3/tronwallet-adapter-ledger': link:../../packages/adapters/ledger - '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/tronlink-evm + '@tronweb3/tronwallet-adapter-metamask': link:../../packages/adapters/metamask '@tronweb3/tronwallet-adapter-okxwallet': link:../../packages/adapters/okxwallet '@tronweb3/tronwallet-adapter-react-hooks': link:../../packages/react/react-hooks '@tronweb3/tronwallet-adapter-react-ui': link:../../packages/react/react-ui '@tronweb3/tronwallet-adapter-tokenpocket': link:../../packages/adapters/tokenpocket + '@tronweb3/tronwallet-adapter-tronlink-evm': link:../../packages/adapters/tronlink-evm '@tronweb3/tronwallet-adapters': link:../../packages/adapters/adapters events: 3.3.0 ganache: 7.9.0 @@ -4889,6 +4894,21 @@ packages: magic-string: 0.27.0 dev: true + /@rollup/plugin-inject/5.0.3_rollup@4.0.2: + resolution: {integrity: sha512-411QlbL+z2yXpRWFXSmw/teQRMkXcAAC8aYTemc15gwJRpvEVDQwoe+N/HTFD8RFG8+88Bme9DK2V9CVm7hJdA==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.2_rollup@4.0.2 + estree-walker: 2.0.2 + magic-string: 0.27.0 + rollup: 4.0.2 + dev: false + /@rollup/plugin-json/6.0.1_rollup@4.0.2: resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} engines: {node: '>=14.0.0'} @@ -4999,14 +5019,12 @@ packages: estree-walker: 2.0.2 picomatch: 2.3.1 rollup: 4.0.2 - dev: true /@rollup/rollup-android-arm-eabi/4.0.2: resolution: {integrity: sha512-xDvk1pT4vaPU2BOLy0MqHMdYZyntqpaBf8RhBiezlqG9OjY8F50TyctHo8znigYKd+QCFhCmlmXHOL/LoaOl3w==} cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@rollup/rollup-android-arm64/4.0.2: @@ -5014,7 +5032,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@rollup/rollup-darwin-arm64/4.0.2: @@ -5022,7 +5039,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@rollup/rollup-darwin-x64/4.0.2: @@ -5030,7 +5046,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm-gnueabihf/4.0.2: @@ -5038,7 +5053,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm64-gnu/4.0.2: @@ -5046,7 +5060,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-arm64-musl/4.0.2: @@ -5054,7 +5067,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-x64-gnu/4.0.2: @@ -5062,7 +5074,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-linux-x64-musl/4.0.2: @@ -5070,7 +5081,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-arm64-msvc/4.0.2: @@ -5078,7 +5088,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-ia32-msvc/4.0.2: @@ -5086,7 +5095,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@rollup/rollup-win32-x64-msvc/4.0.2: @@ -5094,7 +5102,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@rushstack/eslint-patch/1.2.0: @@ -10259,7 +10266,6 @@ packages: /estree-walker/2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} - dev: true /esutils/2.0.3: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} @@ -14459,7 +14465,6 @@ packages: engines: {node: '>=12'} dependencies: '@jridgewell/sourcemap-codec': 1.4.14 - dev: true /make-dir/3.1.0: resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==} @@ -17012,6 +17017,15 @@ packages: '@rollup/plugin-inject': 5.0.3 dev: true + /rollup-plugin-polyfill-node/0.11.0_rollup@4.0.2: + resolution: {integrity: sha512-5t+qhq4LAQKQBgbPOQJEoxxGzU5b+zLfvzpUAGy9u0MCMs8y+mrjUAv8+xrkWdxnwXQwJtjmCMnA9lCflsMzNw==} + peerDependencies: + rollup: ^1.20.0 || ^2.0.0 || ^3.0.0 + dependencies: + '@rollup/plugin-inject': 5.0.3_rollup@4.0.2 + rollup: 4.0.2 + dev: false + /rollup-plugin-terser/7.0.2_rollup@2.79.1: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser @@ -17058,7 +17072,6 @@ packages: '@rollup/rollup-win32-ia32-msvc': 4.0.2 '@rollup/rollup-win32-x64-msvc': 4.0.2 fsevents: 2.3.2 - dev: true /rpc-websockets/7.5.1: resolution: {integrity: sha512-kGFkeTsmd37pHPMaHIgN1LVKXMi0JD782v4Ds9ZKtLlwdTKjn+CxM9A9/gLT2LaOuEcEFGL98h1QWQtlOIdW0w==} diff --git a/scripts/build-umd.js b/scripts/build-umd.js index 3c6a76c..baa7e7e 100644 --- a/scripts/build-umd.js +++ b/scripts/build-umd.js @@ -5,34 +5,23 @@ const nodeResolve = require('@rollup/plugin-node-resolve'); const commonjs = require('@rollup/plugin-commonjs'); const terser = require('@rollup/plugin-terser'); const json = require('@rollup/plugin-json'); +const nodePolyfills = require('rollup-plugin-polyfill-node'); + const { cwd } = require('process'); const { resolve } = require('path'); const inputOptions = { input: './lib/cjs/index.js', - plugins: [commonjs(), nodeResolve(), json()], - external: [ - 'eventemitter3', - 'buffer', - 'events', - 'react', - 'react-dom', - '@tronweb3/tronwallet-abstract-adapter', - '@tronweb3/tronwallet-adapter-tronlink', - ], + plugins: [commonjs(), nodeResolve(), json(), nodePolyfills()], + external: ['@walletconnect/sign-client'], }; const commonOptions = { format: 'umd', name: getOutputName(), globals: { - buffer: 'buffer.Buffer', - events: 'EventEmitter', - eventemitter3: 'EventEmitter3', - react: 'React', - 'react-dom': 'ReactDOM', - '@tronweb3/tronwallet-abstract-adapter': 'TronwalletAbstractAdapter', - '@tronweb3/tronwallet-adapter-tronlink': 'TronwalletAdapterTronlink', + '@walletconnect/sign-client': '@walletconnect/sign-client', }, + inlineDynamicImports: true, }; const outputOptionsList = [ { @@ -71,7 +60,7 @@ async function generateOutputs(bundle) { function getOutputName() { const packageJson = require(resolve(cwd(), 'package.json')); - const name = packageJson.name.split('/')[1].replaceAll(/(?:^|-)([a-z])/g, ($0, $1) => $1.toUpperCase()); + const name = packageJson.name; console.log('[build:umd] current name: ' + name); return name; } From 6cf7c2384f3dda74c345666117135e6e166c9311 Mon Sep 17 00:00:00 2001 From: kean Date: Wed, 18 Oct 2023 16:33:06 +0800 Subject: [PATCH 05/13] feat: upgraded bitKeepWallet --- packages/adapters/bitkeep/package.json | 1 + packages/adapters/bitkeep/src/adapter.ts | 37 ++++++++++++++---------- packages/adapters/bitkeep/src/utils.ts | 6 ++-- 3 files changed, 26 insertions(+), 18 deletions(-) diff --git a/packages/adapters/bitkeep/package.json b/packages/adapters/bitkeep/package.json index a5cd4c3..e4f3536 100644 --- a/packages/adapters/bitkeep/package.json +++ b/packages/adapters/bitkeep/package.json @@ -41,6 +41,7 @@ "test": "jest" }, "dependencies": { + "@bitget-wallet/web3-sdk": "^0.0.8", "@tronweb3/tronwallet-abstract-adapter": "workspace:^", "@tronweb3/tronwallet-adapter-tronlink": "workspace:^" }, diff --git a/packages/adapters/bitkeep/src/adapter.ts b/packages/adapters/bitkeep/src/adapter.ts index 59431f1..fda240e 100644 --- a/packages/adapters/bitkeep/src/adapter.ts +++ b/packages/adapters/bitkeep/src/adapter.ts @@ -12,6 +12,7 @@ import { isInMobileBrowser, } from '@tronweb3/tronwallet-abstract-adapter'; import { getNetworkInfoByTronWeb } from '@tronweb3/tronwallet-adapter-tronlink'; +import { WalletInfo, TronLinkAdapter } from '@bitget-wallet/web3-sdk'; import type { TronLinkWallet } from '@tronweb3/tronwallet-adapter-tronlink'; import type { Transaction, @@ -20,7 +21,7 @@ import type { BaseAdapterConfig, Network, } from '@tronweb3/tronwallet-abstract-adapter'; -import { openBitKeep, supportBitKeep } from './utils.js'; +import { openBitgetWallet, supportBitgetWallet } from './utils.js'; import type { TronWeb } from '@tronweb3/tronwallet-adapter-tronlink'; declare global { @@ -33,25 +34,28 @@ declare global { } export interface BitKeepAdapterConfig extends BaseAdapterConfig { /** - * Timeout in millisecond for checking if BitKeep is supported. + * Timeout in millisecond for checking if Bitget Wallet is supported. * Default is 2 * 1000ms */ checkTimeout?: number; /** - * Set if open BitKeep app using DeepLink. + * Set if open Wallet's website url when wallet is not installed. + * Default is true. + */ + openUrlWhenWalletNotFound?: boolean; + /** + * Set if open Bitget Wallet app using DeepLink. * Default is true. */ openAppWithDeeplink?: boolean; } -export const BitKeepAdapterName = 'BitKeep' as AdapterName<'BitKeep'>; +export const BitgetWalletAdapterName = WalletInfo?.name as AdapterName<'Bitget Wallet'>; export class BitKeepAdapter extends Adapter { - name = BitKeepAdapterName; - url = 'https://bitkeep.com'; - icon = - 'data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTI4IiBoZWlnaHQ9IjEyOCIgdmlld0JveD0iMCAwIDEyOCAxMjgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSIxMjgiIGhlaWdodD0iMTI4IiByeD0iNjQiIGZpbGw9IiM3NTI0RjkiLz4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xMDIgNDUuNjAyN1Y0OS44MjA0QzEwMi4wMDEgNTAuMjI4MyAxMDEuODkzIDUwLjYyOTIgMTAxLjY4NyA1MC45ODI3QzEwMS40ODEgNTEuMzM2MSAxMDEuMTg1IDUxLjYyOTYgMTAwLjgyOCA1MS44MzM1TDg3LjA5MDggNTkuNjgwMUw5OS4zNjMzIDY2LjY3MUMxMDAuMTY1IDY3LjEyOTUgMTAwLjgzMSA2Ny43ODkyIDEwMS4yOTQgNjguNTgzNkMxMDEuNzU3IDY5LjM3OCAxMDIuMDAxIDcwLjI3OTEgMTAyIDcxLjE5NjJWODIuNDQyNEMxMDIuMDAxIDgzLjM2IDEwMS43NTggODQuMjYxNyAxMDEuMjk1IDg1LjA1NjdDMTAwLjgzMiA4NS44NTE2IDEwMC4xNjYgODYuNTExNyA5OS4zNjMzIDg2Ljk3MDVMNjcuMDg2OSAxMDUuM0M2Ni4yODUzIDEwNS43NTkgNjUuMzc1OSAxMDYgNjQuNDUwMiAxMDZDNjMuNTI0NSAxMDYgNjIuNjE1MSAxMDUuNzU5IDYxLjgxMzUgMTA1LjNMNTEuMjUyIDk5LjI2MTFDNTEuMDczNyA5OS4xNTkzIDUwLjkyNTYgOTkuMDEyOCA1MC44MjI3IDk4LjgzNjNDNTAuNzE5OCA5OC42NTk5IDUwLjY2NTYgOTguNDU5NyA1MC42NjU2IDk4LjI1NkM1MC42NjU2IDk4LjA1MjIgNTAuNzE5OCA5Ny44NTIgNTAuODIyNyA5Ny42NzU2QzUwLjkyNTYgOTcuNDk5MSA1MS4wNzM3IDk3LjM1MjcgNTEuMjUyIDk3LjI1MDhMODYuMTE1MiA3Ny4zODM1Qzg2LjIwNCA3Ny4zMzI1IDg2LjI3NzcgNzcuMjU5MyA4Ni4zMjkgNzcuMTcxMkM4Ni4zODAyIDc3LjA4MzIgODYuNDA3MiA3Ni45ODMzIDg2LjQwNzIgNzYuODgxN0M4Ni40MDcyIDc2Ljc4IDg2LjM4MDIgNzYuNjgwMiA4Ni4zMjkgNzYuNTkyMUM4Ni4yNzc3IDc2LjUwNCA4Ni4yMDQgNzYuNDMwOCA4Ni4xMTUyIDc2LjM3OThMNzMuMTcxOSA2OC45NzcxQzcyLjgxNTYgNjguNzczNCA3Mi40MTE0IDY4LjY2NjIgNzIgNjguNjY2MkM3MS41ODg2IDY4LjY2NjIgNzEuMTg0NCA2OC43NzM0IDcwLjgyODEgNjguOTc3MUwzNS40MTcgODkuMTcyMkMzNS4xNDk4IDg5LjMyNSAzNC44NDY3IDg5LjQwNTQgMzQuNTM4MSA4OS40MDU0QzM0LjIyOTUgODkuNDA1NCAzMy45MjY0IDg5LjMyNSAzMy42NTkyIDg5LjE3MjJMMjkuNjQ4NCA4Ni45MDA5QzI4Ljg0MjQgODYuNDQyOCAyOC4xNzI5IDg1Ljc4MiAyNy43MDc4IDg0Ljk4NTNDMjcuMjQyNyA4NC4xODg2IDI2Ljk5ODUgODMuMjg0MyAyNyA4Mi4zNjQxVjc3Ljc2NjRDMjYuOTk5OCA3Ny40NjA3IDI3LjA4MDkgNzcuMTYwMyAyNy4yMzUyIDc2Ljg5NTVDMjcuMzg5NSA3Ni42MzA3IDI3LjYxMTUgNzYuNDEwOSAyNy44Nzg5IDc2LjI1OEw3OC42NTA0IDQ3LjM2OTNDNzguNzM5MiA0Ny4zMTgzIDc4LjgxMjkgNDcuMjQ1MSA3OC44NjQxIDQ3LjE1N0M3OC45MTU0IDQ3LjA2ODkgNzguOTQyMyA0Ni45NjkxIDc4Ljk0MjMgNDYuODY3NEM3OC45NDIzIDQ2Ljc2NTggNzguOTE1NCA0Ni42NjU5IDc4Ljg2NDEgNDYuNTc3OUM3OC44MTI5IDQ2LjQ4OTggNzguNzM5MiA0Ni40MTY2IDc4LjY1MDQgNDYuMzY1Nkw2NS42ODY1IDM4LjkzNjdDNjUuMzMwMiAzOC43MzMxIDY0LjkyNjEgMzguNjI1OCA2NC41MTQ2IDM4LjYyNThDNjQuMTAzMiAzOC42MjU4IDYzLjY5OTEgMzguNzMzMSA2My4zNDI4IDM4LjkzNjdMMjguNzU3OCA1OC42M0MyOC41Nzk4IDU4LjczMTggMjguMzc3OCA1OC43ODU0IDI4LjE3MjIgNTguNzg1NUMyNy45NjY2IDU4Ljc4NTUgMjcuNzY0NiA1OC43MzIgMjcuNTg2NSA1OC42MzAzQzI3LjQwODQgNTguNTI4NiAyNy4yNjA0IDU4LjM4MjMgMjcuMTU3NSA1OC4yMDYxQzI3LjA1NDUgNTguMDI5OSAyNy4wMDAyIDU3LjgzIDI3IDU3LjYyNjRWNDUuNTQ3NkMyNi45OTg5IDQ0LjYzIDI3LjI0MiA0My43MjgzIDI3LjcwNDkgNDIuOTMzNEMyOC4xNjc4IDQyLjEzODQgMjguODM0MSA0MS40NzgzIDI5LjYzNjcgNDEuMDE5NUw2MS45MDcyIDIyLjY5NTRDNjIuNzA3MSAyMi4yMzk4IDYzLjYxMzggMjIgNjQuNTM2NiAyMkM2NS40NTk0IDIyIDY2LjM2NjEgMjIuMjM5OCA2Ny4xNjYgMjIuNjk1NEw5OS4zNjMzIDQxLjA4MzNDMTAwLjE2NSA0MS41NDE0IDEwMC44MyA0Mi4yMDAxIDEwMS4yOTMgNDIuOTkzNEMxMDEuNzU2IDQzLjc4NjcgMTAyIDQ0LjY4NjYgMTAyIDQ1LjYwMjdaIiBmaWxsPSJ3aGl0ZSIvPgo8L3N2Zz4K'; - + name = BitgetWalletAdapterName; + url = WalletInfo?.homepage; + icon = WalletInfo?.logolist?.base64; config: Required; private _readyState: WalletReadyState = WalletReadyState.Loading; private _state: AdapterState = AdapterState.Loading; @@ -79,7 +83,7 @@ export class BitKeepAdapter extends Adapter { this.setState(AdapterState.NotFound); return; } - if (supportBitKeep()) { + if (supportBitgetWallet()) { this._readyState = WalletReadyState.Found; this._updateWallet(); } else { @@ -275,7 +279,7 @@ export class BitKeepAdapter extends Adapter { this._checkPromise = new Promise((resolve) => { const check = () => { times++; - const isSupport = supportBitKeep(); + const isSupport = supportBitgetWallet(); if (isSupport || times > maxTimes) { timer && clearInterval(timer); this._readyState = isSupport ? WalletReadyState.Found : WalletReadyState.NotFound; @@ -294,15 +298,18 @@ export class BitKeepAdapter extends Adapter { if (this.config.openAppWithDeeplink === false) { return; } - if (openBitKeep()) { + if (openBitgetWallet()) { throw new WalletNotFoundError(); } } - private _updateWallet = () => { + private _updateWallet = async () => { let state = this.state; let address = this.address; - if (supportBitKeep()) { - this._wallet = (window.bitkeep?.tronLink || window.tronLink) as TronLinkWallet; + if (supportBitgetWallet()) { + const adapter = new TronLinkAdapter(); + this._wallet = + ((await adapter?.getProvider().tronLink) as TronLinkWallet) || + (window.bitkeep?.tronLink as TronLinkWallet); address = this._wallet.tronWeb.defaultAddress?.base58 || null; state = this._wallet.ready ? AdapterState.Connected : AdapterState.Disconnect; if (!this._wallet.ready) { diff --git a/packages/adapters/bitkeep/src/utils.ts b/packages/adapters/bitkeep/src/utils.ts index 51c4e99..72337aa 100644 --- a/packages/adapters/bitkeep/src/utils.ts +++ b/packages/adapters/bitkeep/src/utils.ts @@ -1,11 +1,11 @@ import { isInMobileBrowser } from '@tronweb3/tronwallet-abstract-adapter'; -export function supportBitKeep() { +export function supportBitgetWallet() { return !!window.tronLink && (window as any).isBitKeep; } -export function openBitKeep() { - if (isInMobileBrowser() && !supportBitKeep()) { +export function openBitgetWallet() { + if (isInMobileBrowser() && !supportBitgetWallet()) { const { origin, pathname, search, hash } = window.location; const url = origin + pathname + search + hash; location.href = `https://bkcode.vip?action=dapp&url=${encodeURIComponent(url)}`; From 6f9dff40d26dcd4363a4b7fc96a193dc31ae7595 Mon Sep 17 00:00:00 2001 From: Justin Zhu Date: Thu, 19 Oct 2023 10:21:40 +0800 Subject: [PATCH 06/13] chore: update package version --- demos/cdn-demo/package.json | 24 +++++++++---------- demos/cdn-demo/tronlink-evm/index.html | 3 +++ demos/dev-demo/package.json | 24 +++++++++---------- package.json | 2 +- .../abstract-adapter-evm/package.json | 2 +- .../adapters/abstract-adapter/package.json | 2 +- packages/adapters/adapters/package.json | 2 +- packages/adapters/bitkeep/package.json | 2 +- packages/adapters/ledger/package.json | 2 +- packages/adapters/metamask/README.md | 2 +- packages/adapters/metamask/package.json | 2 +- packages/adapters/okxwallet/package.json | 2 +- packages/adapters/tokenpocket/package.json | 2 +- packages/adapters/tronlink-evm/README.md | 2 +- packages/adapters/tronlink-evm/package.json | 2 +- packages/adapters/tronlink/package.json | 2 +- packages/adapters/walletconnect/package.json | 2 +- packages/react/react-hooks/package.json | 2 +- packages/react/react-ui/package.json | 2 +- 19 files changed, 43 insertions(+), 40 deletions(-) diff --git a/demos/cdn-demo/package.json b/demos/cdn-demo/package.json index 20d28a0..b9daca0 100644 --- a/demos/cdn-demo/package.json +++ b/demos/cdn-demo/package.json @@ -1,23 +1,23 @@ { "name": "cdn-demo", "private": true, - "version": "0.0.0", + "version": "0.0.1", "type": "module", "scripts": { "dev": "serve" }, "dependencies": { - "@tronweb3/abstract-adapter-evm": "^1.0.0", - "@tronweb3/tronwallet-abstract-adapter": "^1.1.5", - "@tronweb3/tronwallet-adapter-bitkeep": "^1.0.1", - "@tronweb3/tronwallet-adapter-ledger": "^1.1.7", - "@tronweb3/tronwallet-adapter-metamask": "^1.0.0", - "@tronweb3/tronwallet-adapter-okxwallet": "^1.0.1", - "@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.1", - "@tronweb3/tronwallet-adapter-tronlink": "^1.1.8", - "@tronweb3/tronwallet-adapter-tronlink-evm": "^1.0.0", - "@tronweb3/tronwallet-adapter-walletconnect": "^1.0.4", - "@tronweb3/tronwallet-adapters": "^1.1.8", + "@tronweb3/abstract-adapter-evm": "^1.0.1", + "@tronweb3/tronwallet-abstract-adapter": "^1.1.6", + "@tronweb3/tronwallet-adapter-bitkeep": "^1.0.2", + "@tronweb3/tronwallet-adapter-ledger": "^1.1.8", + "@tronweb3/tronwallet-adapter-metamask": "^1.0.1", + "@tronweb3/tronwallet-adapter-okxwallet": "^1.0.2", + "@tronweb3/tronwallet-adapter-tokenpocket": "^1.0.2", + "@tronweb3/tronwallet-adapter-tronlink": "^1.1.9", + "@tronweb3/tronwallet-adapter-tronlink-evm": "^1.0.1", + "@tronweb3/tronwallet-adapter-walletconnect": "^1.0.5", + "@tronweb3/tronwallet-adapters": "^1.1.9", "@walletconnect/sign-client": "^2.1.4", "serve": "^14.2.1" } diff --git a/demos/cdn-demo/tronlink-evm/index.html b/demos/cdn-demo/tronlink-evm/index.html index 45957e2..34987e1 100644 --- a/demos/cdn-demo/tronlink-evm/index.html +++ b/demos/cdn-demo/tronlink-evm/index.html @@ -12,6 +12,7 @@ + +``` + +**Note**: You should adjust the relative path according to the position of the HTML file. + +2. Get specified adapter + +```js +const { TronLinkAdapter, BitKeepAdapter, WalletConnectAdapter, OkxWalletAdapter } = + window['@tronweb3/tronwallet-adapters']; +const tronlinkAdapter = new TronLinkAdapter({ + openTronLinkAppOnMobile: true, + openUrlWhenWalletNotFound: false, + checkTimeout: 3000, +}); +``` + +A demo with cdn file can be found [here](https://github.com/tronprotocol/tronwallet-adapter/tree/main/demos/cdn-demo). + +#### WalletConnectAdapter + +If you want to use `WalletConnectAdapter`, you should install another dependency in addition: + +```bash +npm i @walletconnect/sign-client +``` + +And add a script tag for `@walletconnect/sign-client` before the adapters `umd` file: + +```diff ++ + +``` + ## API Reference ### Adapter diff --git a/packages/adapters/bitkeep/README.md b/packages/adapters/bitkeep/README.md index 86ae5d1..a13d10d 100644 --- a/packages/adapters/bitkeep/README.md +++ b/packages/adapters/bitkeep/README.md @@ -1,6 +1,6 @@ # `@tronweb3/tronwallet-adapter-bitkeep` -This package provides an adapter to enable TRON DApps to connect to the [Bitget(BitKeep) Wallet extension and App](https://bitkeep.com/). +This package provides an adapter to enable TRON DApps to connect to the [Bitget(Former BitKeep) Wallet extension and App](https://www.bitget.com/). ## Demo