algosdk 3.4.0 → 3.5.1
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/README.md +4 -4
- package/dist/browser/algosdk.min.js +1 -1
- package/dist/browser/algosdk.min.js.map +1 -1
- package/dist/cjs/appAccess.js +261 -0
- package/dist/cjs/appAccess.js.map +1 -0
- package/dist/cjs/client/v2/indexer/models/types.js +266 -8
- package/dist/cjs/client/v2/indexer/models/types.js.map +1 -1
- package/dist/cjs/composer.js +13 -5
- package/dist/cjs/composer.js.map +1 -1
- package/dist/cjs/logicsig.js +54 -17
- package/dist/cjs/logicsig.js.map +1 -1
- package/dist/cjs/makeTxn.js +60 -12
- package/dist/cjs/makeTxn.js.map +1 -1
- package/dist/cjs/signing.js +4 -4
- package/dist/cjs/signing.js.map +1 -1
- package/dist/cjs/transaction.js +110 -0
- package/dist/cjs/transaction.js.map +1 -1
- package/dist/esm/appAccess.js +255 -0
- package/dist/esm/appAccess.js.map +1 -0
- package/dist/esm/client/v2/indexer/models/types.js +261 -6
- package/dist/esm/client/v2/indexer/models/types.js.map +1 -1
- package/dist/esm/composer.js +13 -5
- package/dist/esm/composer.js.map +1 -1
- package/dist/esm/logicsig.js +54 -17
- package/dist/esm/logicsig.js.map +1 -1
- package/dist/esm/makeTxn.js +60 -12
- package/dist/esm/makeTxn.js.map +1 -1
- package/dist/esm/signing.js +4 -4
- package/dist/esm/signing.js.map +1 -1
- package/dist/esm/transaction.js +110 -0
- package/dist/esm/transaction.js.map +1 -1
- package/dist/types/appAccess.d.ts +28 -0
- package/dist/types/client/v2/indexer/models/types.d.ts +157 -8
- package/dist/types/composer.d.ts +6 -2
- package/dist/types/logicsig.d.ts +2 -0
- package/dist/types/makeTxn.d.ts +9 -9
- package/dist/types/transaction.d.ts +18 -0
- package/dist/types/types/transactions/base.d.ts +76 -0
- package/package.json +1 -1
- package/src/appAccess.ts +298 -0
- package/src/client/v2/indexer/models/types.ts +423 -5
- package/src/composer.ts +24 -4
- package/src/logicsig.ts +68 -17
- package/src/makeTxn.ts +105 -12
- package/src/signing.ts +4 -4
- package/src/transaction.ts +168 -0
- package/src/types/transactions/base.ts +91 -0
package/src/composer.ts
CHANGED
|
@@ -31,6 +31,7 @@ import { SignedTransaction } from './signedTransaction.js';
|
|
|
31
31
|
import {
|
|
32
32
|
BoxReference,
|
|
33
33
|
OnApplicationComplete,
|
|
34
|
+
ResourceReference,
|
|
34
35
|
SuggestedParams,
|
|
35
36
|
} from './types/transactions/base.js';
|
|
36
37
|
import { arrayEqual, stringifyJSON, ensureUint64 } from './utils/utils.js';
|
|
@@ -217,9 +218,11 @@ export class AtomicTransactionComposer {
|
|
|
217
218
|
appForeignApps,
|
|
218
219
|
appForeignAssets,
|
|
219
220
|
boxes,
|
|
221
|
+
access,
|
|
220
222
|
note,
|
|
221
223
|
lease,
|
|
222
224
|
rekeyTo,
|
|
225
|
+
rejectVersion,
|
|
223
226
|
signer,
|
|
224
227
|
}: {
|
|
225
228
|
/** The ID of the smart contract to call. Set this to 0 to indicate an application creation call. */
|
|
@@ -256,12 +259,16 @@ export class AtomicTransactionComposer {
|
|
|
256
259
|
appForeignAssets?: Array<number | bigint>;
|
|
257
260
|
/** The box references for this application call */
|
|
258
261
|
boxes?: BoxReference[];
|
|
262
|
+
/** The resource references for this application call */
|
|
263
|
+
access?: ResourceReference[];
|
|
259
264
|
/** The note value for this application call */
|
|
260
265
|
note?: Uint8Array;
|
|
261
266
|
/** The lease value for this application call */
|
|
262
267
|
lease?: Uint8Array;
|
|
263
268
|
/** If provided, the address that the sender will be rekeyed to at the conclusion of this application call */
|
|
264
269
|
rekeyTo?: string | Address;
|
|
270
|
+
/** The lowest application version for which this transaction should immediately fail. 0 indicates that no version check should be performed. */
|
|
271
|
+
rejectVersion?: number | bigint;
|
|
265
272
|
/** A transaction signer that can authorize this application call from sender */
|
|
266
273
|
signer: TransactionSigner;
|
|
267
274
|
}): void {
|
|
@@ -324,6 +331,16 @@ export class AtomicTransactionComposer {
|
|
|
324
331
|
);
|
|
325
332
|
}
|
|
326
333
|
|
|
334
|
+
// Validate that access and legacy foreign arrays are not both specified
|
|
335
|
+
if (
|
|
336
|
+
access &&
|
|
337
|
+
(appAccounts || appForeignApps || appForeignAssets || boxes)
|
|
338
|
+
) {
|
|
339
|
+
throw new Error(
|
|
340
|
+
'Cannot specify both access and legacy foreign arrays (appAccounts, appForeignApps, appForeignAssets, boxes)'
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
|
|
327
344
|
if (methodArgs == null) {
|
|
328
345
|
// eslint-disable-next-line no-param-reassign
|
|
329
346
|
methodArgs = [];
|
|
@@ -472,10 +489,12 @@ export class AtomicTransactionComposer {
|
|
|
472
489
|
sender,
|
|
473
490
|
appIndex: appID,
|
|
474
491
|
appArgs: appArgsEncoded,
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
492
|
+
// Only pass legacy foreign arrays if access is not provided
|
|
493
|
+
accounts: access ? undefined : foreignAccounts,
|
|
494
|
+
foreignApps: access ? undefined : foreignApps,
|
|
495
|
+
foreignAssets: access ? undefined : foreignAssets,
|
|
496
|
+
boxes: access ? undefined : boxReferences,
|
|
497
|
+
access,
|
|
479
498
|
onComplete:
|
|
480
499
|
onComplete == null ? OnApplicationComplete.NoOpOC : onComplete,
|
|
481
500
|
approvalProgram,
|
|
@@ -485,6 +504,7 @@ export class AtomicTransactionComposer {
|
|
|
485
504
|
numLocalInts,
|
|
486
505
|
numLocalByteSlices,
|
|
487
506
|
extraPages,
|
|
507
|
+
rejectVersion,
|
|
488
508
|
lease,
|
|
489
509
|
note,
|
|
490
510
|
rekeyTo,
|
package/src/logicsig.ts
CHANGED
|
@@ -60,6 +60,7 @@ export function sanityCheckProgram(program: Uint8Array) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
const programTag = new TextEncoder().encode('Program');
|
|
63
|
+
const multisigProgramTag = new TextEncoder().encode('MsigProgram');
|
|
63
64
|
|
|
64
65
|
/**
|
|
65
66
|
LogicSig implementation
|
|
@@ -85,6 +86,10 @@ export class LogicSig implements encoding.Encodable {
|
|
|
85
86
|
key: 'msig',
|
|
86
87
|
valueSchema: new OptionalSchema(ENCODED_MULTISIG_SCHEMA),
|
|
87
88
|
},
|
|
89
|
+
{
|
|
90
|
+
key: 'lmsig',
|
|
91
|
+
valueSchema: new OptionalSchema(ENCODED_MULTISIG_SCHEMA),
|
|
92
|
+
},
|
|
88
93
|
])
|
|
89
94
|
);
|
|
90
95
|
|
|
@@ -92,6 +97,7 @@ export class LogicSig implements encoding.Encodable {
|
|
|
92
97
|
args: Uint8Array[];
|
|
93
98
|
sig?: Uint8Array;
|
|
94
99
|
msig?: EncodedMultisig;
|
|
100
|
+
lmsig?: EncodedMultisig;
|
|
95
101
|
|
|
96
102
|
constructor(program: Uint8Array, programArgs?: Array<Uint8Array> | null) {
|
|
97
103
|
if (
|
|
@@ -112,6 +118,7 @@ export class LogicSig implements encoding.Encodable {
|
|
|
112
118
|
this.args = args;
|
|
113
119
|
this.sig = undefined;
|
|
114
120
|
this.msig = undefined;
|
|
121
|
+
this.lmsig = undefined;
|
|
115
122
|
}
|
|
116
123
|
|
|
117
124
|
// eslint-disable-next-line class-methods-use-this
|
|
@@ -128,6 +135,9 @@ export class LogicSig implements encoding.Encodable {
|
|
|
128
135
|
if (this.msig) {
|
|
129
136
|
data.set('msig', encodedMultiSigToEncodingData(this.msig));
|
|
130
137
|
}
|
|
138
|
+
if (this.lmsig) {
|
|
139
|
+
data.set('lmsig', encodedMultiSigToEncodingData(this.lmsig));
|
|
140
|
+
}
|
|
131
141
|
return data;
|
|
132
142
|
}
|
|
133
143
|
|
|
@@ -140,6 +150,9 @@ export class LogicSig implements encoding.Encodable {
|
|
|
140
150
|
if (data.get('msig')) {
|
|
141
151
|
lsig.msig = encodedMultiSigFromEncodingData(data.get('msig'));
|
|
142
152
|
}
|
|
153
|
+
if (data.get('lmsig')) {
|
|
154
|
+
lsig.lmsig = encodedMultiSigFromEncodingData(data.get('lmsig'));
|
|
155
|
+
}
|
|
143
156
|
return lsig;
|
|
144
157
|
}
|
|
145
158
|
|
|
@@ -148,7 +161,8 @@ export class LogicSig implements encoding.Encodable {
|
|
|
148
161
|
* @param publicKey - Verification key (derived from sender address or escrow address)
|
|
149
162
|
*/
|
|
150
163
|
verify(publicKey: Uint8Array) {
|
|
151
|
-
|
|
164
|
+
const sigCount = [this.sig, this.msig, this.lmsig].filter(Boolean).length;
|
|
165
|
+
if (sigCount > 1) {
|
|
152
166
|
return false;
|
|
153
167
|
}
|
|
154
168
|
|
|
@@ -160,7 +174,7 @@ export class LogicSig implements encoding.Encodable {
|
|
|
160
174
|
|
|
161
175
|
const toBeSigned = utils.concatArrays(programTag, this.logic);
|
|
162
176
|
|
|
163
|
-
if (!this.sig && !this.msig) {
|
|
177
|
+
if (!this.sig && !this.msig && !this.lmsig) {
|
|
164
178
|
const hash = nacl.genericHash(toBeSigned);
|
|
165
179
|
return utils.arrayEqual(hash, publicKey);
|
|
166
180
|
}
|
|
@@ -169,7 +183,25 @@ export class LogicSig implements encoding.Encodable {
|
|
|
169
183
|
return nacl.verify(toBeSigned, this.sig, publicKey);
|
|
170
184
|
}
|
|
171
185
|
|
|
172
|
-
|
|
186
|
+
if (this.lmsig) {
|
|
187
|
+
const multisigAddr = addressFromMultisigPreImg({
|
|
188
|
+
version: this.lmsig.v,
|
|
189
|
+
threshold: this.lmsig.thr,
|
|
190
|
+
pks: this.lmsig.subsig.map((subsig) => subsig.pk),
|
|
191
|
+
});
|
|
192
|
+
const lmsigProgram = utils.concatArrays(
|
|
193
|
+
multisigProgramTag,
|
|
194
|
+
multisigAddr.publicKey,
|
|
195
|
+
this.logic
|
|
196
|
+
);
|
|
197
|
+
return verifyMultisig(lmsigProgram, this.lmsig!, publicKey);
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
if (this.msig) {
|
|
201
|
+
return verifyMultisig(toBeSigned, this.msig!, publicKey);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
return false;
|
|
173
205
|
}
|
|
174
206
|
|
|
175
207
|
/**
|
|
@@ -193,14 +225,14 @@ export class LogicSig implements encoding.Encodable {
|
|
|
193
225
|
} else {
|
|
194
226
|
const subsigs = pksFromAddresses(msig.addrs).map((pk) => ({ pk }));
|
|
195
227
|
|
|
196
|
-
this.
|
|
228
|
+
this.lmsig = {
|
|
197
229
|
v: msig.version,
|
|
198
230
|
thr: msig.threshold,
|
|
199
231
|
subsig: subsigs,
|
|
200
232
|
};
|
|
201
233
|
|
|
202
|
-
const [sig, index] = this.singleSignMultisig(secretKey, this.
|
|
203
|
-
this.
|
|
234
|
+
const [sig, index] = this.singleSignMultisig(secretKey, this.lmsig);
|
|
235
|
+
this.lmsig.subsig[index].s = sig;
|
|
204
236
|
}
|
|
205
237
|
}
|
|
206
238
|
|
|
@@ -209,11 +241,11 @@ export class LogicSig implements encoding.Encodable {
|
|
|
209
241
|
* @param secretKey - Secret key to sign with
|
|
210
242
|
*/
|
|
211
243
|
appendToMultisig(secretKey: Uint8Array) {
|
|
212
|
-
if (this.
|
|
244
|
+
if (this.lmsig === undefined) {
|
|
213
245
|
throw new Error('no multisig present');
|
|
214
246
|
}
|
|
215
|
-
const [sig, index] = this.singleSignMultisig(secretKey, this.
|
|
216
|
-
this.
|
|
247
|
+
const [sig, index] = this.singleSignMultisig(secretKey, this.lmsig);
|
|
248
|
+
this.lmsig.subsig[index].s = sig;
|
|
217
249
|
}
|
|
218
250
|
|
|
219
251
|
signProgram(secretKey: Uint8Array) {
|
|
@@ -222,6 +254,21 @@ export class LogicSig implements encoding.Encodable {
|
|
|
222
254
|
return sig;
|
|
223
255
|
}
|
|
224
256
|
|
|
257
|
+
signProgramMultisig(secretKey: Uint8Array, msig: EncodedMultisig) {
|
|
258
|
+
const multisigAddr = addressFromMultisigPreImg({
|
|
259
|
+
version: msig.v,
|
|
260
|
+
threshold: msig.thr,
|
|
261
|
+
pks: msig.subsig.map((subsig) => subsig.pk),
|
|
262
|
+
});
|
|
263
|
+
const toBeSigned = utils.concatArrays(
|
|
264
|
+
multisigProgramTag,
|
|
265
|
+
multisigAddr.publicKey,
|
|
266
|
+
this.logic
|
|
267
|
+
);
|
|
268
|
+
const sig = nacl.sign(toBeSigned, secretKey);
|
|
269
|
+
return sig;
|
|
270
|
+
}
|
|
271
|
+
|
|
225
272
|
singleSignMultisig(
|
|
226
273
|
secretKey: Uint8Array,
|
|
227
274
|
msig: EncodedMultisig
|
|
@@ -238,7 +285,7 @@ export class LogicSig implements encoding.Encodable {
|
|
|
238
285
|
if (index === -1) {
|
|
239
286
|
throw new Error('invalid secret key');
|
|
240
287
|
}
|
|
241
|
-
const sig = this.
|
|
288
|
+
const sig = this.signProgramMultisig(secretKey, msig);
|
|
242
289
|
return [sig, index];
|
|
243
290
|
}
|
|
244
291
|
|
|
@@ -332,7 +379,7 @@ export class LogicSigAccount implements encoding.Encodable {
|
|
|
332
379
|
* To verify the delegation signature, use `verify`.
|
|
333
380
|
*/
|
|
334
381
|
isDelegated() {
|
|
335
|
-
return !!(this.lsig.sig || this.lsig.msig);
|
|
382
|
+
return !!(this.lsig.sig || this.lsig.msig || this.lsig.lmsig);
|
|
336
383
|
}
|
|
337
384
|
|
|
338
385
|
/**
|
|
@@ -354,9 +401,12 @@ export class LogicSigAccount implements encoding.Encodable {
|
|
|
354
401
|
* escrow address that is the hash of the LogicSig's program code.
|
|
355
402
|
*/
|
|
356
403
|
address(): Address {
|
|
357
|
-
|
|
404
|
+
const sigCount = [this.lsig.sig, this.lsig.msig, this.lsig.lmsig].filter(
|
|
405
|
+
Boolean
|
|
406
|
+
).length;
|
|
407
|
+
if (sigCount > 1) {
|
|
358
408
|
throw new Error(
|
|
359
|
-
'LogicSig has too many signatures. At most one of sig or
|
|
409
|
+
'LogicSig has too many signatures. At most one of sig, msig, or lmsig may be present'
|
|
360
410
|
);
|
|
361
411
|
}
|
|
362
412
|
|
|
@@ -367,11 +417,12 @@ export class LogicSigAccount implements encoding.Encodable {
|
|
|
367
417
|
return new Address(this.sigkey);
|
|
368
418
|
}
|
|
369
419
|
|
|
370
|
-
|
|
420
|
+
const msig = this.lsig.lmsig || this.lsig.msig;
|
|
421
|
+
if (msig) {
|
|
371
422
|
const msigMetadata = {
|
|
372
|
-
version:
|
|
373
|
-
threshold:
|
|
374
|
-
pks:
|
|
423
|
+
version: msig.v,
|
|
424
|
+
threshold: msig.thr,
|
|
425
|
+
pks: msig.subsig.map((subsig) => subsig.pk),
|
|
375
426
|
};
|
|
376
427
|
return addressFromMultisigPreImg(msigMetadata);
|
|
377
428
|
}
|
package/src/makeTxn.ts
CHANGED
|
@@ -9,8 +9,10 @@ import {
|
|
|
9
9
|
AssetTransferTransactionParams,
|
|
10
10
|
AssetFreezeTransactionParams,
|
|
11
11
|
ApplicationCallTransactionParams,
|
|
12
|
+
ApplicationCallReferenceParams,
|
|
12
13
|
} from './types/transactions/base.js';
|
|
13
14
|
import { Address } from './encoding/address.js';
|
|
15
|
+
import { foreignArraysToResourceReferences } from './appAccess.js';
|
|
14
16
|
|
|
15
17
|
/** Contains parameters common to every transaction type */
|
|
16
18
|
export interface CommonTransactionParams {
|
|
@@ -397,6 +399,10 @@ export function makeApplicationCallTxnFromObject({
|
|
|
397
399
|
foreignApps,
|
|
398
400
|
foreignAssets,
|
|
399
401
|
boxes,
|
|
402
|
+
convertToAccess,
|
|
403
|
+
holdings,
|
|
404
|
+
locals,
|
|
405
|
+
access,
|
|
400
406
|
approvalProgram,
|
|
401
407
|
clearProgram,
|
|
402
408
|
numLocalInts,
|
|
@@ -404,14 +410,35 @@ export function makeApplicationCallTxnFromObject({
|
|
|
404
410
|
numGlobalInts,
|
|
405
411
|
numGlobalByteSlices,
|
|
406
412
|
extraPages,
|
|
413
|
+
rejectVersion,
|
|
407
414
|
note,
|
|
408
415
|
lease,
|
|
409
416
|
rekeyTo,
|
|
410
417
|
suggestedParams,
|
|
411
|
-
}: ApplicationCallTransactionParams &
|
|
418
|
+
}: ApplicationCallTransactionParams &
|
|
419
|
+
CommonTransactionParams &
|
|
420
|
+
ApplicationCallReferenceParams): Transaction {
|
|
412
421
|
if (onComplete == null) {
|
|
413
422
|
throw Error('onComplete must be provided');
|
|
414
423
|
}
|
|
424
|
+
if (
|
|
425
|
+
access &&
|
|
426
|
+
(accounts || foreignApps || foreignAssets || boxes || holdings || locals)
|
|
427
|
+
) {
|
|
428
|
+
throw Error('cannot specify both access and other access fields');
|
|
429
|
+
}
|
|
430
|
+
let access2 = access;
|
|
431
|
+
if (convertToAccess) {
|
|
432
|
+
access2 = foreignArraysToResourceReferences({
|
|
433
|
+
appIndex,
|
|
434
|
+
accounts,
|
|
435
|
+
foreignApps,
|
|
436
|
+
foreignAssets,
|
|
437
|
+
holdings,
|
|
438
|
+
locals,
|
|
439
|
+
boxes,
|
|
440
|
+
});
|
|
441
|
+
}
|
|
415
442
|
return new Transaction({
|
|
416
443
|
type: TransactionType.appl,
|
|
417
444
|
sender,
|
|
@@ -423,10 +450,12 @@ export function makeApplicationCallTxnFromObject({
|
|
|
423
450
|
appIndex,
|
|
424
451
|
onComplete,
|
|
425
452
|
appArgs,
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
453
|
+
// Only pass legacy foreign arrays if access is not provided
|
|
454
|
+
accounts: access2 ? undefined : accounts,
|
|
455
|
+
foreignAssets: access2 ? undefined : foreignAssets,
|
|
456
|
+
foreignApps: access2 ? undefined : foreignApps,
|
|
457
|
+
boxes: access2 ? undefined : boxes,
|
|
458
|
+
access: access2,
|
|
430
459
|
approvalProgram,
|
|
431
460
|
clearProgram,
|
|
432
461
|
numLocalInts,
|
|
@@ -434,6 +463,7 @@ export function makeApplicationCallTxnFromObject({
|
|
|
434
463
|
numGlobalInts,
|
|
435
464
|
numGlobalByteSlices,
|
|
436
465
|
extraPages,
|
|
466
|
+
rejectVersion,
|
|
437
467
|
},
|
|
438
468
|
});
|
|
439
469
|
}
|
|
@@ -451,6 +481,10 @@ export function makeApplicationCreateTxnFromObject({
|
|
|
451
481
|
foreignApps,
|
|
452
482
|
foreignAssets,
|
|
453
483
|
boxes,
|
|
484
|
+
convertToAccess,
|
|
485
|
+
holdings,
|
|
486
|
+
locals,
|
|
487
|
+
access,
|
|
454
488
|
approvalProgram,
|
|
455
489
|
clearProgram,
|
|
456
490
|
numLocalInts,
|
|
@@ -469,7 +503,8 @@ export function makeApplicationCreateTxnFromObject({
|
|
|
469
503
|
Required<
|
|
470
504
|
Pick<ApplicationCallTransactionParams, 'approvalProgram' | 'clearProgram'>
|
|
471
505
|
> &
|
|
472
|
-
CommonTransactionParams
|
|
506
|
+
CommonTransactionParams &
|
|
507
|
+
ApplicationCallReferenceParams): Transaction {
|
|
473
508
|
if (!approvalProgram || !clearProgram) {
|
|
474
509
|
throw Error('approvalProgram and clearProgram must be provided');
|
|
475
510
|
}
|
|
@@ -485,6 +520,10 @@ export function makeApplicationCreateTxnFromObject({
|
|
|
485
520
|
foreignApps,
|
|
486
521
|
foreignAssets,
|
|
487
522
|
boxes,
|
|
523
|
+
convertToAccess,
|
|
524
|
+
holdings,
|
|
525
|
+
locals,
|
|
526
|
+
access,
|
|
488
527
|
approvalProgram,
|
|
489
528
|
clearProgram,
|
|
490
529
|
numLocalInts,
|
|
@@ -512,6 +551,10 @@ export function makeApplicationUpdateTxnFromObject({
|
|
|
512
551
|
foreignApps,
|
|
513
552
|
foreignAssets,
|
|
514
553
|
boxes,
|
|
554
|
+
convertToAccess,
|
|
555
|
+
holdings,
|
|
556
|
+
locals,
|
|
557
|
+
access,
|
|
515
558
|
approvalProgram,
|
|
516
559
|
clearProgram,
|
|
517
560
|
note,
|
|
@@ -532,7 +575,8 @@ export function makeApplicationUpdateTxnFromObject({
|
|
|
532
575
|
Required<
|
|
533
576
|
Pick<ApplicationCallTransactionParams, 'approvalProgram' | 'clearProgram'>
|
|
534
577
|
> &
|
|
535
|
-
CommonTransactionParams
|
|
578
|
+
CommonTransactionParams &
|
|
579
|
+
ApplicationCallReferenceParams): Transaction {
|
|
536
580
|
if (!appIndex) {
|
|
537
581
|
throw Error('appIndex must be provided');
|
|
538
582
|
}
|
|
@@ -548,6 +592,10 @@ export function makeApplicationUpdateTxnFromObject({
|
|
|
548
592
|
foreignApps,
|
|
549
593
|
foreignAssets,
|
|
550
594
|
boxes,
|
|
595
|
+
convertToAccess,
|
|
596
|
+
holdings,
|
|
597
|
+
locals,
|
|
598
|
+
access,
|
|
551
599
|
approvalProgram,
|
|
552
600
|
clearProgram,
|
|
553
601
|
note,
|
|
@@ -570,6 +618,10 @@ export function makeApplicationDeleteTxnFromObject({
|
|
|
570
618
|
foreignApps,
|
|
571
619
|
foreignAssets,
|
|
572
620
|
boxes,
|
|
621
|
+
convertToAccess,
|
|
622
|
+
holdings,
|
|
623
|
+
locals,
|
|
624
|
+
access,
|
|
573
625
|
note,
|
|
574
626
|
lease,
|
|
575
627
|
rekeyTo,
|
|
@@ -585,7 +637,8 @@ export function makeApplicationDeleteTxnFromObject({
|
|
|
585
637
|
| 'approvalProgram'
|
|
586
638
|
| 'clearProgram'
|
|
587
639
|
> &
|
|
588
|
-
CommonTransactionParams
|
|
640
|
+
CommonTransactionParams &
|
|
641
|
+
ApplicationCallReferenceParams): Transaction {
|
|
589
642
|
if (!appIndex) {
|
|
590
643
|
throw Error('appIndex must be provided');
|
|
591
644
|
}
|
|
@@ -598,6 +651,10 @@ export function makeApplicationDeleteTxnFromObject({
|
|
|
598
651
|
foreignApps,
|
|
599
652
|
foreignAssets,
|
|
600
653
|
boxes,
|
|
654
|
+
convertToAccess,
|
|
655
|
+
holdings,
|
|
656
|
+
locals,
|
|
657
|
+
access,
|
|
601
658
|
note,
|
|
602
659
|
lease,
|
|
603
660
|
rekeyTo,
|
|
@@ -618,6 +675,10 @@ export function makeApplicationOptInTxnFromObject({
|
|
|
618
675
|
foreignApps,
|
|
619
676
|
foreignAssets,
|
|
620
677
|
boxes,
|
|
678
|
+
convertToAccess,
|
|
679
|
+
holdings,
|
|
680
|
+
locals,
|
|
681
|
+
access,
|
|
621
682
|
note,
|
|
622
683
|
lease,
|
|
623
684
|
rekeyTo,
|
|
@@ -633,7 +694,8 @@ export function makeApplicationOptInTxnFromObject({
|
|
|
633
694
|
| 'approvalProgram'
|
|
634
695
|
| 'clearProgram'
|
|
635
696
|
> &
|
|
636
|
-
CommonTransactionParams
|
|
697
|
+
CommonTransactionParams &
|
|
698
|
+
ApplicationCallReferenceParams): Transaction {
|
|
637
699
|
if (!appIndex) {
|
|
638
700
|
throw Error('appIndex must be provided');
|
|
639
701
|
}
|
|
@@ -647,6 +709,10 @@ export function makeApplicationOptInTxnFromObject({
|
|
|
647
709
|
foreignAssets,
|
|
648
710
|
boxes,
|
|
649
711
|
note,
|
|
712
|
+
convertToAccess,
|
|
713
|
+
holdings,
|
|
714
|
+
locals,
|
|
715
|
+
access,
|
|
650
716
|
lease,
|
|
651
717
|
rekeyTo,
|
|
652
718
|
suggestedParams,
|
|
@@ -666,6 +732,10 @@ export function makeApplicationCloseOutTxnFromObject({
|
|
|
666
732
|
foreignApps,
|
|
667
733
|
foreignAssets,
|
|
668
734
|
boxes,
|
|
735
|
+
convertToAccess,
|
|
736
|
+
holdings,
|
|
737
|
+
locals,
|
|
738
|
+
access,
|
|
669
739
|
note,
|
|
670
740
|
lease,
|
|
671
741
|
rekeyTo,
|
|
@@ -681,7 +751,8 @@ export function makeApplicationCloseOutTxnFromObject({
|
|
|
681
751
|
| 'approvalProgram'
|
|
682
752
|
| 'clearProgram'
|
|
683
753
|
> &
|
|
684
|
-
CommonTransactionParams
|
|
754
|
+
CommonTransactionParams &
|
|
755
|
+
ApplicationCallReferenceParams): Transaction {
|
|
685
756
|
if (!appIndex) {
|
|
686
757
|
throw Error('appIndex must be provided');
|
|
687
758
|
}
|
|
@@ -694,6 +765,10 @@ export function makeApplicationCloseOutTxnFromObject({
|
|
|
694
765
|
foreignApps,
|
|
695
766
|
foreignAssets,
|
|
696
767
|
boxes,
|
|
768
|
+
convertToAccess,
|
|
769
|
+
holdings,
|
|
770
|
+
locals,
|
|
771
|
+
access,
|
|
697
772
|
note,
|
|
698
773
|
lease,
|
|
699
774
|
rekeyTo,
|
|
@@ -714,6 +789,10 @@ export function makeApplicationClearStateTxnFromObject({
|
|
|
714
789
|
foreignApps,
|
|
715
790
|
foreignAssets,
|
|
716
791
|
boxes,
|
|
792
|
+
convertToAccess,
|
|
793
|
+
holdings,
|
|
794
|
+
locals,
|
|
795
|
+
access,
|
|
717
796
|
note,
|
|
718
797
|
lease,
|
|
719
798
|
rekeyTo,
|
|
@@ -729,7 +808,8 @@ export function makeApplicationClearStateTxnFromObject({
|
|
|
729
808
|
| 'approvalProgram'
|
|
730
809
|
| 'clearProgram'
|
|
731
810
|
> &
|
|
732
|
-
CommonTransactionParams
|
|
811
|
+
CommonTransactionParams &
|
|
812
|
+
ApplicationCallReferenceParams): Transaction {
|
|
733
813
|
if (!appIndex) {
|
|
734
814
|
throw Error('appIndex must be provided');
|
|
735
815
|
}
|
|
@@ -742,6 +822,10 @@ export function makeApplicationClearStateTxnFromObject({
|
|
|
742
822
|
foreignApps,
|
|
743
823
|
foreignAssets,
|
|
744
824
|
boxes,
|
|
825
|
+
convertToAccess,
|
|
826
|
+
holdings,
|
|
827
|
+
locals,
|
|
828
|
+
access,
|
|
745
829
|
note,
|
|
746
830
|
lease,
|
|
747
831
|
rekeyTo,
|
|
@@ -762,6 +846,10 @@ export function makeApplicationNoOpTxnFromObject({
|
|
|
762
846
|
foreignApps,
|
|
763
847
|
foreignAssets,
|
|
764
848
|
boxes,
|
|
849
|
+
convertToAccess,
|
|
850
|
+
holdings,
|
|
851
|
+
locals,
|
|
852
|
+
access,
|
|
765
853
|
note,
|
|
766
854
|
lease,
|
|
767
855
|
rekeyTo,
|
|
@@ -777,7 +865,8 @@ export function makeApplicationNoOpTxnFromObject({
|
|
|
777
865
|
| 'approvalProgram'
|
|
778
866
|
| 'clearProgram'
|
|
779
867
|
> &
|
|
780
|
-
CommonTransactionParams
|
|
868
|
+
CommonTransactionParams &
|
|
869
|
+
ApplicationCallReferenceParams): Transaction {
|
|
781
870
|
if (!appIndex) {
|
|
782
871
|
throw Error('appIndex must be provided');
|
|
783
872
|
}
|
|
@@ -790,6 +879,10 @@ export function makeApplicationNoOpTxnFromObject({
|
|
|
790
879
|
foreignApps,
|
|
791
880
|
foreignAssets,
|
|
792
881
|
boxes,
|
|
882
|
+
convertToAccess,
|
|
883
|
+
holdings,
|
|
884
|
+
locals,
|
|
885
|
+
access,
|
|
793
886
|
note,
|
|
794
887
|
lease,
|
|
795
888
|
rekeyTo,
|
package/src/signing.ts
CHANGED
|
@@ -62,11 +62,11 @@ export function signLogicSigTransactionObject(
|
|
|
62
62
|
// delegating account is the sender. If that's not the case, the signing
|
|
63
63
|
// will fail.
|
|
64
64
|
lsigAddress = new Address(txn.sender.publicKey);
|
|
65
|
-
} else if (lsig.
|
|
65
|
+
} else if (lsig.lmsig) {
|
|
66
66
|
const msigMetadata = {
|
|
67
|
-
version: lsig.
|
|
68
|
-
threshold: lsig.
|
|
69
|
-
pks: lsig.
|
|
67
|
+
version: lsig.lmsig.v,
|
|
68
|
+
threshold: lsig.lmsig.thr,
|
|
69
|
+
pks: lsig.lmsig.subsig.map((subsig) => subsig.pk),
|
|
70
70
|
};
|
|
71
71
|
lsigAddress = addressFromMultisigPreImg(msigMetadata);
|
|
72
72
|
} else {
|