@multiplatform.one/web3 7.33.1 → 7.34.1

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.
Files changed (61) hide show
  1. package/README.md +24 -6
  2. package/dist/cjs/phantom/crypto.cjs +108 -0
  3. package/dist/cjs/phantom/crypto.native.js +224 -0
  4. package/dist/cjs/phantom/crypto.native.js.map +1 -0
  5. package/dist/cjs/phantom/index.cjs +16 -1
  6. package/dist/cjs/phantom/index.native.js +16 -1
  7. package/dist/cjs/phantom/index.native.js.map +1 -1
  8. package/dist/cjs/phantom/solana.cjs +309 -0
  9. package/dist/cjs/phantom/solana.native.js +466 -0
  10. package/dist/cjs/phantom/solana.native.js.map +1 -0
  11. package/dist/cjs/phantom/urls.cjs +68 -3
  12. package/dist/cjs/phantom/urls.native.js +92 -4
  13. package/dist/cjs/phantom/urls.native.js.map +1 -1
  14. package/dist/esm/phantom/crypto.mjs +67 -0
  15. package/dist/esm/phantom/crypto.mjs.map +1 -0
  16. package/dist/esm/phantom/crypto.native.js +180 -0
  17. package/dist/esm/phantom/crypto.native.js.map +1 -0
  18. package/dist/esm/phantom/index.mjs +4 -2
  19. package/dist/esm/phantom/index.mjs.map +1 -1
  20. package/dist/esm/phantom/index.native.js +4 -2
  21. package/dist/esm/phantom/index.native.js.map +1 -1
  22. package/dist/esm/phantom/solana.mjs +271 -0
  23. package/dist/esm/phantom/solana.mjs.map +1 -0
  24. package/dist/esm/phantom/solana.native.js +425 -0
  25. package/dist/esm/phantom/solana.native.js.map +1 -0
  26. package/dist/esm/phantom/urls.mjs +53 -3
  27. package/dist/esm/phantom/urls.mjs.map +1 -1
  28. package/dist/esm/phantom/urls.native.js +77 -4
  29. package/dist/esm/phantom/urls.native.js.map +1 -1
  30. package/dist/jsx/phantom/crypto.mjs +67 -0
  31. package/dist/jsx/phantom/crypto.mjs.map +1 -0
  32. package/dist/jsx/phantom/crypto.native.js +224 -0
  33. package/dist/jsx/phantom/crypto.native.js.map +1 -0
  34. package/dist/jsx/phantom/index.mjs +4 -2
  35. package/dist/jsx/phantom/index.mjs.map +1 -1
  36. package/dist/jsx/phantom/index.native.js +16 -1
  37. package/dist/jsx/phantom/index.native.js.map +1 -1
  38. package/dist/jsx/phantom/solana.mjs +271 -0
  39. package/dist/jsx/phantom/solana.mjs.map +1 -0
  40. package/dist/jsx/phantom/solana.native.js +466 -0
  41. package/dist/jsx/phantom/solana.native.js.map +1 -0
  42. package/dist/jsx/phantom/urls.mjs +53 -3
  43. package/dist/jsx/phantom/urls.mjs.map +1 -1
  44. package/dist/jsx/phantom/urls.native.js +92 -4
  45. package/dist/jsx/phantom/urls.native.js.map +1 -1
  46. package/package.json +7 -6
  47. package/src/phantom/crypto.spec.ts +61 -0
  48. package/src/phantom/crypto.ts +88 -0
  49. package/src/phantom/index.ts +38 -5
  50. package/src/phantom/solana.spec.ts +262 -0
  51. package/src/phantom/solana.ts +374 -0
  52. package/src/phantom/urls.spec.ts +101 -10
  53. package/src/phantom/urls.ts +119 -4
  54. package/types/phantom/crypto.d.ts +27 -0
  55. package/types/phantom/crypto.d.ts.map +1 -0
  56. package/types/phantom/index.d.ts +3 -1
  57. package/types/phantom/index.d.ts.map +1 -1
  58. package/types/phantom/solana.d.ts +113 -0
  59. package/types/phantom/solana.d.ts.map +1 -0
  60. package/types/phantom/urls.d.ts +46 -2
  61. package/types/phantom/urls.d.ts.map +1 -1
