@solana/kora 0.1.0 → 0.2.0-beta.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.
@@ -1,4 +1,3 @@
1
- // TODO Make sure to change necessary deps from devdeps to deps
2
1
  import { assertIsAddress, createNoopSigner } from '@solana/kit';
3
2
  import crypto from 'crypto';
4
3
  import { getInstructionsFromBase64Message } from './utils/transaction.js';
@@ -100,6 +100,8 @@ export interface SignTransactionResponse {
100
100
  * Response from signing and sending a transaction.
101
101
  */
102
102
  export interface SignAndSendTransactionResponse {
103
+ /** Transaction signature */
104
+ signature: string;
103
105
  /** Base64-encoded signed transaction */
104
106
  signed_transaction: string;
105
107
  /** Public key of the signer used to send the transaction */
@@ -1,6 +1,6 @@
1
1
  import { getCreateAccountInstruction } from '@solana-program/system';
2
2
  import { findAssociatedTokenPda, getCreateAssociatedTokenIdempotentInstructionAsync, getInitializeMintInstruction, getMintSize, getMintToInstruction, TOKEN_PROGRAM_ADDRESS, } from '@solana-program/token';
3
- import { airdropFactory, createSolanaRpc, createSolanaRpcSubscriptions, lamports, sendAndConfirmTransactionFactory, pipe, createTransactionMessage, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageFeePayerSigner, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsAddress, createKeyPairSignerFromBytes, getBase58Encoder, } from '@solana/kit';
3
+ import { airdropFactory, createSolanaRpc, createSolanaRpcSubscriptions, lamports, sendAndConfirmTransactionFactory, pipe, createTransactionMessage, setTransactionMessageLifetimeUsingBlockhash, setTransactionMessageFeePayerSigner, appendTransactionMessageInstructions, signTransactionMessageWithSigners, getSignatureFromTransaction, assertIsAddress, createKeyPairSignerFromBytes, getBase58Encoder, assertIsSendableTransaction, assertIsTransactionWithBlockhashLifetime, } from '@solana/kit';
4
4
  import { updateOrAppendSetComputeUnitLimitInstruction, updateOrAppendSetComputeUnitPriceInstruction, MAX_COMPUTE_UNIT_LIMIT, } from '@solana-program/compute-budget';
5
5
  import { config } from 'dotenv';
6
6
  import path from 'path';
@@ -94,6 +94,8 @@ const createDefaultTransaction = async (client, feePayer, computeLimit = MAX_COM
94
94
  const signAndSendTransaction = async (client, transactionMessage, commitment) => {
95
95
  const signedTransaction = await signTransactionMessageWithSigners(transactionMessage);
96
96
  const signature = getSignatureFromTransaction(signedTransaction);
97
+ assertIsSendableTransaction(signedTransaction);
98
+ assertIsTransactionWithBlockhashLifetime(signedTransaction);
97
99
  await sendAndConfirmTransactionFactory(client)(signedTransaction, { commitment, skipPreflight: true });
98
100
  return signature;
99
101
  };
@@ -212,6 +212,7 @@ describe('KoraClient Unit Tests', () => {
212
212
  transaction: 'base64_encoded_transaction',
213
213
  };
214
214
  const mockResponse = {
215
+ signature: 'transaction_signature',
215
216
  signed_transaction: 'base64_signed_transaction',
216
217
  signer_pubkey: 'test_signer_pubkey',
217
218
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solana/kora",
3
- "version": "0.1.0",
3
+ "version": "0.2.0-beta.0",
4
4
  "description": "TypeScript SDK for Kora RPC",
5
5
  "main": "dist/src/index.js",
6
6
  "type": "module",
@@ -16,12 +16,16 @@
16
16
  ],
17
17
  "author": "",
18
18
  "license": "MIT",
19
+ "peerDependencies": {
20
+ "@solana-program/token": "^0.9.0",
21
+ "@solana/kit": "^5.0.0"
22
+ },
19
23
  "devDependencies": {
20
- "@solana-program/compute-budget": "^0.8.0",
21
- "@solana-program/system": "^0.7.0",
22
- "@solana-program/token": "^0.5.1",
23
- "@solana/kit": "^2.3.0",
24
- "@solana/prettier-config-solana": "^0.0.5",
24
+ "@solana-program/compute-budget": "^0.11.0",
25
+ "@solana-program/system": "^0.10.0",
26
+ "@solana-program/token": "^0.9.0",
27
+ "@solana/kit": "^5.1.0",
28
+ "@solana/prettier-config-solana": "^0.0.6",
25
29
  "@types/jest": "^29.5.12",
26
30
  "@types/node": "^20.17.27",
27
31
  "@typescript-eslint/eslint-plugin": "^8.38.0",
@@ -34,7 +38,8 @@
34
38
  "ts-node": "^10.9.2",
35
39
  "typedoc": "^0.28.9",
36
40
  "typedoc-plugin-markdown": "^4.8.0",
37
- "typescript": "^5.3.3"
41
+ "typescript": "^5.3.3",
42
+ "ws": "^8.18.3"
38
43
  },
39
44
  "scripts": {
40
45
  "build": "tsc",