@@ -4,7 +4,6 @@ import { BaseModule } from '../_baseModule.js';
4
4
import algosdk , { Transaction , TransactionLike } from 'algosdk' ;
5
5
import camelcaseKeys from 'camelcase-keys' ;
6
6
import AlgoStack from '../../index.js' ;
7
- import options from '../../utils/options.js' ;
8
7
import Client from '../client/index.js' ;
9
8
import merge from 'lodash/merge.js' ;
10
9
@@ -51,7 +50,7 @@ export default class Txns extends BaseModule {
51
50
//
52
51
// Single Transaction
53
52
// ----------------------------------------------
54
- async sendTxn ( params : Record < string , any > , configs ?: TxnsConfigs ) : Promise < Record < string , any > | undefined > {
53
+ public async sendTxn ( params : Record < string , any > , configs ?: TxnsConfigs ) : Promise < Record < string , any > | undefined > {
55
54
56
55
try {
57
56
const baseParams = await this . getTxnParams ( ) ;
@@ -80,7 +79,7 @@ export default class Txns extends BaseModule {
80
79
//
81
80
// Grouped Transactions
82
81
// ----------------------------------------------
83
- async sendGroupedTxns ( paramsGroup : Record < string , any > [ ] , configs ?: TxnsConfigs ) : Promise < Record < string , any > | undefined > {
82
+ public async sendGroupedTxns ( paramsGroup : Record < string , any > [ ] , configs ?: TxnsConfigs ) : Promise < Record < string , any > | undefined > {
84
83
try {
85
84
const baseParams = await this . getTxnParams ( ) ;
86
85
let group : Transaction [ ] = [ ] ;
@@ -116,7 +115,7 @@ export default class Txns extends BaseModule {
116
115
//
117
116
// Sequenced transactions
118
117
// ----------------------------------------------
119
- async sendSequencedTxns ( paramsSequence : TransactionLike [ ] , configs ?: TxnsConfigs ) : Promise < Record < string , any > [ ] | undefined > {
118
+ public async sendSequencedTxns ( paramsSequence : TransactionLike [ ] , configs ?: TxnsConfigs ) : Promise < Record < string , any > [ ] | undefined > {
120
119
try {
121
120
const baseParams = await this . getTxnParams ( ) ;
122
121
let sequence : Transaction [ ] = [ ] ;
@@ -149,7 +148,7 @@ export default class Txns extends BaseModule {
149
148
//
150
149
// Get txn params
151
150
// ----------------------------------------------
152
- async getTxnParams ( ) {
151
+ public async getTxnParams ( ) {
153
152
const txn = await this . algod . getTransactionParams ( ) . do ( ) ;
154
153
return txn ;
155
154
}
@@ -158,7 +157,7 @@ export default class Txns extends BaseModule {
158
157
//
159
158
// Sign
160
159
// ----------------------------------------------
161
- async signTxn ( txns : Transaction | Transaction [ ] ) : Promise < Uint8Array [ ] | false > {
160
+ public async signTxn ( txns : Transaction | Transaction [ ] ) : Promise < Uint8Array [ ] | false > {
162
161
if ( ! this . client || ! this . client . connector ) return false ;
163
162
if ( ! Array . isArray ( txns ) ) txns = [ txns ] ;
164
163
const signedTxns = await this . client . connector . sign ( txns ) ;
@@ -168,15 +167,15 @@ export default class Txns extends BaseModule {
168
167
//
169
168
// Send transaction
170
169
// ----------------------------------------------
171
- async submitTxn ( signedTxn : Uint8Array | Uint8Array [ ] ) {
170
+ public async submitTxn ( signedTxn : Uint8Array | Uint8Array [ ] ) {
172
171
const txn = await this . algod . sendRawTransaction ( signedTxn ) . do ( ) ;
173
172
return txn ;
174
173
}
175
174
176
175
//
177
176
// Wait for txn to be processed
178
177
// ----------------------------------------------
179
- async wait ( txnId , maxBlocks = 10 ) : Promise < Record < string , any > > {
178
+ public async wait ( txnId , maxBlocks = 10 ) : Promise < Record < string , any > > {
180
179
const confirmation = await algosdk . waitForConfirmation ( this . algod , txnId , maxBlocks ) ;
181
180
return camelcaseKeys ( confirmation , { deep : true } ) ;
182
181
}
0 commit comments