package/README.md CHANGED
@@ -545,12 +545,15 @@ if (status === "profile-incomplete") {
545
545
 
546
546
  ## Phantom on a phone
547
547
 
548
- `@multiplatform.one/web3/phantom` reaches Phantom's EVM wallet from Chrome
549
- or Safari on a phone, Custom Tabs and `ASWebAuthenticationSession` included.
550
- Phantom's deeplinks carry no EVM methods, so it goes through Phantom's in-app
551
- browser. Off Phantom, the tap calls `openInPhantom()` with nothing awaited
552
- first. The page reopens inside Phantom, where its EVM provider is injected and
553
- `connectPhantomEvm` returns the usual EVM client. Base Sepolia and other testnets need Phantom's Testnet Mode.
548
+ `@multiplatform.one/web3/phantom` reaches the Phantom app from Chrome or
549
+ Safari on a phone, Custom Tabs and `ASWebAuthenticationSession` included.
550
+ Phantom's deeplinks carry Solana only, so the two families take different
551
+ roads.
552
+
553
+ EVM goes through Phantom's in-app browser. Off Phantom, the tap calls
554
+ `openInPhantom()` with nothing awaited first; the page reopens inside Phantom,
555
+ where its EVM provider is injected and `connectPhantomEvm` returns the usual
556
+ EVM client. Base Sepolia and other testnets need Phantom's Testnet Mode.
554
557
 
555
558
  ```ts
556
559
  import { connectPhantomEvm, openInPhantom, phantomEvmRoute } from "@multiplatform.one/web3/phantom";
@@ -564,6 +567,21 @@ button.onclick = () => {
564
567
  };
565
568
  ```
566
569
 
570
+ Solana uses Phantom's encrypted deeplinks. `phantomDeeplink` keeps the dapp
571
+ keypair and session in localStorage, so they survive the reload on return.
572
+ Each request navigates before it returns, inside the tap. On every page load,
573
+ `handleRedirect()` reads Phantom's answer off the URL.
574
+
575
+ ```ts
576
+ const phantom = phantomDeeplink({ appUrl: location.origin, cluster: "devnet" });
577
+ const answer = phantom.handleRedirect();
578
+ if (answer?.ok && answer.method === "signTransaction") {
579
+ await sendSolanaTransaction(rpcUrl, answer.transaction);
580
+ }
581
+ connectButton.onclick = () => phantom.connect();
582
+ payButton.onclick = () => phantom.signTransaction(preparedTransactionBytes);
583
+ ```
584
+
567
585
  ## License
568
586
 
569
587
  Apache-2.0
@@ -0,0 +1,108 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all) __defProp(target, name, {
9
+ get: all[name],
10
+ enumerable: true
11
+ });
12
+ };
13
+ var __copyProps = (to, from, except, desc) => {
14
+ if (from && typeof from === "object" || typeof from === "function") {
15
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
16
+ get: () => from[key],
17
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
18
+ });
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
23
+ // If the importer is in node compatibility mode or this is not an ESM
24
+ // file that has been converted to a CommonJS file using a Babel-
25
+ // compatible transform (i.e. "__esModule" has not been set), then set
26
+ // "default" to the CommonJS "module.exports" for node compatibility.
27
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
28
+ value: mod,
29
+ enumerable: true
30
+ }) : target, mod));
31
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
32
+ value: true
33
+ }), mod);
34
+ var crypto_exports = {};
35
+ __export(crypto_exports, {
36
+ PhantomDecryptError: () => PhantomDecryptError,
37
+ boxKeyPairFromSecretKey: () => boxKeyPairFromSecretKey,
38
+ decryptPayload: () => decryptPayload,
39
+ encryptPayload: () => encryptPayload,
40
+ generateBoxKeyPair: () => generateBoxKeyPair,
41
+ sharedSecret: () => sharedSecret
42
+ });
43
+ module.exports = __toCommonJS(crypto_exports);
44
+ var import_salsa = require("@noble/ciphers/salsa");
45
+ var import_ed25519 = require("@noble/curves/ed25519");
46
+ var import_bs58 = __toESM(require("bs58"));
47
+ class PhantomDecryptError extends Error {
48
+ constructor(message = "could not decrypt Phantom's response with this session's key") {
49
+ super(message);
50
+ this.name = "PhantomDecryptError";
51
+ }
52
+ }
53
+ function randomBytes(length) {
54
+ const bytes = new Uint8Array(length);
55
+ globalThis.crypto.getRandomValues(bytes);
56
+ return bytes;
57
+ }
58
+ function generateBoxKeyPair() {
59
+ const secretKey = randomBytes(32);
60
+ return {
61
+ secretKey,
62
+ publicKey: import_ed25519.x25519.getPublicKey(secretKey)
63
+ };
64
+ }
65
+ function boxKeyPairFromSecretKey(secretKey) {
66
+ return {
67
+ secretKey,
68
+ publicKey: import_ed25519.x25519.getPublicKey(secretKey)
69
+ };
70
+ }
71
+ const sigma = new Uint32Array([1634760805, 857760878, 2036477234, 1797285236]);
72
+ function toWords(bytes) {
73
+ const view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
74
+ const words = new Uint32Array(bytes.length / 4);
75
+ for (let i = 0; i < words.length; i += 1) words[i] = view.getUint32(i * 4, true);
76
+ return words;
77
+ }
78
+ function fromWords(words) {
79
+ const bytes = new Uint8Array(words.length * 4);
80
+ const view = new DataView(bytes.buffer);
81
+ for (let i = 0; i < words.length; i += 1) view.setUint32(i * 4, words[i], true);
82
+ return bytes;
83
+ }
84
+ function sharedSecret(theirPublicKey, mySecretKey) {
85
+ const point = import_ed25519.x25519.getSharedSecret(mySecretKey, theirPublicKey);
86
+ const out = new Uint32Array(8);
87
+ (0, import_salsa.hsalsa)(sigma, toWords(point), new Uint32Array(4), out);
88
+ return fromWords(out);
89
+ }
90
+ function encryptPayload(value, secret, nonce = randomBytes(24)) {
91
+ const plaintext = new TextEncoder().encode(JSON.stringify(value));
92
+ const sealed = (0, import_salsa.xsalsa20poly1305)(secret, nonce).encrypt(plaintext);
93
+ return {
94
+ nonce: import_bs58.default.encode(nonce),
95
+ payload: import_bs58.default.encode(sealed)
96
+ };
97
+ }
98
+ function decryptPayload(data, nonce, secret) {
99
+ let opened;
100
+ try {
101
+ opened = (0, import_salsa.xsalsa20poly1305)(secret, import_bs58.default.decode(nonce)).decrypt(import_bs58.default.decode(data));
102
+ } catch (error) {
103
+ throw Object.assign(new PhantomDecryptError(), {
104
+ cause: error
105
+ });
106
+ }
107
+ return JSON.parse(new TextDecoder().decode(opened));
108
+ }
@@ -0,0 +1,224 @@
1
+ "use strict";
2
+
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __export = (target, all) => {
10
+ for (var name in all) __defProp(target, name, {
11
+ get: all[name],
12
+ enumerable: true
13
+ });
14
+ };
15
+ var __copyProps = (to, from, except, desc) => {
16
+ if (from && typeof from === "object" || typeof from === "function") {
17
+ for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
18
+ get: () => from[key],
19
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
20
+ });
21
+ }
22
+ return to;
23
+ };
24
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
25
+ // If the importer is in node compatibility mode or this is not an ESM
26
+ // file that has been converted to a CommonJS file using a Babel-
27
+ // compatible transform (i.e. "__esModule" has not been set), then set
28
+ // "default" to the CommonJS "module.exports" for node compatibility.
29
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
30
+ value: mod,
31
+ enumerable: true
32
+ }) : target, mod));
33
+ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
34
+ value: true
35
+ }), mod);
36
+ var crypto_exports = {};
37
+ __export(crypto_exports, {
38
+ PhantomDecryptError: () => PhantomDecryptError,
39
+ boxKeyPairFromSecretKey: () => boxKeyPairFromSecretKey,
40
+ decryptPayload: () => decryptPayload,
41
+ encryptPayload: () => encryptPayload,
42
+ generateBoxKeyPair: () => generateBoxKeyPair,
43
+ sharedSecret: () => sharedSecret
44
+ });
45
+ module.exports = __toCommonJS(crypto_exports);
46
+ var import_salsa = require("@noble/ciphers/salsa");
47
+ var import_ed25519 = require("@noble/curves/ed25519");
48
+ var import_bs58 = __toESM(require("bs58"));
49
+ function _assert_this_initialized(self) {
50
+ if (self === void 0) {
51
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
52
+ }
53
+ return self;
54
+ }
55
+ function _call_super(_this, derived, args) {
56
+ derived = _get_prototype_of(derived);
57
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
58
+ }
59
+ function _class_call_check(instance, Constructor) {
60
+ if (!(instance instanceof Constructor)) {
61
+ throw new TypeError("Cannot call a class as a function");
62
+ }
63
+ }
64
+ function _construct(Parent, args, Class) {
65
+ if (_is_native_reflect_construct()) {
66
+ _construct = Reflect.construct;
67
+ } else {
68
+ _construct = function construct(Parent2, args2, Class2) {
69
+ var a = [null];
70
+ a.push.apply(a, args2);
71
+ var Constructor = Function.bind.apply(Parent2, a);
72
+ var instance = new Constructor();
73
+ if (Class2) _set_prototype_of(instance, Class2.prototype);
74
+ return instance;
75
+ };
76
+ }
77
+ return _construct.apply(null, arguments);
78
+ }
79
+ function _get_prototype_of(o) {
80
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o2) {
81
+ return o2.__proto__ || Object.getPrototypeOf(o2);
82
+ };
83
+ return _get_prototype_of(o);
84
+ }
85
+ function _inherits(subClass, superClass) {
86
+ if (typeof superClass !== "function" && superClass !== null) {
87
+ throw new TypeError("Super expression must either be null or a function");
88
+ }
89
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
90
+ constructor: {
91
+ value: subClass,
92
+ writable: true,
93
+ configurable: true
94
+ }
95
+ });
96
+ if (superClass) _set_prototype_of(subClass, superClass);
97
+ }
98
+ function _is_native_function(fn) {
99
+ return Function.toString.call(fn).indexOf("[native code]") !== -1;
100
+ }
101
+ function _possible_constructor_return(self, call) {
102
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
103
+ return call;
104
+ }
105
+ return _assert_this_initialized(self);
106
+ }
107
+ function _set_prototype_of(o, p) {
108
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o2, p2) {
109
+ o2.__proto__ = p2;
110
+ return o2;
111
+ };
112
+ return _set_prototype_of(o, p);
113
+ }
114
+ function _type_of(obj) {
115
+ "@swc/helpers - typeof";
116
+
117
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
118
+ }
119
+ function _wrap_native_super(Class) {
120
+ var _cache = typeof Map === "function" ? /* @__PURE__ */new Map() : void 0;
121
+ _wrap_native_super = function wrapNativeSuper(Class2) {
122
+ if (Class2 === null || !_is_native_function(Class2)) return Class2;
123
+ if (typeof Class2 !== "function") {
124
+ throw new TypeError("Super expression must either be null or a function");
125
+ }
126
+ if (typeof _cache !== "undefined") {
127
+ if (_cache.has(Class2)) return _cache.get(Class2);
128
+ _cache.set(Class2, Wrapper);
129
+ }
130
+ function Wrapper() {
131
+ return _construct(Class2, arguments, _get_prototype_of(this).constructor);
132
+ }
133
+ Wrapper.prototype = Object.create(Class2.prototype, {
134
+ constructor: {
135
+ value: Wrapper,
136
+ enumerable: false,
137
+ writable: true,
138
+ configurable: true
139
+ }
140
+ });
141
+ return _set_prototype_of(Wrapper, Class2);
142
+ };
143
+ return _wrap_native_super(Class);
144
+ }
145
+ function _is_native_reflect_construct() {
146
+ try {
147
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
148
+ } catch (_) {}
149
+ return (_is_native_reflect_construct = function () {
150
+ return !!result;
151
+ })();
152
+ }
153
+ var PhantomDecryptError = /* @__PURE__ */function (Error1) {
154
+ "use strict";
155
+
156
+ _inherits(PhantomDecryptError2, Error1);
157
+ function PhantomDecryptError2() {
158
+ var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "could not decrypt Phantom's response with this session's key";
159
+ _class_call_check(this, PhantomDecryptError2);
160
+ var _this;
161
+ _this = _call_super(this, PhantomDecryptError2, [message]);
162
+ _this.name = "PhantomDecryptError";
163
+ return _this;
164
+ }
165
+ return PhantomDecryptError2;
166
+ }(_wrap_native_super(Error));
167
+ function randomBytes(length) {
168
+ var bytes = new Uint8Array(length);
169
+ globalThis.crypto.getRandomValues(bytes);
170
+ return bytes;
171
+ }
172
+ function generateBoxKeyPair() {
173
+ var secretKey = randomBytes(32);
174
+ return {
175
+ secretKey,
176
+ publicKey: import_ed25519.x25519.getPublicKey(secretKey)
177
+ };
178
+ }
179
+ function boxKeyPairFromSecretKey(secretKey) {
180
+ return {
181
+ secretKey,
182
+ publicKey: import_ed25519.x25519.getPublicKey(secretKey)
183
+ };
184
+ }
185
+ var sigma = new Uint32Array([1634760805, 857760878, 2036477234, 1797285236]);
186
+ function toWords(bytes) {
187
+ var view = new DataView(bytes.buffer, bytes.byteOffset, bytes.byteLength);
188
+ var words = new Uint32Array(bytes.length / 4);
189
+ for (var i = 0; i < words.length; i += 1) words[i] = view.getUint32(i * 4, true);
190
+ return words;
191
+ }
192
+ function fromWords(words) {
193
+ var bytes = new Uint8Array(words.length * 4);
194
+ var view = new DataView(bytes.buffer);
195
+ for (var i = 0; i < words.length; i += 1) view.setUint32(i * 4, words[i], true);
196
+ return bytes;
197
+ }
198
+ function sharedSecret(theirPublicKey, mySecretKey) {
199
+ var point = import_ed25519.x25519.getSharedSecret(mySecretKey, theirPublicKey);
200
+ var out = new Uint32Array(8);
201
+ (0, import_salsa.hsalsa)(sigma, toWords(point), new Uint32Array(4), out);
202
+ return fromWords(out);
203
+ }
204
+ function encryptPayload(value, secret) {
205
+ var nonce = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : randomBytes(24);
206
+ var plaintext = new TextEncoder().encode(JSON.stringify(value));
207
+ var sealed = (0, import_salsa.xsalsa20poly1305)(secret, nonce).encrypt(plaintext);
208
+ return {
209
+ nonce: import_bs58.default.encode(nonce),
210
+ payload: import_bs58.default.encode(sealed)
211
+ };
212
+ }
213
+ function decryptPayload(data, nonce, secret) {
214
+ var opened;
215
+ try {
216
+ opened = (0, import_salsa.xsalsa20poly1305)(secret, import_bs58.default.decode(nonce)).decrypt(import_bs58.default.decode(data));
217
+ } catch (error) {
218
+ throw Object.assign(new PhantomDecryptError(), {
219
+ cause: error
220
+ });
221
+ }
222
+ return JSON.parse(new TextDecoder().decode(opened));
223
+ }
224
+ //# sourceMappingURL=crypto.native.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","crypto_exports","__export","PhantomDecryptError","boxKeyPairFromSecretKey","decryptPayload","encryptPayload","generateBoxKeyPair","sharedSecret","module","exports","import_salsa","require","import_ed25519","import_bs58","__toESM","_assert_this_initialized","self","ReferenceError","_call_super","_this","derived","args","_get_prototype_of","_possible_constructor_return","_is_native_reflect_construct","Reflect","construct","constructor","apply","_class_call_check","instance","Constructor","TypeError","_construct","Parent","Class","Parent2","args2","Class2","a","push","Function","bind","_set_prototype_of","prototype","arguments","o","Object","setPrototypeOf","getPrototypeOf","o2","__proto__","_inherits","subClass","superClass","create","writable","configurable"],"sources":["../../../src/phantom/crypto.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,cAAA;AAAAC,QAAA,CAAAD,cAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAA,mBAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAA,uBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAA,cAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAA,kBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAA;AAAA;AAAAC,MAAA,CAAAC,OAAA,GAAAd,YAAyC,CAAAK,cAAA;AACzC,IAAAU,YAAA,GAAAC,OAAuB;AACvB,IAAAC,cAAiB,GAAAD,OAAA;AAcV,IAAAE,WAAM,GAAAC,OAAA,CAAAH,OAAA,CAA4B,MAAM;AAAA,SAC7CI,wBAAsBA,CAAAC,IAAA;EACpB,IAAAA,IAAM,UAAO;IACb,MAAK,IAAAC,cAAO;EACd;EACF,OAAAD,IAAA;AAEA;AACE,SAAME,WAAYA,CAAAC,KAAA,EAAAC,OAAW,EAAMC,IAAA;EACnCD,OAAA,GAAAE,iBAAkB,CAAAF,OAAgB;EAClC,OAAOG,4BAAA,CAAAJ,KAAA,EAAAK,4BAAA,KAAAC,OAAA,CAAAC,SAAA,CAAAN,OAAA,EAAAC,IAAA,QAAAC,iBAAA,CAAAH,KAAA,EAAAQ,WAAA,IAAAP,OAAA,CAAAQ,KAAA,CAAAT,KAAA,EAAAE,IAAA;AACT;AAGO,SAASQ,kBAAAC,QAAiC,EAAAC,WAAA;EAC/C,MAAMD,QAAA,YAAYC,WAAc;IAChC,MAAO,IAAEC,SAAW,oCAAkB;EACxC;AAEO;AACL,SAAOC,UAAEA,CAAAC,MAAW,EAAAb,IAAA,EAAWc,KAAA;EACjC,IAAAX,4BAAA;IAEAS,UAAc,GAAAR,OAAI,CAAAC,SAAa;EAE/B,OAAS;IACPO,UAAM,GAAO,SAAIP,SAAeA,CAAAU,OAAQ,EAAAC,KAAM,EAAAC,MAAA,EAAY;MAC1D,IAAMC,CAAA,IACN,IAAS,CACT;MACFA,CAAA,CAAAC,IAAA,CAAAZ,KAAA,CAAAW,CAAA,EAAAF,KAAA;MAEA,IAASN,WAAU,GAAAU,QAAgC,CAAAC,IAAA,CAAAd,KAAA,CAAAQ,OAAA,EAAAG,CAAA;MACjD,IAAMT,QAAQ,GAAI,IAAAC,WAAW,CAAM;MACnC,IAAMO,MAAO,EAAAK,iBAAmB,CAAAb,QAAM,EAAAQ,MAAA,CAAAM,SAAA;MACtC,OAASd,QAAO;IAChB;EACF;EAOO,OAASG,UAAA,CAAAL,KAAa,OAAAiB,SAA4B;AACvD;AACA,SAAMvB,iBAAUA,CAAAwB,CAAA,EAAY;EAC5BxB,iBAAA,GAAAyB,MAAO,CAAAC,cAAe,GAAAD,MAAQ,CAAAE,cAAiB,GAAG,SAAGA,eAAAC,EAAA;IACrD,OAAOA,EAAA,CAAAC,SAAa,IAAAJ,MAAA,CAAAE,cAAA,CAAAC,EAAA;EACtB;EAGO,OAAS5B,iBACd,CAAAwB,CAAA;AAIA;AACA,SAAMM,UAAAC,QAAS,EAAAC,UAAA;EACf,WAASA,UAAO,eAAK,IAAAA,UAAY,KAAG,MAAS;IAC/C,UAAAtB,SAAA;EAGO;EACLqB,QAAI,CAAAT,SAAA,GAAAG,MAAA,CAAAQ,MAAA,CAAAD,UAAA,IAAAA,UAAA,CAAAV,SAAA;IACJjB,WAAI;MACF5B,KAAA,EAAAsD,QAAS;MACXG,QAAS,MAAO;MACdC,YAAa;IACf;EACA;EACF,IAAAH,UAAA,EAAAX,iBAAA,CAAAU,QAAA,EAAAC,UAAA","ignoreList":[]}
@@ -22,15 +22,30 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
22
22
  }), mod);
