@@ -16,59 +16,23 @@ pnpm run build
1616
1717### Running Tests
1818
19- Tests rely on [ Solana CLI's] ( https://solana.com/docs/intro/installation ) local test validator.
2019
2120Start your local Kora RPC Server from the root project directory:
2221
2322``` bash
24- make run
23+ kora --config tests/src/common/fixtures/kora-test.toml rpc start --signers-config tests/src/common/fixtures/signers.toml
2524```
2625
27- Make sure the Kora RPC's payer wallet matches ` KORA_ADDRESS ` (not required if using the default values).
28- Make sure the ` TEST_USDC_MINT_SECRET ` public key is included in the root's ` kora.toml ` (not required if using the default values)
26+ Tests rely on [ Solana CLI's] ( https://solana.com/docs/intro/installation ) local test validator.
2927
3028Run:
3129
3230``` bash
33- pnpm test:integration
31+ pnpm test:ci: integration
3432```
3533
3634This will start a local test validator and run all tests.
3735
38- Alternatively, you can start your own test validator and run:
39-
40- ``` bash
41- pnpm test
42- ```
43-
44- Based on your test file, here's the optional environment configuration section:
45-
46- You may optionally configure a ` .env ` file for your tests in ` sdks/ts ` :
47-
48- ``` bash
49- # Solana Configuration
50- SOLANA_RPC_URL=
51- SOLANA_WS_URL=
52- SOLANA_VALIDATOR_STARTUP_TIME=
53- SOLANA_VALIDATOR_ARGS=
54- COMMITMENT=
55-
56- # Kora API Configuration
57- KORA_ADDRESS=
58- KORA_RPC_URL=
59-
60- # Token Mint Configuration
61- TOKEN_DECIMALS=
62- TOKEN_DROP_AMOUNT=
63- SOL_DROP_AMOUNT=
64-
65- # Test Configuration
66- SENDER_SECRET=your_test_private_key
67- TEST_USDC_MINT_SECRET=your_test_usdc_mint_address
68- DESTINATION_ADDRESS=your_test_destination_address
69- ```
70-
71- All environment variables are optional and have sensible defaults.
7236
7337## Quick Start
7438
@@ -92,92 +56,5 @@ console.log('Message:', result.message);
9256console .log (' Instructions:' , result .instructions );
9357```
9458
95- ## API Reference
96-
97- ### Configuration Methods
98-
99- #### ` getConfig() `
100- Get the current Kora configuration.
101- ``` typescript
102- const config = await client .getConfig ();
103- ```
104-
105- #### ` getPayerSigner() `
106- Get the payer signer and payment destination.
107- ``` typescript
108- const { signer, payment_destination } = await client .getPayerSigner ();
109- ```
110-
111- #### ` getSupportedTokens() `
112- Get list of supported tokens.
113- ``` typescript
114- const { tokens } = await client .getSupportedTokens ();
115- ```
116-
117- ### Transaction Methods
118-
119- #### ` transferTransaction(request: TransferTransactionRequest) `
120- Create a token transfer transaction.
121- ``` typescript
122- const response = await client .transferTransaction ({
123- amount: 1000000 ,
124- token: " EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ,
125- source: " sourceAddress" ,
126- destination: " destinationAddress"
127- });
128- ```
129-
130- #### ` signTransaction(request: SignTransactionRequest) `
131- Sign a transaction.
132- ``` typescript
133- const result = await client .signTransaction ({
134- transaction: " base58EncodedTransaction"
135- });
136- ```
137-
138- #### ` signAndSendTransaction(request: SignAndSendTransactionRequest) `
139- Sign and send a transaction.
140- ``` typescript
141- const result = await client .signAndSendTransaction ({
142- transaction: " base64EncodedTransaction"
143- });
144- ```
145-
146- #### ` signTransactionIfPaid(request: SignTransactionIfPaidRequest) `
147- Sign a transaction if it pays the fee payer.
148- ``` typescript
149- const result = await client .signTransactionIfPaid ({
150- transaction: " base58EncodedTransaction" ,
151- margin: 0.1 , // Optional: 10% margin
152- });
153- ```
154-
155- ### Utility Methods
156-
157- #### ` getBlockhash() `
158- Get the latest blockhash.
159- ``` typescript
160- const { blockhash } = await client .getBlockhash ();
161- ```
162-
163- #### ` estimateTransactionFee(transaction: string, feeToken: string) `
164- Estimate transaction fee.
165- ``` typescript
166- const { fee_in_lamports } = await client .estimateTransactionFee (
167- " base58EncodedTransaction" ,
168- " feeTokenMint"
169- );
170- ```
171-
172- ## Error Handling
173-
174- The SDK throws errors with descriptive messages when RPC calls fail:
175-
176- ``` typescript
177- try {
178- await client .transferTransaction (request );
179- } catch (error ) {
180- console .error (' Transfer failed:' , error .message );
181- // Example error: "RPC Error -32602: invalid type: map, expected u64"
182- }
183- ```
59+ ** [ → API Reference] ( ./docs/README.md ) **
60+ ** [ → Quick Start] ( /docs/getting-started/QUICK_START.md ) **
0 commit comments