@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.
- package/README.md +6 -14
- 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
|
-
//
|
|
47
|
-
const
|
|
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
|
-
.
|
|
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
|
-
//
|
|
116
|
-
const
|
|
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
|
-
.
|
|
151
|
-
.setTxCreationTime(txCreationTime)
|
|
143
|
+
.setValidFrom(validFrom)
|
|
152
144
|
.addInstruction(instruction)
|
|
153
145
|
.build();
|
|
154
146
|
|
package/package.json
CHANGED