23
23
  var phantom_exports = {};
24
24
  __export(phantom_exports, {
25
+ PhantomDecryptError: () => import_crypto.PhantomDecryptError,
26
+ PhantomNotConnectedError: () => import_solana.PhantomNotConnectedError,
25
27
  PhantomNotInjectedError: () => import_evm.PhantomNotInjectedError,
28
+ boxKeyPairFromSecretKey: () => import_crypto.boxKeyPairFromSecretKey,
26
29
  connectPhantomEvm: () => import_evm.connectPhantomEvm,
30
+ decryptPayload: () => import_crypto.decryptPayload,
27
31
  discoverPhantomEthereumProvider: () => import_evm.discoverPhantomEthereumProvider,
32
+ encryptPayload: () => import_crypto.encryptPayload,
33
+ generateBoxKeyPair: () => import_crypto.generateBoxKeyPair,
28
34
  openInPhantom: () => import_evm.openInPhantom,
35
+ parsePhantomRedirect: () => import_urls.parsePhantomRedirect,
29
36
  phantomBrowseUrl: () => import_urls.phantomBrowseUrl,
37
+ phantomConnectUrl: () => import_urls.phantomConnectUrl,
38
+ phantomDeeplink: () => import_solana.phantomDeeplink,
30
39
  phantomEthereumProvider: () => import_evm.phantomEthereumProvider,
31
40
  phantomEvmRoute: () => import_evm.phantomEvmRoute,
32
- phantomUniversalLinkBase: () => import_urls.phantomUniversalLinkBase
41
+ phantomMethodUrl: () => import_urls.phantomMethodUrl,
42
+ phantomUniversalLinkBase: () => import_urls.phantomUniversalLinkBase,
43
+ sendSolanaTransaction: () => import_solana.sendSolanaTransaction,
44
+ sharedSecret: () => import_crypto.sharedSecret,
45
+ stripPhantomRedirect: () => import_urls.stripPhantomRedirect
33
46
  });
