algosdk 1.24.1 → 2.0.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 (105) hide show
  1. package/README.md +4 -4
  2. package/dist/browser/algosdk.min.js +1 -1
  3. package/dist/browser/algosdk.min.js.LICENSE.txt +0 -18
  4. package/dist/browser/algosdk.min.js.map +1 -1
  5. package/dist/cjs/client/v2/algod/algod.js +1 -1
  6. package/dist/cjs/client/v2/algod/algod.js.map +1 -1
  7. package/dist/cjs/client/v2/algod/models/types.js +161 -123
  8. package/dist/cjs/client/v2/algod/models/types.js.map +1 -1
  9. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js +0 -7
  10. package/dist/cjs/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  11. package/dist/cjs/dryrun.js +16 -7
  12. package/dist/cjs/dryrun.js.map +1 -1
  13. package/dist/cjs/logicsig.js +3 -14
  14. package/dist/cjs/logicsig.js.map +1 -1
  15. package/dist/cjs/main.js +3 -6
  16. package/dist/cjs/main.js.map +1 -1
  17. package/dist/cjs/makeTxn.js +1 -193
  18. package/dist/cjs/makeTxn.js.map +1 -1
  19. package/dist/esm/client/v2/algod/algod.js +1 -1
  20. package/dist/esm/client/v2/algod/algod.js.map +1 -1
  21. package/dist/esm/client/v2/algod/models/types.js +160 -120
  22. package/dist/esm/client/v2/algod/models/types.js.map +1 -1
  23. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js +0 -7
  24. package/dist/esm/client/v2/indexer/lookupAssetTransactions.js.map +1 -1
  25. package/dist/esm/dryrun.js +16 -7
  26. package/dist/esm/dryrun.js.map +1 -1
  27. package/dist/esm/logicsig.js +2 -12
  28. package/dist/esm/logicsig.js.map +1 -1
  29. package/dist/esm/main.js +1 -4
  30. package/dist/esm/main.js.map +1 -1
  31. package/dist/esm/makeTxn.js +0 -185
  32. package/dist/esm/makeTxn.js.map +1 -1
  33. package/dist/types/client/v2/algod/algod.d.ts +1 -1
  34. package/dist/types/client/v2/algod/models/types.d.ts +122 -67
  35. package/dist/types/client/v2/indexer/lookupAssetTransactions.d.ts +0 -4
  36. package/dist/types/logicsig.d.ts +2 -10
  37. package/dist/types/main.d.ts +1 -3
  38. package/dist/types/makeTxn.d.ts +1 -147
  39. package/dist/types/types/transactions/encoded.d.ts +0 -15
  40. package/package.json +1 -1
  41. package/src/client/v2/algod/algod.ts +2 -2
  42. package/src/client/v2/algod/models/types.ts +318 -249
  43. package/src/client/v2/indexer/lookupAssetTransactions.ts +0 -8
  44. package/src/dryrun.ts +13 -13
  45. package/src/logicsig.ts +2 -13
  46. package/src/main.ts +1 -5
  47. package/src/makeTxn.ts +0 -421
  48. package/src/types/transactions/encoded.ts +0 -17
  49. package/dist/cjs/client/algod.js +0 -295
  50. package/dist/cjs/client/algod.js.map +0 -1
  51. package/dist/cjs/logic/langspec.json +0 -2014
  52. package/dist/cjs/logic/logic.js +0 -262
  53. package/dist/cjs/logic/logic.js.map +0 -1
  54. package/dist/cjs/logicTemplates/dynamicfee.js +0 -192
  55. package/dist/cjs/logicTemplates/dynamicfee.js.map +0 -1
  56. package/dist/cjs/logicTemplates/htlc.js +0 -145
  57. package/dist/cjs/logicTemplates/htlc.js.map +0 -1
  58. package/dist/cjs/logicTemplates/index.js +0 -19
  59. package/dist/cjs/logicTemplates/index.js.map +0 -1
  60. package/dist/cjs/logicTemplates/limitorder.js +0 -167
  61. package/dist/cjs/logicTemplates/limitorder.js.map +0 -1
  62. package/dist/cjs/logicTemplates/periodicpayment.js +0 -163
  63. package/dist/cjs/logicTemplates/periodicpayment.js.map +0 -1
  64. package/dist/cjs/logicTemplates/split.js +0 -154
  65. package/dist/cjs/logicTemplates/split.js.map +0 -1
  66. package/dist/cjs/logicTemplates/templates.js +0 -67
  67. package/dist/cjs/logicTemplates/templates.js.map +0 -1
  68. package/dist/esm/client/algod.js +0 -295
  69. package/dist/esm/client/algod.js.map +0 -1
  70. package/dist/esm/logic/langspec.json +0 -2014
  71. package/dist/esm/logic/logic.js +0 -249
  72. package/dist/esm/logic/logic.js.map +0 -1
  73. package/dist/esm/logicTemplates/dynamicfee.js +0 -192
  74. package/dist/esm/logicTemplates/dynamicfee.js.map +0 -1
  75. package/dist/esm/logicTemplates/htlc.js +0 -145
  76. package/dist/esm/logicTemplates/htlc.js.map +0 -1
  77. package/dist/esm/logicTemplates/index.js +0 -19
  78. package/dist/esm/logicTemplates/index.js.map +0 -1
  79. package/dist/esm/logicTemplates/limitorder.js +0 -167
  80. package/dist/esm/logicTemplates/limitorder.js.map +0 -1
  81. package/dist/esm/logicTemplates/periodicpayment.js +0 -163
  82. package/dist/esm/logicTemplates/periodicpayment.js.map +0 -1
  83. package/dist/esm/logicTemplates/split.js +0 -154
  84. package/dist/esm/logicTemplates/split.js.map +0 -1
  85. package/dist/esm/logicTemplates/templates.js +0 -67
  86. package/dist/esm/logicTemplates/templates.js.map +0 -1
  87. package/dist/types/client/algod.d.ts +0 -162
  88. package/dist/types/logic/logic.d.ts +0 -45
  89. package/dist/types/logicTemplates/dynamicfee.d.ts +0 -59
  90. package/dist/types/logicTemplates/htlc.d.ts +0 -51
  91. package/dist/types/logicTemplates/index.d.ts +0 -16
  92. package/dist/types/logicTemplates/limitorder.d.ts +0 -70
  93. package/dist/types/logicTemplates/periodicpayment.d.ts +0 -58
  94. package/dist/types/logicTemplates/split.d.ts +0 -57
  95. package/dist/types/logicTemplates/templates.d.ts +0 -6
  96. package/src/client/algod.js +0 -365
  97. package/src/logic/langspec.json +0 -2014
  98. package/src/logic/logic.ts +0 -316
  99. package/src/logicTemplates/dynamicfee.js +0 -219
  100. package/src/logicTemplates/htlc.js +0 -165
  101. package/src/logicTemplates/index.js +0 -20
  102. package/src/logicTemplates/limitorder.js +0 -227
  103. package/src/logicTemplates/periodicpayment.js +0 -208
  104. package/src/logicTemplates/split.js +0 -208
  105. package/src/logicTemplates/templates.js +0 -78
