@nosana/kit 1.0.10 → 2.0.9
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/README.md +539 -152
- package/dist/NosanaClient.d.ts +58 -0
- package/dist/NosanaClient.js +103 -0
- package/dist/NosanaClient.js.map +1 -0
- package/dist/config/defaultConfigs.d.ts +2 -1
- package/dist/config/defaultConfigs.js +4 -4
- package/dist/config/defaultConfigs.js.map +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/types.d.ts +41 -33
- package/dist/config/types.js +14 -13
- package/dist/config/types.js.map +1 -0
- package/dist/config/utils.d.ts +2 -2
- package/dist/config/utils.js +11 -4
- package/dist/config/utils.js.map +1 -0
- package/dist/errors/NosanaError.d.ts +1 -0
- package/dist/errors/NosanaError.js +2 -0
- package/dist/errors/NosanaError.js.map +1 -0
- package/dist/generated_clients/jobs/accounts/index.d.ts +5 -5
- package/dist/generated_clients/jobs/accounts/index.js +6 -5
- package/dist/generated_clients/jobs/accounts/index.js.map +1 -0
- package/dist/generated_clients/jobs/accounts/jobAccount.d.ts +10 -6
- package/dist/generated_clients/jobs/accounts/jobAccount.js +6 -2
- package/dist/generated_clients/jobs/accounts/jobAccount.js.map +1 -0
- package/dist/generated_clients/jobs/accounts/marketAccount.d.ts +6 -2
- package/dist/generated_clients/jobs/accounts/marketAccount.js +6 -2
- package/dist/generated_clients/jobs/accounts/marketAccount.js.map +1 -0
- package/dist/generated_clients/jobs/accounts/runAccount.d.ts +10 -6
- package/dist/generated_clients/jobs/accounts/runAccount.js +6 -2
- package/dist/generated_clients/jobs/accounts/runAccount.js.map +1 -0
- package/dist/generated_clients/jobs/errors/index.d.ts +3 -3
- package/dist/generated_clients/jobs/errors/index.js +4 -3
- package/dist/generated_clients/jobs/errors/index.js.map +1 -0
- package/dist/generated_clients/jobs/errors/nosanaJobs.d.ts +2 -2
- package/dist/generated_clients/jobs/errors/nosanaJobs.js +4 -3
- package/dist/generated_clients/jobs/errors/nosanaJobs.js.map +1 -0
- package/dist/generated_clients/jobs/index.d.ts +7 -7
- package/dist/generated_clients/jobs/index.js +8 -7
- package/dist/generated_clients/jobs/index.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/assign.d.ts +14 -14
- package/dist/generated_clients/jobs/instructions/assign.js +8 -8
- package/dist/generated_clients/jobs/instructions/assign.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/claim.d.ts +13 -13
- package/dist/generated_clients/jobs/instructions/claim.js +8 -8
- package/dist/generated_clients/jobs/instructions/claim.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/clean.d.ts +10 -10
- package/dist/generated_clients/jobs/instructions/clean.js +8 -8
- package/dist/generated_clients/jobs/instructions/clean.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/cleanAdmin.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/cleanAdmin.js +8 -8
- package/dist/generated_clients/jobs/instructions/cleanAdmin.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/close.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/close.js +8 -8
- package/dist/generated_clients/jobs/instructions/close.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/closeAdmin.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/closeAdmin.js +8 -8
- package/dist/generated_clients/jobs/instructions/closeAdmin.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/complete.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/complete.js +9 -12
- package/dist/generated_clients/jobs/instructions/complete.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/delist.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/delist.js +8 -8
- package/dist/generated_clients/jobs/instructions/delist.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/end.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/end.js +8 -8
- package/dist/generated_clients/jobs/instructions/end.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/extend.d.ts +12 -12
- package/dist/generated_clients/jobs/instructions/extend.js +8 -8
- package/dist/generated_clients/jobs/instructions/extend.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/finish.d.ts +23 -20
- package/dist/generated_clients/jobs/instructions/finish.js +15 -12
- package/dist/generated_clients/jobs/instructions/finish.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/index.d.ts +21 -21
- package/dist/generated_clients/jobs/instructions/index.js +22 -21
- package/dist/generated_clients/jobs/instructions/index.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/list.d.ts +14 -14
- package/dist/generated_clients/jobs/instructions/list.js +8 -8
- package/dist/generated_clients/jobs/instructions/list.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/open.d.ts +12 -12
- package/dist/generated_clients/jobs/instructions/open.js +8 -8
- package/dist/generated_clients/jobs/instructions/open.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/quit.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/quit.js +8 -8
- package/dist/generated_clients/jobs/instructions/quit.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/quitAdmin.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/quitAdmin.js +8 -8
- package/dist/generated_clients/jobs/instructions/quitAdmin.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/recover.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/recover.js +8 -8
- package/dist/generated_clients/jobs/instructions/recover.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/stop.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/stop.js +8 -8
- package/dist/generated_clients/jobs/instructions/stop.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/update.d.ts +11 -11
- package/dist/generated_clients/jobs/instructions/update.js +8 -8
- package/dist/generated_clients/jobs/instructions/update.js.map +1 -0
- package/dist/generated_clients/jobs/instructions/work.d.ts +13 -13
- package/dist/generated_clients/jobs/instructions/work.js +8 -8
- package/dist/generated_clients/jobs/instructions/work.js.map +1 -0
- package/dist/generated_clients/jobs/programs/index.d.ts +3 -3
- package/dist/generated_clients/jobs/programs/index.js +4 -3
- package/dist/generated_clients/jobs/programs/index.js.map +1 -0
- package/dist/generated_clients/jobs/programs/nosanaJobs.d.ts +52 -50
- package/dist/generated_clients/jobs/programs/nosanaJobs.js +30 -31
- package/dist/generated_clients/jobs/programs/nosanaJobs.js.map +1 -0
- package/dist/generated_clients/jobs/shared/index.d.ts +5 -5
- package/dist/generated_clients/jobs/shared/index.js +4 -3
- package/dist/generated_clients/jobs/shared/index.js.map +1 -0
- package/dist/generated_clients/jobs/types/index.d.ts +5 -5
- package/dist/generated_clients/jobs/types/index.js +6 -5
- package/dist/generated_clients/jobs/types/index.js.map +1 -0
- package/dist/generated_clients/jobs/types/jobState.d.ts +12 -11
- package/dist/generated_clients/jobs/types/jobState.js +8 -8
- package/dist/generated_clients/jobs/types/jobState.js.map +1 -0
- package/dist/generated_clients/jobs/types/jobType.d.ts +15 -14
- package/dist/generated_clients/jobs/types/jobType.js +11 -11
- package/dist/generated_clients/jobs/types/jobType.js.map +1 -0
- package/dist/generated_clients/jobs/types/queueType.d.ts +12 -11
- package/dist/generated_clients/jobs/types/queueType.js +8 -8
- package/dist/generated_clients/jobs/types/queueType.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/accounts/claimStatus.d.ts +10 -6
- package/dist/generated_clients/merkle_distributor/accounts/claimStatus.js +6 -2
- package/dist/generated_clients/merkle_distributor/accounts/claimStatus.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/accounts/index.d.ts +4 -4
- package/dist/generated_clients/merkle_distributor/accounts/index.js +5 -4
- package/dist/generated_clients/merkle_distributor/accounts/index.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/accounts/merkleDistributor.d.ts +10 -6
- package/dist/generated_clients/merkle_distributor/accounts/merkleDistributor.js +6 -2
- package/dist/generated_clients/merkle_distributor/accounts/merkleDistributor.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/errors/index.d.ts +3 -3
- package/dist/generated_clients/merkle_distributor/errors/index.js +4 -3
- package/dist/generated_clients/merkle_distributor/errors/index.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/errors/merkleDistributor.d.ts +2 -2
- package/dist/generated_clients/merkle_distributor/errors/merkleDistributor.js +4 -3
- package/dist/generated_clients/merkle_distributor/errors/merkleDistributor.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/index.d.ts +6 -6
- package/dist/generated_clients/merkle_distributor/index.js +7 -6
- package/dist/generated_clients/merkle_distributor/index.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/claimLocked.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/claimLocked.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/claimLocked.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/clawback.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/clawback.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/clawback.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeClaimStatus.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/closeClaimStatus.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/closeClaimStatus.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/closeDistributor.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/closeDistributor.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/closeDistributor.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/index.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/index.js +12 -11
- package/dist/generated_clients/merkle_distributor/instructions/index.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/newClaim.d.ts +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/newClaim.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/newClaim.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/newDistributor.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/newDistributor.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/newDistributor.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/setAdmin.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/setAdmin.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/setAdmin.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/setClawbackReceiver.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/setClawbackReceiver.js +8 -8
- package/dist/generated_clients/merkle_distributor/instructions/setClawbackReceiver.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/instructions/setEnableSlot.d.ts +11 -11
- package/dist/generated_clients/merkle_distributor/instructions/setEnableSlot.js +9 -12
- package/dist/generated_clients/merkle_distributor/instructions/setEnableSlot.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/programs/index.d.ts +3 -3
- package/dist/generated_clients/merkle_distributor/programs/index.js +4 -3
- package/dist/generated_clients/merkle_distributor/programs/index.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/programs/merkleDistributor.d.ts +29 -27
- package/dist/generated_clients/merkle_distributor/programs/merkleDistributor.js +18 -19
- package/dist/generated_clients/merkle_distributor/programs/merkleDistributor.js.map +1 -0
- package/dist/generated_clients/merkle_distributor/shared/index.d.ts +5 -5
- package/dist/generated_clients/merkle_distributor/shared/index.js +4 -3
- package/dist/generated_clients/merkle_distributor/shared/index.js.map +1 -0
- package/dist/generated_clients/staking/accounts/index.d.ts +4 -4
- package/dist/generated_clients/staking/accounts/index.js +5 -4
- package/dist/generated_clients/staking/accounts/index.js.map +1 -0
- package/dist/generated_clients/staking/accounts/settingsAccount.d.ts +9 -6
- package/dist/generated_clients/staking/accounts/settingsAccount.js +6 -2
- package/dist/generated_clients/staking/accounts/settingsAccount.js.map +1 -0
- package/dist/generated_clients/staking/accounts/stakeAccount.d.ts +9 -6
- package/dist/generated_clients/staking/accounts/stakeAccount.js +6 -2
- package/dist/generated_clients/staking/accounts/stakeAccount.js.map +1 -0
- package/dist/generated_clients/staking/errors/index.d.ts +3 -3
- package/dist/generated_clients/staking/errors/index.js +4 -3
- package/dist/generated_clients/staking/errors/index.js.map +1 -0
- package/dist/generated_clients/staking/errors/nosanaStaking.d.ts +2 -2
- package/dist/generated_clients/staking/errors/nosanaStaking.js +4 -3
- package/dist/generated_clients/staking/errors/nosanaStaking.js.map +1 -0
- package/dist/generated_clients/staking/index.d.ts +6 -6
- package/dist/generated_clients/staking/index.js +7 -6
- package/dist/generated_clients/staking/index.js.map +1 -0
- package/dist/generated_clients/staking/instructions/close.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/close.js +8 -8
- package/dist/generated_clients/staking/instructions/close.js.map +1 -0
- package/dist/generated_clients/staking/instructions/extend.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/extend.js +9 -12
- package/dist/generated_clients/staking/instructions/extend.js.map +1 -0
- package/dist/generated_clients/staking/instructions/index.d.ts +12 -12
- package/dist/generated_clients/staking/instructions/index.js +13 -12
- package/dist/generated_clients/staking/instructions/index.js.map +1 -0
- package/dist/generated_clients/staking/instructions/init.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/init.js +8 -8
- package/dist/generated_clients/staking/instructions/init.js.map +1 -0
- package/dist/generated_clients/staking/instructions/restake.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/restake.js +8 -8
- package/dist/generated_clients/staking/instructions/restake.js.map +1 -0
- package/dist/generated_clients/staking/instructions/slash.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/slash.js +8 -8
- package/dist/generated_clients/staking/instructions/slash.js.map +1 -0
- package/dist/generated_clients/staking/instructions/stake.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/stake.js +8 -8
- package/dist/generated_clients/staking/instructions/stake.js.map +1 -0
- package/dist/generated_clients/staking/instructions/topup.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/topup.js +8 -8
- package/dist/generated_clients/staking/instructions/topup.js.map +1 -0
- package/dist/generated_clients/staking/instructions/unstake.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/unstake.js +8 -8
- package/dist/generated_clients/staking/instructions/unstake.js.map +1 -0
- package/dist/generated_clients/staking/instructions/updateSettings.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/updateSettings.js +8 -8
- package/dist/generated_clients/staking/instructions/updateSettings.js.map +1 -0
- package/dist/generated_clients/staking/instructions/withdraw.d.ts +11 -11
- package/dist/generated_clients/staking/instructions/withdraw.js +8 -8
- package/dist/generated_clients/staking/instructions/withdraw.js.map +1 -0
- package/dist/generated_clients/staking/programs/index.d.ts +3 -3
- package/dist/generated_clients/staking/programs/index.js +4 -3
- package/dist/generated_clients/staking/programs/index.js.map +1 -0
- package/dist/generated_clients/staking/programs/nosanaStaking.d.ts +33 -31
- package/dist/generated_clients/staking/programs/nosanaStaking.js +20 -21
- package/dist/generated_clients/staking/programs/nosanaStaking.js.map +1 -0
- package/dist/generated_clients/staking/shared/index.d.ts +5 -5
- package/dist/generated_clients/staking/shared/index.js +4 -3
- package/dist/generated_clients/staking/shared/index.js.map +1 -0
- package/dist/index.d.ts +13 -32
- package/dist/index.js +13 -37
- package/dist/index.js.map +1 -0
- package/dist/logger/Logger.d.ts +4 -4
- package/dist/logger/Logger.js +7 -2
- package/dist/logger/Logger.js.map +1 -0
- package/dist/services/SolanaService.d.ts +49 -26
- package/dist/services/SolanaService.js +191 -133
- package/dist/services/SolanaService.js.map +1 -0
- package/dist/services/TokenService.d.ts +41 -0
- package/dist/services/TokenService.js +136 -0
- package/dist/services/TokenService.js.map +1 -0
- package/dist/services/programs/JobsProgram.d.ts +106 -0
- package/dist/services/programs/JobsProgram.js +584 -0
- package/dist/services/programs/JobsProgram.js.map +1 -0
- package/dist/services/programs/MerkleDistributorProgram.d.ts +101 -0
- package/dist/services/programs/MerkleDistributorProgram.js +343 -0
- package/dist/services/programs/MerkleDistributorProgram.js.map +1 -0
- package/dist/services/programs/StakeProgram.d.ts +46 -0
- package/dist/services/programs/StakeProgram.js +87 -0
- package/dist/services/programs/StakeProgram.js.map +1 -0
- package/dist/types.d.ts +17 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/convertBigIntToNumber.d.ts +19 -0
- package/dist/utils/convertBigIntToNumber.js +15 -0
- package/dist/utils/convertBigIntToNumber.js.map +1 -0
- package/dist/utils/getStaticAccounts.d.ts +23 -0
- package/dist/utils/getStaticAccounts.js +39 -0
- package/dist/utils/getStaticAccounts.js.map +1 -0
- package/dist/utils/index.d.ts +3 -20
- package/dist/utils/index.js +5 -16
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/walletToAuthorizationSigner.d.ts +10 -0
- package/dist/utils/walletToAuthorizationSigner.js +42 -0
- package/dist/utils/walletToAuthorizationSigner.js.map +1 -0
- package/package.json +17 -14
- package/dist/ipfs/IPFS.d.ts +0 -50
- package/dist/ipfs/IPFS.js +0 -149
- package/dist/programs/BaseProgram.d.ts +0 -20
- package/dist/programs/BaseProgram.js +0 -31
- package/dist/programs/JobsProgram.d.ts +0 -129
- package/dist/programs/JobsProgram.js +0 -559
- package/dist/programs/MerkleDistributorProgram.d.ts +0 -115
- package/dist/programs/MerkleDistributorProgram.js +0 -337
- package/dist/programs/StakeProgram.d.ts +0 -29
- package/dist/programs/StakeProgram.js +0 -91
- package/dist/services/NosService.d.ts +0 -48
- package/dist/services/NosService.js +0 -139
- package/dist/utils/walletConverter.d.ts +0 -9
- package/dist/utils/walletConverter.js +0 -141
package/README.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
TypeScript SDK for interacting with the Nosana Network on Solana. Provides comprehensive tools for managing jobs, markets, runs, and protocol operations on the Nosana decentralized compute network.
|
|
4
4
|
|
|
5
|
+
> **v2.0.0** - Major release featuring functional architecture, universal wallet support, and enhanced transaction handling. See [CHANGELOG.md](./CHANGELOG.md) for migration guide.
|
|
6
|
+
|
|
5
7
|
## Installation
|
|
6
8
|
|
|
7
9
|
```bash
|
|
@@ -16,17 +18,17 @@ npm install @nosana/kit
|
|
|
16
18
|
## Quick Start
|
|
17
19
|
|
|
18
20
|
```typescript
|
|
19
|
-
import {
|
|
21
|
+
import { createNosanaClient, NosanaNetwork } from '@nosana/kit';
|
|
20
22
|
|
|
21
23
|
// Initialize with mainnet defaults
|
|
22
|
-
const client =
|
|
24
|
+
const client = createNosanaClient();
|
|
23
25
|
|
|
24
26
|
// Or specify network and configuration
|
|
25
|
-
const client =
|
|
27
|
+
const client = createNosanaClient(NosanaNetwork.DEVNET, {
|
|
26
28
|
solana: {
|
|
27
29
|
rpcEndpoint: 'https://your-custom-rpc.com',
|
|
28
|
-
commitment: 'confirmed'
|
|
29
|
-
}
|
|
30
|
+
commitment: 'confirmed',
|
|
31
|
+
},
|
|
30
32
|
});
|
|
31
33
|
|
|
32
34
|
// Fetch a job by address
|
|
@@ -34,25 +36,29 @@ const job = await client.jobs.get('job-address');
|
|
|
34
36
|
console.log('Job state:', job.state);
|
|
35
37
|
|
|
36
38
|
// Query jobs with filters
|
|
37
|
-
const completedJobs = await client.jobs.all({
|
|
39
|
+
const completedJobs = await client.jobs.all({
|
|
38
40
|
market: 'market-address',
|
|
39
|
-
state: 2
|
|
41
|
+
state: 2, // JobState.COMPLETED
|
|
40
42
|
});
|
|
41
43
|
```
|
|
42
44
|
|
|
43
45
|
## Architecture
|
|
44
46
|
|
|
45
|
-
The SDK
|
|
47
|
+
The SDK uses a functional architecture with factory functions for improved modularity and testability:
|
|
46
48
|
|
|
47
|
-
- **`services/`** - Utility services
|
|
48
|
-
- **`
|
|
49
|
-
- **`
|
|
50
|
-
- **`
|
|
51
|
-
- **`
|
|
49
|
+
- **`services/`** - Utility services and program interfaces
|
|
50
|
+
- **`SolanaService`** - Low-level Solana RPC operations, transactions, and PDA derivations
|
|
51
|
+
- **`TokenService`** - Token account operations (configured for NOS token)
|
|
52
|
+
- **`programs/`** - On-chain program interfaces
|
|
53
|
+
- **`JobsProgram`** - Jobs, runs, and markets management
|
|
54
|
+
- **`StakeProgram`** - Staking account operations
|
|
55
|
+
- **`MerkleDistributorProgram`** - Merkle distributor and claim operations
|
|
56
|
+
- **`ipfs/`** - IPFS integration for pinning and retrieving data
|
|
57
|
+
- **`config/`** - Network configurations and defaults
|
|
58
|
+
- **`utils/`** - Helper utilities and type conversions
|
|
59
|
+
- **`generated_clients/`** - Auto-generated Solana program clients (exported as namespaces)
|
|
52
60
|
|
|
53
|
-
|
|
54
|
-
- **Services** = Helper services and utilities for common operations
|
|
55
|
-
- **Programs** = Interfaces to on-chain Solana programs
|
|
61
|
+
All components use factory functions with explicit dependency injection, making the codebase modular, testable, and maintainable.
|
|
56
62
|
|
|
57
63
|
## Configuration
|
|
58
64
|
|
|
@@ -66,21 +72,24 @@ The SDK supports two networks:
|
|
|
66
72
|
### Configuration Options
|
|
67
73
|
|
|
68
74
|
```typescript
|
|
69
|
-
import {
|
|
75
|
+
import { createNosanaClient, NosanaNetwork, LogLevel } from '@nosana/kit';
|
|
70
76
|
|
|
71
|
-
const client =
|
|
77
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
72
78
|
solana: {
|
|
73
79
|
cluster: 'mainnet-beta',
|
|
74
80
|
rpcEndpoint: 'https://api.mainnet-beta.solana.com',
|
|
75
|
-
commitment: 'confirmed'
|
|
81
|
+
commitment: 'confirmed',
|
|
76
82
|
},
|
|
77
83
|
ipfs: {
|
|
78
84
|
api: 'https://api.pinata.cloud',
|
|
79
85
|
jwt: 'your-pinata-jwt-token',
|
|
80
|
-
gateway: 'https://gateway.pinata.cloud/ipfs/'
|
|
86
|
+
gateway: 'https://gateway.pinata.cloud/ipfs/',
|
|
81
87
|
},
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
api: {
|
|
89
|
+
apiKey: 'your-api-key', // Optional: API key for authentication
|
|
90
|
+
},
|
|
91
|
+
logLevel: LogLevel.DEBUG,
|
|
92
|
+
wallet: myWallet, // Optional: Set wallet during initialization (must be a Wallet type)
|
|
84
93
|
});
|
|
85
94
|
```
|
|
86
95
|
|
|
@@ -88,49 +97,92 @@ const client = new NosanaClient(NosanaNetwork.MAINNET, {
|
|
|
88
97
|
|
|
89
98
|
### NosanaClient
|
|
90
99
|
|
|
91
|
-
Main entry point for SDK interactions.
|
|
100
|
+
Main entry point for SDK interactions. Created using the `createNosanaClient()` factory function.
|
|
92
101
|
|
|
93
102
|
**Properties:**
|
|
103
|
+
|
|
94
104
|
- `config: ClientConfig` - Active configuration
|
|
95
105
|
- `jobs: JobsProgram` - Jobs program interface
|
|
96
106
|
- `stake: StakeProgram` - Staking program interface
|
|
107
|
+
- `merkleDistributor: MerkleDistributorProgram` - Merkle distributor program interface
|
|
97
108
|
- `solana: SolanaService` - General Solana utilities (RPC, transactions, PDAs)
|
|
98
|
-
- `nos:
|
|
99
|
-
- `
|
|
109
|
+
- `nos: TokenService` - Token operations service (configured for NOS token)
|
|
110
|
+
- `api: NosanaApi | undefined` - Nosana API client for interacting with Nosana APIs (jobs, credits, markets)
|
|
111
|
+
- `ipfs: ReturnType<typeof createIpfsClient>` - IPFS operations for pinning and retrieving data
|
|
112
|
+
- `authorization: NosanaAuthorization | Omit<NosanaAuthorization, 'generate' | 'generateHeaders'>` - Authorization service for message signing and validation
|
|
100
113
|
- `logger: Logger` - Logging instance
|
|
101
|
-
- `wallet?:
|
|
114
|
+
- `wallet?: Wallet` - Active wallet (if set). Set this property directly to configure the wallet.
|
|
115
|
+
|
|
116
|
+
**Factory Function:**
|
|
102
117
|
|
|
103
|
-
|
|
104
|
-
- `setWallet(wallet: WalletConfig): Promise<KeyPairSigner>` - Set the signing wallet
|
|
118
|
+
- `createNosanaClient(network?: NosanaNetwork, customConfig?: PartialClientConfig): NosanaClient` - Creates a new client instance
|
|
105
119
|
|
|
106
120
|
### Wallet Configuration
|
|
107
121
|
|
|
108
|
-
The SDK supports
|
|
122
|
+
The SDK supports universal wallet configuration through a unified `Wallet` type that must support both message and transaction signing (`MessageSigner & TransactionSigner`). This enables compatibility with both browser wallets (wallet-standard) and keypair-based wallets.
|
|
123
|
+
|
|
124
|
+
#### Wallet Requirements
|
|
125
|
+
|
|
126
|
+
The wallet must implement both `MessageSigner` and `TransactionSigner` interfaces from `@solana/kit`. This allows the SDK to use the wallet for:
|
|
127
|
+
- **Message signing** - For API authentication and authorization
|
|
128
|
+
- **Transaction signing** - For on-chain operations
|
|
129
|
+
|
|
130
|
+
#### Browser Wallets (Wallet-Standard)
|
|
131
|
+
|
|
132
|
+
Full support for wallet-standard compatible browser wallets (Phantom, Solflare, etc.):
|
|
109
133
|
|
|
110
134
|
```typescript
|
|
111
|
-
|
|
112
|
-
|
|
135
|
+
import { createNosanaClient } from '@nosana/kit';
|
|
136
|
+
import { useWalletAccountSigner } from '@nosana/solana-vue';
|
|
113
137
|
|
|
114
|
-
//
|
|
115
|
-
|
|
138
|
+
// Create client
|
|
139
|
+
const client = createNosanaClient();
|
|
116
140
|
|
|
117
|
-
//
|
|
118
|
-
|
|
141
|
+
// Set browser wallet (wallet-standard compatible)
|
|
142
|
+
client.wallet = useWalletAccountSigner(account, currentChain);
|
|
143
|
+
```
|
|
119
144
|
|
|
120
|
-
|
|
121
|
-
await client.setWallet('/path/to/keypair.json');
|
|
145
|
+
#### Keypair Wallets
|
|
122
146
|
|
|
123
|
-
|
|
124
|
-
process.env.SOLANA_PRIVATE_KEY = JSON.stringify(keypairArray);
|
|
125
|
-
await client.setWallet('env:SOLANA_PRIVATE_KEY');
|
|
147
|
+
Seamless support for keypair-based wallets:
|
|
126
148
|
|
|
127
|
-
|
|
128
|
-
|
|
149
|
+
```typescript
|
|
150
|
+
import { createNosanaClient } from '@nosana/kit';
|
|
151
|
+
import { generateKeyPairSigner } from '@solana/kit';
|
|
129
152
|
|
|
130
|
-
//
|
|
131
|
-
|
|
153
|
+
// Create client
|
|
154
|
+
const client = createNosanaClient();
|
|
155
|
+
|
|
156
|
+
// Set keypair wallet
|
|
157
|
+
const keypair = generateKeyPairSigner();
|
|
158
|
+
client.wallet = keypair;
|
|
132
159
|
```
|
|
133
160
|
|
|
161
|
+
#### Configuration Options
|
|
162
|
+
|
|
163
|
+
Wallets can be set at client initialization or dynamically assigned:
|
|
164
|
+
|
|
165
|
+
```typescript
|
|
166
|
+
import { createNosanaClient, NosanaNetwork } from '@nosana/kit';
|
|
167
|
+
import type { Wallet } from '@nosana/kit';
|
|
168
|
+
|
|
169
|
+
// Option 1: Set wallet during initialization
|
|
170
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
171
|
+
wallet: myWallet,
|
|
172
|
+
});
|
|
173
|
+
|
|
174
|
+
// Option 2: Set wallet dynamically
|
|
175
|
+
const client = createNosanaClient();
|
|
176
|
+
client.wallet = myWallet;
|
|
177
|
+
|
|
178
|
+
// Option 3: Change wallet at runtime
|
|
179
|
+
client.wallet = anotherWallet;
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
#### Type Safety
|
|
183
|
+
|
|
184
|
+
The SDK leverages `@solana/kit` types for compile-time safety, ensuring wallet compatibility before runtime.
|
|
185
|
+
|
|
134
186
|
## Jobs Program API
|
|
135
187
|
|
|
136
188
|
### Fetching Accounts
|
|
@@ -145,10 +197,10 @@ Fetch a job account. If `checkRun` is true (default), automatically checks for a
|
|
|
145
197
|
|
|
146
198
|
```typescript
|
|
147
199
|
const job = await client.jobs.get('job-address');
|
|
148
|
-
console.log(job.state);
|
|
149
|
-
console.log(job.price);
|
|
150
|
-
console.log(job.ipfsJob);
|
|
151
|
-
console.log(job.timeStart);
|
|
200
|
+
console.log(job.state); // JobState enum
|
|
201
|
+
console.log(job.price); // Job price in smallest unit
|
|
202
|
+
console.log(job.ipfsJob); // IPFS CID of job definition
|
|
203
|
+
console.log(job.timeStart); // Start timestamp (if running)
|
|
152
204
|
```
|
|
153
205
|
|
|
154
206
|
#### Get Single Run
|
|
@@ -161,9 +213,9 @@ Fetch a run account by address.
|
|
|
161
213
|
|
|
162
214
|
```typescript
|
|
163
215
|
const run = await client.jobs.run('run-address');
|
|
164
|
-
console.log(run.job);
|
|
165
|
-
console.log(run.node);
|
|
166
|
-
console.log(run.time);
|
|
216
|
+
console.log(run.job); // Associated job address
|
|
217
|
+
console.log(run.node); // Node executing the run
|
|
218
|
+
console.log(run.time); // Run start time
|
|
167
219
|
```
|
|
168
220
|
|
|
169
221
|
#### Get Single Market
|
|
@@ -176,8 +228,8 @@ Fetch a market account by address.
|
|
|
176
228
|
|
|
177
229
|
```typescript
|
|
178
230
|
const market = await client.jobs.market('market-address');
|
|
179
|
-
console.log(market.queueType);
|
|
180
|
-
console.log(market.jobPrice);
|
|
231
|
+
console.log(market.queueType); // MarketQueueType enum
|
|
232
|
+
console.log(market.jobPrice); // Market job price
|
|
181
233
|
```
|
|
182
234
|
|
|
183
235
|
#### Get Multiple Jobs
|
|
@@ -189,11 +241,7 @@ async multiple(addresses: Address[], checkRuns?: boolean): Promise<Job[]>
|
|
|
189
241
|
Batch fetch multiple jobs by addresses.
|
|
190
242
|
|
|
191
243
|
```typescript
|
|
192
|
-
const jobs = await client.jobs.multiple([
|
|
193
|
-
'job-address-1',
|
|
194
|
-
'job-address-2',
|
|
195
|
-
'job-address-3'
|
|
196
|
-
], true);
|
|
244
|
+
const jobs = await client.jobs.multiple(['job-address-1', 'job-address-2', 'job-address-3'], true);
|
|
197
245
|
```
|
|
198
246
|
|
|
199
247
|
### Querying with Filters
|
|
@@ -217,12 +265,12 @@ import { JobState } from '@nosana/kit';
|
|
|
217
265
|
// Get all running jobs in a market
|
|
218
266
|
const runningJobs = await client.jobs.all({
|
|
219
267
|
state: JobState.RUNNING,
|
|
220
|
-
market: 'market-address'
|
|
268
|
+
market: 'market-address',
|
|
221
269
|
});
|
|
222
270
|
|
|
223
271
|
// Get all jobs for a project
|
|
224
272
|
const projectJobs = await client.jobs.all({
|
|
225
|
-
project: 'project-address'
|
|
273
|
+
project: 'project-address',
|
|
226
274
|
});
|
|
227
275
|
```
|
|
228
276
|
|
|
@@ -248,17 +296,13 @@ const nodeRuns = await client.jobs.runs({ node: 'node-address' });
|
|
|
248
296
|
#### Query All Markets
|
|
249
297
|
|
|
250
298
|
```typescript
|
|
251
|
-
async markets(
|
|
252
|
-
project?: Address
|
|
253
|
-
}): Promise<Market[]>
|
|
299
|
+
async markets(): Promise<Market[]>
|
|
254
300
|
```
|
|
255
301
|
|
|
256
|
-
Fetch
|
|
302
|
+
Fetch all market accounts.
|
|
257
303
|
|
|
258
304
|
```typescript
|
|
259
|
-
const
|
|
260
|
-
project: 'project-address'
|
|
261
|
-
});
|
|
305
|
+
const markets = await client.jobs.markets();
|
|
262
306
|
```
|
|
263
307
|
|
|
264
308
|
### Creating Jobs
|
|
@@ -278,18 +322,18 @@ Create a list instruction for posting a job to a market. Returns an instruction
|
|
|
278
322
|
|
|
279
323
|
```typescript
|
|
280
324
|
// Set wallet first
|
|
281
|
-
|
|
325
|
+
client.wallet = yourWallet;
|
|
282
326
|
|
|
283
327
|
// Create job instruction
|
|
284
328
|
const instruction = await client.jobs.post({
|
|
285
329
|
market: 'market-address',
|
|
286
|
-
timeout: 3600,
|
|
287
|
-
ipfsHash: 'QmXxx...',
|
|
288
|
-
node: 'node-address'
|
|
330
|
+
timeout: 3600, // Timeout in seconds
|
|
331
|
+
ipfsHash: 'QmXxx...', // IPFS CID of job definition
|
|
332
|
+
node: 'node-address', // Optional: target specific node
|
|
289
333
|
});
|
|
290
334
|
|
|
291
335
|
// Submit the instruction
|
|
292
|
-
await client.solana.
|
|
336
|
+
await client.solana.buildSignAndSend(instruction);
|
|
293
337
|
```
|
|
294
338
|
|
|
295
339
|
### Real-time Monitoring
|
|
@@ -312,7 +356,7 @@ Subscribe to real-time account updates via WebSocket. Includes automatic reconne
|
|
|
312
356
|
const stopMonitoring = await client.jobs.monitor({
|
|
313
357
|
onJobAccount: async (job) => {
|
|
314
358
|
console.log('Job update:', job.address, job.state);
|
|
315
|
-
|
|
359
|
+
|
|
316
360
|
// Process updates - save to database, trigger workflows, etc.
|
|
317
361
|
if (job.state === JobState.COMPLETED) {
|
|
318
362
|
await processCompletedJob(job);
|
|
@@ -323,7 +367,7 @@ const stopMonitoring = await client.jobs.monitor({
|
|
|
323
367
|
},
|
|
324
368
|
onError: (error) => {
|
|
325
369
|
console.error('Monitor error:', error);
|
|
326
|
-
}
|
|
370
|
+
},
|
|
327
371
|
});
|
|
328
372
|
|
|
329
373
|
// Stop monitoring when done
|
|
@@ -339,24 +383,24 @@ The monitor handles WebSocket reconnection automatically and continues processin
|
|
|
339
383
|
```typescript
|
|
340
384
|
type Job = {
|
|
341
385
|
address: Address;
|
|
342
|
-
state: JobState;
|
|
343
|
-
ipfsJob: string | null;
|
|
386
|
+
state: JobState; // QUEUED | RUNNING | COMPLETED | STOPPED
|
|
387
|
+
ipfsJob: string | null; // IPFS CID of job definition
|
|
344
388
|
ipfsResult: string | null; // IPFS CID of job result
|
|
345
389
|
market: Address;
|
|
346
390
|
node: Address;
|
|
347
391
|
payer: Address;
|
|
348
392
|
project: Address;
|
|
349
393
|
price: number;
|
|
350
|
-
timeStart: number;
|
|
351
|
-
timeEnd: number;
|
|
352
|
-
timeout: number;
|
|
394
|
+
timeStart: number; // Unix timestamp
|
|
395
|
+
timeEnd: number; // Unix timestamp
|
|
396
|
+
timeout: number; // Seconds
|
|
353
397
|
};
|
|
354
398
|
|
|
355
399
|
enum JobState {
|
|
356
400
|
QUEUED = 0,
|
|
357
401
|
RUNNING = 1,
|
|
358
402
|
COMPLETED = 2,
|
|
359
|
-
STOPPED = 3
|
|
403
|
+
STOPPED = 3,
|
|
360
404
|
}
|
|
361
405
|
```
|
|
362
406
|
|
|
@@ -365,9 +409,9 @@ enum JobState {
|
|
|
365
409
|
```typescript
|
|
366
410
|
type Run = {
|
|
367
411
|
address: Address;
|
|
368
|
-
job: Address;
|
|
369
|
-
node: Address;
|
|
370
|
-
time: number;
|
|
412
|
+
job: Address; // Associated job
|
|
413
|
+
node: Address; // Node executing the job
|
|
414
|
+
time: number; // Unix timestamp
|
|
371
415
|
};
|
|
372
416
|
```
|
|
373
417
|
|
|
@@ -376,7 +420,7 @@ type Run = {
|
|
|
376
420
|
```typescript
|
|
377
421
|
type Market = {
|
|
378
422
|
address: Address;
|
|
379
|
-
queueType: MarketQueueType;
|
|
423
|
+
queueType: MarketQueueType; // JOB_QUEUE | NODE_QUEUE
|
|
380
424
|
jobPrice: number;
|
|
381
425
|
nodeStakeMinimum: number;
|
|
382
426
|
jobTimeout: number;
|
|
@@ -387,7 +431,7 @@ type Market = {
|
|
|
387
431
|
|
|
388
432
|
enum MarketQueueType {
|
|
389
433
|
JOB_QUEUE = 0,
|
|
390
|
-
NODE_QUEUE = 1
|
|
434
|
+
NODE_QUEUE = 1,
|
|
391
435
|
}
|
|
392
436
|
```
|
|
393
437
|
|
|
@@ -398,14 +442,34 @@ General Solana utility service for low-level RPC operations, transactions, and P
|
|
|
398
442
|
### Methods
|
|
399
443
|
|
|
400
444
|
```typescript
|
|
401
|
-
//
|
|
402
|
-
|
|
445
|
+
// Build, sign, and send transaction in one call (convenience method)
|
|
446
|
+
buildSignAndSend(
|
|
447
|
+
instructions: Instruction | Instruction[],
|
|
448
|
+
options?: {
|
|
449
|
+
feePayer?: TransactionSigner;
|
|
450
|
+
commitment?: 'processed' | 'confirmed' | 'finalized';
|
|
451
|
+
}
|
|
452
|
+
): Promise<Signature>
|
|
403
453
|
|
|
404
|
-
//
|
|
405
|
-
|
|
454
|
+
// Build transaction from instructions
|
|
455
|
+
buildTransaction(
|
|
456
|
+
instructions: Instruction | Instruction[],
|
|
457
|
+
options?: { feePayer?: TransactionSigner }
|
|
458
|
+
): Promise<TransactionMessage & TransactionMessageWithFeePayer & TransactionMessageWithBlockhashLifetime>
|
|
406
459
|
|
|
407
|
-
//
|
|
408
|
-
|
|
460
|
+
// Sign a transaction message
|
|
461
|
+
signTransaction(
|
|
462
|
+
transactionMessage: TransactionMessage & TransactionMessageWithFeePayer & TransactionMessageWithBlockhashLifetime
|
|
463
|
+
): Promise<SendableTransaction & Transaction & TransactionWithBlockhashLifetime>
|
|
464
|
+
|
|
465
|
+
// Send and confirm a signed transaction
|
|
466
|
+
sendTransaction(
|
|
467
|
+
transaction: SendableTransaction & Transaction & TransactionWithBlockhashLifetime,
|
|
468
|
+
options?: { commitment?: 'processed' | 'confirmed' | 'finalized' }
|
|
469
|
+
): Promise<Signature>
|
|
470
|
+
|
|
471
|
+
// Get account balance
|
|
472
|
+
getBalance(address?: Address | string): Promise<bigint>
|
|
409
473
|
|
|
410
474
|
// Derive program derived address
|
|
411
475
|
pda(seeds: Array<Address | string>, programId: Address): Promise<Address>
|
|
@@ -414,70 +478,390 @@ pda(seeds: Array<Address | string>, programId: Address): Promise<Address>
|
|
|
414
478
|
### Examples
|
|
415
479
|
|
|
416
480
|
```typescript
|
|
417
|
-
// Send a single instruction
|
|
418
|
-
const signature = await client.solana.
|
|
481
|
+
// Send a single instruction (convenience method)
|
|
482
|
+
const signature = await client.solana.buildSignAndSend(instruction);
|
|
419
483
|
|
|
420
484
|
// Send multiple instructions atomically
|
|
421
|
-
const signature = await client.solana.
|
|
485
|
+
const signature = await client.solana.buildSignAndSend([ix1, ix2, ix3]);
|
|
486
|
+
|
|
487
|
+
// Or build, sign, and send separately for more control
|
|
488
|
+
const transactionMessage = await client.solana.buildTransaction(instruction);
|
|
489
|
+
const signedTransaction = await client.solana.signTransaction(transactionMessage);
|
|
490
|
+
const signature = await client.solana.sendTransaction(signedTransaction);
|
|
422
491
|
|
|
423
492
|
// Check account balance
|
|
424
493
|
const balance = await client.solana.getBalance('address');
|
|
425
494
|
console.log(`Balance: ${balance} lamports`);
|
|
426
495
|
|
|
427
496
|
// Derive PDA
|
|
428
|
-
const pda = await client.solana.pda(
|
|
429
|
-
['seed1', 'seed2'],
|
|
430
|
-
programAddress
|
|
431
|
-
);
|
|
497
|
+
const pda = await client.solana.pda(['seed1', 'seed2'], programAddress);
|
|
432
498
|
```
|
|
433
499
|
|
|
434
|
-
## IPFS
|
|
500
|
+
## IPFS Service
|
|
435
501
|
|
|
436
|
-
|
|
502
|
+
The IPFS service provides methods to pin data to IPFS and retrieve data from IPFS. It's configured via the `ipfs` property in the client configuration.
|
|
437
503
|
|
|
438
|
-
|
|
439
|
-
// Convert Solana hash to IPFS CID
|
|
440
|
-
IPFS.solHashToIpfsHash(hash: Uint8Array | number[]): string | null
|
|
504
|
+
### Configuration
|
|
441
505
|
|
|
442
|
-
|
|
443
|
-
|
|
506
|
+
```typescript
|
|
507
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
508
|
+
ipfs: {
|
|
509
|
+
api: 'https://api.pinata.cloud',
|
|
510
|
+
jwt: 'your-pinata-jwt-token',
|
|
511
|
+
gateway: 'https://gateway.pinata.cloud/ipfs/',
|
|
512
|
+
},
|
|
513
|
+
});
|
|
444
514
|
```
|
|
445
515
|
|
|
446
|
-
###
|
|
516
|
+
### Methods
|
|
447
517
|
|
|
448
518
|
```typescript
|
|
449
|
-
// Pin JSON data to
|
|
450
|
-
pin(data: object
|
|
519
|
+
// Pin JSON data to IPFS
|
|
520
|
+
pin(data: object): Promise<string>
|
|
451
521
|
|
|
452
|
-
// Pin file to
|
|
453
|
-
pinFile(filePath: string
|
|
454
|
-
|
|
455
|
-
// Pin buffer/stream to Pinata
|
|
456
|
-
pinFileFromBuffer(source: Buffer | Readable, filename: string): Promise<string>
|
|
522
|
+
// Pin a file to IPFS
|
|
523
|
+
pinFile(filePath: string): Promise<string>
|
|
457
524
|
|
|
458
525
|
// Retrieve data from IPFS
|
|
459
|
-
retrieve(hash: string | Uint8Array
|
|
526
|
+
retrieve(hash: string | Uint8Array): Promise<any>
|
|
460
527
|
```
|
|
461
528
|
|
|
462
529
|
### Examples
|
|
463
530
|
|
|
464
531
|
```typescript
|
|
465
|
-
//
|
|
466
|
-
const ipfsCid = IPFS.solHashToIpfsHash(solanaHashBytes);
|
|
467
|
-
const solanaHash = IPFS.IpfsHashToByteArray(ipfsCid);
|
|
468
|
-
|
|
469
|
-
// Pin job definition
|
|
532
|
+
// Pin job definition to IPFS
|
|
470
533
|
const cid = await client.ipfs.pin({
|
|
471
534
|
version: 1,
|
|
472
535
|
type: 'docker',
|
|
473
536
|
image: 'ubuntu:latest',
|
|
474
|
-
command: ['echo', 'hello']
|
|
475
|
-
}
|
|
537
|
+
command: ['echo', 'hello'],
|
|
538
|
+
});
|
|
539
|
+
console.log('Pinned to IPFS:', cid);
|
|
476
540
|
|
|
477
|
-
//
|
|
541
|
+
// Pin a file to IPFS
|
|
542
|
+
const fileCid = await client.ipfs.pinFile('/path/to/file.txt');
|
|
543
|
+
|
|
544
|
+
// Retrieve job results from IPFS
|
|
478
545
|
const results = await client.ipfs.retrieve(job.ipfsResult);
|
|
546
|
+
console.log('Job results:', results);
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
### Utility Functions
|
|
550
|
+
|
|
551
|
+
The SDK also exports utility functions for converting between Solana hash formats and IPFS CIDs:
|
|
552
|
+
|
|
553
|
+
```typescript
|
|
554
|
+
import { solBytesArrayToIpfsHash, ipfsHashToSolBytesArray } from '@nosana/kit';
|
|
555
|
+
|
|
556
|
+
// Convert Solana hash bytes to IPFS CID
|
|
557
|
+
const ipfsCid = solBytesArrayToIpfsHash(solanaHashBytes);
|
|
558
|
+
|
|
559
|
+
// Convert IPFS CID to Solana hash bytes
|
|
560
|
+
const solanaHash = ipfsHashToSolBytesArray(ipfsCid);
|
|
479
561
|
```
|
|
480
562
|
|
|
563
|
+
## API Service
|
|
564
|
+
|
|
565
|
+
The API service provides access to Nosana APIs for jobs, credits, and markets. It's automatically configured based on your authentication method.
|
|
566
|
+
|
|
567
|
+
### Authentication Methods
|
|
568
|
+
|
|
569
|
+
The API service supports two authentication methods:
|
|
570
|
+
|
|
571
|
+
1. **API Key Authentication** (Recommended for server-side applications)
|
|
572
|
+
- Provide an API key in the configuration
|
|
573
|
+
- API key takes precedence over wallet-based authentication
|
|
574
|
+
|
|
575
|
+
2. **Wallet-Based Authentication** (For client-side applications)
|
|
576
|
+
- Set a wallet on the client
|
|
577
|
+
- Uses message signing for authentication
|
|
578
|
+
- Automatically enabled when a wallet is configured
|
|
579
|
+
|
|
580
|
+
### Configuration
|
|
581
|
+
|
|
582
|
+
```typescript
|
|
583
|
+
// Option 1: Use API key (recommended for servers)
|
|
584
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
585
|
+
api: {
|
|
586
|
+
apiKey: 'your-api-key-here',
|
|
587
|
+
},
|
|
588
|
+
});
|
|
589
|
+
|
|
590
|
+
// Option 2: Use wallet-based auth (for client-side)
|
|
591
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET);
|
|
592
|
+
client.wallet = myWallet;
|
|
593
|
+
|
|
594
|
+
// Option 3: API key takes precedence when both are provided
|
|
595
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
596
|
+
api: {
|
|
597
|
+
apiKey: 'your-api-key-here',
|
|
598
|
+
},
|
|
599
|
+
wallet: myWallet, // API key will be used, not wallet
|
|
600
|
+
});
|
|
601
|
+
```
|
|
602
|
+
|
|
603
|
+
### Behavior
|
|
604
|
+
|
|
605
|
+
- **With API Key**: API is created immediately with API key authentication
|
|
606
|
+
- **With Wallet**: API is created when wallet is set, using wallet-based authentication
|
|
607
|
+
- **Without Both**: API is `undefined` until either an API key or wallet is provided
|
|
608
|
+
- **Priority**: If both API key and wallet are provided, API key is used
|
|
609
|
+
|
|
610
|
+
### API Structure
|
|
611
|
+
|
|
612
|
+
The API service provides access to three main APIs:
|
|
613
|
+
|
|
614
|
+
```typescript
|
|
615
|
+
client.api?.jobs // Jobs API
|
|
616
|
+
client.api?.credits // Credits API
|
|
617
|
+
client.api?.markets // Markets API
|
|
618
|
+
```
|
|
619
|
+
|
|
620
|
+
### Examples
|
|
621
|
+
|
|
622
|
+
```typescript
|
|
623
|
+
// Using API key
|
|
624
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
625
|
+
api: { apiKey: 'your-api-key' },
|
|
626
|
+
});
|
|
627
|
+
|
|
628
|
+
// API is immediately available
|
|
629
|
+
if (client.api) {
|
|
630
|
+
// Use the API
|
|
631
|
+
const jobs = await client.api.jobs.list();
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
// Using wallet-based auth
|
|
635
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET);
|
|
636
|
+
client.wallet = myWallet;
|
|
637
|
+
|
|
638
|
+
// API is now available
|
|
639
|
+
if (client.api) {
|
|
640
|
+
const credits = await client.api.credits.get();
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
// API updates reactively when wallet changes
|
|
644
|
+
client.wallet = undefined; // API becomes undefined
|
|
645
|
+
client.wallet = anotherWallet; // API is recreated with new wallet
|
|
646
|
+
```
|
|
647
|
+
|
|
648
|
+
## Authorization Service
|
|
649
|
+
|
|
650
|
+
The authorization service provides cryptographic message signing and validation using Ed25519 signatures. It's automatically available on the client and adapts based on whether a wallet is configured.
|
|
651
|
+
|
|
652
|
+
### Behavior
|
|
653
|
+
|
|
654
|
+
- **With Wallet**: When a wallet is set, the authorization service provides all methods including `generate`, `validate`, `generateHeaders`, and `validateHeaders`.
|
|
655
|
+
- **Without Wallet**: When no wallet is set, the authorization service only provides `validate` and `validateHeaders` methods (read-only validation).
|
|
656
|
+
|
|
657
|
+
### Methods
|
|
658
|
+
|
|
659
|
+
```typescript
|
|
660
|
+
// Generate a signed message (requires wallet)
|
|
661
|
+
generate(message: string | Uint8Array, options?: GenerateOptions): Promise<string>
|
|
662
|
+
|
|
663
|
+
// Validate a signed message
|
|
664
|
+
validate(
|
|
665
|
+
message: string | Uint8Array,
|
|
666
|
+
signature: string | Uint8Array,
|
|
667
|
+
publicKey?: string | Uint8Array
|
|
668
|
+
): Promise<boolean>
|
|
669
|
+
|
|
670
|
+
// Generate signed HTTP headers (requires wallet)
|
|
671
|
+
generateHeaders(
|
|
672
|
+
method: string,
|
|
673
|
+
path: string,
|
|
674
|
+
body?: string | Uint8Array,
|
|
675
|
+
options?: GenerateHeaderOptions
|
|
676
|
+
): Promise<Headers>
|
|
677
|
+
|
|
678
|
+
// Validate HTTP headers
|
|
679
|
+
validateHeaders(headers: Headers | Record<string, string>): Promise<boolean>
|
|
680
|
+
```
|
|
681
|
+
|
|
682
|
+
### Examples
|
|
683
|
+
|
|
684
|
+
```typescript
|
|
685
|
+
// Set wallet first to enable signing
|
|
686
|
+
client.wallet = myWallet;
|
|
687
|
+
|
|
688
|
+
// Generate a signed message
|
|
689
|
+
const signedMessage = await client.authorization.generate('Hello, Nosana!');
|
|
690
|
+
console.log('Signed message:', signedMessage);
|
|
691
|
+
|
|
692
|
+
// Validate a signed message
|
|
693
|
+
const isValid = await client.authorization.validate('Hello, Nosana!', signedMessage);
|
|
694
|
+
console.log('Message is valid:', isValid);
|
|
695
|
+
|
|
696
|
+
// Generate signed HTTP headers for API requests
|
|
697
|
+
const headers = await client.authorization.generateHeaders(
|
|
698
|
+
'POST',
|
|
699
|
+
'/api/jobs',
|
|
700
|
+
JSON.stringify({ data: 'example' })
|
|
701
|
+
);
|
|
702
|
+
|
|
703
|
+
// Use headers in HTTP request
|
|
704
|
+
fetch('https://api.nosana.com/api/jobs', {
|
|
705
|
+
method: 'POST',
|
|
706
|
+
headers: headers,
|
|
707
|
+
body: JSON.stringify({ data: 'example' }),
|
|
708
|
+
});
|
|
709
|
+
|
|
710
|
+
// Validate incoming HTTP headers
|
|
711
|
+
const isValidRequest = await client.authorization.validateHeaders(requestHeaders);
|
|
712
|
+
if (!isValidRequest) {
|
|
713
|
+
throw new Error('Invalid authorization');
|
|
714
|
+
}
|
|
715
|
+
```
|
|
716
|
+
|
|
717
|
+
### Use Cases
|
|
718
|
+
|
|
719
|
+
- **API Authentication**: Sign requests to Nosana APIs using message signatures
|
|
720
|
+
- **Message Verification**: Verify signed messages from other parties
|
|
721
|
+
- **Secure Communication**: Establish authenticated communication channels
|
|
722
|
+
- **Request Authorization**: Validate incoming API requests
|
|
723
|
+
|
|
724
|
+
## Merkle Distributor Program
|
|
725
|
+
|
|
726
|
+
The MerkleDistributorProgram provides methods to interact with merkle distributor accounts and claim tokens from distributions.
|
|
727
|
+
|
|
728
|
+
### Get a Single Distributor
|
|
729
|
+
|
|
730
|
+
Fetch a merkle distributor account by its address:
|
|
731
|
+
|
|
732
|
+
```typescript
|
|
733
|
+
const distributor = await client.merkleDistributor.get('distributor-address');
|
|
734
|
+
|
|
735
|
+
console.log('Distributor:', distributor.address);
|
|
736
|
+
console.log('Admin:', distributor.admin);
|
|
737
|
+
console.log('Mint:', distributor.mint);
|
|
738
|
+
console.log('Root:', distributor.root);
|
|
739
|
+
```
|
|
740
|
+
|
|
741
|
+
### Get All Distributors
|
|
742
|
+
|
|
743
|
+
Fetch all merkle distributor accounts:
|
|
744
|
+
|
|
745
|
+
```typescript
|
|
746
|
+
const distributors = await client.merkleDistributor.all();
|
|
747
|
+
console.log(`Found ${distributors.length} distributors`);
|
|
748
|
+
```
|
|
749
|
+
|
|
750
|
+
### Get Claim Status
|
|
751
|
+
|
|
752
|
+
Fetch claim status for a specific distributor and claimant:
|
|
753
|
+
|
|
754
|
+
```typescript
|
|
755
|
+
// Get claim status for the wallet's address
|
|
756
|
+
const claimStatus =
|
|
757
|
+
await client.merkleDistributor.getClaimStatusForDistributor('distributor-address');
|
|
758
|
+
|
|
759
|
+
// Or specify a claimant address
|
|
760
|
+
const claimStatus = await client.merkleDistributor.getClaimStatusForDistributor(
|
|
761
|
+
'distributor-address',
|
|
762
|
+
'claimant-address'
|
|
763
|
+
);
|
|
764
|
+
|
|
765
|
+
if (claimStatus) {
|
|
766
|
+
console.log('Claimed:', claimStatus.claimed);
|
|
767
|
+
console.log('Amount Unlocked:', claimStatus.amountUnlocked);
|
|
768
|
+
console.log('Amount Locked:', claimStatus.amountLocked);
|
|
769
|
+
} else {
|
|
770
|
+
console.log('No claim status found');
|
|
771
|
+
}
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
### Get Claim Status PDA
|
|
775
|
+
|
|
776
|
+
Derive the ClaimStatus PDA address:
|
|
777
|
+
|
|
778
|
+
```typescript
|
|
779
|
+
// Derive for wallet's address
|
|
780
|
+
const pda = await client.merkleDistributor.getClaimStatusPda('distributor-address');
|
|
781
|
+
|
|
782
|
+
// Or specify a claimant address
|
|
783
|
+
const pda = await client.merkleDistributor.getClaimStatusPda(
|
|
784
|
+
'distributor-address',
|
|
785
|
+
'claimant-address'
|
|
786
|
+
);
|
|
787
|
+
```
|
|
788
|
+
|
|
789
|
+
### Claim Tokens
|
|
790
|
+
|
|
791
|
+
Claim tokens from a merkle distributor:
|
|
792
|
+
|
|
793
|
+
```typescript
|
|
794
|
+
// Set wallet first
|
|
795
|
+
client.wallet = yourWallet;
|
|
796
|
+
|
|
797
|
+
// Claim tokens
|
|
798
|
+
const instruction = await client.merkleDistributor.claim({
|
|
799
|
+
distributor: 'distributor-address',
|
|
800
|
+
amountUnlocked: 1000000, // Amount in smallest unit
|
|
801
|
+
amountLocked: 500000,
|
|
802
|
+
proof: [
|
|
803
|
+
/* merkle proof array */
|
|
804
|
+
],
|
|
805
|
+
target: ClaimTarget.YES, // or ClaimTarget.NO
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
// Submit the instruction
|
|
809
|
+
await client.solana.buildSignAndSend(instruction);
|
|
810
|
+
```
|
|
811
|
+
|
|
812
|
+
### Clawback Tokens
|
|
813
|
+
|
|
814
|
+
Clawback tokens from a merkle distributor (admin only):
|
|
815
|
+
|
|
816
|
+
```typescript
|
|
817
|
+
// Set wallet first (must be admin)
|
|
818
|
+
client.wallet = adminWallet;
|
|
819
|
+
|
|
820
|
+
// Clawback tokens
|
|
821
|
+
const instruction = await client.merkleDistributor.clawback({
|
|
822
|
+
distributor: 'distributor-address',
|
|
823
|
+
});
|
|
824
|
+
|
|
825
|
+
// Submit the instruction
|
|
826
|
+
await client.solana.buildSignAndSend(instruction);
|
|
827
|
+
```
|
|
828
|
+
|
|
829
|
+
### Type Definitions
|
|
830
|
+
|
|
831
|
+
```typescript
|
|
832
|
+
interface MerkleDistributor {
|
|
833
|
+
address: Address;
|
|
834
|
+
admin: Address;
|
|
835
|
+
mint: Address;
|
|
836
|
+
root: string; // Base58 encoded merkle root
|
|
837
|
+
buffer0: string;
|
|
838
|
+
buffer1: string;
|
|
839
|
+
buffer2: string;
|
|
840
|
+
// ... additional fields
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
interface ClaimStatus {
|
|
844
|
+
address: Address;
|
|
845
|
+
distributor: Address;
|
|
846
|
+
claimant: Address;
|
|
847
|
+
claimed: boolean;
|
|
848
|
+
amountUnlocked: number;
|
|
849
|
+
amountLocked: number;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
enum ClaimTarget {
|
|
853
|
+
YES = 'YES',
|
|
854
|
+
NO = 'NO',
|
|
855
|
+
}
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
### Use Cases
|
|
859
|
+
|
|
860
|
+
- **Airdrop Claims**: Allow users to claim tokens from merkle tree distributions
|
|
861
|
+
- **Reward Distribution**: Distribute rewards to eligible addresses
|
|
862
|
+
- **Token Vesting**: Manage locked and unlocked token distributions
|
|
863
|
+
- **Governance**: Distribute governance tokens to eligible participants
|
|
864
|
+
|
|
481
865
|
## Staking Program
|
|
482
866
|
|
|
483
867
|
The StakeProgram provides methods to interact with Nosana staking accounts on-chain.
|
|
@@ -506,7 +890,7 @@ Fetch multiple stake accounts by their addresses:
|
|
|
506
890
|
const addresses = ['address1', 'address2', 'address3'];
|
|
507
891
|
const stakes = await client.stake.multiple(addresses);
|
|
508
892
|
|
|
509
|
-
stakes.forEach(stake => {
|
|
893
|
+
stakes.forEach((stake) => {
|
|
510
894
|
console.log(`${stake.address}: ${stake.amount} staked`);
|
|
511
895
|
});
|
|
512
896
|
```
|
|
@@ -555,9 +939,7 @@ const totalStaked = allStakes.reduce((sum, stake) => sum + stake.amount, 0);
|
|
|
555
939
|
const averageStake = totalStaked / allStakes.length;
|
|
556
940
|
|
|
557
941
|
// Find largest stake
|
|
558
|
-
const largestStake = allStakes.reduce((max, stake) =>
|
|
559
|
-
Math.max(max, stake.amount), 0
|
|
560
|
-
);
|
|
942
|
+
const largestStake = allStakes.reduce((max, stake) => Math.max(max, stake.amount), 0);
|
|
561
943
|
|
|
562
944
|
console.log('Staking Statistics:');
|
|
563
945
|
console.log(`Total Staked: ${totalStaked.toLocaleString()} NOS`);
|
|
@@ -566,9 +948,9 @@ console.log(`Largest Stake: ${largestStake.toLocaleString()} NOS`);
|
|
|
566
948
|
console.log(`Number of Stakers: ${allStakes.length}`);
|
|
567
949
|
```
|
|
568
950
|
|
|
569
|
-
##
|
|
951
|
+
## Token Service
|
|
570
952
|
|
|
571
|
-
The
|
|
953
|
+
The TokenService provides methods to interact with token accounts on Solana. In the NosanaClient, it's configured for the NOS token and accessible via `client.nos`.
|
|
572
954
|
|
|
573
955
|
### Get All Token Holders
|
|
574
956
|
|
|
@@ -580,7 +962,7 @@ const holders = await client.nos.getAllTokenHolders();
|
|
|
580
962
|
|
|
581
963
|
console.log(`Found ${holders.length} NOS token holders`);
|
|
582
964
|
|
|
583
|
-
holders.forEach(holder => {
|
|
965
|
+
holders.forEach((holder) => {
|
|
584
966
|
console.log(`${holder.owner}: ${holder.uiAmount} NOS`);
|
|
585
967
|
});
|
|
586
968
|
|
|
@@ -593,9 +975,9 @@ const userAccounts = await client.nos.getAllTokenHolders({ excludePdaAccounts: t
|
|
|
593
975
|
console.log(`User-owned accounts: ${userAccounts.length}`);
|
|
594
976
|
|
|
595
977
|
// Combine filters
|
|
596
|
-
const activeUsers = await client.nos.getAllTokenHolders({
|
|
978
|
+
const activeUsers = await client.nos.getAllTokenHolders({
|
|
597
979
|
includeZeroBalance: false,
|
|
598
|
-
excludePdaAccounts: true
|
|
980
|
+
excludePdaAccounts: true,
|
|
599
981
|
});
|
|
600
982
|
console.log(`Active user accounts: ${activeUsers.length}`);
|
|
601
983
|
```
|
|
@@ -640,7 +1022,7 @@ interface TokenAccount {
|
|
|
640
1022
|
}
|
|
641
1023
|
|
|
642
1024
|
interface TokenAccountWithBalance extends TokenAccount {
|
|
643
|
-
uiAmount: number;
|
|
1025
|
+
uiAmount: number; // Balance with decimals applied
|
|
644
1026
|
}
|
|
645
1027
|
```
|
|
646
1028
|
|
|
@@ -658,7 +1040,7 @@ interface TokenAccountWithBalance extends TokenAccount {
|
|
|
658
1040
|
const holders = await client.nos.getAllTokenHolders();
|
|
659
1041
|
|
|
660
1042
|
// Find holders with at least 1000 NOS
|
|
661
|
-
const largeHolders = holders.filter(h => h.uiAmount >= 1000);
|
|
1043
|
+
const largeHolders = holders.filter((h) => h.uiAmount >= 1000);
|
|
662
1044
|
|
|
663
1045
|
// Sort by balance descending
|
|
664
1046
|
largeHolders.sort((a, b) => b.uiAmount - a.uiAmount);
|
|
@@ -694,7 +1076,7 @@ enum ErrorCodes {
|
|
|
694
1076
|
VALIDATION_ERROR = 'VALIDATION_ERROR',
|
|
695
1077
|
NO_WALLET = 'NO_WALLET',
|
|
696
1078
|
FILE_ERROR = 'FILE_ERROR',
|
|
697
|
-
WALLET_CONVERSION_ERROR = 'WALLET_CONVERSION_ERROR'
|
|
1079
|
+
WALLET_CONVERSION_ERROR = 'WALLET_CONVERSION_ERROR',
|
|
698
1080
|
}
|
|
699
1081
|
```
|
|
700
1082
|
|
|
@@ -713,7 +1095,7 @@ try {
|
|
|
713
1095
|
break;
|
|
714
1096
|
case ErrorCodes.NO_WALLET:
|
|
715
1097
|
console.error('Wallet not configured');
|
|
716
|
-
|
|
1098
|
+
client.wallet = myWallet;
|
|
717
1099
|
break;
|
|
718
1100
|
case ErrorCodes.TRANSACTION_ERROR:
|
|
719
1101
|
console.error('Transaction failed:', error.details);
|
|
@@ -722,7 +1104,7 @@ try {
|
|
|
722
1104
|
console.error('Unknown error:', error.message);
|
|
723
1105
|
}
|
|
724
1106
|
} else {
|
|
725
|
-
throw error;
|
|
1107
|
+
throw error; // Re-throw non-Nosana errors
|
|
726
1108
|
}
|
|
727
1109
|
}
|
|
728
1110
|
```
|
|
@@ -734,23 +1116,23 @@ The SDK includes a built-in singleton logger with configurable levels.
|
|
|
734
1116
|
### Log Levels
|
|
735
1117
|
|
|
736
1118
|
```typescript
|
|
737
|
-
enum
|
|
1119
|
+
enum LogLevel {
|
|
738
1120
|
DEBUG = 'debug',
|
|
739
1121
|
INFO = 'info',
|
|
740
1122
|
WARN = 'warn',
|
|
741
1123
|
ERROR = 'error',
|
|
742
|
-
NONE = 'none'
|
|
1124
|
+
NONE = 'none',
|
|
743
1125
|
}
|
|
744
1126
|
```
|
|
745
1127
|
|
|
746
1128
|
### Configuration
|
|
747
1129
|
|
|
748
1130
|
```typescript
|
|
749
|
-
import {
|
|
1131
|
+
import { createNosanaClient, LogLevel } from '@nosana/kit';
|
|
750
1132
|
|
|
751
1133
|
// Set log level during initialization
|
|
752
|
-
const client =
|
|
753
|
-
logLevel:
|
|
1134
|
+
const client = createNosanaClient(NosanaNetwork.MAINNET, {
|
|
1135
|
+
logLevel: LogLevel.DEBUG,
|
|
754
1136
|
});
|
|
755
1137
|
|
|
756
1138
|
// Access logger directly
|
|
@@ -795,27 +1177,32 @@ npm run generate-clients
|
|
|
795
1177
|
The SDK is written in TypeScript and provides complete type definitions. All types are exported for use in your applications:
|
|
796
1178
|
|
|
797
1179
|
```typescript
|
|
798
|
-
import type {
|
|
799
|
-
Job,
|
|
800
|
-
Run,
|
|
801
|
-
Market,
|
|
1180
|
+
import type {
|
|
1181
|
+
Job,
|
|
1182
|
+
Run,
|
|
1183
|
+
Market,
|
|
802
1184
|
JobState,
|
|
803
1185
|
MarketQueueType,
|
|
1186
|
+
Stake,
|
|
1187
|
+
MerkleDistributor,
|
|
1188
|
+
ClaimStatus,
|
|
1189
|
+
ClaimTarget,
|
|
804
1190
|
ClientConfig,
|
|
805
1191
|
NosanaClient,
|
|
806
|
-
|
|
807
|
-
Address
|
|
1192
|
+
Wallet,
|
|
808
1193
|
} from '@nosana/kit';
|
|
1194
|
+
import type { Address } from '@solana/kit';
|
|
809
1195
|
```
|
|
810
1196
|
|
|
811
1197
|
## Dependencies
|
|
812
1198
|
|
|
813
1199
|
Core dependencies:
|
|
814
|
-
|
|
815
|
-
- `@solana
|
|
816
|
-
- `
|
|
817
|
-
- `
|
|
818
|
-
-
|
|
1200
|
+
|
|
1201
|
+
- `@solana/kit` 5.0.0 - Solana web3 library
|
|
1202
|
+
- `@solana-program/token` 0.8.0 - Token program utilities
|
|
1203
|
+
- `@solana-program/system` 0.10.0 - System program utilities
|
|
1204
|
+
- `@solana-program/compute-budget` 0.11.0 - Compute budget utilities
|
|
1205
|
+
- `bs58` 6.0.0 - Base58 encoding
|
|
819
1206
|
|
|
820
1207
|
## License
|
|
821
1208
|
|