34
47
  module.exports = __toCommonJS(phantom_exports);
48
+ var import_crypto = require("./crypto.cjs");
35
49
  var import_evm = require("./evm.cjs");
50
+ var import_solana = require("./solana.cjs");
36
51
  var import_urls = require("./urls.cjs");
@@ -24,16 +24,31 @@ var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
24
24
  }), mod);
25
25
  var phantom_exports = {};
26
26
  __export(phantom_exports, {
27
+ PhantomDecryptError: () => import_crypto.PhantomDecryptError,
28
+ PhantomNotConnectedError: () => import_solana.PhantomNotConnectedError,
27
29
  PhantomNotInjectedError: () => import_evm.PhantomNotInjectedError,
30
+ boxKeyPairFromSecretKey: () => import_crypto.boxKeyPairFromSecretKey,
28
31
  connectPhantomEvm: () => import_evm.connectPhantomEvm,
32
+ decryptPayload: () => import_crypto.decryptPayload,
29
33
  discoverPhantomEthereumProvider: () => import_evm.discoverPhantomEthereumProvider,
34
+ encryptPayload: () => import_crypto.encryptPayload,
35
+ generateBoxKeyPair: () => import_crypto.generateBoxKeyPair,
30
36
  openInPhantom: () => import_evm.openInPhantom,
37
+ parsePhantomRedirect: () => import_urls.parsePhantomRedirect,
31
38
  phantomBrowseUrl: () => import_urls.phantomBrowseUrl,
39
+ phantomConnectUrl: () => import_urls.phantomConnectUrl,
40
+ phantomDeeplink: () => import_solana.phantomDeeplink,
32
41
  phantomEthereumProvider: () => import_evm.phantomEthereumProvider,
33
42
  phantomEvmRoute: () => import_evm.phantomEvmRoute,
34
- phantomUniversalLinkBase: () => import_urls.phantomUniversalLinkBase
43
+ phantomMethodUrl: () => import_urls.phantomMethodUrl,
44
+ phantomUniversalLinkBase: () => import_urls.phantomUniversalLinkBase,
45
+ sendSolanaTransaction: () => import_solana.sendSolanaTransaction,
46
+ sharedSecret: () => import_crypto.sharedSecret,
47
+ stripPhantomRedirect: () => import_urls.stripPhantomRedirect
35
48
  });
