@reown/appkit-solana-react-native 0.0.0-accounts-canary.1-20251023174733

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 (73) hide show
  1. package/lib/commonjs/adapter.js +271 -0
  2. package/lib/commonjs/adapter.js.map +1 -0
  3. package/lib/commonjs/connectors/DeeplinkConnector.js +271 -0
  4. package/lib/commonjs/connectors/DeeplinkConnector.js.map +1 -0
  5. package/lib/commonjs/connectors/PhantomConnector.js +39 -0
  6. package/lib/commonjs/connectors/PhantomConnector.js.map +1 -0
  7. package/lib/commonjs/connectors/SolflareConnector.js +39 -0
  8. package/lib/commonjs/connectors/SolflareConnector.js.map +1 -0
  9. package/lib/commonjs/helpers.js +102 -0
  10. package/lib/commonjs/helpers.js.map +1 -0
  11. package/lib/commonjs/index.js +27 -0
  12. package/lib/commonjs/index.js.map +1 -0
  13. package/lib/commonjs/package.json +1 -0
  14. package/lib/commonjs/providers/DeeplinkProvider.js +432 -0
  15. package/lib/commonjs/providers/DeeplinkProvider.js.map +1 -0
  16. package/lib/commonjs/types.js +6 -0
  17. package/lib/commonjs/types.js.map +1 -0
  18. package/lib/commonjs/utils/createSPLTokenTransaction.js +96 -0
  19. package/lib/commonjs/utils/createSPLTokenTransaction.js.map +1 -0
  20. package/lib/commonjs/utils/createSendTransaction.js +30 -0
  21. package/lib/commonjs/utils/createSendTransaction.js.map +1 -0
  22. package/lib/module/adapter.js +265 -0
  23. package/lib/module/adapter.js.map +1 -0
  24. package/lib/module/connectors/DeeplinkConnector.js +265 -0
  25. package/lib/module/connectors/DeeplinkConnector.js.map +1 -0
  26. package/lib/module/connectors/PhantomConnector.js +34 -0
  27. package/lib/module/connectors/PhantomConnector.js.map +1 -0
  28. package/lib/module/connectors/SolflareConnector.js +34 -0
  29. package/lib/module/connectors/SolflareConnector.js.map +1 -0
  30. package/lib/module/helpers.js +95 -0
  31. package/lib/module/helpers.js.map +1 -0
  32. package/lib/module/index.js +11 -0
  33. package/lib/module/index.js.map +1 -0
  34. package/lib/module/providers/DeeplinkProvider.js +426 -0
  35. package/lib/module/providers/DeeplinkProvider.js.map +1 -0
  36. package/lib/module/types.js +4 -0
  37. package/lib/module/types.js.map +1 -0
  38. package/lib/module/utils/createSPLTokenTransaction.js +92 -0
  39. package/lib/module/utils/createSPLTokenTransaction.js.map +1 -0
  40. package/lib/module/utils/createSendTransaction.js +26 -0
  41. package/lib/module/utils/createSendTransaction.js.map +1 -0
  42. package/lib/typescript/adapter.d.ts +23 -0
  43. package/lib/typescript/adapter.d.ts.map +1 -0
  44. package/lib/typescript/connectors/DeeplinkConnector.d.ts +30 -0
  45. package/lib/typescript/connectors/DeeplinkConnector.d.ts.map +1 -0
  46. package/lib/typescript/connectors/PhantomConnector.d.ts +12 -0
  47. package/lib/typescript/connectors/PhantomConnector.d.ts.map +1 -0
  48. package/lib/typescript/connectors/SolflareConnector.d.ts +12 -0
  49. package/lib/typescript/connectors/SolflareConnector.d.ts.map +1 -0
  50. package/lib/typescript/helpers.d.ts +31 -0
  51. package/lib/typescript/helpers.d.ts.map +1 -0
  52. package/lib/typescript/index.d.ts +5 -0
  53. package/lib/typescript/index.d.ts.map +1 -0
  54. package/lib/typescript/providers/DeeplinkProvider.d.ts +59 -0
  55. package/lib/typescript/providers/DeeplinkProvider.d.ts.map +1 -0
  56. package/lib/typescript/types.d.ts +99 -0
  57. package/lib/typescript/types.d.ts.map +1 -0
  58. package/lib/typescript/utils/createSPLTokenTransaction.d.ts +4 -0
  59. package/lib/typescript/utils/createSPLTokenTransaction.d.ts.map +1 -0
  60. package/lib/typescript/utils/createSendTransaction.d.ts +10 -0
  61. package/lib/typescript/utils/createSendTransaction.d.ts.map +1 -0
  62. package/package.json +54 -0
  63. package/readme.md +9 -0
  64. package/src/adapter.ts +315 -0
  65. package/src/connectors/DeeplinkConnector.ts +353 -0
  66. package/src/connectors/PhantomConnector.ts +36 -0
  67. package/src/connectors/SolflareConnector.ts +36 -0
  68. package/src/helpers.ts +102 -0
  69. package/src/index.ts +9 -0
  70. package/src/providers/DeeplinkProvider.ts +605 -0
  71. package/src/types.ts +132 -0
  72. package/src/utils/createSPLTokenTransaction.ts +152 -0
  73. package/src/utils/createSendTransaction.ts +41 -0
