Skip to content

Commit 6c78742

Browse files
committed
export types from algosdk
1 parent f7adea9 commit 6c78742

File tree

6 files changed

+36
-12
lines changed

6 files changed

+36
-12
lines changed

Diff for: src/enums.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
export * from './modules/txns/enums.js';
12

23
/**
34
* Asset categories

Diff for: src/modules/query/types.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
import type Query from './query.js';
2-
import { Addon } from '../../enums.js';
31
import { ApiUrl } from './enums.js';
2+
import type Query from './query.js';
43

54
export type LookupMethods = Query['lookup'];
65
export type SearchMethods = Query['search'];

Diff for: src/modules/txns/enums.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export {
2+
TransactionType,
3+
} from 'algosdk';

Diff for: src/modules/txns/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export { default } from './txns.js';
2-
// export * from './types.js'
2+
export * from './types.js';
3+
export * from './enums.js';

Diff for: src/modules/txns/txns.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { BaseModule } from '../_baseModule.js';
44
import algosdk, { Transaction, TransactionLike } from 'algosdk';
55
import camelcaseKeys from 'camelcase-keys';
66
import AlgoStack from '../../index.js';
7-
import options from '../../utils/options.js';
87
import Client from '../client/index.js';
98
import merge from 'lodash/merge.js';
109

@@ -51,7 +50,7 @@ export default class Txns extends BaseModule {
5150
//
5251
// Single Transaction
5352
// ----------------------------------------------
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> {
5554

5655
try {
5756
const baseParams = await this.getTxnParams();
@@ -80,7 +79,7 @@ export default class Txns extends BaseModule {
8079
//
8180
// Grouped Transactions
8281
// ----------------------------------------------
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> {
8483
try {
8584
const baseParams = await this.getTxnParams();
8685
let group: Transaction[] = [];
@@ -116,7 +115,7 @@ export default class Txns extends BaseModule {
116115
//
117116
// Sequenced transactions
118117
// ----------------------------------------------
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> {
120119
try {
121120
const baseParams = await this.getTxnParams();
122121
let sequence: Transaction[] = [];
@@ -149,7 +148,7 @@ export default class Txns extends BaseModule {
149148
//
150149
// Get txn params
151150
// ----------------------------------------------
152-
async getTxnParams () {
151+
public async getTxnParams () {
153152
const txn = await this.algod.getTransactionParams().do();
154153
return txn;
155154
}
@@ -158,7 +157,7 @@ export default class Txns extends BaseModule {
158157
//
159158
// Sign
160159
// ----------------------------------------------
161-
async signTxn (txns: Transaction|Transaction[]): Promise<Uint8Array[]|false> {
160+
public async signTxn (txns: Transaction|Transaction[]): Promise<Uint8Array[]|false> {
162161
if (!this.client || !this.client.connector) return false;
163162
if (!Array.isArray(txns)) txns = [txns];
164163
const signedTxns = await this.client.connector.sign(txns);
@@ -168,15 +167,15 @@ export default class Txns extends BaseModule {
168167
//
169168
// Send transaction
170169
// ----------------------------------------------
171-
async submitTxn (signedTxn: Uint8Array|Uint8Array[]) {
170+
public async submitTxn (signedTxn: Uint8Array|Uint8Array[]) {
172171
const txn = await this.algod.sendRawTransaction(signedTxn).do();
173172
return txn;
174173
}
175174

176175
//
177176
// Wait for txn to be processed
178177
// ----------------------------------------------
179-
async wait (txnId, maxBlocks = 10): Promise<Record<string, any>> {
178+
public async wait (txnId, maxBlocks = 10): Promise<Record<string, any>> {
180179
const confirmation = await algosdk.waitForConfirmation(this.algod, txnId, maxBlocks);
181180
return camelcaseKeys(confirmation, { deep: true });
182181
}

Diff for: src/modules/txns/types.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,25 @@
1-
21
export interface TxnsConfigs {
32
wait?: boolean,
43
}
4+
5+
export type {
6+
AppClearStateTxn,
7+
AppCloseOutTxn,
8+
AppCreateTxn,
9+
AppDeleteTxn,
10+
AppNoOpTxn,
11+
AppOptInTxn,
12+
AppUpdateTxn,
13+
AssetConfigTxn,
14+
AssetCreateTxn,
15+
AssetDestroyTxn,
16+
AssetFreezeTxn,
17+
AssetTransferTxn,
18+
KeyRegistrationTxn,
19+
PaymentTxn,
20+
StateProofTxn,
21+
Transaction,
22+
TransactionLike,
23+
TransactionParams,
24+
TransactionSigner,
25+
} from 'algosdk';

0 commit comments

Comments
 (0)