36
49
  module.exports = __toCommonJS(phantom_exports);
50
+ var import_crypto = require("./crypto.native.js");
37
51
  var import_evm = require("./evm.native.js");
52
+ var import_solana = require("./solana.native.js");
38
53
  var import_urls = require("./urls.native.js");
39
54
  //# sourceMappingURL=index.native.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","phantom_exports","__export","PhantomNotInjectedError","import_evm","connectPhantomEvm","discoverPhantomEthereumProvider","openInPhantom","phantomBrowseUrl","import_urls","phantomEthereumProvider","phantomEvmRoute","phantomUniversalLinkBase","module","exports","require"],"sources":["../../../src/phantom/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAC,UAAA,CAAAD,uBAAA;EAAAE,iBAAA,EAAAA,CAAA,KAAAD,UAAA,CAAAC,iBAAA;EAAAC,+BAAA,EAAAA,CAAA,KAAAF,UAAA,CAAAE,+BAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAH,UAAA,CAAAG,aAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAC,WAAA,CAAAD,gBAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAN,UAAA,CAAAM,uBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAP,UAAA,CAAAO,eAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAH,WAAA,CAAAG;AAAA;AAIAC,MAAA,CAAAC,OAAA,GAUOlB,YAAA,CAAAK,eAAA;AACP,IAAAG,UAAA,GAAAW,OAA2D","ignoreList":[]}