@@ -0,0 +1,30 @@
1
+ import { WalletConnector, type AppKitNetwork, type CaipNetworkId, type ChainNamespace, type ConnectOptions, type Namespaces, type ConnectorInitOptions, type ConnectionProperties } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkProvider } from '../providers/DeeplinkProvider';
3
+ import type { DeeplinkConnectorConfig } from '../types';
4
+ export declare abstract class DeeplinkConnector extends WalletConnector {
5
+ private readonly config;
6
+ private currentCaipNetworkId;
7
+ private dappEncryptionKeyPair?;
8
+ private static readonly SUPPORTED_NAMESPACE;
9
+ constructor(config: DeeplinkConnectorConfig);
10
+ protected abstract getBaseUrl(): string;
11
+ protected abstract getStorageKey(): string;
12
+ protected abstract getDappKeypairStorageKey(): string;
13
+ protected abstract getEncryptionKeyFieldName(): string;
14
+ init(ops: ConnectorInitOptions): Promise<void>;
15
+ private initializeKeyPair;
16
+ connect(opts?: ConnectOptions): Promise<Namespaces | undefined>;
17
+ disconnect(): Promise<void>;
18
+ private clearSession;
19
+ getProvider(): DeeplinkProvider;
20
+ private getStorage;
21
+ getNamespaces(): Namespaces;
22
+ getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
23
+ getProperties(): ConnectionProperties | undefined;
24
+ isConnected(): boolean;
25
+ switchNetwork(network: AppKitNetwork): Promise<void>;
26
+ restoreSession(): Promise<boolean>;
27
+ private saveSession;
28
+ private clearSessionStorage;
29
+ }
30
+ //# sourceMappingURL=DeeplinkConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeeplinkConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/DeeplinkConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,c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@@ -0,0 +1,12 @@
1
+ import { type WalletInfo } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkConnector } from './DeeplinkConnector';
3
+ import type { PhantomConnectorConfig } from '../types';
4
+ export declare class PhantomConnector extends DeeplinkConnector {
5
+ constructor(config?: PhantomConnectorConfig);
6
+ getWalletInfo(): WalletInfo;
7
+ protected getBaseUrl(): string;
8
+ protected getStorageKey(): string;
9
+ protected getDappKeypairStorageKey(): string;
10
+ protected getEncryptionKeyFieldName(): string;
11
+ }
12
+ //# sourceMappingURL=PhantomConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PhantomConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/PhantomConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAMvD,qBAAa,gBAAiB,SAAQ,iBAAiB;gBACzC,MAAM,CAAC,EAAE,sBAAsB;IAIlC,aAAa,IAAI,UAAU;IAOpC,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B,SAAS,CAAC,aAAa,IAAI,MAAM;IAIjC,SAAS,CAAC,wBAAwB,IAAI,MAAM;IAI5C,SAAS,CAAC,yBAAyB,IAAI,MAAM;CAG9C"}
@@ -0,0 +1,12 @@
1
+ import { type WalletInfo } from '@reown/appkit-common-react-native';
2
+ import { DeeplinkConnector } from './DeeplinkConnector';
3
+ import type { SolflareConnectorConfig } from '../types';
4
+ export declare class SolflareConnector extends DeeplinkConnector {
5
+ constructor(config?: SolflareConnectorConfig);
6
+ getWalletInfo(): WalletInfo;
7
+ protected getBaseUrl(): string;
8
+ protected getStorageKey(): string;
9
+ protected getDappKeypairStorageKey(): string;
10
+ protected getEncryptionKeyFieldName(): string;
11
+ }
12
+ //# sourceMappingURL=SolflareConnector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SolflareConnector.d.ts","sourceRoot":"","sources":["../../../src/connectors/SolflareConnector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,UAAU,EAAE,MAAM,mCAAmC,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAMxD,qBAAa,iBAAkB,SAAQ,iBAAiB;gBAC1C,MAAM,CAAC,EAAE,uBAAuB;IAInC,aAAa,IAAI,UAAU;IAOpC,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B,SAAS,CAAC,aAAa,IAAI,MAAM;IAIjC,SAAS,CAAC,wBAAwB,IAAI,MAAM;IAI5C,SAAS,CAAC,yBAAyB,IAAI,MAAM;CAG9C"}
@@ -0,0 +1,31 @@
1
+ import type { TokenInfo } from './types';
2
+ /**
3
+ * Validates if the given string is a Solana address.
4
+ * @param address The string to validate.
5
+ * @returns True if the address is valid, false otherwise.
6
+ */
7
+ export declare function isSolanaAddress(address: string): boolean;
8
+ /**
9
+ * Helper to fetch SOL balance using JSON-RPC
10
+ * @param rpcUrl Solana RPC endpoint
11
+ * @param address Solana public address (base58)
12
+ */
13
+ export declare function getSolanaNativeBalance(rpcUrl: string, address: string): Promise<number>;
14
+ /**
15
+ * Fetch metadata for a Solana SPL token using the Jupiter token list.
16
+ * @param mint - The token's mint address
17
+ * @returns TokenInfo if found, or undefined
18
+ */
19
+ export declare function getSolanaTokenMetadata(mint: string): Promise<TokenInfo | undefined>;
20
+ /**
21
+ * Get the balance of a token for a given address
22
+ * @param rpcUrl - The RPC URL to use
23
+ * @param address - The address to get the balance for
24
+ * @param tokenAddress - The address of the token to get the balance for
25
+ * @returns The balance of the token for the given address
26
+ */
27
+ export declare function getSolanaTokenBalance(rpcUrl: string, address: string, tokenAddress: string): Promise<{
28
+ amount: string;
29
+ symbol: string;
30
+ }>;
31
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAIxD;AAED;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAuB7F;AAID;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAgBzF;AAED;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAsB7C"}
@@ -0,0 +1,5 @@
1
+ export { SolanaAdapter } from './adapter';
2
+ export type { PhantomConnectorConfig, SolflareConnectorConfig } from './types';
3
+ export { PhantomConnector } from './connectors/PhantomConnector';
4
+ export { SolflareConnector } from './connectors/SolflareConnector';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG1C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAC;AAG/E,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,59 @@
1
+ /// <reference types="node" />
2
+ import type { Provider, RequestArguments, CaipNetworkId } from '@reown/appkit-common-react-native';
3
+ import type { DeeplinkProviderConfig, DeeplinkConnectResult, DeeplinkSession, Cluster } from '../types';
4
+ import EventEmitter from 'events';
5
+ export declare const SOLANA_SIGNING_METHODS: {
6
+ readonly SOLANA_SIGN_TRANSACTION: "solana_signTransaction";
7
+ readonly SOLANA_SIGN_MESSAGE: "solana_signMessage";
8
+ readonly SOLANA_SIGN_AND_SEND_TRANSACTION: "solana_signAndSendTransaction";
9
+ readonly SOLANA_SIGN_ALL_TRANSACTIONS: "solana_signAllTransactions";
10
+ };
11
+ export declare class DeeplinkProvider extends EventEmitter implements Provider {
12
+ private readonly config;
13
+ private dappEncryptionKeyPair;
14
+ private currentCluster;
15
+ private sharedKey;
16
+ private storage;
17
+ private sessionToken;
18
+ private userPublicKey;
19
+ private walletEncryptionPublicKeyBs58;
20
+ private activeSubscription;
21
+ private isOperationPending;
22
+ constructor(config: DeeplinkProviderConfig);
23
+ private getSessionStorageKey;
24
+ /**
25
+ * Cleanup method to be called when the provider is destroyed
26
+ */
27
+ destroy(): void;
28
+ /**
29
+ * Safely cleanup the active subscription
30
+ */
31
+ private cleanupActiveSubscription;
32
+ /**
33
+ * Safely set a new subscription, ensuring no operation is pending
34
+ */
35
+ private setActiveSubscription;
36
+ getUserPublicKey(): string | null;
37
+ isConnected(): boolean;
38
+ getCurrentCluster(): Cluster;
39
+ private buildUrl;
40
+ /**
41
+ * Open a deeplink URL and wait for a redirect back to the app. Handles subscription
42
+ * lifecycle and common error extraction from `errorCode`/`errorMessage` query params.
43
+ */
44
+ private openDeeplinkAndWait;
45
+ private getRpcMethodName;
46
+ private encryptPayload;
47
+ private decryptPayload;
48
+ restoreSession(): Promise<boolean>;
49
+ private saveSession;
50
+ private clearSessionStorage;
51
+ connect<T = DeeplinkConnectResult>(params?: {
52
+ cluster?: Cluster;
53
+ }): Promise<T>;
54
+ disconnect(): Promise<void>;
55
+ clearSession(): Promise<void>;
56
+ setSession(session: DeeplinkSession): void;
57
+ request<T>(args: RequestArguments, _chainId?: CaipNetworkId): Promise<T>;
58
+ }
59
+ //# sourceMappingURL=DeeplinkProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DeeplinkProvider.d.ts","sourceRoot":"","sources":["../../../src/providers/DeeplinkProvider.ts"],"names":[],"mappings":";AAIA,OAAO,KAAK,EACV,QAAQ,EACR,gBAAgB,EAChB,aAAa,EAEd,MAAM,mCAAmC,CAAC;AAC3C,OAAO,KAAK,EACV,sBAAsB,EACtB,qBAAqB,EACrB,eAAe,EAYf,OAAO,EACR,MAAM,UAAU,CAAC;AAClB,OAAO,YAAY,MAAM,QAAQ,CAAC;AAElC,eAAO,MAAM,sBAAsB;;;;;CAKzB,CAAC;AAQX,qBAAa,gBAAiB,SAAQ,YAAa,YAAW,QAAQ;IACpE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;IAChD,OAAO,CAAC,qBAAqB,CAAkB;IAC/C,OAAO,CAAC,cAAc,CAAU;IAChC,OAAO,CAAC,SAAS,CAA2B;IAE5C,OAAO,CAAC,OAAO,CAAU;IAEzB,OAAO,CAAC,YAAY,CAAuB;IAC3C,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,6BAA6B,CAAuB;IAG5D,OAAO,CAAC,kBAAkB,CAAuC;IACjE,OAAO,CAAC,kBAAkB,CAAS;gBAEvB,MAAM,EAAE,sBAAsB;IAQ1C,OAAO,CAAC,oBAAoB;IAI5B;;OAEG;IACI,OAAO,IAAI,IAAI;IAKtB;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAQjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAS7B,gBAAgB,IAAI,MAAM,GAAG,IAAI;IAIjC,WAAW,IAAI,OAAO;IAIf,iBAAiB,IAAI,OAAO;IAInC,OAAO,CAAC,QAAQ;IAMhB;;;OAGG;YACW,mBAAmB;IAiDjC,OAAO,CAAC,gBAAgB;IAgBxB,OAAO,CAAC,cAAc;IAkCtB,OAAO,CAAC,cAAc;IAiCT,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC;YA6BjC,WAAW;YAiBX,mBAAmB;IAQpB,OAAO,CAAC,CAAC,GAAG,qBAAqB,EAAE,MAAM,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,CAAC,CAAC;IAkE9E,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuC3B,YAAY,IAAI,OAAO,CAAC,IAAI,CAAC;IAYnC,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,IAAI;IAOpC,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,gBAAgB,EAAE,QAAQ,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC;CAyKtF"}
@@ -0,0 +1,99 @@
1
+ import type { CaipNetworkId, Namespaces, Storage, WalletInfo } from '@reown/appkit-common-react-native';
2
+ import type nacl from 'tweetnacl';
3
+ import type { Connection } from '@solana/web3.js';
4
+ export interface TokenInfo {
5
+ address: string;
6
+ symbol: string;
7
+ name: string;
8
+ decimals: number;
9
+ logoURI?: string;
10
+ }
11
+ export type SPLTokenTransactionArgs = {
12
+ connection: Connection;
13
+ fromAddress: string;
14
+ toAddress: string;
15
+ amount: number;
16
+ tokenMint: string;
17
+ };
18
+ export type Cluster = 'mainnet-beta' | 'testnet' | 'devnet';
19
+ export type DeeplinkConnectResult = DeeplinkSession;
20
+ export interface DeeplinkSession {
21
+ sessionToken: string;
22
+ userPublicKey: string;
23
+ walletEncryptionPublicKeyBs58: string;
24
+ cluster: Cluster;
25
+ }
26
+ export interface SignTransactionRequestParams {
27
+ transaction: string;
28
+ }
29
+ export interface SignMessageRequestParams {
30
+ message: Uint8Array | string;
31
+ display?: 'utf8' | 'hex';
32
+ }
33
+ export interface SignAllTransactionsRequestParams {
34
+ transactions: string[];
35
+ }
36
+ export interface DeeplinkResponse {
37
+ wallet_encryption_public_key?: string;
38
+ nonce: string;
39
+ data: string;
40
+ }
41
+ export interface DecryptedConnectData {
42
+ public_key: string;
43
+ session: string;
44
+ }
45
+ export interface DeeplinkProviderConfig {
46
+ appScheme: string;
47
+ dappUrl: string;
48
+ storage: Storage;
49
+ cluster?: Cluster;
50
+ dappEncryptionKeyPair: nacl.BoxKeyPair;
51
+ type: 'phantom' | 'solflare';
52
+ baseUrl: string;
53
+ encryptionKeyFieldName: string;
54
+ }
55
+ export type DeeplinkRpcMethod = 'connect' | 'disconnect' | 'signTransaction' | 'signAndSendTransaction' | 'signAllTransactions' | 'signMessage';
56
+ export interface DeeplinkSignTransactionParams {
57
+ dapp_encryption_public_key: string;
58
+ redirect_link: string;
59
+ payload: string;
60
+ nonce: string;
61
+ cluster?: Cluster;
62
+ }
63
+ export interface DeeplinkSignAllTransactionsParams {
64
+ dapp_encryption_public_key: string;
65
+ redirect_link: string;
66
+ payload: string;
67
+ nonce: string;
68
+ cluster?: Cluster;
69
+ }
70
+ export interface DeeplinkSignMessageParams {
71
+ dapp_encryption_public_key: string;
72
+ redirect_link: string;
73
+ payload: string;
74
+ nonce: string;
75
+ }
76
+ export interface DeeplinkConnectParams {
77
+ app_url: string;
78
+ dapp_encryption_public_key: string;
79
+ redirect_link: string;
80
+ cluster?: Cluster;
81
+ }
82
+ export interface DeeplinkDisconnectParams {
83
+ dapp_encryption_public_key: string;
84
+ redirect_link: string;
85
+ payload: string;
86
+ nonce: string;
87
+ }
88
+ export interface DeeplinkConnectorConfig {
89
+ type: 'phantom' | 'solflare';
90
+ cluster?: Cluster;
91
+ }
92
+ export interface DeeplinkConnectorSessionData {
93
+ namespaces: Namespaces;
94
+ wallet: WalletInfo;
95
+ currentCaipNetworkId: CaipNetworkId;
96
+ }
97
+ export type PhantomConnectorConfig = Pick<DeeplinkConnectorConfig, 'cluster'>;
98
+ export type SolflareConnectorConfig = Pick<DeeplinkConnectorConfig, 'cluster'>;
99
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,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AAC;CACnB;AAED,MAAM,WAAW,wBAAwB;IACvC,0BAA0B,EAAE,MAAM,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,IAAI,EAAE,SAAS,GAAG,UAAU,CAAC;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,UAAU,CAAC;IACvB,MAAM,EAAE,UAAU,CAAC;IACnB,oBAAoB,EAAE,aAAa,CAAC;CACrC;AAED,MAAM,MAAM,sBAAsB,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC;AAC9E,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,uBAAuB,EAAE,SAAS,CAAC,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { Transaction } from '@solana/web3.js';
2
+ import type { SPLTokenTransactionArgs } from '../types';
3
+ export declare function createSPLTokenTransaction({ fromAddress, toAddress, amount, tokenMint, connection }: SPLTokenTransactionArgs): Promise<Transaction>;
4
+ //# sourceMappingURL=createSPLTokenTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSPLTokenTransaction.d.ts","sourceRoot":"","sources":["../../../src/utils/createSPLTokenTransaction.ts"],"names":[],"mappings":"AAUA,OAAO,EAIL,WAAW,EAEZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAC;AAyBxD,wBAAsB,yBAAyB,CAAC,EAC9C,WAAW,EACX,SAAS,EACT,MAAM,EACN,SAAS,EACT,UAAU,EACX,EAAE,uBAAuB,GAAG,OAAO,CAAC,WAAW,CAAC,CAuGhD"}
@@ -0,0 +1,10 @@
1
+ import { type Connection, Transaction } from '@solana/web3.js';
2
+ type SendTransactionArgs = {
3
+ connection: Connection;
4
+ fromAddress: string;
5
+ toAddress: string;
6
+ amount: number;
7
+ };
8
+ export declare function createSendTransaction({ fromAddress, toAddress, amount, connection }: SendTransactionArgs): Promise<Transaction>;
9
+ export {};
10
+ //# sourceMappingURL=createSendTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSendTransaction.d.ts","sourceRoot":"","sources":["../../../src/utils/createSendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,UAAU,EAIf,WAAW,EACZ,MAAM,iBAAiB,CAAC;AAEzB,KAAK,mBAAmB,GAAG;IACzB,UAAU,EAAE,UAAU,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,wBAAsB,qBAAqB,CAAC,EAC1C,WAAW,EACX,SAAS,EACT,MAAM,EACN,UAAU,EACX,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,CAoB5C"}
package/package.json ADDED
@@ -0,0 +1,54 @@
1
+ {
2
+ "name": "@reown/appkit-solana-react-native",
3
+ "version": "0.0.0-accounts-canary.1-20251023174733",
4
+ "main": "lib/commonjs/index.js",
5
+ "types": "lib/typescript/index.d.ts",
6
+ "module": "lib/module/index.js",
7
+ "react-native": "src/index.ts",
8
+ "source": "src/index.ts",
9
+ "scripts": {
10
+ "build": "bob build",
11
+ "clean": "rm -rf lib",
12
+ "lint": "eslint . --ext .js,.jsx,.ts,.tsx"
13
+ },
14
+ "files": [
15
+ "src",
16
+ "lib",
17
+ "!**/__tests__",
18
+ "!**/__fixtures__",
19
+ "!**/__mocks__"
20
+ ],
21
+ "keywords": [
22
+ "web3",
23
+ "crypto",
24
+ "solana",
25
+ "appkit",
26
+ "reown",
27
+ "walletconnect",
28
+ "react-native"
29
+ ],
30
+ "repository": "https://github.com/reown-com/appkit-react-native",
31
+ "author": "Reown (https://discord.gg/reown)",
32
+ "homepage": "https://reown.com/appkit",
33
+ "license": "SEE LICENSE IN LICENSE.md",
34
+ "bugs": {
35
+ "url": "https://github.com/reown-com/appkit-react-native/issues"
36
+ },
37
+ "publishConfig": {
38
+ "registry": "https://registry.npmjs.org/",
39
+ "access": "public",
40
+ "provenance": true
41
+ },
42
+ "dependencies": {
43
+ "@reown/appkit-common-react-native": "0.0.0-accounts-canary.1-20251023174733",
44
+ "@solana/spl-token": "0.4.13",
45
+ "@solana/web3.js": "1.98.2",
46
+ "bs58": "6.0.0",
47
+ "tweetnacl": "1.0.3"
48
+ },
49
+ "peerDependencies": {
50
+ "@walletconnect/react-native-compat": ">=2.16.1",
51
+ "react": ">=18",
52
+ "react-native": ">=0.72"
53
+ }
54
+ }
package/readme.md ADDED
@@ -0,0 +1,9 @@
1
+ #### 📚 [Documentation](https://docs.reown.com/appkit/react-native/core/installation)
2
+
3
+ #### 🔎 [Examples](https://github.com/reown-com/react-native-examples)
4
+
5
+ #### 🔗 [Website](https://reown.com/appkit)
6
+
7
+ # AppKit
8
+
9
+ Your on-ramp to web3 multichain. AppKit is a versatile library that makes it super easy to connect users with your Dapp and start interacting with the blockchain.