@dynamic-labs-sdk/solana 0.13.0 → 0.14.0

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 (110) hide show
  1. package/dist/{addSolanaWalletStandardExtension-DikNvaRF.esm.js → addSolanaWalletStandardExtension-B7GpGFx3.esm.js} +2 -2
  2. package/dist/{addSolanaWalletStandardExtension-DikNvaRF.esm.js.map → addSolanaWalletStandardExtension-B7GpGFx3.esm.js.map} +1 -1
  3. package/dist/{addSolanaWalletStandardExtension-D5uAzwwi.cjs.js → addSolanaWalletStandardExtension-Bv39eDZc.cjs.js} +2 -2
  4. package/dist/{addSolanaWalletStandardExtension-D5uAzwwi.cjs.js.map → addSolanaWalletStandardExtension-Bv39eDZc.cjs.js.map} +1 -1
  5. package/dist/{addWaasSolanaExtension-DBfiocjd.cjs.js → addWaasSolanaExtension-BaxzWnYL.cjs.js} +3 -3
  6. package/dist/{addWaasSolanaExtension-DBfiocjd.cjs.js.map → addWaasSolanaExtension-BaxzWnYL.cjs.js.map} +1 -1
  7. package/dist/{addWaasSolanaExtension-FUlrXwXm.esm.js → addWaasSolanaExtension-ofYQDYyc.esm.js} +2 -2
  8. package/dist/{addWaasSolanaExtension-FUlrXwXm.esm.js.map → addWaasSolanaExtension-ofYQDYyc.esm.js.map} +1 -1
  9. package/dist/exports/index.d.ts +6 -2
  10. package/dist/exports/index.d.ts.map +1 -1
  11. package/dist/index.cjs.js +980 -3
  12. package/dist/index.cjs.js.map +1 -1
  13. package/dist/index.esm.js +979 -7
  14. package/dist/index.esm.js.map +1 -1
  15. package/dist/{isVersionedTransaction-s73AwAKu.esm.js → isVersionedTransaction-CecentWi.esm.js} +2 -2
  16. package/dist/{isVersionedTransaction-s73AwAKu.esm.js.map → isVersionedTransaction-CecentWi.esm.js.map} +1 -1
  17. package/dist/{isVersionedTransaction-CSkcEh-G.cjs.js → isVersionedTransaction-DW-V1tUS.cjs.js} +3 -3
  18. package/dist/{isVersionedTransaction-CSkcEh-G.cjs.js.map → isVersionedTransaction-DW-V1tUS.cjs.js.map} +1 -1
  19. package/dist/phantomRedirect/PhantomRedirectWalletProvider.types.d.ts +112 -0
  20. package/dist/phantomRedirect/PhantomRedirectWalletProvider.types.d.ts.map +1 -0
  21. package/dist/phantomRedirect/addPhantomRedirectSolanaExtension/addPhantomRedirectSolanaExtension.d.ts +115 -0
  22. package/dist/phantomRedirect/addPhantomRedirectSolanaExtension/addPhantomRedirectSolanaExtension.d.ts.map +1 -0
  23. package/dist/phantomRedirect/addPhantomRedirectSolanaExtension/index.d.ts +3 -0
  24. package/dist/phantomRedirect/addPhantomRedirectSolanaExtension/index.d.ts.map +1 -0
  25. package/dist/phantomRedirect/completePhantomRedirect/completePhantomRedirect.d.ts +32 -0
  26. package/dist/phantomRedirect/completePhantomRedirect/completePhantomRedirect.d.ts.map +1 -0
  27. package/dist/phantomRedirect/completePhantomRedirect/index.d.ts +3 -0
  28. package/dist/phantomRedirect/completePhantomRedirect/index.d.ts.map +1 -0
  29. package/dist/phantomRedirect/createPhantomRedirectWalletProvider/createPhantomRedirectWalletProvider.d.ts +17 -0
  30. package/dist/phantomRedirect/createPhantomRedirectWalletProvider/createPhantomRedirectWalletProvider.d.ts.map +1 -0
  31. package/dist/phantomRedirect/createPhantomRedirectWalletProvider/index.d.ts +3 -0
  32. package/dist/phantomRedirect/createPhantomRedirectWalletProvider/index.d.ts.map +1 -0
  33. package/dist/phantomRedirect/detectPhantomRedirect/detectPhantomRedirect.d.ts +17 -0
  34. package/dist/phantomRedirect/detectPhantomRedirect/detectPhantomRedirect.d.ts.map +1 -0
  35. package/dist/phantomRedirect/detectPhantomRedirect/index.d.ts +3 -0
  36. package/dist/phantomRedirect/detectPhantomRedirect/index.d.ts.map +1 -0
  37. package/dist/phantomRedirect/errors/NoPendingPhantomRequestError.d.ts +5 -0
  38. package/dist/phantomRedirect/errors/NoPendingPhantomRequestError.d.ts.map +1 -0
  39. package/dist/phantomRedirect/errors/NoPhantomSessionError.d.ts +5 -0
  40. package/dist/phantomRedirect/errors/NoPhantomSessionError.d.ts.map +1 -0
  41. package/dist/phantomRedirect/errors/PhantomMissingEncryptionParamsError.d.ts +5 -0
  42. package/dist/phantomRedirect/errors/PhantomMissingEncryptionParamsError.d.ts.map +1 -0
  43. package/dist/phantomRedirect/errors/PhantomRedirectDecryptionError.d.ts +5 -0
  44. package/dist/phantomRedirect/errors/PhantomRedirectDecryptionError.d.ts.map +1 -0
  45. package/dist/phantomRedirect/errors/PhantomRedirectRejectedError.d.ts +9 -0
  46. package/dist/phantomRedirect/errors/PhantomRedirectRejectedError.d.ts.map +1 -0
  47. package/dist/phantomRedirect/errors/PhantomRedirectTimeoutError.d.ts +5 -0
  48. package/dist/phantomRedirect/errors/PhantomRedirectTimeoutError.d.ts.map +1 -0
  49. package/dist/phantomRedirect/phantomRedirect.broadcast.types.d.ts +6 -0
  50. package/dist/phantomRedirect/phantomRedirect.broadcast.types.d.ts.map +1 -0
  51. package/dist/phantomRedirect/phantomRedirect.constants.d.ts +5 -0
  52. package/dist/phantomRedirect/phantomRedirect.constants.d.ts.map +1 -0
  53. package/dist/phantomRedirect/phantomRedirect.events.d.ts +152 -0
  54. package/dist/phantomRedirect/phantomRedirect.events.d.ts.map +1 -0
  55. package/dist/phantomRedirect/storage/pendingRequestStorageSchema/index.d.ts +2 -0
  56. package/dist/phantomRedirect/storage/pendingRequestStorageSchema/index.d.ts.map +1 -0
  57. package/dist/phantomRedirect/storage/pendingRequestStorageSchema/pendingRequestStorageSchema.d.ts +15 -0
  58. package/dist/phantomRedirect/storage/pendingRequestStorageSchema/pendingRequestStorageSchema.d.ts.map +1 -0
  59. package/dist/phantomRedirect/storage/phantomSessionStorageSchema/index.d.ts +2 -0
  60. package/dist/phantomRedirect/storage/phantomSessionStorageSchema/index.d.ts.map +1 -0
  61. package/dist/phantomRedirect/storage/phantomSessionStorageSchema/phantomSessionStorageSchema.d.ts +14 -0
  62. package/dist/phantomRedirect/storage/phantomSessionStorageSchema/phantomSessionStorageSchema.d.ts.map +1 -0
  63. package/dist/phantomRedirect/utils/broadcastPhantomEvent/broadcastPhantomEvent.d.ts +16 -0
  64. package/dist/phantomRedirect/utils/broadcastPhantomEvent/broadcastPhantomEvent.d.ts.map +1 -0
  65. package/dist/phantomRedirect/utils/broadcastPhantomEvent/index.d.ts +2 -0
  66. package/dist/phantomRedirect/utils/broadcastPhantomEvent/index.d.ts.map +1 -0
  67. package/dist/phantomRedirect/utils/buildPhantomDeepLink/buildPhantomDeepLink.d.ts +23 -0
  68. package/dist/phantomRedirect/utils/buildPhantomDeepLink/buildPhantomDeepLink.d.ts.map +1 -0
  69. package/dist/phantomRedirect/utils/buildPhantomDeepLink/index.d.ts +3 -0
  70. package/dist/phantomRedirect/utils/buildPhantomDeepLink/index.d.ts.map +1 -0
  71. package/dist/phantomRedirect/utils/cleanPhantomParamsFromUrl/cleanPhantomParamsFromUrl.d.ts +15 -0
  72. package/dist/phantomRedirect/utils/cleanPhantomParamsFromUrl/cleanPhantomParamsFromUrl.d.ts.map +1 -0
  73. package/dist/phantomRedirect/utils/cleanPhantomParamsFromUrl/index.d.ts +3 -0
  74. package/dist/phantomRedirect/utils/cleanPhantomParamsFromUrl/index.d.ts.map +1 -0
  75. package/dist/phantomRedirect/utils/crypto/createNaClSharedSecret/createNaClSharedSecret.d.ts +13 -0
  76. package/dist/phantomRedirect/utils/crypto/createNaClSharedSecret/createNaClSharedSecret.d.ts.map +1 -0
  77. package/dist/phantomRedirect/utils/crypto/createNaClSharedSecret/index.d.ts +3 -0
  78. package/dist/phantomRedirect/utils/crypto/createNaClSharedSecret/index.d.ts.map +1 -0
  79. package/dist/phantomRedirect/utils/crypto/decryptPayload/decryptPayload.d.ts +16 -0
  80. package/dist/phantomRedirect/utils/crypto/decryptPayload/decryptPayload.d.ts.map +1 -0
  81. package/dist/phantomRedirect/utils/crypto/decryptPayload/index.d.ts +3 -0
  82. package/dist/phantomRedirect/utils/crypto/decryptPayload/index.d.ts.map +1 -0
  83. package/dist/phantomRedirect/utils/crypto/encryptPayload/encryptPayload.d.ts +17 -0
  84. package/dist/phantomRedirect/utils/crypto/encryptPayload/encryptPayload.d.ts.map +1 -0
  85. package/dist/phantomRedirect/utils/crypto/encryptPayload/index.d.ts +3 -0
  86. package/dist/phantomRedirect/utils/crypto/encryptPayload/index.d.ts.map +1 -0
  87. package/dist/phantomRedirect/utils/crypto/generateNaClKeyPair/generateNaClKeyPair.d.ts +11 -0
  88. package/dist/phantomRedirect/utils/crypto/generateNaClKeyPair/generateNaClKeyPair.d.ts.map +1 -0
  89. package/dist/phantomRedirect/utils/crypto/generateNaClKeyPair/index.d.ts +3 -0
  90. package/dist/phantomRedirect/utils/crypto/generateNaClKeyPair/index.d.ts.map +1 -0
  91. package/dist/phantomRedirect/utils/getPhantomCluster/getPhantomCluster.d.ts +23 -0
  92. package/dist/phantomRedirect/utils/getPhantomCluster/getPhantomCluster.d.ts.map +1 -0
  93. package/dist/phantomRedirect/utils/getPhantomOriginTab/getPhantomOriginTab.d.ts +19 -0
  94. package/dist/phantomRedirect/utils/getPhantomOriginTab/getPhantomOriginTab.d.ts.map +1 -0
  95. package/dist/phantomRedirect/utils/getPhantomOriginTab/index.d.ts +3 -0
  96. package/dist/phantomRedirect/utils/getPhantomOriginTab/index.d.ts.map +1 -0
  97. package/dist/phantomRedirect/utils/listenForPhantomBroadcast/index.d.ts +2 -0
  98. package/dist/phantomRedirect/utils/listenForPhantomBroadcast/index.d.ts.map +1 -0
  99. package/dist/phantomRedirect/utils/listenForPhantomBroadcast/listenForPhantomBroadcast.d.ts +15 -0
  100. package/dist/phantomRedirect/utils/listenForPhantomBroadcast/listenForPhantomBroadcast.d.ts.map +1 -0
  101. package/dist/phantomRedirect/utils/parsePhantomRedirectParams/index.d.ts +3 -0
  102. package/dist/phantomRedirect/utils/parsePhantomRedirectParams/index.d.ts.map +1 -0
  103. package/dist/phantomRedirect/utils/parsePhantomRedirectParams/parsePhantomRedirectParams.d.ts +22 -0
  104. package/dist/phantomRedirect/utils/parsePhantomRedirectParams/parsePhantomRedirectParams.d.ts.map +1 -0
  105. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  106. package/dist/waas.cjs.js +3 -3
  107. package/dist/waas.esm.js +2 -2
  108. package/dist/walletStandard.cjs.js +2 -2
  109. package/dist/walletStandard.esm.js +2 -2
  110. package/package.json +7 -5