1
+ {"version":3,"names":["__toCommonJS","mod","__copyProps","__defProp","value","phantom_exports","__export","PhantomDecryptError","import_crypto","PhantomNotConnectedError","import_solana","PhantomNotInjectedError","import_evm","boxKeyPairFromSecretKey","connectPhantomEvm","decryptPayload","discoverPhantomEthereumProvider","encryptPayload","generateBoxKeyPair","openInPhantom","parsePhantomRedirect","import_urls","phantomBrowseUrl","phantomConnectUrl","phantomDeeplink","phantomEthereumProvider","phantomEvmRoute","phantomMethodUrl","phantomUniversalLinkBase","sendSolanaTransaction","sharedSecret","stripPhantomRedirect","module","exports","require"],"sources":["../../../src/phantom/index.ts"],"sourcesContent":[null],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,GAAA,IAAAC,WAAA,CAAAC,SAAA;EAAAC,KAAA;AAAA,IAAAH,GAAA;AAAA,IAAAI,eAAA;AAAAC,QAAA,CAAAD,eAAA;EAAAE,mBAAA,EAAAA,CAAA,KAAAC,aAAA,CAAAD,mBAAA;EAAAE,wBAAA,EAAAA,CAAA,KAAAC,aAAA,CAAAD,wBAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAC,UAAA,CAAAD,uBAAA;EAAAE,uBAAA,EAAAA,CAAA,KAAAL,aAAA,CAAAK,uBAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAF,UAAA,CAAAE,iBAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAP,aAAA,CAAAO,cAAA;EAAAC,+BAAA,EAAAA,CAAA,KAAAJ,UAAA,CAAAI,+BAAA;EAAAC,cAAA,EAAAA,CAAA,KAAAT,aAAA,CAAAS,cAAA;EAAAC,kBAAA,EAAAA,CAAA,KAAAV,aAAA,CAAAU,kBAAA;EAAAC,aAAA,EAAAA,CAAA,KAAAP,UAAA,CAAAO,aAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAC,WAAA,CAAAD,oBAAA;EAAAE,gBAAA,EAAAA,CAAA,KAAAD,WAAA,CAAAC,gBAAA;EAAAC,iBAAA,EAAAA,CAAA,KAAAF,WAAA,CAAAE,iBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAd,aAAA,CAAAc,eAAA;EAAAC,uBAAA,EAAAA,CAAA,KAAAb,UAAA,CAAAa,uBAAA;EAAAC,eAAA,EAAAA,CAAA,KAAAd,UAAA,CAAAc,eAAA;EAAAC,gBAAA,EAAAA,CAAA,KAAAN,WAAA,CAAAM,gBAAA;EAAAC,wBAAA,EAAAA,CAAA,KAAAP,WAAA,CAAAO,wBAAA;EAAAC,qBAAA,EAAAA,CAAA,KAAAnB,aAAA,CAAAmB,qBAAA;EAAAC,YAAA,EAAAA,CAAA,KAAAtB,aAAA,CAAAsB,YAAA;EAAAC,oBAAA,EAAAA,CAAA,KAAAV,WAAA,CAAAU;AAAA;AAKAC,MAAA,CAAAC,OAAA,GAAAjC,YASO,CAAAK,eAAA;AACP,IAAAG,aAUO,GAAA0B,OAAA;AACP,IAAAtB,UAAA,GAAAsB,OASO;AACP,IAAAxB,aAAA,GAYOwB,OAAA","ignoreList":[]}