algosdk 1.17.0 → 1.19.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.
Files changed (115) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.map +1 -1
  4. package/dist/cjs/index.js +5 -1
  5. package/dist/cjs/index.js.map +1 -1
  6. package/dist/cjs/src/abi/abi_type.js +12 -12
  7. package/dist/cjs/src/abi/abi_type.js.map +1 -1
  8. package/dist/cjs/src/abi/contract.js +3 -0
  9. package/dist/cjs/src/abi/contract.js.map +1 -1
  10. package/dist/cjs/src/abi/index.js +5 -1
  11. package/dist/cjs/src/abi/index.js.map +1 -1
  12. package/dist/cjs/src/abi/interface.js +3 -0
  13. package/dist/cjs/src/abi/interface.js.map +1 -1
  14. package/dist/cjs/src/abi/method.js +19 -4
  15. package/dist/cjs/src/abi/method.js.map +1 -1
  16. package/dist/cjs/src/account.js +5 -1
  17. package/dist/cjs/src/account.js.map +1 -1
  18. package/dist/cjs/src/bid.js +5 -1
  19. package/dist/cjs/src/bid.js.map +1 -1
  20. package/dist/cjs/src/client/client.js +7 -3
  21. package/dist/cjs/src/client/client.js.map +1 -1
  22. package/dist/cjs/src/client/kmd.js +5 -1
  23. package/dist/cjs/src/client/kmd.js.map +1 -1
  24. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js +24 -9
  25. package/dist/cjs/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  26. package/dist/cjs/src/client/v2/algod/block.js +5 -1
  27. package/dist/cjs/src/client/v2/algod/block.js.map +1 -1
  28. package/dist/cjs/src/client/v2/algod/compile.js +5 -1
  29. package/dist/cjs/src/client/v2/algod/compile.js.map +1 -1
  30. package/dist/cjs/src/client/v2/algod/dryrun.js +6 -2
  31. package/dist/cjs/src/client/v2/algod/dryrun.js.map +1 -1
  32. package/dist/cjs/src/client/v2/algod/pendingTransactionInformation.js +5 -1
  33. package/dist/cjs/src/client/v2/algod/pendingTransactionInformation.js.map +1 -1
  34. package/dist/cjs/src/client/v2/algod/pendingTransactions.js +5 -1
  35. package/dist/cjs/src/client/v2/algod/pendingTransactions.js.map +1 -1
  36. package/dist/cjs/src/client/v2/algod/pendingTransactionsByAddress.js +5 -1
  37. package/dist/cjs/src/client/v2/algod/pendingTransactionsByAddress.js.map +1 -1
  38. package/dist/cjs/src/client/v2/algod/sendRawTransaction.js +1 -1
  39. package/dist/cjs/src/client/v2/algod/sendRawTransaction.js.map +1 -1
  40. package/dist/cjs/src/client/v2/indexer/lookupAssetTransactions.js +1 -1
  41. package/dist/cjs/src/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  42. package/dist/cjs/src/client/v2/indexer/searchForTransactions.js +1 -1
  43. package/dist/cjs/src/client/v2/indexer/searchForTransactions.js.map +1 -1
  44. package/dist/cjs/src/composer.js +10 -9
  45. package/dist/cjs/src/composer.js.map +1 -1
  46. package/dist/cjs/src/dryrun.js +6 -8
  47. package/dist/cjs/src/dryrun.js.map +1 -1
  48. package/dist/cjs/src/encoding/address.js +6 -2
  49. package/dist/cjs/src/encoding/address.js.map +1 -1
  50. package/dist/cjs/src/encoding/encoding.js +5 -1
  51. package/dist/cjs/src/encoding/encoding.js.map +1 -1
  52. package/dist/cjs/src/group.js +5 -1
  53. package/dist/cjs/src/group.js.map +1 -1
  54. package/dist/cjs/src/logic/sourcemap.js +67 -0
  55. package/dist/cjs/src/logic/sourcemap.js.map +1 -0
  56. package/dist/cjs/src/logicsig.js +10 -6
  57. package/dist/cjs/src/logicsig.js.map +1 -1
  58. package/dist/cjs/src/main.js +8 -2
  59. package/dist/cjs/src/main.js.map +1 -1
  60. package/dist/cjs/src/makeTxn.js +5 -1
  61. package/dist/cjs/src/makeTxn.js.map +1 -1
  62. package/dist/cjs/src/mnemonic/mnemonic.js +5 -1
  63. package/dist/cjs/src/mnemonic/mnemonic.js.map +1 -1
  64. package/dist/cjs/src/multisig.js +5 -1
  65. package/dist/cjs/src/multisig.js.map +1 -1
  66. package/dist/cjs/src/signer.js +3 -3
  67. package/dist/cjs/src/signer.js.map +1 -1
  68. package/dist/cjs/src/transaction.js +6 -2
  69. package/dist/cjs/src/transaction.js.map +1 -1
  70. package/dist/cjs/src/types/index.js +5 -1
  71. package/dist/cjs/src/types/index.js.map +1 -1
  72. package/dist/cjs/src/types/transactions/index.js +5 -1
  73. package/dist/cjs/src/types/transactions/index.js.map +1 -1
  74. package/dist/cjs/src/utils/utils.js +8 -10
  75. package/dist/cjs/src/utils/utils.js.map +1 -1
  76. package/dist/esm/src/abi/contract.js +4 -1
  77. package/dist/esm/src/abi/contract.js.map +1 -1
  78. package/dist/esm/src/abi/interface.js +4 -1
  79. package/dist/esm/src/abi/interface.js.map +1 -1
  80. package/dist/esm/src/abi/method.js +14 -0
  81. package/dist/esm/src/abi/method.js.map +1 -1
  82. package/dist/esm/src/client/client.js +2 -2
  83. package/dist/esm/src/client/client.js.map +1 -1
  84. package/dist/esm/src/client/urlTokenBaseHTTPClient.js +19 -5
  85. package/dist/esm/src/client/urlTokenBaseHTTPClient.js.map +1 -1
  86. package/dist/esm/src/client/v2/algod/compile.js +5 -1
  87. package/dist/esm/src/client/v2/algod/compile.js.map +1 -1
  88. package/dist/esm/src/composer.js +1 -0
  89. package/dist/esm/src/composer.js.map +1 -1
  90. package/dist/esm/src/dryrun.js +1 -3
  91. package/dist/esm/src/dryrun.js.map +1 -1
  92. package/dist/esm/src/logic/sourcemap.js +40 -0
  93. package/dist/esm/src/logic/sourcemap.js.map +1 -0
  94. package/dist/esm/src/logicsig.js +4 -4
  95. package/dist/esm/src/logicsig.js.map +1 -1
  96. package/dist/esm/src/main.js +1 -0
  97. package/dist/esm/src/main.js.map +1 -1
  98. package/dist/esm/src/utils/utils.js +7 -9
  99. package/dist/esm/src/utils/utils.js.map +1 -1
  100. package/dist/types/src/abi/contract.d.ts +1 -0
  101. package/dist/types/src/abi/interface.d.ts +1 -0
  102. package/dist/types/src/abi/method.d.ts +1 -0
  103. package/dist/types/src/client/client.d.ts +1 -1
  104. package/dist/types/src/client/v2/algod/compile.d.ts +1 -0
  105. package/dist/types/src/composer.d.ts +4 -0
  106. package/dist/types/src/logic/sourcemap.d.ts +20 -0
  107. package/dist/types/src/logicTemplates/dynamicfee.d.ts +2 -2
  108. package/dist/types/src/logicTemplates/htlc.d.ts +1 -1
  109. package/dist/types/src/logicTemplates/limitorder.d.ts +3 -3
  110. package/dist/types/src/logicTemplates/periodicpayment.d.ts +7 -7
  111. package/dist/types/src/logicTemplates/split.d.ts +2 -2
  112. package/dist/types/src/logicsig.d.ts +3 -3
  113. package/dist/types/src/main.d.ts +1 -0
  114. package/dist/types/src/utils/utils.d.ts +1 -1
  115. package/package.json +15 -13
