@algorandfoundation/algorand-typescript 1.0.0-beta.27 → 1.0.0-beta.29
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/arc4/c2c.d.ts +5 -5
- package/gtxn-CXBH4yay.js +71 -0
- package/gtxn-CXBH4yay.js.map +1 -0
- package/gtxn.d.ts +602 -16
- package/gtxn.mjs +3 -0
- package/gtxn.mjs.map +1 -0
- package/index-rjo2X8sp.js.map +1 -1
- package/index.mjs +4 -68
- package/index.mjs.map +1 -1
- package/itxn-CPeSA_Q_.js +202 -0
- package/itxn-CPeSA_Q_.js.map +1 -0
- package/itxn.d.ts +989 -86
- package/itxn.mjs +3 -0
- package/itxn.mjs.map +1 -0
- package/{op-Dh5PXhZo.js → op-BgdftarW.js} +80 -80
- package/op-BgdftarW.js.map +1 -0
- package/op.d.ts +79 -79
- package/op.mjs +1 -1
- package/package.json +11 -1
- package/transactions.d.ts +0 -316
- package/op-Dh5PXhZo.js.map +0 -1
package/arc4/c2c.d.ts
CHANGED
@@ -2,7 +2,7 @@ import { CompileContractOptions, CompiledContract } from '../compiled';
|
|
2
2
|
import * as gtxn from '../gtxn';
|
3
3
|
import { AnyFunction, ConstructorFor, DeliberateAny, InstanceMethod } from '../internal/typescript-helpers';
|
4
4
|
import * as itxn from '../itxn';
|
5
|
-
import { ApplicationCallFields,
|
5
|
+
import { ApplicationCallFields, ApplicationCallInnerTxn } from '../itxn';
|
6
6
|
import { Contract } from './index';
|
7
7
|
/**
|
8
8
|
* Defines txn fields that are available for a bare create application call.
|
@@ -16,7 +16,7 @@ export type BareCreateApplicationCallFields = Omit<ApplicationCallFields, 'appId
|
|
16
16
|
* Conditional type which given a group transaction type, returns the equivalent inner transaction
|
17
17
|
* params type.
|
18
18
|
*/
|
19
|
-
export type GtxnToItxnFields<T extends gtxn.Transaction> = T extends gtxn.PaymentTxn ? itxn.PaymentItxnParams : T extends gtxn.KeyRegistrationTxn ? itxn.KeyRegistrationItxnParams : T extends gtxn.AssetConfigTxn ? itxn.AssetConfigItxnParams : T extends gtxn.AssetTransferTxn ? itxn.AssetTransferItxnParams : T extends gtxn.AssetFreezeTxn ? itxn.AssetFreezeItxnParams : T extends gtxn.
|
19
|
+
export type GtxnToItxnFields<T extends gtxn.Transaction> = T extends gtxn.PaymentTxn ? itxn.PaymentItxnParams : T extends gtxn.KeyRegistrationTxn ? itxn.KeyRegistrationItxnParams : T extends gtxn.AssetConfigTxn ? itxn.AssetConfigItxnParams : T extends gtxn.AssetTransferTxn ? itxn.AssetTransferItxnParams : T extends gtxn.AssetFreezeTxn ? itxn.AssetFreezeItxnParams : T extends gtxn.ApplicationCallTxn ? itxn.ApplicationCallItxnParams : itxn.ItxnParams;
|
20
20
|
/**
|
21
21
|
* Conditional type which given an application argument, returns the input type for that argument.
|
22
22
|
*
|
@@ -41,9 +41,9 @@ export type TypedApplicationCallFields<TArgs> = Omit<ApplicationCallFields, 'app
|
|
41
41
|
* The response type of a typed application call. Includes the raw itxn result object and the parsed ABI return value if applicable.
|
42
42
|
*/
|
43
43
|
export type TypedApplicationCallResponse<TReturn> = TReturn extends void ? {
|
44
|
-
itxn:
|
44
|
+
itxn: ApplicationCallInnerTxn;
|
45
45
|
} : {
|
46
|
-
itxn:
|
46
|
+
itxn: ApplicationCallInnerTxn;
|
47
47
|
returnValue: TReturn;
|
48
48
|
};
|
49
49
|
/**
|
@@ -65,7 +65,7 @@ export type ContractProxy<TContract extends Contract> = CompiledContract & {
|
|
65
65
|
* Create a bare application call itxn to create the contract.
|
66
66
|
* @param fields Specify values for transaction fields which should override the default values.
|
67
67
|
*/
|
68
|
-
bareCreate(fields?: BareCreateApplicationCallFields):
|
68
|
+
bareCreate(fields?: BareCreateApplicationCallFields): ApplicationCallInnerTxn;
|
69
69
|
};
|
70
70
|
/**
|
71
71
|
* Pre compile the target ARC4 contract and return a proxy object for constructing inner transactions to call an instance of that contract.
|
package/gtxn-CXBH4yay.js
ADDED
@@ -0,0 +1,71 @@
|
|
1
|
+
import { N as NoImplementation } from './errors-D124-zqo.js';
|
2
|
+
|
3
|
+
/**
|
4
|
+
* Get the nth transaction in the group without verifying its type
|
5
|
+
* @param n The index of the txn in the group
|
6
|
+
*/
|
7
|
+
function Transaction(n) {
|
8
|
+
throw new NoImplementation();
|
9
|
+
}
|
10
|
+
/**
|
11
|
+
* Get the nth transaction in the group
|
12
|
+
* Verifies the txn type is 'pay'
|
13
|
+
* @param n The index of the txn in the group
|
14
|
+
*/
|
15
|
+
function PaymentTxn(n) {
|
16
|
+
throw new NoImplementation();
|
17
|
+
}
|
18
|
+
/**
|
19
|
+
* Get the nth transaction in the group
|
20
|
+
* Verifies the txn type is 'keyreg'
|
21
|
+
* @param n The index of the txn in the group
|
22
|
+
*/
|
23
|
+
function KeyRegistrationTxn(n) {
|
24
|
+
throw new NoImplementation();
|
25
|
+
}
|
26
|
+
/**
|
27
|
+
* Get the nth transaction in the group
|
28
|
+
* Verifies the txn type is 'acfg'
|
29
|
+
* @param n The index of the txn in the group
|
30
|
+
*/
|
31
|
+
function AssetConfigTxn(n) {
|
32
|
+
throw new NoImplementation();
|
33
|
+
}
|
34
|
+
/**
|
35
|
+
* Get the nth transaction in the group
|
36
|
+
* Verifies the txn type is 'axfer'
|
37
|
+
* @param n The index of the txn in the group
|
38
|
+
*/
|
39
|
+
function AssetTransferTxn(n) {
|
40
|
+
throw new NoImplementation();
|
41
|
+
}
|
42
|
+
/**
|
43
|
+
* Get the nth transaction in the group
|
44
|
+
* Verifies the txn type is 'afrz'
|
45
|
+
* @param n The index of the txn in the group
|
46
|
+
*/
|
47
|
+
function AssetFreezeTxn(n) {
|
48
|
+
throw new NoImplementation();
|
49
|
+
}
|
50
|
+
/**
|
51
|
+
* Get the nth transaction in the group
|
52
|
+
* Verifies the txn type is 'appl'
|
53
|
+
* @param n The index of the txn in the group
|
54
|
+
*/
|
55
|
+
function ApplicationCallTxn(n) {
|
56
|
+
throw new NoImplementation();
|
57
|
+
}
|
58
|
+
|
59
|
+
var gtxn = /*#__PURE__*/Object.freeze({
|
60
|
+
__proto__: null,
|
61
|
+
ApplicationCallTxn: ApplicationCallTxn,
|
62
|
+
AssetConfigTxn: AssetConfigTxn,
|
63
|
+
AssetFreezeTxn: AssetFreezeTxn,
|
64
|
+
AssetTransferTxn: AssetTransferTxn,
|
65
|
+
KeyRegistrationTxn: KeyRegistrationTxn,
|
66
|
+
PaymentTxn: PaymentTxn,
|
67
|
+
Transaction: Transaction
|
68
|
+
});
|
69
|
+
|
70
|
+
export { AssetConfigTxn as A, KeyRegistrationTxn as K, PaymentTxn as P, Transaction as T, AssetTransferTxn as a, AssetFreezeTxn as b, ApplicationCallTxn as c, gtxn as g };
|
71
|
+
//# sourceMappingURL=gtxn-CXBH4yay.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"gtxn-CXBH4yay.js","sources":["../src/gtxn.ts"],"sourcesContent":["/* THIS FILE IS GENERATED BY ~/scripts/generate-txn-types.ts - DO NOT MODIFY DIRECTLY */\nimport { OnCompleteAction } from './on-complete-action'\nimport { bytes, uint64 } from './primitives'\nimport { Account, Application, Asset } from './reference'\nimport { TransactionType } from './transactions'\nimport { NoImplementation } from './internal/errors'\nconst isGtxn = Symbol('isGtxn')\n/**\n * A group transaction of type 'pay'\n */\nexport interface PaymentTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.Payment\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * 32 byte address\n */\n readonly receiver: Account\n /**\n * microalgos\n */\n readonly amount: uint64\n /**\n * 32 byte address\n */\n readonly closeRemainderTo: Account\n}\n/**\n * A group transaction of type 'keyreg'\n */\nexport interface KeyRegistrationTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.KeyRegistration\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * 32 byte address\n */\n readonly voteKey: bytes\n /**\n * 32 byte address\n */\n readonly selectionKey: bytes\n /**\n * The first round that the participation key is valid.\n */\n readonly voteFirst: uint64\n /**\n * The last round that the participation key is valid.\n */\n readonly voteLast: uint64\n /**\n * Dilution for the 2-level participation key\n */\n readonly voteKeyDilution: uint64\n /**\n * Marks an account nonparticipating for rewards\n */\n readonly nonparticipation: boolean\n /**\n * 64 byte state proof public key\n */\n readonly stateProofKey: bytes\n}\n/**\n * A group transaction of type 'acfg'\n */\nexport interface AssetConfigTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.AssetConfig\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * Asset ID in asset config transaction\n */\n readonly configAsset: Asset\n /**\n * The asset created by this transaction\n */\n readonly createdAsset: Asset\n /**\n * Total number of units of this asset created\n */\n readonly total: uint64\n /**\n * Number of digits to display after the decimal place when displaying the asset\n */\n readonly decimals: uint64\n /**\n * Whether the asset's slots are frozen by default or not, 0 or 1\n */\n readonly defaultFrozen: boolean\n /**\n * Unit name of the asset\n */\n readonly unitName: bytes\n /**\n * The asset name\n */\n readonly assetName: bytes\n /**\n * URL\n */\n readonly url: bytes\n /**\n * 32 byte commitment to unspecified asset metadata\n */\n readonly metadataHash: bytes\n /**\n * 32 byte address\n */\n readonly manager: Account\n /**\n * 32 byte address\n */\n readonly reserve: Account\n /**\n * 32 byte address\n */\n readonly freeze: Account\n /**\n * 32 byte address\n */\n readonly clawback: Account\n}\n/**\n * A group transaction of type 'axfer'\n */\nexport interface AssetTransferTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.AssetTransfer\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * Asset ID\n */\n readonly xferAsset: Asset\n /**\n * value in Asset's units\n */\n readonly assetAmount: uint64\n /**\n * 32 byte address. Source of assets if Sender is the Asset's Clawback address.\n */\n readonly assetSender: Account\n /**\n * 32 byte address\n */\n readonly assetReceiver: Account\n /**\n * 32 byte address\n */\n readonly assetCloseTo: Account\n}\n/**\n * A group transaction of type 'afrz'\n */\nexport interface AssetFreezeTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.AssetFreeze\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * Asset ID being frozen or un-frozen\n */\n readonly freezeAsset: Asset\n /**\n * 32 byte address of the account whose asset slot is being frozen or un-frozen\n */\n readonly freezeAccount: Account\n /**\n * The new frozen value\n */\n readonly frozen: boolean\n}\n/**\n * A group transaction of type 'appl'\n */\nexport interface ApplicationCallTxn {\n /** @hidden */\n [isGtxn]?: true\n /**\n * 32 byte address\n */\n readonly sender: Account\n /**\n * microalgos\n */\n readonly fee: uint64\n /**\n * round number\n */\n readonly firstValid: uint64\n /**\n * UNIX timestamp of block before txn.FirstValid. Fails if negative\n */\n readonly firstValidTime: uint64\n /**\n * round number\n */\n readonly lastValid: uint64\n /**\n * Any data up to 1024 bytes\n */\n readonly note: bytes\n /**\n * 32 byte lease value\n */\n readonly lease: bytes\n /**\n * Transaction type as bytes\n */\n readonly typeBytes: bytes\n /**\n * Transaction type\n */\n readonly type: TransactionType.ApplicationCall\n /**\n * Position of this transaction within an atomic group\n * A stand-alone transaction is implicitly element 0 in a group of 1\n */\n readonly groupIndex: uint64\n /**\n * The computed ID for this transaction. 32 bytes.\n */\n readonly txnId: bytes\n /**\n * 32 byte Sender's new AuthAddr\n */\n readonly rekeyTo: Account\n /**\n * ApplicationID from ApplicationCall transaction\n */\n readonly appId: Application\n /**\n * The application created by this transaction\n */\n readonly createdApplication: Application\n /**\n * ApplicationCall transaction on completion action\n */\n readonly onCompletion: OnCompleteAction\n /**\n * Number of ApplicationArgs\n */\n readonly numAppArgs: uint64\n /**\n * Number of ApplicationArgs\n */\n readonly numAccounts: uint64\n /**\n * The first page of the Approval program\n */\n readonly approvalProgram: bytes\n /**\n * The first page of the Clear State program\n */\n readonly clearStateProgram: bytes\n /**\n * Number of Assets\n */\n readonly numAssets: uint64\n /**\n * Number of Applications\n */\n readonly numApps: uint64\n /**\n * Number of global state integers this application makes use of.\n */\n readonly globalNumUint: uint64\n /**\n * Number of global state byteslices this application makes use of.\n */\n readonly globalNumBytes: uint64\n /**\n * Number of local state integers this application makes use of.\n */\n readonly localNumUint: uint64\n /**\n * Number of local state byteslices this application makes use of.\n */\n readonly localNumBytes: uint64\n /**\n * Number of additional pages for each of the application's approval and clear state program\n */\n readonly extraProgramPages: uint64\n /**\n * The last message emitted. Empty bytes if none were emitted. App mode only\n */\n readonly lastLog: bytes\n /**\n * Read application logs\n * @param index Index of the log to get\n */\n logs(index: uint64): bytes\n /**\n * Number of Approval Program pages\n */\n readonly numApprovalProgramPages: uint64\n /**\n * All approval program pages\n * @param index Index of the page to get\n */\n approvalProgramPages(index: uint64): bytes\n /**\n * Number of Clear State Program pages\n */\n readonly numClearStateProgramPages: uint64\n /**\n * All clear state program pages\n * @param index Index of the page to get\n */\n clearStateProgramPages(index: uint64): bytes\n /**\n * Arguments passed to the application in the ApplicationCall transaction\n * @param index Index of the arg to get\n */\n appArgs(index: uint64): bytes\n /**\n * Accounts listed in the ApplicationCall transaction\n * @param index Index of the account to get\n */\n accounts(index: uint64): Account\n /**\n * Foreign Assets listed in the ApplicationCall transaction\n * @param index Index of the asset to get\n */\n assets(index: uint64): Asset\n /**\n * Foreign Apps listed in the ApplicationCall transaction\n * @param index Index of the application to get\n */\n apps(index: uint64): Application\n /**\n * The id of the created application\n */\n readonly createdApp: Application\n /**\n * Number of logs\n */\n readonly numLogs: uint64\n}\n/**\n * A group transaction of any type\n */\nexport type Transaction = PaymentTxn | KeyRegistrationTxn | AssetConfigTxn | AssetTransferTxn | AssetFreezeTxn | ApplicationCallTxn\n/**\n * Get the nth transaction in the group without verifying its type\n * @param n The index of the txn in the group\n */\nexport function Transaction(n: uint64): Transaction {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'pay'\n * @param n The index of the txn in the group\n */\nexport function PaymentTxn(n: uint64): PaymentTxn {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'keyreg'\n * @param n The index of the txn in the group\n */\nexport function KeyRegistrationTxn(n: uint64): KeyRegistrationTxn {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'acfg'\n * @param n The index of the txn in the group\n */\nexport function AssetConfigTxn(n: uint64): AssetConfigTxn {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'axfer'\n * @param n The index of the txn in the group\n */\nexport function AssetTransferTxn(n: uint64): AssetTransferTxn {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'afrz'\n * @param n The index of the txn in the group\n */\nexport function AssetFreezeTxn(n: uint64): AssetFreezeTxn {\n throw new NoImplementation()\n}\n/**\n * Get the nth transaction in the group\n * Verifies the txn type is 'appl'\n * @param n The index of the txn in the group\n */\nexport function ApplicationCallTxn(n: uint64): ApplicationCallTxn {\n throw new NoImplementation()\n}\n"],"names":[],"mappings":";;AAskBA;;;AAGG;AACG,SAAU,WAAW,CAAC,CAAS,EAAA;IACnC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,UAAU,CAAC,CAAS,EAAA;IAClC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,CAAS,EAAA;IAC1C,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,cAAc,CAAC,CAAS,EAAA;IACtC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,gBAAgB,CAAC,CAAS,EAAA;IACxC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,cAAc,CAAC,CAAS,EAAA;IACtC,MAAM,IAAI,gBAAgB,EAAE;AAC9B;AACA;;;;AAIG;AACG,SAAU,kBAAkB,CAAC,CAAS,EAAA;IAC1C,MAAM,IAAI,gBAAgB,EAAE;AAC9B;;;;;;;;;;;;;;;"}
|