toss-expo-sdk 0.1.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.
- package/LICENSE +20 -0
- package/README.md +292 -0
- package/lib/module/ble.js +103 -0
- package/lib/module/ble.js.map +1 -0
- package/lib/module/client/TossClient.js +324 -0
- package/lib/module/client/TossClient.js.map +1 -0
- package/lib/module/client/index.js +4 -0
- package/lib/module/client/index.js.map +1 -0
- package/lib/module/contexts/WalletContext.js +99 -0
- package/lib/module/contexts/WalletContext.js.map +1 -0
- package/lib/module/discovery.js +434 -0
- package/lib/module/discovery.js.map +1 -0
- package/lib/module/errors.js +47 -0
- package/lib/module/errors.js.map +1 -0
- package/lib/module/examples/offlinePaymentFlow.js +234 -0
- package/lib/module/examples/offlinePaymentFlow.js.map +1 -0
- package/lib/module/index.js +32 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/intent.js +223 -0
- package/lib/module/intent.js.map +1 -0
- package/lib/module/intentManager.js +145 -0
- package/lib/module/intentManager.js.map +1 -0
- package/lib/module/internal/arciumHelper.js +50 -0
- package/lib/module/internal/arciumHelper.js.map +1 -0
- package/lib/module/nfc.js +54 -0
- package/lib/module/nfc.js.map +1 -0
- package/lib/module/noise.js +14 -0
- package/lib/module/noise.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/qr.js +57 -0
- package/lib/module/qr.js.map +1 -0
- package/lib/module/reconciliation.js +329 -0
- package/lib/module/reconciliation.js.map +1 -0
- package/lib/module/services/authService.js +205 -0
- package/lib/module/services/authService.js.map +1 -0
- package/lib/module/storage/secureStorage.js +89 -0
- package/lib/module/storage/secureStorage.js.map +1 -0
- package/lib/module/storage.js +16 -0
- package/lib/module/storage.js.map +1 -0
- package/lib/module/sync.js +64 -0
- package/lib/module/sync.js.map +1 -0
- package/lib/module/types/tossUser.js +41 -0
- package/lib/module/types/tossUser.js.map +1 -0
- package/lib/module/utils/nonceUtils.js +38 -0
- package/lib/module/utils/nonceUtils.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/__tests__/index.test.d.ts +1 -0
- package/lib/typescript/src/__tests__/index.test.d.ts.map +1 -0
- package/lib/typescript/src/__tests__/reconciliation.test.d.ts +6 -0
- package/lib/typescript/src/__tests__/reconciliation.test.d.ts.map +1 -0
- package/lib/typescript/src/ble.d.ts +10 -0
- package/lib/typescript/src/ble.d.ts.map +1 -0
- package/lib/typescript/src/client/TossClient.d.ts +110 -0
- package/lib/typescript/src/client/TossClient.d.ts.map +1 -0
- package/lib/typescript/src/client/index.d.ts +3 -0
- package/lib/typescript/src/client/index.d.ts.map +1 -0
- package/lib/typescript/src/contexts/WalletContext.d.ts +20 -0
- package/lib/typescript/src/contexts/WalletContext.d.ts.map +1 -0
- package/lib/typescript/src/discovery.d.ts +188 -0
- package/lib/typescript/src/discovery.d.ts.map +1 -0
- package/lib/typescript/src/errors.d.ts +27 -0
- package/lib/typescript/src/errors.d.ts.map +1 -0
- package/lib/typescript/src/examples/offlinePaymentFlow.d.ts +48 -0
- package/lib/typescript/src/examples/offlinePaymentFlow.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +13 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/intent.d.ts +84 -0
- package/lib/typescript/src/intent.d.ts.map +1 -0
- package/lib/typescript/src/intentManager.d.ts +46 -0
- package/lib/typescript/src/intentManager.d.ts.map +1 -0
- package/lib/typescript/src/internal/arciumHelper.d.ts +19 -0
- package/lib/typescript/src/internal/arciumHelper.d.ts.map +1 -0
- package/lib/typescript/src/nfc.d.ts +7 -0
- package/lib/typescript/src/nfc.d.ts.map +1 -0
- package/lib/typescript/src/noise.d.ts +5 -0
- package/lib/typescript/src/noise.d.ts.map +1 -0
- package/lib/typescript/src/qr.d.ts +6 -0
- package/lib/typescript/src/qr.d.ts.map +1 -0
- package/lib/typescript/src/reconciliation.d.ts +65 -0
- package/lib/typescript/src/reconciliation.d.ts.map +1 -0
- package/lib/typescript/src/services/authService.d.ts +55 -0
- package/lib/typescript/src/services/authService.d.ts.map +1 -0
- package/lib/typescript/src/storage/secureStorage.d.ts +7 -0
- package/lib/typescript/src/storage/secureStorage.d.ts.map +1 -0
- package/lib/typescript/src/storage.d.ts +4 -0
- package/lib/typescript/src/storage.d.ts.map +1 -0
- package/lib/typescript/src/sync.d.ts +40 -0
- package/lib/typescript/src/sync.d.ts.map +1 -0
- package/lib/typescript/src/types/tossUser.d.ts +39 -0
- package/lib/typescript/src/types/tossUser.d.ts.map +1 -0
- package/lib/typescript/src/utils/nonceUtils.d.ts +8 -0
- package/lib/typescript/src/utils/nonceUtils.d.ts.map +1 -0
- package/package.json +176 -0
- package/src/__tests__/index.test.tsx +1 -0
- package/src/__tests__/reconciliation.test.tsx +361 -0
- package/src/ble.ts +138 -0
- package/src/client/TossClient.ts +435 -0
- package/src/client/index.ts +2 -0
- package/src/contexts/WalletContext.tsx +127 -0
- package/src/discovery.ts +542 -0
- package/src/errors.ts +51 -0
- package/src/examples/offlinePaymentFlow.ts +331 -0
- package/src/index.tsx +61 -0
- package/src/intent.ts +328 -0
- package/src/intentManager.ts +164 -0
- package/src/internal/arciumHelper.ts +58 -0
- package/src/nfc.ts +57 -0
- package/src/noise.ts +9 -0
- package/src/qr.tsx +65 -0
- package/src/reconciliation.ts +421 -0
- package/src/services/authService.ts +238 -0
- package/src/storage/secureStorage.ts +100 -0
- package/src/storage.ts +17 -0
- package/src/sync.ts +101 -0
- package/src/types/tossUser.ts +81 -0
- package/src/utils/nonceUtils.ts +56 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Keypair, PublicKey } from '@solana/web3.js';
|
|
2
|
+
import type { TossUser } from '../types/tossUser';
|
|
3
|
+
export declare const SESSION_KEY = "toss_user_session";
|
|
4
|
+
type UserSession = {
|
|
5
|
+
id: string;
|
|
6
|
+
token: string;
|
|
7
|
+
expiresAt: number;
|
|
8
|
+
walletAddress: string;
|
|
9
|
+
};
|
|
10
|
+
export declare class AuthService {
|
|
11
|
+
static signInWithWallet(walletAddress: string, isTemporary?: boolean): Promise<{
|
|
12
|
+
user: TossUser;
|
|
13
|
+
session: UserSession;
|
|
14
|
+
}>;
|
|
15
|
+
static saveSession(session: UserSession): Promise<void>;
|
|
16
|
+
static getSession(): Promise<UserSession | null>;
|
|
17
|
+
static signOut(): Promise<void>;
|
|
18
|
+
static isWalletUnlocked(): Promise<boolean>;
|
|
19
|
+
static unlockWalletWithBiometrics(): Promise<Keypair | null>;
|
|
20
|
+
/**
|
|
21
|
+
* Setup biometric-protected wallet (REQUIRED for security)
|
|
22
|
+
*
|
|
23
|
+
* SECURITY CRITICAL:
|
|
24
|
+
* - Private keypair is encrypted and stored in hardware-secure storage
|
|
25
|
+
* - Private key NEVER accessible without biometric authentication
|
|
26
|
+
* - User CANNOT export, backup, or access seed phrase
|
|
27
|
+
* - Keypair is device-specific and non-custodial
|
|
28
|
+
*
|
|
29
|
+
* @param keypair User's Solana keypair (never re-used or exported)
|
|
30
|
+
* @param useBiometrics Must be true (biometric is mandatory, not optional)
|
|
31
|
+
*/
|
|
32
|
+
static setupWalletProtection(keypair: Keypair, useBiometrics?: boolean): Promise<void>;
|
|
33
|
+
/**
|
|
34
|
+
* Verify wallet is stored securely (requires biometric to access)
|
|
35
|
+
* @returns true if wallet exists and requires biometric
|
|
36
|
+
*/
|
|
37
|
+
static isKeypairStoredSecurely(): Promise<boolean>;
|
|
38
|
+
/**
|
|
39
|
+
* Get public key only (NO AUTHENTICATION REQUIRED - public key is safe)
|
|
40
|
+
* Use this for displaying wallet address, sending funds to, etc.
|
|
41
|
+
*/
|
|
42
|
+
static getPublicKeyWithoutAuth(): Promise<PublicKey | null>;
|
|
43
|
+
/**
|
|
44
|
+
* Lock wallet from memory (does NOT delete stored keypair)
|
|
45
|
+
* Keypair remains encrypted in secure storage
|
|
46
|
+
*/
|
|
47
|
+
static lockWalletFromMemory(): Promise<void>;
|
|
48
|
+
/**
|
|
49
|
+
* Permanently delete wallet (IRREVERSIBLE)
|
|
50
|
+
* Only use for logout or account deletion
|
|
51
|
+
*/
|
|
52
|
+
static deleteWalletPermanently(): Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
export {};
|
|
55
|
+
//# sourceMappingURL=authService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authService.d.ts","sourceRoot":"","sources":["../../../../src/services/authService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,eAAO,MAAM,WAAW,sBAAsB,CAAC;AAI/C,KAAK,WAAW,GAAG;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;CACvB,CAAC;AAEF,qBAAa,WAAW;WACT,gBAAgB,CAC3B,aAAa,EAAE,MAAM,EACrB,WAAW,GAAE,OAAe,GAC3B,OAAO,CAAC;QAAE,IAAI,EAAE,QAAQ,CAAC;QAAC,OAAO,EAAE,WAAW,CAAA;KAAE,CAAC;WAwCvC,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;WAIhD,UAAU,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC;WAKzC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;WAKxB,gBAAgB,IAAI,OAAO,CAAC,OAAO,CAAC;WAQpC,0BAA0B,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC;IA2DlE;;;;;;;;;;;OAWG;WACU,qBAAqB,CAChC,OAAO,EAAE,OAAO,EAChB,aAAa,GAAE,OAAc,GAC5B,OAAO,CAAC,IAAI,CAAC;IAoChB;;;OAGG;WACU,uBAAuB,IAAI,OAAO,CAAC,OAAO,CAAC;IAKxD;;;OAGG;WACU,uBAAuB,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAajE;;;OAGG;WACU,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKlD;;;OAGG;WACU,uBAAuB,IAAI,OAAO,CAAC,IAAI,CAAC;CAKtD"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { SolanaIntent } from '../intent';
|
|
2
|
+
export declare function secureStoreIntent(intent: SolanaIntent): Promise<void>;
|
|
3
|
+
export declare function getSecureIntent(intentId: string): Promise<SolanaIntent | null>;
|
|
4
|
+
export declare function getAllSecureIntents(): Promise<SolanaIntent[]>;
|
|
5
|
+
export declare function removeSecureIntent(intentId: string): Promise<void>;
|
|
6
|
+
export declare function clearAllSecureIntents(): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=secureStorage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"secureStorage.d.ts","sourceRoot":"","sources":["../../../../src/storage/secureStorage.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAoB9C,wBAAsB,iBAAiB,CAAC,MAAM,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3E;AAED,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,GAAG,IAAI,CAAC,CAY9B;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAanE;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAexE;AAED,wBAAsB,qBAAqB,IAAI,OAAO,CAAC,IAAI,CAAC,CAU3D"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../../src/storage.ts"],"names":[],"mappings":"AAIA,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,GAAG,iBAInD;AAED,wBAAsB,iBAAiB,iBAEtC;AAED,wBAAsB,mBAAmB,kBAExC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Synchronisation with Solana Blockchain
|
|
3
|
+
*
|
|
4
|
+
* Implements Section 9 of the TOSS Technical Paper:
|
|
5
|
+
* Upon regaining connectivity, devices initiate reconciliation with onchain state.
|
|
6
|
+
* All offline artifacts are verified onchain and settled with deterministic outcomes.
|
|
7
|
+
*/
|
|
8
|
+
import { Connection, PublicKey } from '@solana/web3.js';
|
|
9
|
+
import { type SettlementResult, type ReconciliationState } from './reconciliation';
|
|
10
|
+
export interface SyncResult {
|
|
11
|
+
successfulSettlements: SettlementResult[];
|
|
12
|
+
failedSettlements: SettlementResult[];
|
|
13
|
+
detectedConflicts: {
|
|
14
|
+
intentId: string;
|
|
15
|
+
conflict: string;
|
|
16
|
+
}[];
|
|
17
|
+
reconciliationState: ReconciliationState;
|
|
18
|
+
syncTimestamp: number;
|
|
19
|
+
isComplete: boolean;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Full sync and reconciliation with the Solana blockchain
|
|
23
|
+
*
|
|
24
|
+
* This is the primary function for TOSS settlement. When a device regains
|
|
25
|
+
* connectivity, it calls this to:
|
|
26
|
+
* 1. Detect any conflicts with onchain state
|
|
27
|
+
* 2. Settle all pending intents
|
|
28
|
+
* 3. Update local state with results
|
|
29
|
+
*
|
|
30
|
+
* @param connection Connection to Solana RPC
|
|
31
|
+
* @param feePayer Optional fee payer keypair public key
|
|
32
|
+
* @returns Detailed sync results including conflicts and settlements
|
|
33
|
+
*/
|
|
34
|
+
export declare function syncToChain(connection: Connection, feePayer?: PublicKey): Promise<SyncResult>;
|
|
35
|
+
/**
|
|
36
|
+
* Lightweight sync to check status without settling
|
|
37
|
+
* Useful for monitoring or UI updates without committing to settlements
|
|
38
|
+
*/
|
|
39
|
+
export declare function checkSyncStatus(connection: Connection): Promise<ReconciliationState>;
|
|
40
|
+
//# sourceMappingURL=sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../../../src/sync.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAIL,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAG1B,MAAM,WAAW,UAAU;IAEzB,qBAAqB,EAAE,gBAAgB,EAAE,CAAC;IAE1C,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;IAEtC,iBAAiB,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAE5D,mBAAmB,EAAE,mBAAmB,CAAC;IAEzC,aAAa,EAAE,MAAM,CAAC;IAEtB,UAAU,EAAE,OAAO,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAsB,WAAW,CAC/B,UAAU,EAAE,UAAU,EACtB,QAAQ,CAAC,EAAE,SAAS,GACnB,OAAO,CAAC,UAAU,CAAC,CAyCrB;AAED;;;GAGG;AACH,wBAAsB,eAAe,CACnC,UAAU,EAAE,UAAU,GACrB,OAAO,CAAC,mBAAmB,CAAC,CAE9B"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { PublicKey } from '@solana/web3.js';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a TOSS wallet user in the ecosystem
|
|
4
|
+
*/
|
|
5
|
+
export type TossUser = {
|
|
6
|
+
userId: string;
|
|
7
|
+
username: string;
|
|
8
|
+
displayName?: string;
|
|
9
|
+
wallet: {
|
|
10
|
+
publicKey: PublicKey;
|
|
11
|
+
isVerified: boolean;
|
|
12
|
+
createdAt: string;
|
|
13
|
+
};
|
|
14
|
+
device: {
|
|
15
|
+
id: string;
|
|
16
|
+
name?: string;
|
|
17
|
+
lastActive: string;
|
|
18
|
+
client: 'mobile' | 'web' | 'desktop';
|
|
19
|
+
};
|
|
20
|
+
status: 'active' | 'inactive' | 'restricted';
|
|
21
|
+
lastSeen: string;
|
|
22
|
+
tossFeatures: {
|
|
23
|
+
canSend: boolean;
|
|
24
|
+
canReceive: boolean;
|
|
25
|
+
isPrivateTxEnabled: boolean;
|
|
26
|
+
maxTransactionAmount: number;
|
|
27
|
+
};
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* Minimal user info for transaction context
|
|
33
|
+
*/
|
|
34
|
+
export type TossUserContext = Pick<TossUser, 'userId' | 'username' | 'wallet' | 'status'> & {
|
|
35
|
+
deviceId: string;
|
|
36
|
+
sessionId: string;
|
|
37
|
+
};
|
|
38
|
+
export declare const exampleTossUser: TossUser;
|
|
39
|
+
//# sourceMappingURL=tossUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tossUser.d.ts","sourceRoot":"","sources":["../../../../src/types/tossUser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG;IAErB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;IAGrB,MAAM,EAAE;QACN,SAAS,EAAE,SAAS,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IAGF,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,UAAU,EAAE,MAAM,CAAC;QACnB,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,SAAS,CAAC;KACtC,CAAC;IAGF,MAAM,EAAE,QAAQ,GAAG,UAAU,GAAG,YAAY,CAAC;IAC7C,QAAQ,EAAE,MAAM,CAAC;IAGjB,YAAY,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC;QACjB,UAAU,EAAE,OAAO,CAAC;QACpB,kBAAkB,EAAE,OAAO,CAAC;QAC5B,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;IAGF,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,QAAQ,EACR,QAAQ,GAAG,UAAU,GAAG,QAAQ,GAAG,QAAQ,CAC5C,GAAG;IACF,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,QAyB7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PublicKey, Connection, Keypair } from '@solana/web3.js';
|
|
2
|
+
export declare function createNonceAccount(connection: Connection, feePayer: Keypair, nonceAccount?: Keypair, amount?: number): Promise<{
|
|
3
|
+
nonceAccount: Keypair;
|
|
4
|
+
nonceAuth: PublicKey;
|
|
5
|
+
}>;
|
|
6
|
+
export declare function getNonce(connection: Connection, nonceAccount: PublicKey): Promise<string>;
|
|
7
|
+
export declare function createNonceAdvanceInstruction(noncePubkey: PublicKey, authorizedPubkey: PublicKey): import("@solana/web3.js").TransactionInstruction;
|
|
8
|
+
//# sourceMappingURL=nonceUtils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nonceUtils.d.ts","sourceRoot":"","sources":["../../../../src/utils/nonceUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,UAAU,EACV,OAAO,EAER,MAAM,iBAAiB,CAAC;AAEzB,wBAAsB,kBAAkB,CACtC,UAAU,EAAE,UAAU,EACtB,QAAQ,EAAE,OAAO,EACjB,YAAY,GAAE,OAA4B,EAC1C,MAAM,SAAuB,GAC5B,OAAO,CAAC;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,SAAS,CAAA;CAAE,CAAC,CAsB1D;AAED,wBAAsB,QAAQ,CAC5B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,SAAS,GACtB,OAAO,CAAC,MAAM,CAAC,CAIjB;AAED,wBAAgB,6BAA6B,CAC3C,WAAW,EAAE,SAAS,EACtB,gBAAgB,EAAE,SAAS,oDAM5B"}
|
package/package.json
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "toss-expo-sdk",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The official React Native SDK for The Offline Solana Stack (TOSS)",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./lib/module/index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": {
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"require": {
|
|
14
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
15
|
+
"default": "./lib/module/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"./package.json": "./package.json"
|
|
19
|
+
},
|
|
20
|
+
"files": [
|
|
21
|
+
"lib/",
|
|
22
|
+
"src/",
|
|
23
|
+
"README.md",
|
|
24
|
+
"LICENSE"
|
|
25
|
+
],
|
|
26
|
+
"scripts": {
|
|
27
|
+
"example": "yarn workspace toss-expo-sdk-example",
|
|
28
|
+
"clean": "del-cli lib",
|
|
29
|
+
"prepare": "bob build",
|
|
30
|
+
"typecheck": "tsc --noEmit",
|
|
31
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"release": "release-it --only-version"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"toss",
|
|
37
|
+
"offline-solana",
|
|
38
|
+
"solana",
|
|
39
|
+
"solana-sdk",
|
|
40
|
+
"offline-sdk",
|
|
41
|
+
"react-native-sdk",
|
|
42
|
+
"react-native-solana",
|
|
43
|
+
"crypto",
|
|
44
|
+
"peer-to-peer",
|
|
45
|
+
"offline-first",
|
|
46
|
+
"offlinesolana"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/zyppprotocol/toss-expo-sdk.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "Joshua Idele (Zypp Protocol) <codewithjoshh@gmail.com> (https://github.com/Coding-With-Josh)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/zyppprotocol/toss-expo-sdk/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/zyppprotocol/toss-expo-sdk#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"peerDependencies": {
|
|
62
|
+
"react": ">=18",
|
|
63
|
+
"react-native": ">=0.71"
|
|
64
|
+
},
|
|
65
|
+
"devDependencies": {
|
|
66
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
67
|
+
"@eslint/compat": "^1.3.2",
|
|
68
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
69
|
+
"@eslint/js": "^9.35.0",
|
|
70
|
+
"@react-native-community/cli": "latest",
|
|
71
|
+
"@react-native/babel-preset": "0.83.0",
|
|
72
|
+
"@react-native/eslint-config": "0.83.0",
|
|
73
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
74
|
+
"@types/jest": "^29.5.14",
|
|
75
|
+
"@types/react": "^19.1.12",
|
|
76
|
+
"commitlint": "^19.8.1",
|
|
77
|
+
"del-cli": "^6.0.0",
|
|
78
|
+
"eslint": "^9.35.0",
|
|
79
|
+
"eslint-config-prettier": "^10.1.8",
|
|
80
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
81
|
+
"eslint-plugin-react-native": "^5.0.0",
|
|
82
|
+
"jest": "^29.7.0",
|
|
83
|
+
"lefthook": "^2.0.3",
|
|
84
|
+
"prettier": "^3.7.4",
|
|
85
|
+
"react": "19.1.0",
|
|
86
|
+
"react-native": "0.81.5",
|
|
87
|
+
"react-native-builder-bob": "^0.40.13",
|
|
88
|
+
"release-it": "^19.0.4",
|
|
89
|
+
"typescript": "^5.9.2"
|
|
90
|
+
},
|
|
91
|
+
"workspaces": [
|
|
92
|
+
"example"
|
|
93
|
+
],
|
|
94
|
+
"packageManager": "yarn@4.11.0",
|
|
95
|
+
"react-native-builder-bob": {
|
|
96
|
+
"source": "src",
|
|
97
|
+
"output": "lib",
|
|
98
|
+
"targets": [
|
|
99
|
+
[
|
|
100
|
+
"module",
|
|
101
|
+
{
|
|
102
|
+
"esm": true
|
|
103
|
+
}
|
|
104
|
+
],
|
|
105
|
+
[
|
|
106
|
+
"typescript",
|
|
107
|
+
{
|
|
108
|
+
"project": "tsconfig.build.json"
|
|
109
|
+
}
|
|
110
|
+
]
|
|
111
|
+
]
|
|
112
|
+
},
|
|
113
|
+
"prettier": {
|
|
114
|
+
"quoteProps": "consistent",
|
|
115
|
+
"singleQuote": true,
|
|
116
|
+
"tabWidth": 2,
|
|
117
|
+
"trailingComma": "es5",
|
|
118
|
+
"useTabs": false
|
|
119
|
+
},
|
|
120
|
+
"jest": {
|
|
121
|
+
"preset": "react-native",
|
|
122
|
+
"modulePathIgnorePatterns": [
|
|
123
|
+
"<rootDir>/example/node_modules",
|
|
124
|
+
"<rootDir>/lib/"
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"commitlint": {
|
|
128
|
+
"extends": [
|
|
129
|
+
"@commitlint/config-conventional"
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
"release-it": {
|
|
133
|
+
"git": {
|
|
134
|
+
"commitMessage": "chore: release ${version}",
|
|
135
|
+
"tagName": "v${version}"
|
|
136
|
+
},
|
|
137
|
+
"npm": {
|
|
138
|
+
"publish": true
|
|
139
|
+
},
|
|
140
|
+
"github": {
|
|
141
|
+
"release": true
|
|
142
|
+
},
|
|
143
|
+
"plugins": {
|
|
144
|
+
"@release-it/conventional-changelog": {
|
|
145
|
+
"preset": {
|
|
146
|
+
"name": "angular"
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"create-react-native-library": {
|
|
152
|
+
"type": "library",
|
|
153
|
+
"languages": "js",
|
|
154
|
+
"tools": [
|
|
155
|
+
"eslint",
|
|
156
|
+
"jest",
|
|
157
|
+
"lefthook",
|
|
158
|
+
"release-it"
|
|
159
|
+
],
|
|
160
|
+
"version": "0.56.0"
|
|
161
|
+
},
|
|
162
|
+
"dependencies": {
|
|
163
|
+
"@arcium-hq/client": "^0.5.4",
|
|
164
|
+
"@chainsafe/libp2p-noise": "^17.0.0",
|
|
165
|
+
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
166
|
+
"@solana/web3.js": "^1.98.4",
|
|
167
|
+
"bs58": "^6.0.0",
|
|
168
|
+
"expo-local-authentication": "^17.0.8",
|
|
169
|
+
"expo-secure-store": "^15.0.8",
|
|
170
|
+
"react-native-ble-plx": "^3.5.0",
|
|
171
|
+
"react-native-nfc-manager": "^3.17.2",
|
|
172
|
+
"react-native-vision-camera": "^4.7.3",
|
|
173
|
+
"tweetnacl": "^1.0.3",
|
|
174
|
+
"vision-camera-code-scanner": "^0.2.0"
|
|
175
|
+
}
|
|
176
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
it.todo('write a test');
|