@@ -0,0 +1,11 @@
1
+ export type NaClKeyPair = {
2
+ publicKey: string;
3
+ secretKey: string;
4
+ };
5
+ /**
6
+ * Generates a new NaCl key pair for encryption.
7
+ *
8
+ * @returns A key pair with base58-encoded public and secret keys
9
+ */
10
+ export declare const generateNaClKeyPair: () => NaClKeyPair;
11
+ //# sourceMappingURL=generateNaClKeyPair.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generateNaClKeyPair.d.ts","sourceRoot":"","sources":["../../../../../src/phantomRedirect/utils/crypto/generateNaClKeyPair/generateNaClKeyPair.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,WAAW,GAAG;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,QAAO,WAOtC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { generateNaClKeyPair } from './generateNaClKeyPair';
2
+ export type { NaClKeyPair } from './generateNaClKeyPair';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/phantomRedirect/utils/crypto/generateNaClKeyPair/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { DynamicClient, WalletAccount } from '@dynamic-labs-sdk/client';
2
+ type GetPhantomClusterParams = {
3
+ dynamicClient: DynamicClient;
4
+ walletAccount: WalletAccount;
5
+ } | {
6
+ dynamicClient: DynamicClient;
7
+ walletAccount?: never;
8
+ };
9
+ /**
10
+ * Returns the Solana cluster name expected by Phantom's deep link protocol
11
+ * (e.g. "mainnet-beta", "devnet", "testnet").
12
+ *
13
+ * - When a `walletAccount` is provided, reads the cluster from the active network
14
+ * data for that account.
15
+ * - When no `walletAccount` is provided (e.g. during `connect` before an account
16
+ * exists), falls back to the first registered SOL network provider's cluster.
17
+ *
18
+ * Returns `undefined` if no cluster can be determined; Phantom will use the
19
+ * wallet's default in that case.
20
+ */
21
+ export declare const getPhantomCluster: ({ dynamicClient, walletAccount, }: GetPhantomClusterParams) => Promise<string | undefined>;
22
+ export {};
23
+ //# sourceMappingURL=getPhantomCluster.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPhantomCluster.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/getPhantomCluster/getPhantomCluster.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAI7E,KAAK,uBAAuB,GACxB;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,aAAa,EAAE,aAAa,CAAA;CAAE,GAC9D;IAAE,aAAa,EAAE,aAAa,CAAC;IAAC,aAAa,CAAC,EAAE,KAAK,CAAA;CAAE,CAAC;AAE5D;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,iBAAiB,sCAG3B,uBAAuB,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CActD,CAAC"}
@@ -0,0 +1,19 @@
1
+ export type PhantomOriginTabService = {
2
+ isOriginTab: boolean;
3
+ };
4
+ /**
5
+ * Per-client service that tracks whether this JavaScript context is the
6
+ * **originating tab** that initiated a Phantom redirect request.
7
+ *
8
+ * Calling `getPhantomOriginTab(client)` for the first time lazily creates the
9
+ * service with `isOriginTab: false`. `setupPhantomListeners` sets it to `true`
10
+ * immediately when a request is initiated, so `completePhantomRedirect` can
11
+ * detect clone tabs by checking this flag.
12
+ *
13
+ * Because the service is stored in the client's `runtimeServices` Map (one
14
+ * entry per client instance), it is naturally scoped to the current JavaScript
15
+ * context — no browser globals (`sessionStorage`, `window`) are needed, making
16
+ * this approach compatible with SSR and React Native.
17
+ */
18
+ export declare const getPhantomOriginTab: (client: import("@dynamic-labs-sdk/client").DynamicClient) => PhantomOriginTabService;
19
+ //# sourceMappingURL=getPhantomOriginTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getPhantomOriginTab.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/getPhantomOriginTab/getPhantomOriginTab.ts"],"names":[],"mappings":"AAEA,MAAM,MAAM,uBAAuB,GAAG;IACpC,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,mBAAmB,uFAG/B,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { getPhantomOriginTab } from './getPhantomOriginTab';
2
+ export type { PhantomOriginTabService } from './getPhantomOriginTab';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/getPhantomOriginTab/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { listenForPhantomBroadcast } from './listenForPhantomBroadcast';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/listenForPhantomBroadcast/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC"}
@@ -0,0 +1,15 @@
1
+ import type { DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import type { PhantomEvents } from '../../phantomRedirect.broadcast.types';
3
+ /**
4
+ * Registers listeners for Phantom redirect events broadcast from other tabs
5
+ * (e.g. the redirect-completion tab), using the crossTabBroadcast service.
6
+ *
7
+ * Returns a cleanup function that unregisters all listeners — call it when the
8
+ * operation is no longer pending (e.g. in a promise `.finally()`).
9
+ *
10
+ * @param listeners - Map of event names to handler functions
11
+ * @param client - The Dynamic client instance
12
+ * @returns Cleanup function that removes all registered listeners
13
+ */
14
+ export declare const listenForPhantomBroadcast: (listeners: Partial<PhantomEvents>, client: DynamicClient) => (() => void);
15
+ //# sourceMappingURL=listenForPhantomBroadcast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listenForPhantomBroadcast.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/listenForPhantomBroadcast/listenForPhantomBroadcast.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAE3E;;;;;;;;;;GAUG;AACH,eAAO,MAAM,yBAAyB,cACzB,OAAO,CAAC,aAAa,CAAC,UACzB,aAAa,KACpB,CAAC,MAAM,IAAI,CAsBb,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { parsePhantomRedirectParams } from './parsePhantomRedirectParams';
2
+ export type { ParsePhantomRedirectParamsParams, PhantomRedirectParams, } from './parsePhantomRedirectParams';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/parsePhantomRedirectParams/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,YAAY,EACV,gCAAgC,EAChC,qBAAqB,GACtB,MAAM,8BAA8B,CAAC"}
@@ -0,0 +1,22 @@
1
+ export type PhantomRedirectParams = {
2
+ data?: string;
3
+ errorCode?: string;
4
+ errorMessage?: string;
5
+ nonce?: string;
6
+ phantomPublicKey?: string;
7
+ requestId?: string;
8
+ };
9
+ export type ParsePhantomRedirectParamsParams = {
10
+ url: URL;
11
+ };
12
+ /**
13
+ * Parses Phantom wallet redirect parameters from a URL.
14
+ *
15
+ * Extracts both success and error parameters from the redirect URL,
16
+ * including encrypted response data or error information.
17
+ *
18
+ * @param params.url - The redirect URL containing Phantom parameters
19
+ * @returns Object containing the parsed redirect parameters
20
+ */
21
+ export declare const parsePhantomRedirectParams: ({ url, }: ParsePhantomRedirectParamsParams) => PhantomRedirectParams;
22
+ //# sourceMappingURL=parsePhantomRedirectParams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parsePhantomRedirectParams.d.ts","sourceRoot":"","sources":["../../../../src/phantomRedirect/utils/parsePhantomRedirectParams/parsePhantomRedirectParams.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,GAAG,EAAE,GAAG,CAAC;CACV,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,0BAA0B,aAEpC,gCAAgC,KAAG,qBAYrC,CAAC"}