@@ -1,162 +0,0 @@
1
- /** @deprecated v1 algod APIs are deprecated, please use the v2 client */
2
- export function Algod(token?: string, baseServer?: string, port?: number, headers?: {}): void;
3
- export class Algod {
4
- /** @deprecated v1 algod APIs are deprecated, please use the v2 client */
5
- constructor(token?: string, baseServer?: string, port?: number, headers?: {});
6
- /**
7
- * status retrieves the StatusResponse from the running node
8
- * @param headerObj, optional
9
- * @returns {Promise<*>}
10
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
11
- */
12
- status: (headerObj?: {}) => Promise<any>;
13
- /**
14
- * healthCheck returns an empty object iff the node is running
15
- * @param headerObj, optional
16
- * @returns {Promise<*>}
17
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
18
- */
19
- healthCheck: (headerObj?: {}) => Promise<any>;
20
- /**
21
- * statusAfterBlock waits for round roundNumber to occur then returns the StatusResponse for this round.
22
- * This call blocks
23
- * @param roundNumber
24
- * @param headerObj, optional
25
- * @returns {Promise<*>}
26
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
27
- */
28
- statusAfterBlock: (roundNumber: any, headerObj?: {}) => Promise<any>;
29
- /**
30
- * pendingTransactions asks algod for a snapshot of current pending txns on the node, bounded by maxTxns.
31
- * If maxTxns = 0, fetches as many transactions as possible.
32
- * @param maxTxns - number
33
- * @param headerObj, optional
34
- * @returns {Promise<*>}
35
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
36
- */
37
- pendingTransactions: (maxTxns: any, headerObj?: {}) => Promise<any>;
38
- /**
39
- * versions retrieves the VersionResponse from the running node
40
- * @param headerObj, optional
41
- * @returns {Promise<*>}
42
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
43
- */
44
- versions: (headerObj?: {}) => Promise<any>;
45
- /**
46
- * LedgerSupply gets the supply details for the specified node's Ledger
47
- * @param headerObj, optional
48
- * @returns {Promise<*>}
49
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
50
- */
51
- ledgerSupply: (headerObj?: {}) => Promise<any>;
52
- /**
53
- * transactionsByAddress returns all transactions for a PK [addr] in the [first, last] rounds range.
54
- * @param addr - string
55
- * @param first - number, optional
56
- * @param last - number, optional
57
- * @param maxTxns - number, optional
58
- * @param headers, optional
59
- * @returns {Promise<*>}
60
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
61
- */
62
- transactionByAddress: (addr: any, first?: any, last?: any, maxTxns?: any, headerObj?: {}) => Promise<any>;
63
- /**
64
- * transactionsByAddressAndDate returns all transactions for a PK [addr] in the [fromDate, toDate] date range.
65
- * The date is a string in the YYYY-MM-DD format.
66
- * @param addr - string
67
- * @param fromDate - string
68
- * @param toDate - string
69
- * @param maxTxns - number, optional
70
- * @param headerObj, optional
71
- * @returns {Promise<*>}
72
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
73
- */
74
- transactionByAddressAndDate: (addr: any, fromDate: any, toDate: any, maxTxns?: any, headerObj?: {}) => Promise<any>;
75
- /**
76
- * transactionById returns the a transaction information of a specific txid [txId]
77
- * Note - This method is allowed only when Indexer is enabled.
78
- * @param txid
79
- * @param headerObj, optional
80
- * @returns {Promise<*>}
81
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
82
- */
83
- transactionById: (txid: any, headerObj?: {}) => Promise<any>;
84
- /**
85
- * transactionInformation returns the transaction information of a specific txid and an address
86
- * @param addr
87
- * @param txid
88
- * @param headerObj, optional
89
- * @returns {Promise<*>}
90
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
91
- */
92
- transactionInformation: (addr: any, txid: any, headerObj?: {}) => Promise<any>;
93
- /**
94
- * pendingTransactionInformation returns the transaction information for a specific txid of a pending transaction
95
- * @param txid
96
- * @param headerObj, optional
97
- * @returns {Promise<*>}
98
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
99
- */
100
- pendingTransactionInformation: (txid: any, headerObj?: {}) => Promise<any>;
101
- /**
102
- * accountInformation returns the passed account's information
103
- * @param addr - string
104
- * @param headerObj, optional
105
- * @returns {Promise<*>}
106
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
107
- */
108
- accountInformation: (addr: any, headerObj?: {}) => Promise<any>;
109
- /**
110
- * assetInformation returns the information for the asset with the passed creator and index
111
- * @param index - number
112
- * @param headerObj, optional
113
- * @returns {Promise<*>}
114
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
115
- */
116
- assetInformation: (index: any, headerObj?: {}) => Promise<any>;
117
- /**
118
- * suggestedFee gets the recommended transaction fee from the node
119
- * @param headerObj, optional
120
- * @returns {Promise<*>}
121
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
122
- */
123
- suggestedFee: (headerObj?: {}) => Promise<any>;
124
- /**
125
- * sendRawTransaction gets an encoded SignedTxn and broadcasts it to the network
126
- * @param txn - Uin8Array
127
- * @param headerObj, optional
128
- * @returns {Promise<*>}
129
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
130
- */
131
- sendRawTransaction: (txn: any, headerObj?: {}) => Promise<any>;
132
- /**
133
- * sendRawTransactions gets a list of encoded SignedTxns and broadcasts it to the network
134
- * @param txn - Array of Uin8Array
135
- * @param headerObj, optional
136
- * @returns {Promise<*>}
137
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
138
- */
139
- sendRawTransactions: (txns: any, headerObj?: {}) => Promise<any>;
140
- /**
141
- * getTransactionParams returns to common needed parameters for a new transaction
142
- * @param headerObj, optional
143
- * @returns {Promise<*>}
144
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
145
- */
146
- getTransactionParams: (headerObj?: {}) => Promise<any>;
147
- /**
148
- * suggestParams returns to common needed parameters for a new transaction, in a format the transaction builder expects
149
- * @param headerObj, optional
150
- * @returns {Object}
151
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
152
- */
153
- suggestParams: (headerObj?: {}) => any;
154
- /**
155
- * block gets the block info for the given round This call blocks
156
- * @param roundNumber
157
- * @param headerObj, optional
158
- * @returns {Promise<*>}
159
- * @deprecated v1 algod APIs are deprecated, please use the v2 client
160
- */
161
- block: (roundNumber: any, headerObj?: {}) => Promise<any>;
162
- }
@@ -1,45 +0,0 @@
1
- /**
2
- * Utilities for working with program bytes.
3
- */
4
- /** @deprecated for langspec.json is deprecated aross all SDKs */
5
- export declare function parseUvarint(array: Uint8Array): [numberFound: number, size: number];
6
- /** readProgram validates program for length and running cost,
7
- * and additionally provides the found int variables and byte blocks
8
- *
9
- * @deprecated Validation relies on metadata (`langspec.json`) that
10
- * does not accurately represent opcode behavior across program versions.
11
- * The behavior of `readProgram` relies on `langspec.json`.
12
- * Thus, this method is being deprecated.
13
- *
14
- * @param program - Program to check
15
- * @param args - Program arguments as array of Uint8Array arrays
16
- * @throws
17
- * @returns
18
- */
19
- export declare function readProgram(program: Uint8Array, args?: Uint8Array[]): [ints: number[], byteArrays: Uint8Array[], valid: boolean];
20
- /**
21
- * checkProgram validates program for length and running cost
22
- *
23
- * @deprecated Validation relies on metadata (`langspec.json`) that
24
- * does not accurately represent opcode behavior across program versions.
25
- * The behavior of `checkProgram` relies on `langspec.json`.
26
- * Thus, this method is being deprecated.
27
- *
28
- * @param program - Program to check
29
- * @param args - Program arguments as array of Uint8Array arrays
30
- * @throws
31
- * @returns true if success
32
- */
33
- export declare function checkProgram(program: Uint8Array, args?: Uint8Array[]): boolean;
34
- /** @deprecated for langspec.json is deprecated aross all SDKs */
35
- export declare function checkIntConstBlock(program: Uint8Array, pc: number): number;
36
- /** @deprecated for langspec.json is deprecated aross all SDKs */
37
- export declare function checkByteConstBlock(program: Uint8Array, pc: number): number;
38
- /** @deprecated for langspec.json is deprecated aross all SDKs */
39
- export declare function checkPushIntOp(program: Uint8Array, pc: number): number;
40
- /** @deprecated for langspec.json is deprecated aross all SDKs */
41
- export declare function checkPushByteOp(program: Uint8Array, pc: number): number;
42
- /** @deprecated for langspec.json is deprecated aross all SDKs */
43
- export declare const langspecEvalMaxVersion: number;
44
- /** @deprecated for langspec.json is deprecated aross all SDKs */
45
- export declare const langspecLogicSigVersion: number;
@@ -1,59 +0,0 @@
1
- export class DynamicFee {
2
- /**
3
- * DynamicFee contract allows you to create a transaction without
4
- * specifying the fee. The fee will be determined at the moment of
5
- * transfer.
6
- *
7
- * @deprecated This feature will be removed in v2.
8
- *
9
- * Constructor Parameters:
10
- * @param {string} receiver: address to receive the assets
11
- * @param {int} amount: amount of assets to transfer
12
- * @param {int} firstValid: first valid round for the transaction
13
- * @param {int} lastValid: last valid round for the transaction
14
- * @param {string} closeRemainder: if you would like to close the account after the transfer, specify the address that would recieve the remainder, else leave undefined
15
- * @param {string} lease: leave undefined to generate a random lease, or supply a lease as base64
16
- * @returns {DynamicFee}
17
- */
18
- constructor(receiver: string, amount: int, firstValid: int, lastValid: int, closeRemainder: string, lease: string);
19
- programBytes: any;
20
- address: string;
21
- /**
22
- * returns the program bytes
23
- * @returns {Uint8Array}
24
- */
25
- getProgram(): Uint8Array;
26
- /**
27
- * returns the string address of the contract
28
- * @returns {string}
29
- */
30
- getAddress(): string;
31
- }
32
- /**
33
- * getDynamicFeeTransactions creates and signs the secondary dynamic fee transaction, updates
34
- * transaction fields, and signs as the fee payer; it returns both
35
- * transactions as bytes suitable for sendRaw.
36
- *
37
- * @deprecated This feature will be removed in v2.
38
- *
39
- * Parameters:
40
- * @param {dict} txn - main transaction from payer's signDynamicFee output (a dict of constructor arguments, NOT a transaction.Transaction)
41
- * @param {LogicSig} lsig - the signed logic received from the payer's signDynamicFee output
42
- * @param {Uint8Array} privateKey - the private key for the account that pays the fee
43
- * @param {int} fee - fee per byte for both transactions
44
- *
45
- * @throws on invalid lsig
46
- */
47
- export function getDynamicFeeTransactions(txn: dict, lsig: LogicSig, privateKey: Uint8Array, fee: int): Uint8Array;
48
- /**
49
- * signDynamicFee returns the main transaction and signed logic needed to complete the transfer.
50
- * These should be sent to the fee payer, who can use GetDynamicFeeTransactions
51
- *
52
- * @deprecated This feature will be removed in v2.
53
- *
54
- * @param {Uint8Array} contract: the bytearray representing the contract
55
- * @param {Uint8Array} secretKey: the secret key for building the logic sig
56
- * @param {string} genesisHash: the genesisHash to use for the txn
57
- * @returns {Object} object containing json of txnbuilder constructor arguments under "txn" and signed logicsig under "lsig"
58
- */
59
- export function signDynamicFee(contract: Uint8Array, secretKey: Uint8Array, genesisHash: string): any;
@@ -1,51 +0,0 @@
1
- export class HTLC {
2
- /**
3
- * HTLC allows a user to receive the Algo prior to a deadline (in terms of a round) by proving a knowledge
4
- * of a special value or to forfeit the ability to claim, returning it to the payer.
5
- * This contract is usually used to perform cross-chained atomic swaps
6
- *
7
- * More formally -
8
- * Algos can be transferred under only two circumstances:
9
- * 1. To receiver if hash_function(arg_0) = hash_value
10
- * 2. To owner if txn.FirstValid > expiry_round
11
- * ...
12
- *
13
- * @deprecated This feature will be removed in v2.
14
- *
15
- *Parameters
16
- *----------
17
- * @param {string} owner: an address that can receive the asset after the expiry round
18
- * @param {string} receiver: address to receive Algos
19
- * @param {string} hashFunction: the hash function to be used (must be either sha256 or keccak256)
20
- * @param {string} hashImage: the hash image in base64
21
- * @param {int} expiryRound: the round on which the assets can be transferred back to owner
22
- * @param {int} maxFee: the maximum fee that can be paid to the network by the account
23
- * @returns {HTLC}
24
- */
25
- constructor(owner: string, receiver: string, hashFunction: string, hashImage: string, expiryRound: int, maxFee: int);
26
- programBytes: any;
27
- address: string;
28
- /**
29
- * returns the program bytes
30
- * @returns {Uint8Array}
31
- */
32
- getProgram(): Uint8Array;
33
- /**
34
- * returns the string address of the contract
35
- * @returns {string}
36
- */
37
- getAddress(): string;
38
- }
39
- /**
40
- * signTransactionWithHTLCUnlock accepts a transaction, such as a payment, and builds the HTLC-unlocking signature around that transaction
41
- *
42
- * @deprecated This feature will be removed in v2.
43
- *
44
- * @param {Uint8Array} contract : byte representation of the HTLC
45
- * @param {Object} txn dictionary containing constructor arguments for a transaction
46
- * @param {string} preImageAsBase64 : preimage of the hash as base64 string
47
- *
48
- * @returns {Object} Object containing txID and blob representing signed transaction.
49
- * @throws error on validation failure
50
- */
51
- export function signTransactionWithHTLCUnlock(contract: Uint8Array, txn: any, preImageAsBase64: string): any;
@@ -1,16 +0,0 @@
1
- import dynamicFeeTemplate = require("./dynamicfee");
2
- import htlcTemplate = require("./htlc");
3
- import limitOrderTemplate = require("./limitorder");
4
- import splitTemplate = require("./split");
5
- import periodicPayTemplate = require("./periodicpayment");
6
- export const DynamicFee: typeof dynamicFeeTemplate.DynamicFee;
7
- export const getDynamicFeeTransactions: typeof dynamicFeeTemplate.getDynamicFeeTransactions;
8
- export const signDynamicFee: typeof dynamicFeeTemplate.signDynamicFee;
9
- export const HTLC: typeof htlcTemplate.HTLC;
10
- export const signTransactionWithHTLCUnlock: typeof htlcTemplate.signTransactionWithHTLCUnlock;
11
- export const LimitOrder: typeof limitOrderTemplate.LimitOrder;
12
- export const getSwapAssetsTransaction: typeof limitOrderTemplate.getSwapAssetsTransaction;
13
- export const Split: typeof splitTemplate.Split;
14
- export const getSplitFundsTransaction: typeof splitTemplate.getSplitFundsTransaction;
15
- export const PeriodicPayment: typeof periodicPayTemplate.PeriodicPayment;
16
- export const getPeriodicPaymentWithdrawalTransaction: typeof periodicPayTemplate.getPeriodicPaymentWithdrawalTransaction;
@@ -1,70 +0,0 @@
1
- export class LimitOrder {
2
- /**
3
- * MakeLimitOrder allows a user to exchange some number of assets for some number of algos.
4
- * Fund the contract with some number of Algos to limit the maximum number of
5
- * Algos you're willing to trade for some other asset.
6
- *
7
- * Works on two cases:
8
- * * trading Algos for some other asset
9
- * * closing out Algos back to the originator after a timeout
10
- *
11
- * trade case, a 2 transaction group:
12
- * gtxn[0] (this txn) Algos from Me to Other
13
- * gtxn[1] asset from Other to Me
14
- *
15
- * We want to get _at least_ some amount of the other asset per our Algos
16
- * gtxn[1].AssetAmount / gtxn[0].Amount >= N / D
17
- * ===
18
- * gtxn[1].AssetAmount * D >= gtxn[0].Amount * N
19
- *
20
- * close-out case:
21
- * txn alone, close out value after timeout
22
- *
23
- * @deprecated This class will be removed in v2.
24
- *
25
- * Constructor Parameters:
26
- * @param {string} owner: the address to refund funds to on timeout
27
- * @param {int} assetid: the ID of the transferred asset
28
- * @param {int} ratn: exchange rate (N asset per D Algos, or better)
29
- * @param {int} ratd: exchange rate (N asset per D Algos, or better)
30
- * @param {int} expiryRound: the round at which the account expires
31
- * @param {int} minTrade: the minimum amount (of Algos) to be traded away
32
- * @param {int} maxFee: maximum fee used by the limit order transaction
33
- * @returns {LimitOrder}
34
- */
35
- constructor(owner: string, assetid: int, ratn: int, ratd: int, expiryRound: int, minTrade: int, maxFee: int);
36
- programBytes: any;
37
- address: string;
38
- owner: string;
39
- assetid: int;
40
- /**
41
- * returns the program bytes
42
- * @returns {Uint8Array}
43
- */
44
- getProgram(): Uint8Array;
45
- /**
46
- * returns the string address of the contract
47
- * @returns {string}
48
- */
49
- getAddress(): string;
50
- }
51
- /**
52
- * returns a group transactions array which transfer funds according to the contract's ratio
53
- *
54
- * @deprecated This feature will be removed in v2.
55
- *
56
- * @param {Uint8Array} contract: byteform of the contract from the payer
57
- * @param {int} assetAmount: the amount of assets to be sent
58
- * @param {int} microAlgoAmount: number of microAlgos to transfer
59
- * @param {Uint8Array} secretKey: secret key for signing transaction
60
- * @param {int} fee: the fee per byte to pay in microAlgos
61
- * @param {int} firstRound: the first round on which these txns will be valid
62
- * @param {int} lastRound: the last round on which these txns will be valid
63
- * @param {string} genesisHash: the b64-encoded genesis hash indicating the network for this transaction
64
- * @returns {Uint8Array}
65
- * the first payment sends money (Algos) from contract to the recipient (we'll call him Buyer), closing the rest of the account to Owner
66
- * the second payment sends money (the asset) from Buyer to the Owner
67
- * these transactions will be rejected if they do not meet the restrictions set by the contract
68
- * @throws error if arguments fail contract validation
69
- */
70
- export function getSwapAssetsTransaction(contract: Uint8Array, assetAmount: int, microAlgoAmount: int, secretKey: Uint8Array, fee: int, firstRound: int, lastRound: int, genesisHash: string): Uint8Array;
@@ -1,58 +0,0 @@
1
- export class PeriodicPayment {
2
- /**
3
- * MakePeriodicPayment allows some account to execute periodic withdrawal of funds.
4
- * This is a contract account.
5
- *
6
- * This allows receiver to withdraw amount every
7
- * period rounds for withdrawWindow after every multiple
8
- * of period.
9
- *
10
- * After expiryRound, all remaining funds in the escrow
11
- * are available to receiver.
12
- *
13
- * @deprecated This class will be removed in v2.
14
- *
15
- * Constructor Parameters:
16
- * @param {string} receiver: address which is authorized to receive withdrawals
17
- * @param {int} amount: the amount to send each period
18
- * @param {int} withdrawalWindow: the duration of a withdrawal period
19
- * @param {int} period: the time between a pair of withdrawal periods
20
- * @param {int} expiryRound: the round at which the account expires
21
- * @param {int} maxFee: maximum fee used by the withdrawal transaction
22
- * @param {string} lease: b64 representation of lease to use, or leave undefined to generate one
23
- * @returns {PeriodicPayment}
24
- */
25
- constructor(receiver: string, amount: int, withdrawalWindow: int, period: int, expiryRound: int, maxFee: int, lease: string);
26
- receiver: string;
27
- amount: int;
28
- withdrawalWindow: int;
29
- period: int;
30
- expiryRound: int;
31
- maxFee: int;
32
- lease: string;
33
- programBytes: Uint8Array;
34
- address: string;
35
- /**
36
- * returns the program bytes
37
- * @returns {Uint8Array}
38
- */
39
- getProgram(): Uint8Array;
40
- /**
41
- * returns the string address of the contract
42
- * @returns {string}
43
- */
44
- getAddress(): string;
45
- }
46
- /**
47
- * getPeriodicPaymentWithdrawalTransaction returns a signed transaction extracting funds form the contract
48
- *
49
- * @deprecated This feature will be removed in v2.
50
- *
51
- * @param {Uint8Array} contract: the bytearray defining the contract, received from the payer
52
- * @param {int} fee: the fee per byte for the transaction
53
- * @param {int} firstValid: the first round on which the txn will be valid
54
- * @param {string} genesisHash: the hash representing the network for the txn
55
- * @returns {Object} Object containing txID and blob representing signed transaction
56
- * @throws error on failure
57
- */
58
- export function getPeriodicPaymentWithdrawalTransaction(contract: Uint8Array, fee: int, firstValid: int, genesisHash: string): any;
@@ -1,57 +0,0 @@
1
- export class Split {
2
- /**
3
- * Split splits money sent to some account to two recipients at some ratio.
4
- * This is a contract account.
5
- *
6
- * This allows either a two-transaction group, for executing a
7
- * split, or single transaction, for closing the account.
8
- *
9
- * Withdrawals from this account are allowed as a group transaction which
10
- * sends receiverOne and receiverTwo amounts with exactly the specified ratio:
11
- * (rat1*amountForReceiverOne) = (rat2*amountForReceiverTwo)
12
- * At least minPay must be sent to receiverOne.
13
- * (CloseRemainderTo must be zero.)
14
- *
15
- * After expiryRound passes, all funds can be refunded to owner.
16
- *
17
- * @deprecated This feature will be removed in v2.
18
- *
19
- * Constructor Parameters:
20
- * @param {string} owner: the address to refund funds to on timeout
21
- * @param {string} receiverOne: the first recipient in the split account
22
- * @param {string} receiverTwo: the second recipient in the split account
23
- * @param {int} rat1: fraction of money to be paid to the 1st recipient
24
- * @param {int} rat2: fraction of money to be paid to the 2nd recipient
25
- * @param {int} expiryRound: the round at which the account expires
26
- * @param {int} minPay: minimum amount to be paid out of the account
27
- * @param {int} maxFee: half of the maximum fee used by each split forwarding group transaction
28
- * @returns {Split}
29
- */
30
- constructor(owner: string, receiverOne: string, receiverTwo: string, rat1: int, rat2: int, expiryRound: int, minPay: int, maxFee: int);
31
- programBytes: any;
32
- address: string;
33
- /**
34
- * returns the program bytes
35
- * @returns {Uint8Array}
36
- */
37
- getProgram(): Uint8Array;
38
- /**
39
- * returns the string address of the contract
40
- * @returns {string}
41
- */
42
- getAddress(): string;
43
- }
44
- /**
45
- * returns a group transactions array which transfer funds according to the contract's ratio
46
- *
47
- * @deprecated This feature will be removed in v2.
48
- *
49
- * @param {Uint8Array} contract: bytes representing the contract in question
50
- * @param {int} amount: the amount to be transferred
51
- * @param {int} firstRound: the first round on which the transaction group will be valid
52
- * @param {int} lastRound: the last round on which the transaction group will be valid
53
- * @param {int} fee: the fee to pay in microAlgos
54
- * @param {string} genesisHash: the b64-encoded genesis hash indicating the network for this transaction
55
- * @returns {Uint8Array}
56
- */
57
- export function getSplitFundsTransaction(contract: Uint8Array, amount: int, firstRound: int, lastRound: int, fee: int, genesisHash: string): Uint8Array;
@@ -1,6 +0,0 @@
1
- export function inject(orig: any, offsets: any, values: any, valueTypes: any): any;
2
- export namespace valTypes {
3
- const INT: number;
4
- const ADDRESS: number;
5
- const BASE64: number;
6
- }