@cartridge/controller 0.7.9-alpha.1 → 0.7.9-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.turbo/turbo-build$colon$deps.log +16 -16
- package/.turbo/turbo-build.log +16 -16
- package/.turbo/turbo-format.log +39 -0
- package/dist/index.js +235 -200
- package/dist/index.js.map +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -0
- package/dist/node/index.d.ts +2 -0
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/{provider-qJi60GEX.js → provider-CGv2ANQX.js} +2 -2
- package/dist/{provider-qJi60GEX.js.map → provider-CGv2ANQX.js.map} +1 -1
- package/dist/session.js +2 -2
- package/dist/stats.html +1 -1
- package/dist/wallets/argent/index.d.ts +1 -0
- package/dist/wallets/bridge.d.ts +2 -0
- package/dist/wallets/metamask/index.d.ts +1 -0
- package/dist/wallets/phantom/index.d.ts +2 -1
- package/dist/wallets/types.d.ts +1 -0
- package/package.json +4 -5
- package/src/wallets/argent/index.ts +8 -2
- package/src/wallets/bridge.ts +19 -5
- package/src/wallets/metamask/index.ts +8 -0
- package/src/wallets/phantom/index.ts +66 -15
- package/src/wallets/types.ts +1 -0
- package/vite.config.js +0 -1
package/dist/stats.html
CHANGED
|
@@ -4929,7 +4929,7 @@ var drawChart = (function (exports) {
|
|
|
4929
4929
|
</script>
|
|
4930
4930
|
<script>
|
|
4931
4931
|
/*<!--*/
|
|
4932
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"1a563ade-1","name":"account.ts"},{"name":"iframe","children":[{"uid":"1a563ade-33","name":"base.ts"},{"uid":"1a563ade-43","name":"keychain.ts"},{"uid":"1a563ade-45","name":"profile.ts"}]},{"name":"wallets","children":[{"name":"metamask/index.ts","uid":"1a563ade-35"},{"name":"phantom/index.ts","uid":"1a563ade-37"},{"name":"argent/index.ts","uid":"1a563ade-39"},{"uid":"1a563ade-41","name":"bridge.ts"}]},{"uid":"1a563ade-47","name":"controller.ts"},{"uid":"1a563ade-49","name":"lookup.ts"},{"uid":"1a563ade-53","name":"index.ts"}]},{"name":"home/broody/development/controller/node_modules/.pnpm","children":[{"name":"@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib","children":[{"uid":"1a563ade-3","name":"enums.js"},{"uid":"1a563ade-5","name":"createDestructor.js"},{"uid":"1a563ade-7","name":"createLogger.js"},{"name":"parent","children":[{"uid":"1a563ade-9","name":"getOriginFromSrc.js"},{"uid":"1a563ade-21","name":"handleAckMessageFactory.js"},{"uid":"1a563ade-23","name":"handleSynMessageFactory.js"},{"uid":"1a563ade-25","name":"monitorIframeRemoval.js"},{"uid":"1a563ade-29","name":"validateIframeHasSrcOrSrcDoc.js"},{"uid":"1a563ade-31","name":"connectToChild.js"}]},{"uid":"1a563ade-11","name":"errorSerialization.js"},{"uid":"1a563ade-13","name":"connectCallReceiver.js"},{"uid":"1a563ade-15","name":"generateId.js"},{"uid":"1a563ade-17","name":"methodSerialization.js"},{"uid":"1a563ade-19","name":"connectCallSender.js"},{"uid":"1a563ade-27","name":"startConnectionTimeout.js"}]},{"name":"@cartridge+presets@https+++codeload.github.com+cartridge-gg+presets+tar.gz+8fcd261/node_modules/@cartridge/presets/dist/index.js","uid":"1a563ade-51"}]}]},{"name":"session.js","children":[{"name":"home/broody/development/controller/packages/account-wasm/pkg-session","children":[{"uid":"1a563ade-55","name":"account_wasm_bg.js"},{"uid":"1a563ade-57","name":"account_wasm.js"}]},{"name":"src/session","children":[{"uid":"1a563ade-59","name":"account.ts"},{"uid":"1a563ade-61","name":"provider.ts"},{"uid":"1a563ade-63","name":"index.ts"}]}]},{"name":"provider-qJi60GEX.js","children":[{"name":"src","children":[{"uid":"1a563ade-65","name":"types.ts"},{"uid":"1a563ade-67","name":"utils.ts"},{"uid":"1a563ade-69","name":"constants.ts"},{"uid":"1a563ade-71","name":"errors.ts"},{"uid":"1a563ade-77","name":"icon.ts"},{"uid":"1a563ade-79","name":"mutex.ts"},{"uid":"1a563ade-81","name":"provider.ts"}]},{"name":"home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/constants.js","uid":"1a563ade-73"},{"uid":"1a563ade-75","name":"package.json"}]}],"isRoot":true},"nodeParts":{"1a563ade-1":{"renderedLength":2560,"gzipLength":871,"brotliLength":711,"metaUid":"1a563ade-0"},"1a563ade-3":{"renderedLength":953,"gzipLength":315,"brotliLength":275,"metaUid":"1a563ade-2"},"1a563ade-5":{"renderedLength":507,"gzipLength":231,"brotliLength":188,"metaUid":"1a563ade-4"},"1a563ade-7":{"renderedLength":239,"gzipLength":171,"brotliLength":148,"metaUid":"1a563ade-6"},"1a563ade-9":{"renderedLength":1674,"gzipLength":796,"brotliLength":652,"metaUid":"1a563ade-8"},"1a563ade-11":{"renderedLength":414,"gzipLength":224,"brotliLength":189,"metaUid":"1a563ade-10"},"1a563ade-13":{"renderedLength":3554,"gzipLength":1132,"brotliLength":922,"metaUid":"1a563ade-12"},"1a563ade-15":{"renderedLength":107,"gzipLength":114,"brotliLength":85,"metaUid":"1a563ade-14"},"1a563ade-17":{"renderedLength":2519,"gzipLength":854,"brotliLength":741,"metaUid":"1a563ade-16"},"1a563ade-19":{"renderedLength":4452,"gzipLength":1440,"brotliLength":1198,"metaUid":"1a563ade-18"},"1a563ade-21":{"renderedLength":1939,"gzipLength":710,"brotliLength":596,"metaUid":"1a563ade-20"},"1a563ade-23":{"renderedLength":1033,"gzipLength":511,"brotliLength":406,"metaUid":"1a563ade-22"},"1a563ade-25":{"renderedLength":885,"gzipLength":442,"brotliLength":338,"metaUid":"1a563ade-24"},"1a563ade-27":{"renderedLength":534,"gzipLength":277,"brotliLength":219,"metaUid":"1a563ade-26"},"1a563ade-29":{"renderedLength":250,"gzipLength":177,"brotliLength":149,"metaUid":"1a563ade-28"},"1a563ade-31":{"renderedLength":2332,"gzipLength":870,"brotliLength":714,"metaUid":"1a563ade-30"},"1a563ade-33":{"renderedLength":3476,"gzipLength":1060,"brotliLength":861,"metaUid":"1a563ade-32"},"1a563ade-35":{"renderedLength":4935,"gzipLength":1024,"brotliLength":841,"metaUid":"1a563ade-34"},"1a563ade-37":{"renderedLength":2800,"gzipLength":688,"brotliLength":570,"metaUid":"1a563ade-36"},"1a563ade-39":{"renderedLength":2566,"gzipLength":747,"brotliLength":629,"metaUid":"1a563ade-38"},"1a563ade-41":{"renderedLength":3372,"gzipLength":849,"brotliLength":762,"metaUid":"1a563ade-40"},"1a563ade-43":{"renderedLength":576,"gzipLength":309,"brotliLength":242,"metaUid":"1a563ade-42"},"1a563ade-45":{"renderedLength":1215,"gzipLength":474,"brotliLength":381,"metaUid":"1a563ade-44"},"1a563ade-47":{"renderedLength":8523,"gzipLength":1854,"brotliLength":1603,"metaUid":"1a563ade-46"},"1a563ade-49":{"renderedLength":1419,"gzipLength":551,"brotliLength":470,"metaUid":"1a563ade-48"},"1a563ade-51":{"renderedLength":77385,"gzipLength":14354,"brotliLength":12125,"metaUid":"1a563ade-50"},"1a563ade-53":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"1a563ade-52"},"1a563ade-55":{"renderedLength":7527,"gzipLength":1819,"brotliLength":1639,"metaUid":"1a563ade-54"},"1a563ade-57":{"renderedLength":23,"gzipLength":40,"brotliLength":27,"metaUid":"1a563ade-56"},"1a563ade-59":{"renderedLength":1016,"gzipLength":466,"brotliLength":370,"metaUid":"1a563ade-58"},"1a563ade-61":{"renderedLength":5866,"gzipLength":1648,"brotliLength":1418,"metaUid":"1a563ade-60"},"1a563ade-63":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"1a563ade-62"},"1a563ade-65":{"renderedLength":359,"gzipLength":179,"brotliLength":149,"metaUid":"1a563ade-64"},"1a563ade-67":{"renderedLength":3607,"gzipLength":1301,"brotliLength":1140,"metaUid":"1a563ade-66"},"1a563ade-69":{"renderedLength":142,"gzipLength":98,"brotliLength":88,"metaUid":"1a563ade-68"},"1a563ade-71":{"renderedLength":160,"gzipLength":136,"brotliLength":105,"metaUid":"1a563ade-70"},"1a563ade-73":{"renderedLength":49,"gzipLength":69,"brotliLength":53,"metaUid":"1a563ade-72"},"1a563ade-75":{"renderedLength":63,"gzipLength":74,"brotliLength":67,"metaUid":"1a563ade-74"},"1a563ade-77":{"renderedLength":15450,"gzipLength":10585,"brotliLength":10568,"metaUid":"1a563ade-76"},"1a563ade-79":{"renderedLength":425,"gzipLength":237,"brotliLength":200,"metaUid":"1a563ade-78"},"1a563ade-81":{"renderedLength":4433,"gzipLength":1093,"brotliLength":950,"metaUid":"1a563ade-80"}},"nodeMetas":{"1a563ade-0":{"id":"/src/account.ts","moduleParts":{"index.js":"1a563ade-1"},"imported":[{"uid":"1a563ade-84"},{"uid":"1a563ade-64"},{"uid":"1a563ade-66"}],"importedBy":[{"uid":"1a563ade-46"}]},"1a563ade-2":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/enums.js","moduleParts":{"index.js":"1a563ade-3"},"imported":[],"importedBy":[{"uid":"1a563ade-90"},{"uid":"1a563ade-30"},{"uid":"1a563ade-93"},{"uid":"1a563ade-22"},{"uid":"1a563ade-26"},{"uid":"1a563ade-28"},{"uid":"1a563ade-104"},{"uid":"1a563ade-12"},{"uid":"1a563ade-18"}]},"1a563ade-4":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/createDestructor.js","moduleParts":{"index.js":"1a563ade-5"},"imported":[],"importedBy":[{"uid":"1a563ade-30"},{"uid":"1a563ade-93"}]},"1a563ade-6":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/createLogger.js","moduleParts":{"index.js":"1a563ade-7"},"imported":[],"importedBy":[{"uid":"1a563ade-30"},{"uid":"1a563ade-93"}]},"1a563ade-8":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/getOriginFromSrc.js","moduleParts":{"index.js":"1a563ade-9"},"imported":[],"importedBy":[{"uid":"1a563ade-30"}]},"1a563ade-10":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/errorSerialization.js","moduleParts":{"index.js":"1a563ade-11"},"imported":[],"importedBy":[{"uid":"1a563ade-12"},{"uid":"1a563ade-18"}]},"1a563ade-12":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/connectCallReceiver.js","moduleParts":{"index.js":"1a563ade-13"},"imported":[{"uid":"1a563ade-10"},{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-20"},{"uid":"1a563ade-104"}]},"1a563ade-14":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/generateId.js","moduleParts":{"index.js":"1a563ade-15"},"imported":[],"importedBy":[{"uid":"1a563ade-18"}]},"1a563ade-16":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/methodSerialization.js","moduleParts":{"index.js":"1a563ade-17"},"imported":[],"importedBy":[{"uid":"1a563ade-30"},{"uid":"1a563ade-93"},{"uid":"1a563ade-18"}]},"1a563ade-18":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/connectCallSender.js","moduleParts":{"index.js":"1a563ade-19"},"imported":[{"uid":"1a563ade-14"},{"uid":"1a563ade-10"},{"uid":"1a563ade-16"},{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-20"},{"uid":"1a563ade-104"}]},"1a563ade-20":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/handleAckMessageFactory.js","moduleParts":{"index.js":"1a563ade-21"},"imported":[{"uid":"1a563ade-12"},{"uid":"1a563ade-18"}],"importedBy":[{"uid":"1a563ade-30"}]},"1a563ade-22":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/handleSynMessageFactory.js","moduleParts":{"index.js":"1a563ade-23"},"imported":[{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-30"}]},"1a563ade-24":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/monitorIframeRemoval.js","moduleParts":{"index.js":"1a563ade-25"},"imported":[],"importedBy":[{"uid":"1a563ade-30"}]},"1a563ade-26":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/startConnectionTimeout.js","moduleParts":{"index.js":"1a563ade-27"},"imported":[{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-30"},{"uid":"1a563ade-93"}]},"1a563ade-28":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/validateIframeHasSrcOrSrcDoc.js","moduleParts":{"index.js":"1a563ade-29"},"imported":[{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-30"}]},"1a563ade-30":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/connectToChild.js","moduleParts":{"index.js":"1a563ade-31"},"imported":[{"uid":"1a563ade-2"},{"uid":"1a563ade-4"},{"uid":"1a563ade-6"},{"uid":"1a563ade-8"},{"uid":"1a563ade-20"},{"uid":"1a563ade-22"},{"uid":"1a563ade-16"},{"uid":"1a563ade-24"},{"uid":"1a563ade-26"},{"uid":"1a563ade-28"}],"importedBy":[{"uid":"1a563ade-90"}]},"1a563ade-32":{"id":"/src/iframe/base.ts","moduleParts":{"index.js":"1a563ade-33"},"imported":[{"uid":"1a563ade-90"}],"importedBy":[{"uid":"1a563ade-83"},{"uid":"1a563ade-42"},{"uid":"1a563ade-44"}]},"1a563ade-34":{"id":"/src/wallets/metamask/index.ts","moduleParts":{"index.js":"1a563ade-35"},"imported":[{"uid":"1a563ade-87"}],"importedBy":[{"uid":"1a563ade-82"},{"uid":"1a563ade-40"}]},"1a563ade-36":{"id":"/src/wallets/phantom/index.ts","moduleParts":{"index.js":"1a563ade-37"},"imported":[],"importedBy":[{"uid":"1a563ade-82"},{"uid":"1a563ade-40"}]},"1a563ade-38":{"id":"/src/wallets/argent/index.ts","moduleParts":{"index.js":"1a563ade-39"},"imported":[{"uid":"1a563ade-88"},{"uid":"1a563ade-89"}],"importedBy":[{"uid":"1a563ade-82"},{"uid":"1a563ade-40"}]},"1a563ade-40":{"id":"/src/wallets/bridge.ts","moduleParts":{"index.js":"1a563ade-41"},"imported":[{"uid":"1a563ade-34"},{"uid":"1a563ade-36"},{"uid":"1a563ade-38"}],"importedBy":[{"uid":"1a563ade-82"},{"uid":"1a563ade-42"}]},"1a563ade-42":{"id":"/src/iframe/keychain.ts","moduleParts":{"index.js":"1a563ade-43"},"imported":[{"uid":"1a563ade-68"},{"uid":"1a563ade-40"},{"uid":"1a563ade-32"}],"importedBy":[{"uid":"1a563ade-83"}]},"1a563ade-44":{"id":"/src/iframe/profile.ts","moduleParts":{"index.js":"1a563ade-45"},"imported":[{"uid":"1a563ade-68"},{"uid":"1a563ade-32"}],"importedBy":[{"uid":"1a563ade-83"}]},"1a563ade-46":{"id":"/src/controller.ts","moduleParts":{"index.js":"1a563ade-47"},"imported":[{"uid":"1a563ade-0"},{"uid":"1a563ade-83"},{"uid":"1a563ade-70"},{"uid":"1a563ade-64"},{"uid":"1a563ade-80"},{"uid":"1a563ade-84"},{"uid":"1a563ade-66"}],"importedBy":[{"uid":"1a563ade-52"}]},"1a563ade-48":{"id":"/src/lookup.ts","moduleParts":{"index.js":"1a563ade-49"},"imported":[{"uid":"1a563ade-84"},{"uid":"1a563ade-68"}],"importedBy":[{"uid":"1a563ade-52"}]},"1a563ade-50":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+presets@https+++codeload.github.com+cartridge-gg+presets+tar.gz+8fcd261/node_modules/@cartridge/presets/dist/index.js","moduleParts":{"index.js":"1a563ade-51"},"imported":[],"importedBy":[{"uid":"1a563ade-52"}]},"1a563ade-52":{"id":"/src/index.ts","moduleParts":{"index.js":"1a563ade-53"},"imported":[{"uid":"1a563ade-46"},{"uid":"1a563ade-70"},{"uid":"1a563ade-64"},{"uid":"1a563ade-48"},{"uid":"1a563ade-66"},{"uid":"1a563ade-82"},{"uid":"1a563ade-50"}],"importedBy":[],"isEntry":true},"1a563ade-54":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm_bg.js","moduleParts":{"session.js":"1a563ade-55"},"imported":[{"uid":"1a563ade-106"}],"importedBy":[{"uid":"1a563ade-56"}]},"1a563ade-56":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm.js","moduleParts":{"session.js":"1a563ade-57"},"imported":[{"uid":"1a563ade-105"},{"uid":"1a563ade-54"}],"importedBy":[{"uid":"1a563ade-58"}]},"1a563ade-58":{"id":"/src/session/account.ts","moduleParts":{"session.js":"1a563ade-59"},"imported":[{"uid":"1a563ade-56"},{"uid":"1a563ade-84"},{"uid":"1a563ade-66"},{"uid":"1a563ade-70"},{"uid":"1a563ade-64"}],"importedBy":[{"uid":"1a563ade-60"}]},"1a563ade-60":{"id":"/src/session/provider.ts","moduleParts":{"session.js":"1a563ade-61"},"imported":[{"uid":"1a563ade-84"},{"uid":"1a563ade-58"},{"uid":"1a563ade-68"},{"uid":"1a563ade-80"},{"uid":"1a563ade-66"}],"importedBy":[{"uid":"1a563ade-62"}]},"1a563ade-62":{"id":"/src/session/index.ts","moduleParts":{"session.js":"1a563ade-63"},"imported":[{"uid":"1a563ade-60"},{"uid":"1a563ade-70"},{"uid":"1a563ade-64"}],"importedBy":[],"isEntry":true},"1a563ade-64":{"id":"/src/types.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-65"},"imported":[],"importedBy":[{"uid":"1a563ade-52"},{"uid":"1a563ade-46"},{"uid":"1a563ade-0"},{"uid":"1a563ade-62"},{"uid":"1a563ade-58"}]},"1a563ade-66":{"id":"/src/utils.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-67"},"imported":[{"uid":"1a563ade-84"}],"importedBy":[{"uid":"1a563ade-52"},{"uid":"1a563ade-46"},{"uid":"1a563ade-0"},{"uid":"1a563ade-60"},{"uid":"1a563ade-58"}]},"1a563ade-68":{"id":"/src/constants.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-69"},"imported":[],"importedBy":[{"uid":"1a563ade-48"},{"uid":"1a563ade-42"},{"uid":"1a563ade-44"},{"uid":"1a563ade-60"}]},"1a563ade-70":{"id":"/src/errors.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-71"},"imported":[],"importedBy":[{"uid":"1a563ade-52"},{"uid":"1a563ade-46"},{"uid":"1a563ade-62"},{"uid":"1a563ade-58"}]},"1a563ade-72":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/constants.js","moduleParts":{"provider-qJi60GEX.js":"1a563ade-73"},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-74":{"id":"/package.json","moduleParts":{"provider-qJi60GEX.js":"1a563ade-75"},"imported":[],"importedBy":[{"uid":"1a563ade-80"}]},"1a563ade-76":{"id":"/src/icon.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-77"},"imported":[],"importedBy":[{"uid":"1a563ade-80"}]},"1a563ade-78":{"id":"/src/mutex.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-79"},"imported":[],"importedBy":[{"uid":"1a563ade-80"}]},"1a563ade-80":{"id":"/src/provider.ts","moduleParts":{"provider-qJi60GEX.js":"1a563ade-81"},"imported":[{"uid":"1a563ade-86"},{"uid":"1a563ade-74"},{"uid":"1a563ade-76"},{"uid":"1a563ade-78"}],"importedBy":[{"uid":"1a563ade-46"},{"uid":"1a563ade-60"}]},"1a563ade-82":{"id":"/src/wallets/index.ts","moduleParts":{},"imported":[{"uid":"1a563ade-85"},{"uid":"1a563ade-40"},{"uid":"1a563ade-34"},{"uid":"1a563ade-36"},{"uid":"1a563ade-38"}],"importedBy":[{"uid":"1a563ade-52"}]},"1a563ade-83":{"id":"/src/iframe/index.ts","moduleParts":{},"imported":[{"uid":"1a563ade-32"},{"uid":"1a563ade-42"},{"uid":"1a563ade-44"}],"importedBy":[{"uid":"1a563ade-46"}]},"1a563ade-84":{"id":"starknet","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-46"},{"uid":"1a563ade-48"},{"uid":"1a563ade-66"},{"uid":"1a563ade-0"},{"uid":"1a563ade-60"},{"uid":"1a563ade-58"}],"isExternal":true},"1a563ade-85":{"id":"/src/wallets/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-82"}]},"1a563ade-86":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/index.js","moduleParts":{},"imported":[{"uid":"1a563ade-91"},{"uid":"1a563ade-92"}],"importedBy":[{"uid":"1a563ade-80"}]},"1a563ade-87":{"id":"@metamask/sdk","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-34"}],"isExternal":true},"1a563ade-88":{"id":"starknetkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-38"}],"isExternal":true},"1a563ade-89":{"id":"starknetkit/injected","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-38"}],"isExternal":true},"1a563ade-90":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/index.js","moduleParts":{},"imported":[{"uid":"1a563ade-30"},{"uid":"1a563ade-93"},{"uid":"1a563ade-2"}],"importedBy":[{"uid":"1a563ade-32"}]},"1a563ade-91":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/index.js","moduleParts":{},"imported":[{"uid":"1a563ade-94"},{"uid":"1a563ade-95"},{"uid":"1a563ade-96"},{"uid":"1a563ade-97"}],"importedBy":[{"uid":"1a563ade-86"}]},"1a563ade-92":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/index.js","moduleParts":{},"imported":[{"uid":"1a563ade-72"},{"uid":"1a563ade-98"},{"uid":"1a563ade-99"},{"uid":"1a563ade-100"},{"uid":"1a563ade-101"},{"uid":"1a563ade-102"},{"uid":"1a563ade-103"}],"importedBy":[{"uid":"1a563ade-86"}]},"1a563ade-93":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/child/connectToParent.js","moduleParts":{},"imported":[{"uid":"1a563ade-4"},{"uid":"1a563ade-6"},{"uid":"1a563ade-2"},{"uid":"1a563ade-104"},{"uid":"1a563ade-16"},{"uid":"1a563ade-26"}],"importedBy":[{"uid":"1a563ade-90"}]},"1a563ade-94":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/contract.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-91"}]},"1a563ade-95":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/errors.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-91"}]},"1a563ade-96":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/components.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-91"}]},"1a563ade-97":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-91"}]},"1a563ade-98":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/typedData.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-99":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/StarknetWindowObject.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-100":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/components.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-101":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/methods.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-102":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/events.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-103":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/errors.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-92"}]},"1a563ade-104":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/child/handleSynAckMessageFactory.js","moduleParts":{},"imported":[{"uid":"1a563ade-2"},{"uid":"1a563ade-12"},{"uid":"1a563ade-18"}],"importedBy":[{"uid":"1a563ade-93"}]},"1a563ade-105":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm_bg.wasm","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-56"}],"isExternal":true},"1a563ade-106":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/snippets/account-wasm-35da9c7350cbc3ae/src/wasm-mutex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"1a563ade-54"}]}},"env":{"rollup":"4.34.6"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4932
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"index.js","children":[{"name":"src","children":[{"uid":"706f9776-1","name":"account.ts"},{"name":"iframe","children":[{"uid":"706f9776-33","name":"base.ts"},{"uid":"706f9776-43","name":"keychain.ts"},{"uid":"706f9776-45","name":"profile.ts"}]},{"name":"wallets","children":[{"name":"metamask/index.ts","uid":"706f9776-35"},{"name":"phantom/index.ts","uid":"706f9776-37"},{"name":"argent/index.ts","uid":"706f9776-39"},{"uid":"706f9776-41","name":"bridge.ts"}]},{"uid":"706f9776-47","name":"controller.ts"},{"uid":"706f9776-49","name":"lookup.ts"},{"uid":"706f9776-53","name":"index.ts"}]},{"name":"home/broody/development/controller/node_modules/.pnpm","children":[{"name":"@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib","children":[{"uid":"706f9776-3","name":"enums.js"},{"uid":"706f9776-5","name":"createDestructor.js"},{"uid":"706f9776-7","name":"createLogger.js"},{"name":"parent","children":[{"uid":"706f9776-9","name":"getOriginFromSrc.js"},{"uid":"706f9776-21","name":"handleAckMessageFactory.js"},{"uid":"706f9776-23","name":"handleSynMessageFactory.js"},{"uid":"706f9776-25","name":"monitorIframeRemoval.js"},{"uid":"706f9776-29","name":"validateIframeHasSrcOrSrcDoc.js"},{"uid":"706f9776-31","name":"connectToChild.js"}]},{"uid":"706f9776-11","name":"errorSerialization.js"},{"uid":"706f9776-13","name":"connectCallReceiver.js"},{"uid":"706f9776-15","name":"generateId.js"},{"uid":"706f9776-17","name":"methodSerialization.js"},{"uid":"706f9776-19","name":"connectCallSender.js"},{"uid":"706f9776-27","name":"startConnectionTimeout.js"}]},{"name":"@cartridge+presets@https+++codeload.github.com+cartridge-gg+presets+tar.gz+8fcd261/node_modules/@cartridge/presets/dist/index.js","uid":"706f9776-51"}]}]},{"name":"session.js","children":[{"name":"home/broody/development/controller/packages/account-wasm/pkg-session","children":[{"uid":"706f9776-55","name":"account_wasm_bg.js"},{"uid":"706f9776-57","name":"account_wasm.js"}]},{"name":"src/session","children":[{"uid":"706f9776-59","name":"account.ts"},{"uid":"706f9776-61","name":"provider.ts"},{"uid":"706f9776-63","name":"index.ts"}]}]},{"name":"provider-CGv2ANQX.js","children":[{"name":"src","children":[{"uid":"706f9776-65","name":"types.ts"},{"uid":"706f9776-67","name":"utils.ts"},{"uid":"706f9776-69","name":"constants.ts"},{"uid":"706f9776-71","name":"errors.ts"},{"uid":"706f9776-77","name":"icon.ts"},{"uid":"706f9776-79","name":"mutex.ts"},{"uid":"706f9776-81","name":"provider.ts"}]},{"name":"home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/constants.js","uid":"706f9776-73"},{"uid":"706f9776-75","name":"package.json"}]}],"isRoot":true},"nodeParts":{"706f9776-1":{"renderedLength":2560,"gzipLength":871,"brotliLength":711,"metaUid":"706f9776-0"},"706f9776-3":{"renderedLength":953,"gzipLength":315,"brotliLength":275,"metaUid":"706f9776-2"},"706f9776-5":{"renderedLength":507,"gzipLength":231,"brotliLength":188,"metaUid":"706f9776-4"},"706f9776-7":{"renderedLength":239,"gzipLength":171,"brotliLength":148,"metaUid":"706f9776-6"},"706f9776-9":{"renderedLength":1674,"gzipLength":796,"brotliLength":652,"metaUid":"706f9776-8"},"706f9776-11":{"renderedLength":414,"gzipLength":224,"brotliLength":189,"metaUid":"706f9776-10"},"706f9776-13":{"renderedLength":3554,"gzipLength":1132,"brotliLength":922,"metaUid":"706f9776-12"},"706f9776-15":{"renderedLength":107,"gzipLength":114,"brotliLength":85,"metaUid":"706f9776-14"},"706f9776-17":{"renderedLength":2519,"gzipLength":854,"brotliLength":741,"metaUid":"706f9776-16"},"706f9776-19":{"renderedLength":4452,"gzipLength":1440,"brotliLength":1198,"metaUid":"706f9776-18"},"706f9776-21":{"renderedLength":1939,"gzipLength":710,"brotliLength":596,"metaUid":"706f9776-20"},"706f9776-23":{"renderedLength":1033,"gzipLength":511,"brotliLength":406,"metaUid":"706f9776-22"},"706f9776-25":{"renderedLength":885,"gzipLength":442,"brotliLength":338,"metaUid":"706f9776-24"},"706f9776-27":{"renderedLength":534,"gzipLength":277,"brotliLength":219,"metaUid":"706f9776-26"},"706f9776-29":{"renderedLength":250,"gzipLength":177,"brotliLength":149,"metaUid":"706f9776-28"},"706f9776-31":{"renderedLength":2332,"gzipLength":870,"brotliLength":714,"metaUid":"706f9776-30"},"706f9776-33":{"renderedLength":3476,"gzipLength":1060,"brotliLength":861,"metaUid":"706f9776-32"},"706f9776-35":{"renderedLength":5069,"gzipLength":1048,"brotliLength":865,"metaUid":"706f9776-34"},"706f9776-37":{"renderedLength":3224,"gzipLength":818,"brotliLength":704,"metaUid":"706f9776-36"},"706f9776-39":{"renderedLength":2658,"gzipLength":768,"brotliLength":651,"metaUid":"706f9776-38"},"706f9776-41":{"renderedLength":3650,"gzipLength":861,"brotliLength":754,"metaUid":"706f9776-40"},"706f9776-43":{"renderedLength":576,"gzipLength":309,"brotliLength":242,"metaUid":"706f9776-42"},"706f9776-45":{"renderedLength":1215,"gzipLength":474,"brotliLength":381,"metaUid":"706f9776-44"},"706f9776-47":{"renderedLength":8523,"gzipLength":1854,"brotliLength":1603,"metaUid":"706f9776-46"},"706f9776-49":{"renderedLength":1419,"gzipLength":551,"brotliLength":470,"metaUid":"706f9776-48"},"706f9776-51":{"renderedLength":77385,"gzipLength":14354,"brotliLength":12125,"metaUid":"706f9776-50"},"706f9776-53":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"706f9776-52"},"706f9776-55":{"renderedLength":7527,"gzipLength":1819,"brotliLength":1639,"metaUid":"706f9776-54"},"706f9776-57":{"renderedLength":23,"gzipLength":40,"brotliLength":27,"metaUid":"706f9776-56"},"706f9776-59":{"renderedLength":1016,"gzipLength":466,"brotliLength":370,"metaUid":"706f9776-58"},"706f9776-61":{"renderedLength":5866,"gzipLength":1648,"brotliLength":1418,"metaUid":"706f9776-60"},"706f9776-63":{"renderedLength":0,"gzipLength":0,"brotliLength":0,"metaUid":"706f9776-62"},"706f9776-65":{"renderedLength":359,"gzipLength":179,"brotliLength":149,"metaUid":"706f9776-64"},"706f9776-67":{"renderedLength":3607,"gzipLength":1301,"brotliLength":1140,"metaUid":"706f9776-66"},"706f9776-69":{"renderedLength":142,"gzipLength":98,"brotliLength":88,"metaUid":"706f9776-68"},"706f9776-71":{"renderedLength":160,"gzipLength":136,"brotliLength":105,"metaUid":"706f9776-70"},"706f9776-73":{"renderedLength":49,"gzipLength":69,"brotliLength":53,"metaUid":"706f9776-72"},"706f9776-75":{"renderedLength":63,"gzipLength":74,"brotliLength":67,"metaUid":"706f9776-74"},"706f9776-77":{"renderedLength":15450,"gzipLength":10585,"brotliLength":10568,"metaUid":"706f9776-76"},"706f9776-79":{"renderedLength":425,"gzipLength":237,"brotliLength":200,"metaUid":"706f9776-78"},"706f9776-81":{"renderedLength":4433,"gzipLength":1093,"brotliLength":950,"metaUid":"706f9776-80"}},"nodeMetas":{"706f9776-0":{"id":"/src/account.ts","moduleParts":{"index.js":"706f9776-1"},"imported":[{"uid":"706f9776-84"},{"uid":"706f9776-64"},{"uid":"706f9776-66"}],"importedBy":[{"uid":"706f9776-46"}]},"706f9776-2":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/enums.js","moduleParts":{"index.js":"706f9776-3"},"imported":[],"importedBy":[{"uid":"706f9776-91"},{"uid":"706f9776-30"},{"uid":"706f9776-94"},{"uid":"706f9776-22"},{"uid":"706f9776-26"},{"uid":"706f9776-28"},{"uid":"706f9776-105"},{"uid":"706f9776-12"},{"uid":"706f9776-18"}]},"706f9776-4":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/createDestructor.js","moduleParts":{"index.js":"706f9776-5"},"imported":[],"importedBy":[{"uid":"706f9776-30"},{"uid":"706f9776-94"}]},"706f9776-6":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/createLogger.js","moduleParts":{"index.js":"706f9776-7"},"imported":[],"importedBy":[{"uid":"706f9776-30"},{"uid":"706f9776-94"}]},"706f9776-8":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/getOriginFromSrc.js","moduleParts":{"index.js":"706f9776-9"},"imported":[],"importedBy":[{"uid":"706f9776-30"}]},"706f9776-10":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/errorSerialization.js","moduleParts":{"index.js":"706f9776-11"},"imported":[],"importedBy":[{"uid":"706f9776-12"},{"uid":"706f9776-18"}]},"706f9776-12":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/connectCallReceiver.js","moduleParts":{"index.js":"706f9776-13"},"imported":[{"uid":"706f9776-10"},{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-20"},{"uid":"706f9776-105"}]},"706f9776-14":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/generateId.js","moduleParts":{"index.js":"706f9776-15"},"imported":[],"importedBy":[{"uid":"706f9776-18"}]},"706f9776-16":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/methodSerialization.js","moduleParts":{"index.js":"706f9776-17"},"imported":[],"importedBy":[{"uid":"706f9776-30"},{"uid":"706f9776-94"},{"uid":"706f9776-18"}]},"706f9776-18":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/connectCallSender.js","moduleParts":{"index.js":"706f9776-19"},"imported":[{"uid":"706f9776-14"},{"uid":"706f9776-10"},{"uid":"706f9776-16"},{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-20"},{"uid":"706f9776-105"}]},"706f9776-20":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/handleAckMessageFactory.js","moduleParts":{"index.js":"706f9776-21"},"imported":[{"uid":"706f9776-12"},{"uid":"706f9776-18"}],"importedBy":[{"uid":"706f9776-30"}]},"706f9776-22":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/handleSynMessageFactory.js","moduleParts":{"index.js":"706f9776-23"},"imported":[{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-30"}]},"706f9776-24":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/monitorIframeRemoval.js","moduleParts":{"index.js":"706f9776-25"},"imported":[],"importedBy":[{"uid":"706f9776-30"}]},"706f9776-26":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/startConnectionTimeout.js","moduleParts":{"index.js":"706f9776-27"},"imported":[{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-30"},{"uid":"706f9776-94"}]},"706f9776-28":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/validateIframeHasSrcOrSrcDoc.js","moduleParts":{"index.js":"706f9776-29"},"imported":[{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-30"}]},"706f9776-30":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/parent/connectToChild.js","moduleParts":{"index.js":"706f9776-31"},"imported":[{"uid":"706f9776-2"},{"uid":"706f9776-4"},{"uid":"706f9776-6"},{"uid":"706f9776-8"},{"uid":"706f9776-20"},{"uid":"706f9776-22"},{"uid":"706f9776-16"},{"uid":"706f9776-24"},{"uid":"706f9776-26"},{"uid":"706f9776-28"}],"importedBy":[{"uid":"706f9776-91"}]},"706f9776-32":{"id":"/src/iframe/base.ts","moduleParts":{"index.js":"706f9776-33"},"imported":[{"uid":"706f9776-91"}],"importedBy":[{"uid":"706f9776-83"},{"uid":"706f9776-42"},{"uid":"706f9776-44"}]},"706f9776-34":{"id":"/src/wallets/metamask/index.ts","moduleParts":{"index.js":"706f9776-35"},"imported":[{"uid":"706f9776-87"}],"importedBy":[{"uid":"706f9776-82"},{"uid":"706f9776-40"}]},"706f9776-36":{"id":"/src/wallets/phantom/index.ts","moduleParts":{"index.js":"706f9776-37"},"imported":[{"uid":"706f9776-88"}],"importedBy":[{"uid":"706f9776-82"},{"uid":"706f9776-40"}]},"706f9776-38":{"id":"/src/wallets/argent/index.ts","moduleParts":{"index.js":"706f9776-39"},"imported":[{"uid":"706f9776-89"},{"uid":"706f9776-90"}],"importedBy":[{"uid":"706f9776-82"},{"uid":"706f9776-40"}]},"706f9776-40":{"id":"/src/wallets/bridge.ts","moduleParts":{"index.js":"706f9776-41"},"imported":[{"uid":"706f9776-34"},{"uid":"706f9776-36"},{"uid":"706f9776-38"}],"importedBy":[{"uid":"706f9776-82"},{"uid":"706f9776-42"}]},"706f9776-42":{"id":"/src/iframe/keychain.ts","moduleParts":{"index.js":"706f9776-43"},"imported":[{"uid":"706f9776-68"},{"uid":"706f9776-40"},{"uid":"706f9776-32"}],"importedBy":[{"uid":"706f9776-83"}]},"706f9776-44":{"id":"/src/iframe/profile.ts","moduleParts":{"index.js":"706f9776-45"},"imported":[{"uid":"706f9776-68"},{"uid":"706f9776-32"}],"importedBy":[{"uid":"706f9776-83"}]},"706f9776-46":{"id":"/src/controller.ts","moduleParts":{"index.js":"706f9776-47"},"imported":[{"uid":"706f9776-0"},{"uid":"706f9776-83"},{"uid":"706f9776-70"},{"uid":"706f9776-64"},{"uid":"706f9776-80"},{"uid":"706f9776-84"},{"uid":"706f9776-66"}],"importedBy":[{"uid":"706f9776-52"}]},"706f9776-48":{"id":"/src/lookup.ts","moduleParts":{"index.js":"706f9776-49"},"imported":[{"uid":"706f9776-84"},{"uid":"706f9776-68"}],"importedBy":[{"uid":"706f9776-52"}]},"706f9776-50":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+presets@https+++codeload.github.com+cartridge-gg+presets+tar.gz+8fcd261/node_modules/@cartridge/presets/dist/index.js","moduleParts":{"index.js":"706f9776-51"},"imported":[],"importedBy":[{"uid":"706f9776-52"}]},"706f9776-52":{"id":"/src/index.ts","moduleParts":{"index.js":"706f9776-53"},"imported":[{"uid":"706f9776-46"},{"uid":"706f9776-70"},{"uid":"706f9776-64"},{"uid":"706f9776-48"},{"uid":"706f9776-66"},{"uid":"706f9776-82"},{"uid":"706f9776-50"}],"importedBy":[],"isEntry":true},"706f9776-54":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm_bg.js","moduleParts":{"session.js":"706f9776-55"},"imported":[{"uid":"706f9776-107"}],"importedBy":[{"uid":"706f9776-56"}]},"706f9776-56":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm.js","moduleParts":{"session.js":"706f9776-57"},"imported":[{"uid":"706f9776-106"},{"uid":"706f9776-54"}],"importedBy":[{"uid":"706f9776-58"}]},"706f9776-58":{"id":"/src/session/account.ts","moduleParts":{"session.js":"706f9776-59"},"imported":[{"uid":"706f9776-56"},{"uid":"706f9776-84"},{"uid":"706f9776-66"},{"uid":"706f9776-70"},{"uid":"706f9776-64"}],"importedBy":[{"uid":"706f9776-60"}]},"706f9776-60":{"id":"/src/session/provider.ts","moduleParts":{"session.js":"706f9776-61"},"imported":[{"uid":"706f9776-84"},{"uid":"706f9776-58"},{"uid":"706f9776-68"},{"uid":"706f9776-80"},{"uid":"706f9776-66"}],"importedBy":[{"uid":"706f9776-62"}]},"706f9776-62":{"id":"/src/session/index.ts","moduleParts":{"session.js":"706f9776-63"},"imported":[{"uid":"706f9776-60"},{"uid":"706f9776-70"},{"uid":"706f9776-64"}],"importedBy":[],"isEntry":true},"706f9776-64":{"id":"/src/types.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-65"},"imported":[],"importedBy":[{"uid":"706f9776-52"},{"uid":"706f9776-46"},{"uid":"706f9776-0"},{"uid":"706f9776-62"},{"uid":"706f9776-58"}]},"706f9776-66":{"id":"/src/utils.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-67"},"imported":[{"uid":"706f9776-84"}],"importedBy":[{"uid":"706f9776-52"},{"uid":"706f9776-46"},{"uid":"706f9776-0"},{"uid":"706f9776-60"},{"uid":"706f9776-58"}]},"706f9776-68":{"id":"/src/constants.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-69"},"imported":[],"importedBy":[{"uid":"706f9776-48"},{"uid":"706f9776-42"},{"uid":"706f9776-44"},{"uid":"706f9776-60"}]},"706f9776-70":{"id":"/src/errors.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-71"},"imported":[],"importedBy":[{"uid":"706f9776-52"},{"uid":"706f9776-46"},{"uid":"706f9776-62"},{"uid":"706f9776-58"}]},"706f9776-72":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/constants.js","moduleParts":{"provider-CGv2ANQX.js":"706f9776-73"},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-74":{"id":"/package.json","moduleParts":{"provider-CGv2ANQX.js":"706f9776-75"},"imported":[],"importedBy":[{"uid":"706f9776-80"}]},"706f9776-76":{"id":"/src/icon.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-77"},"imported":[],"importedBy":[{"uid":"706f9776-80"}]},"706f9776-78":{"id":"/src/mutex.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-79"},"imported":[],"importedBy":[{"uid":"706f9776-80"}]},"706f9776-80":{"id":"/src/provider.ts","moduleParts":{"provider-CGv2ANQX.js":"706f9776-81"},"imported":[{"uid":"706f9776-86"},{"uid":"706f9776-74"},{"uid":"706f9776-76"},{"uid":"706f9776-78"}],"importedBy":[{"uid":"706f9776-46"},{"uid":"706f9776-60"}]},"706f9776-82":{"id":"/src/wallets/index.ts","moduleParts":{},"imported":[{"uid":"706f9776-85"},{"uid":"706f9776-40"},{"uid":"706f9776-34"},{"uid":"706f9776-36"},{"uid":"706f9776-38"}],"importedBy":[{"uid":"706f9776-52"}]},"706f9776-83":{"id":"/src/iframe/index.ts","moduleParts":{},"imported":[{"uid":"706f9776-32"},{"uid":"706f9776-42"},{"uid":"706f9776-44"}],"importedBy":[{"uid":"706f9776-46"}]},"706f9776-84":{"id":"starknet","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-46"},{"uid":"706f9776-48"},{"uid":"706f9776-66"},{"uid":"706f9776-0"},{"uid":"706f9776-60"},{"uid":"706f9776-58"}],"isExternal":true},"706f9776-85":{"id":"/src/wallets/types.ts","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-82"}]},"706f9776-86":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/index.js","moduleParts":{},"imported":[{"uid":"706f9776-92"},{"uid":"706f9776-93"}],"importedBy":[{"uid":"706f9776-80"}]},"706f9776-87":{"id":"@metamask/sdk","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-34"}],"isExternal":true},"706f9776-88":{"id":"@solana/web3.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-36"}],"isExternal":true},"706f9776-89":{"id":"starknetkit","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-38"}],"isExternal":true},"706f9776-90":{"id":"starknetkit/injected","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-38"}],"isExternal":true},"706f9776-91":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/index.js","moduleParts":{},"imported":[{"uid":"706f9776-30"},{"uid":"706f9776-94"},{"uid":"706f9776-2"}],"importedBy":[{"uid":"706f9776-32"}]},"706f9776-92":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/index.js","moduleParts":{},"imported":[{"uid":"706f9776-95"},{"uid":"706f9776-96"},{"uid":"706f9776-97"},{"uid":"706f9776-98"}],"importedBy":[{"uid":"706f9776-86"}]},"706f9776-93":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/index.js","moduleParts":{},"imported":[{"uid":"706f9776-72"},{"uid":"706f9776-99"},{"uid":"706f9776-100"},{"uid":"706f9776-101"},{"uid":"706f9776-102"},{"uid":"706f9776-103"},{"uid":"706f9776-104"}],"importedBy":[{"uid":"706f9776-86"}]},"706f9776-94":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/child/connectToParent.js","moduleParts":{},"imported":[{"uid":"706f9776-4"},{"uid":"706f9776-6"},{"uid":"706f9776-2"},{"uid":"706f9776-105"},{"uid":"706f9776-16"},{"uid":"706f9776-26"}],"importedBy":[{"uid":"706f9776-91"}]},"706f9776-95":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/contract.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-92"}]},"706f9776-96":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/errors.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-92"}]},"706f9776-97":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/components.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-92"}]},"706f9776-98":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/api/nonspec.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-92"}]},"706f9776-99":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/typedData.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-100":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/StarknetWindowObject.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-101":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/components.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-102":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/methods.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-103":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/events.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-104":{"id":"/home/broody/development/controller/node_modules/.pnpm/@starknet-io+types-js@0.7.10/node_modules/@starknet-io/types-js/dist/esm/wallet-api/errors.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-93"}]},"706f9776-105":{"id":"/home/broody/development/controller/node_modules/.pnpm/@cartridge+penpal@6.2.4/node_modules/@cartridge/penpal/lib/child/handleSynAckMessageFactory.js","moduleParts":{},"imported":[{"uid":"706f9776-2"},{"uid":"706f9776-12"},{"uid":"706f9776-18"}],"importedBy":[{"uid":"706f9776-94"}]},"706f9776-106":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/account_wasm_bg.wasm","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-56"}],"isExternal":true},"706f9776-107":{"id":"/home/broody/development/controller/packages/account-wasm/pkg-session/snippets/account-wasm-35da9c7350cbc3ae/src/wasm-mutex.js","moduleParts":{},"imported":[],"importedBy":[{"uid":"706f9776-54"}]}},"env":{"rollup":"4.34.6"},"options":{"gzip":true,"brotli":true,"sourcemap":false}};
|
|
4933
4933
|
|
|
4934
4934
|
const run = () => {
|
|
4935
4935
|
const width = window.innerWidth;
|
|
@@ -9,6 +9,7 @@ export declare class ArgentWallet implements WalletAdapter {
|
|
|
9
9
|
getInfo(): ExternalWallet;
|
|
10
10
|
connect(): Promise<ExternalWalletResponse<any>>;
|
|
11
11
|
signTypedData(data: TypedData): Promise<ExternalWalletResponse<any>>;
|
|
12
|
+
sendTransaction(_txn: any): Promise<ExternalWalletResponse<any>>;
|
|
12
13
|
switchChain(_chainId: string): Promise<boolean>;
|
|
13
14
|
getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
|
|
14
15
|
}
|
package/dist/wallets/bridge.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare class WalletBridge {
|
|
|
8
8
|
externalConnectWallet: (_origin: string) => (type: ExternalWalletType) => Promise<ExternalWalletResponse<unknown>>;
|
|
9
9
|
externalSignMessage: (_origin: string) => (type: ExternalWalletType, message: string) => Promise<ExternalWalletResponse<unknown>>;
|
|
10
10
|
externalSignTypedData: (_origin: string) => (type: ExternalWalletType, data: any) => Promise<ExternalWalletResponse<unknown>>;
|
|
11
|
+
externalSendTransaction: (_origin: string) => (type: ExternalWalletType, txn: any) => Promise<ExternalWalletResponse<unknown>>;
|
|
11
12
|
externalGetBalance: (_origin: string) => (type: ExternalWalletType, tokenAddress?: string) => Promise<ExternalWalletResponse<unknown>>;
|
|
12
13
|
};
|
|
13
14
|
detectWallets(): Promise<ExternalWallet[]>;
|
|
@@ -16,6 +17,7 @@ export declare class WalletBridge {
|
|
|
16
17
|
connectWallet(type: ExternalWalletType): Promise<ExternalWalletResponse>;
|
|
17
18
|
signMessage(type: ExternalWalletType, message: string): Promise<ExternalWalletResponse>;
|
|
18
19
|
signTypedData(type: ExternalWalletType, data: any): Promise<ExternalWalletResponse>;
|
|
20
|
+
sendTransaction(type: ExternalWalletType, txn: any): Promise<ExternalWalletResponse>;
|
|
19
21
|
getBalance(type: ExternalWalletType, tokenAddress?: string): Promise<ExternalWalletResponse>;
|
|
20
22
|
}
|
|
21
23
|
declare global {
|
|
@@ -11,6 +11,7 @@ export declare class MetaMaskWallet implements WalletAdapter {
|
|
|
11
11
|
signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
|
|
12
12
|
signMessage(message: string): Promise<ExternalWalletResponse<any>>;
|
|
13
13
|
signTypedData(data: any): Promise<ExternalWalletResponse<any>>;
|
|
14
|
+
sendTransaction(_txn: any): Promise<ExternalWalletResponse<any>>;
|
|
14
15
|
switchChain(chainId: string): Promise<boolean>;
|
|
15
16
|
getBalance(tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
|
|
16
17
|
}
|
|
@@ -3,11 +3,12 @@ export declare class PhantomWallet implements WalletAdapter {
|
|
|
3
3
|
readonly type: ExternalWalletType;
|
|
4
4
|
readonly platform: ExternalPlatform;
|
|
5
5
|
private account;
|
|
6
|
+
private getProvider;
|
|
6
7
|
isAvailable(): boolean;
|
|
7
8
|
getInfo(): ExternalWallet;
|
|
8
9
|
connect(): Promise<ExternalWalletResponse<any>>;
|
|
9
|
-
signTransaction(transaction: any): Promise<ExternalWalletResponse<any>>;
|
|
10
10
|
signMessage(message: string): Promise<ExternalWalletResponse<any>>;
|
|
11
|
+
sendTransaction(serailized_txn: string): Promise<ExternalWalletResponse<any>>;
|
|
11
12
|
switchChain(_chainId: string): Promise<boolean>;
|
|
12
13
|
getBalance(_tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
|
|
13
14
|
}
|
package/dist/wallets/types.d.ts
CHANGED
|
@@ -23,5 +23,6 @@ export interface WalletAdapter {
|
|
|
23
23
|
connect(): Promise<ExternalWalletResponse<any>>;
|
|
24
24
|
signMessage?(message: string): Promise<ExternalWalletResponse<any>>;
|
|
25
25
|
signTypedData?(data: any): Promise<ExternalWalletResponse<any>>;
|
|
26
|
+
sendTransaction(tx: any): Promise<ExternalWalletResponse<any>>;
|
|
26
27
|
getBalance(tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
|
|
27
28
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cartridge/controller",
|
|
3
|
-
"version": "0.7.9-alpha.
|
|
3
|
+
"version": "0.7.9-alpha.2",
|
|
4
4
|
"description": "Cartridge Controller",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -22,19 +22,18 @@
|
|
|
22
22
|
},
|
|
23
23
|
"peerDependencies": {
|
|
24
24
|
"@metamask/sdk": "^0.32.1",
|
|
25
|
-
"@
|
|
25
|
+
"@solana/web3.js": "^1.98.0",
|
|
26
26
|
"open": "^10.1.0",
|
|
27
27
|
"starknet": "^6.21.0",
|
|
28
28
|
"starknetkit": "^2.6.1"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@cartridge/penpal": "^6.2.4",
|
|
32
|
-
"@metamask/sdk": "^0.32.1",
|
|
33
32
|
"@starknet-io/types-js": "^0.7.7",
|
|
34
33
|
"@telegram-apps/sdk": "^2.4.0",
|
|
35
34
|
"cbor-x": "^1.5.0",
|
|
36
35
|
"fast-deep-equal": "^3.1.3",
|
|
37
|
-
"@cartridge/account-wasm": "0.7.9-alpha.
|
|
36
|
+
"@cartridge/account-wasm": "0.7.9-alpha.2"
|
|
38
37
|
},
|
|
39
38
|
"devDependencies": {
|
|
40
39
|
"@types/jest": "^29.5.14",
|
|
@@ -50,7 +49,7 @@
|
|
|
50
49
|
"vite-plugin-node-polyfills": "^0.22.0",
|
|
51
50
|
"vite-plugin-top-level-await": "^1.4.4",
|
|
52
51
|
"vite-plugin-wasm": "^3.4.1",
|
|
53
|
-
"@cartridge/tsconfig": "0.7.9-alpha.
|
|
52
|
+
"@cartridge/tsconfig": "0.7.9-alpha.2"
|
|
54
53
|
},
|
|
55
54
|
"scripts": {
|
|
56
55
|
"build:deps": "pnpm build",
|
|
@@ -71,8 +71,6 @@ export class ArgentWallet implements WalletAdapter {
|
|
|
71
71
|
throw new Error("Argent is not connected");
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
console.log("signTypedData", data);
|
|
75
|
-
|
|
76
74
|
const sig = await this.wallet.request({
|
|
77
75
|
type: "wallet_signTypedData",
|
|
78
76
|
params: data,
|
|
@@ -89,6 +87,14 @@ export class ArgentWallet implements WalletAdapter {
|
|
|
89
87
|
}
|
|
90
88
|
}
|
|
91
89
|
|
|
90
|
+
async sendTransaction(_txn: any): Promise<ExternalWalletResponse<any>> {
|
|
91
|
+
return {
|
|
92
|
+
success: false,
|
|
93
|
+
wallet: this.type,
|
|
94
|
+
error: "Not implemented",
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
92
98
|
async switchChain(_chainId: string): Promise<boolean> {
|
|
93
99
|
console.warn(
|
|
94
100
|
"Chain switching for Argent may require custom implementation",
|
package/src/wallets/bridge.ts
CHANGED
|
@@ -35,6 +35,9 @@ export class WalletBridge {
|
|
|
35
35
|
externalSignTypedData:
|
|
36
36
|
(_origin: string) => (type: ExternalWalletType, data: any) =>
|
|
37
37
|
this.signTypedData(type, data),
|
|
38
|
+
externalSendTransaction:
|
|
39
|
+
(_origin: string) => (type: ExternalWalletType, txn: any) =>
|
|
40
|
+
this.sendTransaction(type, txn),
|
|
38
41
|
externalGetBalance:
|
|
39
42
|
(_origin: string) =>
|
|
40
43
|
(type: ExternalWalletType, tokenAddress?: string) =>
|
|
@@ -73,11 +76,6 @@ export class WalletBridge {
|
|
|
73
76
|
type: ExternalWalletType,
|
|
74
77
|
): Promise<ExternalWalletResponse> {
|
|
75
78
|
try {
|
|
76
|
-
if (this.connectedWallets.has(type)) {
|
|
77
|
-
const wallet = this.connectedWallets.get(type)!;
|
|
78
|
-
return { success: true, wallet: type, account: wallet.type };
|
|
79
|
-
}
|
|
80
|
-
|
|
81
79
|
const wallet = this.getWalletAdapter(type);
|
|
82
80
|
const response = await wallet.connect();
|
|
83
81
|
|
|
@@ -131,6 +129,22 @@ export class WalletBridge {
|
|
|
131
129
|
}
|
|
132
130
|
}
|
|
133
131
|
|
|
132
|
+
async sendTransaction(
|
|
133
|
+
type: ExternalWalletType,
|
|
134
|
+
txn: any,
|
|
135
|
+
): Promise<ExternalWalletResponse> {
|
|
136
|
+
try {
|
|
137
|
+
if (!this.connectedWallets.has(type)) {
|
|
138
|
+
throw new Error(`Wallet ${type} is not connected`);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const wallet = this.connectedWallets.get(type)!;
|
|
142
|
+
return await wallet.sendTransaction(txn);
|
|
143
|
+
} catch (error) {
|
|
144
|
+
return this.handleError(type, error, "sending transaction with");
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
134
148
|
async getBalance(
|
|
135
149
|
type: ExternalWalletType,
|
|
136
150
|
tokenAddress?: string,
|
|
@@ -143,6 +143,14 @@ export class MetaMaskWallet implements WalletAdapter {
|
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
async sendTransaction(_txn: any): Promise<ExternalWalletResponse<any>> {
|
|
147
|
+
return {
|
|
148
|
+
success: false,
|
|
149
|
+
wallet: this.type,
|
|
150
|
+
error: "Not implemented",
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
146
154
|
async switchChain(chainId: string): Promise<boolean> {
|
|
147
155
|
try {
|
|
148
156
|
if (!this.isAvailable()) {
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { PublicKey, Transaction, VersionedTransaction } from "@solana/web3.js";
|
|
1
2
|
import {
|
|
2
3
|
WalletAdapter,
|
|
3
4
|
ExternalWallet,
|
|
@@ -6,11 +7,52 @@ import {
|
|
|
6
7
|
ExternalPlatform,
|
|
7
8
|
} from "../types";
|
|
8
9
|
|
|
10
|
+
interface PhantomProvider {
|
|
11
|
+
isPhantom: boolean;
|
|
12
|
+
publicKey: PublicKey | null;
|
|
13
|
+
isConnected: boolean;
|
|
14
|
+
connect(opts?: { onlyIfTrusted: boolean }): Promise<{ publicKey: PublicKey }>;
|
|
15
|
+
disconnect(): Promise<void>;
|
|
16
|
+
signTransaction(
|
|
17
|
+
transaction: Transaction | VersionedTransaction,
|
|
18
|
+
): Promise<Transaction | VersionedTransaction>;
|
|
19
|
+
signAllTransactions(
|
|
20
|
+
transactions: (Transaction | VersionedTransaction)[],
|
|
21
|
+
): Promise<(Transaction | VersionedTransaction)[]>;
|
|
22
|
+
signAndSendTransaction(
|
|
23
|
+
transaction: Transaction | VersionedTransaction,
|
|
24
|
+
opts?: { skipPreflight?: boolean; maxRetries?: number },
|
|
25
|
+
): Promise<{ signature: string }>;
|
|
26
|
+
signMessage(
|
|
27
|
+
message: Uint8Array,
|
|
28
|
+
display?: "utf8" | "hex",
|
|
29
|
+
): Promise<{ signature: Uint8Array }>;
|
|
30
|
+
on(
|
|
31
|
+
event: "connect" | "disconnect" | "accountChanged",
|
|
32
|
+
handler: (args: unknown) => void,
|
|
33
|
+
): void;
|
|
34
|
+
request(args: { method: string; params?: unknown }): Promise<unknown>;
|
|
35
|
+
}
|
|
36
|
+
|
|
9
37
|
export class PhantomWallet implements WalletAdapter {
|
|
10
38
|
readonly type: ExternalWalletType = "phantom";
|
|
11
39
|
readonly platform: ExternalPlatform = "solana";
|
|
12
40
|
private account: string | undefined = undefined;
|
|
13
41
|
|
|
42
|
+
private getProvider(): PhantomProvider {
|
|
43
|
+
if (typeof window === "undefined") {
|
|
44
|
+
throw new Error("Not ready");
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const provider = window.solana;
|
|
48
|
+
|
|
49
|
+
if (!provider?.isPhantom) {
|
|
50
|
+
throw new Error("Phantom is not available");
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return provider;
|
|
54
|
+
}
|
|
55
|
+
|
|
14
56
|
isAvailable(): boolean {
|
|
15
57
|
return typeof window !== "undefined" && !!window.solana?.isPhantom;
|
|
16
58
|
}
|
|
@@ -37,7 +79,7 @@ export class PhantomWallet implements WalletAdapter {
|
|
|
37
79
|
throw new Error("Phantom is not available");
|
|
38
80
|
}
|
|
39
81
|
|
|
40
|
-
const response = await
|
|
82
|
+
const response = await this.getProvider().connect();
|
|
41
83
|
if (response.publicKey) {
|
|
42
84
|
this.account = response.publicKey.toString();
|
|
43
85
|
return { success: true, wallet: this.type, account: this.account };
|
|
@@ -54,18 +96,20 @@ export class PhantomWallet implements WalletAdapter {
|
|
|
54
96
|
}
|
|
55
97
|
}
|
|
56
98
|
|
|
57
|
-
async
|
|
58
|
-
transaction: any,
|
|
59
|
-
): Promise<ExternalWalletResponse<any>> {
|
|
99
|
+
async signMessage(message: string): Promise<ExternalWalletResponse<any>> {
|
|
60
100
|
try {
|
|
61
101
|
if (!this.isAvailable() || !this.account) {
|
|
62
102
|
throw new Error("Phantom is not connected");
|
|
63
103
|
}
|
|
64
104
|
|
|
65
|
-
const
|
|
105
|
+
const encodedMessage = new TextEncoder().encode(message);
|
|
106
|
+
const result = await this.getProvider().signMessage(
|
|
107
|
+
encodedMessage,
|
|
108
|
+
"utf8",
|
|
109
|
+
);
|
|
66
110
|
return { success: true, wallet: this.type, result };
|
|
67
111
|
} catch (error) {
|
|
68
|
-
console.error(`Error signing
|
|
112
|
+
console.error(`Error signing message with Phantom:`, error);
|
|
69
113
|
return {
|
|
70
114
|
success: false,
|
|
71
115
|
wallet: this.type,
|
|
@@ -74,17 +118,24 @@ export class PhantomWallet implements WalletAdapter {
|
|
|
74
118
|
}
|
|
75
119
|
}
|
|
76
120
|
|
|
77
|
-
async
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
121
|
+
async sendTransaction(
|
|
122
|
+
serailized_txn: string,
|
|
123
|
+
): Promise<ExternalWalletResponse<any>> {
|
|
124
|
+
if (!this.isAvailable() || !this.account) {
|
|
125
|
+
throw new Error("Phantom is not connected");
|
|
126
|
+
}
|
|
82
127
|
|
|
83
|
-
|
|
84
|
-
const
|
|
85
|
-
|
|
128
|
+
try {
|
|
129
|
+
const txn = Transaction.from(Buffer.from(serailized_txn, "base64"));
|
|
130
|
+
const provider = this.getProvider();
|
|
131
|
+
const result = await provider.signAndSendTransaction(txn);
|
|
132
|
+
return {
|
|
133
|
+
success: true,
|
|
134
|
+
wallet: this.type,
|
|
135
|
+
result,
|
|
136
|
+
};
|
|
86
137
|
} catch (error) {
|
|
87
|
-
console.error(`Error
|
|
138
|
+
console.error(`Error sending transaction with Phantom:`, error);
|
|
88
139
|
return {
|
|
89
140
|
success: false,
|
|
90
141
|
wallet: this.type,
|
package/src/wallets/types.ts
CHANGED
|
@@ -28,5 +28,6 @@ export interface WalletAdapter {
|
|
|
28
28
|
connect(): Promise<ExternalWalletResponse<any>>;
|
|
29
29
|
signMessage?(message: string): Promise<ExternalWalletResponse<any>>;
|
|
30
30
|
signTypedData?(data: any): Promise<ExternalWalletResponse<any>>;
|
|
31
|
+
sendTransaction(tx: any): Promise<ExternalWalletResponse<any>>;
|
|
31
32
|
getBalance(tokenAddress?: string): Promise<ExternalWalletResponse<any>>;
|
|
32
33
|
}
|