@rialo/ts-cdk 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +6 -14
  2. package/package.json +1 -2
package/README.md CHANGED
@@ -43,11 +43,8 @@ const blockhash = await client.getLatestBlockhash();
43
43
  ```typescript
44
44
  import { TransactionBuilder, transferInstruction } from "@rialo/ts-cdk";
45
45
 
46
- // Get blockhash for replay protection
47
- const blockhash = await client.getLatestBlockhash();
48
-
49
- // transaction creation time
50
- const txCreationTime = BigInt(Date.now());
46
+ // transaction valid from
47
+ const validFrom = BigInt(Date.now());
51
48
 
52
49
  // Create transfer instruction
53
50
  const transfer = transferInstruction(
@@ -59,8 +56,7 @@ const transfer = transferInstruction(
59
56
  // Build and sign transaction
60
57
  const tx = TransactionBuilder.create()
61
58
  .setPayer(keypair.publicKey)
62
- .setRecentBlockhash(blockhash)
63
- .setTxCreationTime(txCreationTime)
59
+ .setValidFrom(validFrom)
64
60
  .addInstruction(transfer)
65
61
  .build();
66
62
 
@@ -112,11 +108,8 @@ const bytes = pubkey.toBytes();
112
108
  // Signature operations
113
109
  const sig = Signature.fromBytes(signatureBytes);
114
110
 
115
- // Blockhash for transactions
116
- const blockhash = Blockhash.fromString("base58blockhash");
117
-
118
- // txCreationTime for transactions
119
- const txCreationTime = BigInt(Date.now());
111
+ // validFrom for transactions
112
+ const validFrom = BigInt(Date.now());
120
113
  ```
121
114
 
122
115
  ### Transactions
@@ -147,8 +140,7 @@ const instruction: Instruction = {
147
140
  // Build transaction
148
141
  const tx = TransactionBuilder.create()
149
142
  .setPayer(payerPublicKey)
150
- .setRecentBlockhash(blockhash)
151
- .setTxCreationTime(txCreationTime)
143
+ .setValidFrom(validFrom)
152
144
  .addInstruction(instruction)
153
145
  .build();
154
146
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rialo/ts-cdk",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,7 +21,6 @@
21
21
  "require": "./dist/index.js"
22
22
  }
23
23
  },
24
-
25
24
  "files": [
26
25
  "dist",
27
26
  "README.md",