@@ -4,7 +4,6 @@ const JSONbig = JSONbigWithoutConfig({ useNativeBigInt: true, strict: true });
4
4
  /**
5
5
  * Parse JSON with additional options.
6
6
  * @param str - The JSON string to parse.
7
- * @param options - Parsing options.
8
7
  * @param options - Options object to configure how integers in
9
8
  * this request's JSON response will be decoded. Use the `intDecoding`
10
9
  * property with one of the following options:
@@ -21,25 +20,25 @@ const JSONbig = JSONbigWithoutConfig({ useNativeBigInt: true, strict: true });
21
20
  */
22
21
  export function parseJSON(str, options) {
23
22
  const intDecoding = options && options.intDecoding ? options.intDecoding : IntDecoding.DEFAULT;
24
- const parsed = JSONbig.parse(str, (_, value) => {
23
+ return JSONbig.parse(str, (_, value) => {
25
24
  if (value != null &&
26
25
  typeof value === 'object' &&
27
26
  Object.getPrototypeOf(value) == null) {
28
- // for some reason the Objects returned by JSONbig.parse have a null prototype, so we
29
- // need to fix that.
27
+ // JSONbig.parse objects are created with Object.create(null) and thus have a null prototype
28
+ // let us remedy that
30
29
  Object.setPrototypeOf(value, Object.prototype);
31
30
  }
32
31
  if (typeof value === 'bigint') {
32
+ if (intDecoding === 'safe' && value > Number.MAX_SAFE_INTEGER) {
33
+ throw new Error(`Integer exceeds maximum safe integer: ${value.toString()}. Try parsing with a different intDecoding option.`);
34
+ }
33
35
  if (intDecoding === 'bigint' ||
34
36
  (intDecoding === 'mixed' && value > Number.MAX_SAFE_INTEGER)) {
35
37
  return value;
36
38
  }
37
39
  // JSONbig.parse converts number to BigInts if they are >= 10**15. This is smaller than
38
40
  // Number.MAX_SAFE_INTEGER, so we can convert some BigInts back to normal numbers.
39
- if (intDecoding === 'default' || intDecoding === 'mixed') {
40
- return Number(value);
41
- }
42
- throw new Error(`Integer exceeds maximum safe integer: ${value.toString()}. Try parsing with a different intDecoding option.`);
41
+ return Number(value);
43
42
  }
44
43
  if (typeof value === 'number') {
45
44
  if (intDecoding === 'bigint' && Number.isInteger(value)) {
@@ -48,7 +47,6 @@ export function parseJSON(str, options) {
48
47
  }
49
48
  return value;
50
49
  });
51
- return parsed;
52
50
  }
53
51
  /**
54
52
  * ArrayEqual takes two arrays and return true if equal, false otherwise
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/utils/utils.ts"],"names":[],"mappings":"AAAA,OAAO,oBAAoB,MAAM,aAAa,CAAC;AAC/C,OAAO,WAAW,MAAM,sBAAsB,CAAC;AAE/C,MAAM,OAAO,GAAG,oBAAoB,CAAC,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAM9E;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,SAAS,CAAC,GAAW,EAAE,OAAqB;IAC1D,MAAM,WAAW,GACf,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,OAAO,CAAC;IAC7E,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE;QAC7C,IACE,KAAK,IAAI,IAAI;YACb,OAAO,KAAK,KAAK,QAAQ;YACzB,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,IA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GG;AACH,MAAM,UAAU,MAAM;IACpB,OAAO,CACL,OAAO,OAAO,KAAK,QAAQ;QAC3B,OAAO,OAAO,CAAC,QAAQ,KAAK,QAAQ;QACpC,OAAO,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,WAAW,CAC7C,CAAC;AACJ,CAAC"}
@@ -18,4 +18,5 @@ export declare class ABIContract {
18
18
  readonly methods: ABIMethod[];
19
19
  constructor(params: ABIContractParams);
20
20
  toJSON(): ABIContractParams;
21
+ getMethodByName(name: string): ABIMethod;
21
22
  }
@@ -10,4 +10,5 @@ export declare class ABIInterface {
10
10
  readonly methods: ABIMethod[];
11
11
  constructor(params: ABIInterfaceParams);
12
12
  toJSON(): ABIInterfaceParams;
13
+ getMethodByName(name: string): ABIMethod;
13
14
  }
@@ -37,3 +37,4 @@ export declare class ABIMethod {
37
37
  toJSON(): ABIMethodParams;
38
38
  static fromSignature(signature: string): ABIMethod;
39
39
  }
40
+ export declare function getMethodByName(methods: ABIMethod[], name: string): ABIMethod;
@@ -71,7 +71,7 @@ export default class HTTPClient {
71
71
  * If no content-type present, adds the header "content-type: application/json"
72
72
  * and data is serialized in JSON (if not empty)
73
73
  */
74
- post(relativePath: string, data: any, requestHeaders?: Record<string, string>): Promise<HTTPClientResponse>;
74
+ post(relativePath: string, data: any, requestHeaders?: Record<string, string>, query?: Query<any>): Promise<HTTPClientResponse>;
75
75
  /**
76
76
  * Send a DELETE request.
77
77
  * If no content-type present, adds the header "content-type: application/json"
@@ -12,6 +12,7 @@ export default class Compile extends JSONRequest {
12
12
  private source;
13
13
  constructor(c: HTTPClient, source: string | Uint8Array);
14
14
  path(): string;
15
+ sourcemap(map?: boolean): this;
15
16
  /**
16
17
  * Executes compile
17
18
  * @param headers - A headers object
@@ -12,6 +12,10 @@ export interface ABIResult {
12
12
  * does not return a value (return type "void").
13
13
  */
14
14
  rawReturnValue: Uint8Array;
15
+ /**
16
+ * The method that was called for this result
17
+ */
18
+ method: ABIMethod;
15
19
  /**
16
20
  * The return value from the ABI method call. This will be undefined if the method does not return
17
21
  * a value (return type "void"), or if the SDK was unable to decode the returned value.
@@ -0,0 +1,20 @@
1
+ export declare class SourceMap {
2
+ version: number;
3
+ sources: string[];
4
+ names: string[];
5
+ mappings: string;
6
+ pcToLine: {
7
+ [key: number]: number;
8
+ };
9
+ lineToPc: {
10
+ [key: number]: number[];
11
+ };
12
+ constructor({ version, sources, names, mappings, }: {
13
+ version: number;
14
+ sources: string[];
15
+ names: string[];
16
+ mappings: string;
17
+ });
18
+ getLineForPc(pc: number): number | undefined;
19
+ getPcsForLine(line: number): number[] | undefined;
20
+ }
@@ -15,7 +15,7 @@ export class DynamicFee {
15
15
  * @param {string} lease: leave undefined to generate a random lease, or supply a lease as base64
16
16
  * @returns {DynamicFee}
17
17
  */
18
- constructor(receiver: string, amount: any, firstValid: any, lastValid: any, closeRemainder: string, lease: string);
18
+ constructor(receiver: string, amount: int, firstValid: int, lastValid: int, closeRemainder: string, lease: string);
19
19
  programBytes: any;
20
20
  address: string;
21
21
  /**
@@ -44,7 +44,7 @@ export class DynamicFee {
44
44
  *
45
45
  * @throws on invalid lsig
46
46
  */
47
- export function getDynamicFeeTransactions(txn: any, lsig: any, privateKey: Uint8Array, fee: any): Uint8Array;
47
+ export function getDynamicFeeTransactions(txn: dict, lsig: LogicSig, privateKey: Uint8Array, fee: int): Uint8Array;
48
48
  /**
49
49
  * signDynamicFee returns the main transaction and signed logic needed to complete the transfer.
50
50
  * These should be sent to the fee payer, who can use GetDynamicFeeTransactions
@@ -22,7 +22,7 @@ export class HTLC {
22
22
  * @param {int} maxFee: the maximum fee that can be paid to the network by the account
23
23
  * @returns {HTLC}
24
24
  */
25
- constructor(owner: string, receiver: string, hashFunction: string, hashImage: string, expiryRound: any, maxFee: any);
25
+ constructor(owner: string, receiver: string, hashFunction: string, hashImage: string, expiryRound: int, maxFee: int);
26
26
  programBytes: any;
27
27
  address: string;
28
28
  /**
@@ -32,11 +32,11 @@ export class LimitOrder {
32
32
  * @param {int} maxFee: maximum fee used by the limit order transaction
33
33
  * @returns {LimitOrder}
34
34
  */
35
- constructor(owner: string, assetid: any, ratn: any, ratd: any, expiryRound: any, minTrade: any, maxFee: any);
35
+ constructor(owner: string, assetid: int, ratn: int, ratd: int, expiryRound: int, minTrade: int, maxFee: int);
36
36
  programBytes: any;
37
37
  address: string;
38
38
  owner: string;
39
- assetid: any;
39
+ assetid: int;
40
40
  /**
41
41
  * returns the program bytes
42
42
  * @returns {Uint8Array}
@@ -67,4 +67,4 @@ export class LimitOrder {
67
67
  * these transactions will be rejected if they do not meet the restrictions set by the contract
68
68
  * @throws error if arguments fail contract validation
69
69
  */
70
- export function getSwapAssetsTransaction(contract: Uint8Array, assetAmount: any, microAlgoAmount: any, secretKey: Uint8Array, fee: any, firstRound: any, lastRound: any, genesisHash: string): Uint8Array;
70
+ export function getSwapAssetsTransaction(contract: Uint8Array, assetAmount: int, microAlgoAmount: int, secretKey: Uint8Array, fee: int, firstRound: int, lastRound: int, genesisHash: string): Uint8Array;
@@ -22,13 +22,13 @@ export class PeriodicPayment {
22
22
  * @param {string} lease: b64 representation of lease to use, or leave undefined to generate one
23
23
  * @returns {PeriodicPayment}
24
24
  */
25
- constructor(receiver: string, amount: any, withdrawalWindow: any, period: any, expiryRound: any, maxFee: any, lease: string);
25
+ constructor(receiver: string, amount: int, withdrawalWindow: int, period: int, expiryRound: int, maxFee: int, lease: string);
26
26
  receiver: string;
27
- amount: any;
28
- withdrawalWindow: any;
29
- period: any;
30
- expiryRound: any;
31
- maxFee: any;
27
+ amount: int;
28
+ withdrawalWindow: int;
29
+ period: int;
30
+ expiryRound: int;
31
+ maxFee: int;
32
32
  lease: string;
33
33
  programBytes: Uint8Array;
34
34
  address: string;
@@ -55,4 +55,4 @@ export class PeriodicPayment {
55
55
  * @returns {Object} Object containing txID and blob representing signed transaction
56
56
  * @throws error on failure
57
57
  */
58
- export function getPeriodicPaymentWithdrawalTransaction(contract: Uint8Array, fee: any, firstValid: any, genesisHash: string): any;
58
+ export function getPeriodicPaymentWithdrawalTransaction(contract: Uint8Array, fee: int, firstValid: int, genesisHash: string): any;
@@ -27,7 +27,7 @@ export class Split {
27
27
  * @param {int} maxFee: half of the maximum fee used by each split forwarding group transaction
28
28
  * @returns {Split}
29
29
  */
30
- constructor(owner: string, receiverOne: string, receiverTwo: string, rat1: any, rat2: any, expiryRound: any, minPay: any, maxFee: any);
30
+ constructor(owner: string, receiverOne: string, receiverTwo: string, rat1: int, rat2: int, expiryRound: int, minPay: int, maxFee: int);
31
31
  programBytes: any;
32
32
  address: string;
33
33
  /**
@@ -54,4 +54,4 @@ export class Split {
54
54
  * @param {string} genesisHash: the b64-encoded genesis hash indicating the network for this transaction
55
55
  * @returns {Uint8Array}
56
56
  */
57
- export function getSplitFundsTransaction(contract: Uint8Array, amount: any, firstRound: any, lastRound: any, fee: any, genesisHash: string): Uint8Array;
57
+ export function getSplitFundsTransaction(contract: Uint8Array, amount: int, firstRound: int, lastRound: int, fee: int, genesisHash: string): Uint8Array;
@@ -169,12 +169,12 @@ export declare function signLogicSigTransaction(txn: txnBuilder.TransactionLike,
169
169
  */
170
170
  export declare function logicSigFromByte(encoded: Uint8Array): LogicSig;
171
171
  /**
172
- * tealSign creates a signature compatible with ed25519verify opcode from contract address
172
+ * tealSign creates a signature compatible with ed25519verify opcode from program hash
173
173
  * @param sk - uint8array with secret key
174
174
  * @param data - buffer with data to sign
175
- * @param contractAddress - string representation of teal contract address (program hash)
175
+ * @param programHash - string representation of teal program hash (= contract address for LogicSigs)
176
176
  */
177
- export declare function tealSign(sk: Uint8Array, data: Uint8Array | Buffer, contractAddress: string): Uint8Array;
177
+ export declare function tealSign(sk: Uint8Array, data: Uint8Array | Buffer, programHash: string): Uint8Array;
178
178
  /**
179
179
  * tealSignFromProgram creates a signature compatible with ed25519verify opcode from raw program bytes
180
180
  * @param sk - uint8array with secret key
@@ -78,6 +78,7 @@ export { microalgosToAlgos, algosToMicroalgos, INVALID_MICROALGOS_ERROR_MSG, } f
78
78
  export { computeGroupID, assignGroupID } from './group';
79
79
  export { LogicSigAccount, makeLogicSig, signLogicSigTransaction, signLogicSigTransactionObject, logicSigFromByte, tealSign, tealSignFromProgram, } from './logicsig';
80
80
  export { signMultisigTransaction, mergeMultisigTransactions, appendSignMultisigTransaction, multisigAddress, } from './multisig';
81
+ export { SourceMap } from './logic/sourcemap';
81
82
  export declare const LogicTemplates: any;
82
83
  export * from './dryrun';
83
84
  export * from './makeTxn';
@@ -5,7 +5,6 @@ export interface JSONOptions {
5
5
  /**
6
6
  * Parse JSON with additional options.
7
7
  * @param str - The JSON string to parse.
8
- * @param options - Parsing options.
9
8
  * @param options - Options object to configure how integers in
10
9
  * this request's JSON response will be decoded. Use the `intDecoding`
11
10
  * property with one of the following options:
@@ -39,6 +38,7 @@ export declare function concatArrays(...arrs: ArrayLike<number>[]): Uint8Array;
39
38
  export declare function removeUndefinedProperties(obj: Record<string | number | symbol, any>): {
40
39
  [x: string]: any;
41
40
  [x: number]: any;
41
+ [x: symbol]: any;
42
42
  };
43
43
  /**
44
44
  * Check whether the environment is Node.js (as opposed to the browser)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "algosdk",
3
- "version": "1.17.0",
3
+ "version": "1.19.0",
4
4
  "description": "The official JavaScript SDK for Algorand",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -26,7 +26,10 @@
26
26
  "json-bigint": "^1.0.0",
27
27
  "superagent": "^6.1.0",
28
28
  "tweetnacl": "^1.0.3",
29
- "url-parse": "^1.5.1"
29
+ "vlq": "^2.0.4"
30
+ },
31
+ "optionalDependencies": {
32
+ "fsevents": "2.1.2"
30
33
  },
31
34
  "devDependencies": {
32
35
  "@types/json-bigint": "^1.0.0",
@@ -47,22 +50,21 @@
47
50
  "eslint-plugin-import": "^2.22.1",
48
51
  "eslint-plugin-tsdoc": "^0.2.11",
49
52
  "express": "^4.17.1",
50
- "geckodriver": "^2.0.0",
53
+ "geckodriver": "^3.0.1",
51
54
  "husky": "^4.3.8",
52
55
  "lint-staged": "^10.5.4",
53
56
  "mocha": "^9.0.0",
54
57
  "mocha-lcov-reporter": "^1.3.0",
55
58
  "mock-http-server": "^1.4.3",
56
- "path-browserify": "^1.0.1",
57
59
  "prettier": "2.2.1",
58
- "selenium-webdriver": "^4.0.0-beta.4",
60
+ "selenium-webdriver": "^4.2.0",
59
61
  "source-map-loader": "^2.0.2",
60
- "ts-loader": "^8.3.0",
61
- "ts-node": "^10.0.0",
62
- "typedoc": "^0.22.13",
63
- "typedoc-plugin-missing-exports": "^0.22.6",
64
- "typedoc-plugin-rename-defaults": "^0.4.0",
65
- "typescript": "^4.2.3",
62
+ "ts-loader": "^9.3.1",
63
+ "ts-node": "^10.9.1",
64
+ "typedoc": "^0.23.8",
65
+ "typedoc-plugin-missing-exports": "^0.23.0",
66
+ "typedoc-plugin-rename-defaults": "^0.6.4",
67
+ "typescript": "^4.7.4",
66
68
  "webpack": "^5.38.1",
67
69
  "webpack-cli": "^4.7.2"
68
70
  },
@@ -71,8 +73,8 @@
71
73
  "prepare": "npm run build",
72
74
  "prepare-browser-tests": "npm run build && mkdir -p tests/cucumber/browser/build && cp dist/browser/algosdk.min.* tests/cucumber/browser/build/ && webpack --config tests/cucumber/browser/webpack.config.js",
73
75
  "build": "concurrently \"webpack --config webpack.config.js\" \"tsc -p tsconfig-esm.json\" \"tsc -p tsconfig-cjs.json\"",
74
- "docs": "typedoc src/main.ts --options typedoc.config.json",
75
- "docs:dev": "typedoc src/main.ts --options typedoc.config.json --watch --preserveWatchOutput",
76
+ "docs": "typedoc --options typedoc.config.json",
77
+ "docs:dev": "typedoc --options typedoc.config.json --watch --preserveWatchOutput",
76
78
  "lint": "eslint .",
77
79
  "lint:fix": "eslint --fix .",
78
80
  "format": "prettier --write .",