@algorandfoundation/algorand-typescript-testing 1.0.0-alpha.7 → 1.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.
- package/impl/crypto.d.ts +5 -5
- package/impl/pure.d.ts +2 -2
- package/index.mjs +5 -5
- package/index.mjs.map +1 -1
- package/package.json +3 -3
- package/runtime-helpers-C_HAST0y.js.map +1 -1
- package/test-transformer/index.mjs +125 -44
- package/test-transformer/index.mjs.map +1 -1
- package/test-transformer/node-factory.d.ts +1 -0
- package/test-transformer/supported-binary-op-string.d.ts +1 -0
- package/typescript-helpers.d.ts +3 -0
package/impl/crypto.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { bytes, internal } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { bytes, Ecdsa, internal, VrfVerify } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
export declare const sha256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
3
3
|
export declare const sha3_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
4
|
export declare const keccak256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
5
5
|
export declare const sha512_256: (a: internal.primitives.StubBytesCompat) => bytes;
|
|
6
6
|
export declare const ed25519verifyBare: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
7
7
|
export declare const ed25519verify: (a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat) => boolean;
|
|
8
|
-
export declare const ecdsaVerify: (v:
|
|
9
|
-
export declare const ecdsaPkRecover: (v:
|
|
10
|
-
export declare const ecdsaPkDecompress: (v:
|
|
11
|
-
export declare const vrfVerify: (_s:
|
|
8
|
+
export declare const ecdsaVerify: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubBytesCompat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat, e: internal.primitives.StubBytesCompat) => boolean;
|
|
9
|
+
export declare const ecdsaPkRecover: (v: Ecdsa, a: internal.primitives.StubBytesCompat, b: internal.primitives.StubUint64Compat, c: internal.primitives.StubBytesCompat, d: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
10
|
+
export declare const ecdsaPkDecompress: (v: Ecdsa, a: internal.primitives.StubBytesCompat) => readonly [bytes, bytes];
|
|
11
|
+
export declare const vrfVerify: (_s: VrfVerify, _a: internal.primitives.StubBytesCompat, _b: internal.primitives.StubBytesCompat, _c: internal.primitives.StubBytesCompat) => readonly [bytes, boolean];
|
|
12
12
|
export declare const EllipticCurve: internal.opTypes.EllipticCurveType;
|
package/impl/pure.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { biguint, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { Base64, biguint, bytes, internal, uint64 } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
export declare const addw: (a: internal.primitives.StubUint64Compat, b: internal.primitives.StubUint64Compat) => readonly [uint64, uint64];
|
|
3
|
-
export declare const base64Decode: (e:
|
|
3
|
+
export declare const base64Decode: (e: Base64, a: internal.primitives.StubBytesCompat) => bytes;
|
|
4
4
|
export declare const bitLength: (a: internal.primitives.StubUint64Compat | internal.primitives.StubBytesCompat) => uint64;
|
|
5
5
|
export declare const bsqrt: (a: internal.primitives.StubBigUintCompat) => biguint;
|
|
6
6
|
export declare const btoi: (a: internal.primitives.StubBytesCompat) => uint64;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { internal, Bytes, Uint64, Account, arc4, op, TransactionType, Asset, Application, BigUint, BaseContract, Contract } from '@algorandfoundation/algorand-typescript';
|
|
1
|
+
import { internal, Bytes, Uint64, Account, Ecdsa, arc4, op, Base64, TransactionType, Asset, Application, BigUint, BaseContract, Contract } from '@algorandfoundation/algorand-typescript';
|
|
2
2
|
import algosdk from 'algosdk';
|
|
3
3
|
import { a as asMaybeUint64Cls, b as asUint64, c as asBytes, d as asNumber, M as MAX_BOX_SIZE, t as toBytes, e as asBytesCls, f as asUint8Array, g as conactUint8Arrays, L as LOGIC_DATA_PREFIX, h as asBigInt, i as getObjectReference, j as MIN_TXN_FEE, D as DEFAULT_ACCOUNT_MIN_BALANCE, k as DEFAULT_MAX_TXN_LIFE, Z as ZERO_ADDRESS, l as DEFAULT_ASSET_CREATE_MIN_BALANCE, m as DEFAULT_ASSET_OPT_IN_MIN_BALANCE, n as DEFAULT_GLOBAL_GENESIS_HASH, o as asUint64Cls, p as asMaybeBytesCls, q as asBigUint, B as BITS_IN_BYTE, r as MAX_BYTES_SIZE, s as MAX_UINT8, u as binaryStringToBytes, U as UINT64_SIZE, v as MAX_UINT64, w as Uint64BackedCls, A as ALWAYS_APPROVE_TEAL_PROGRAM, x as BytesBackedCls, y as combineIntoMaxBytePages, z as MAX_ITEMS_IN_LOG, C as ABI_RETURN_VALUE_LOG_PREFIX, E as getRandomBytes, F as getGenericTypeInfo, G as getAbiMetadata, H as iterBigInt, I as getRandomBigInt, J as captureMethodConfig } from './runtime-helpers-C_HAST0y.js';
|
|
4
4
|
import { ec } from 'elliptic';
|
|
@@ -554,7 +554,7 @@ const ecdsaVerify = (v, a, b, c, d, e) => {
|
|
|
554
554
|
return keyPair.verify(dataBytes.asUint8Array(), { r: sigRBytes.asUint8Array(), s: sigSBytes.asUint8Array() });
|
|
555
555
|
};
|
|
556
556
|
const ecdsaPkRecover = (v, a, b, c, d) => {
|
|
557
|
-
if (v !==
|
|
557
|
+
if (v !== Ecdsa.Secp256k1) {
|
|
558
558
|
internal.errors.internalError(`Unsupported ECDSA curve: ${v}`);
|
|
559
559
|
}
|
|
560
560
|
const dataBytes = internal.primitives.BytesCls.fromCompat(a);
|
|
@@ -585,8 +585,8 @@ const EllipticCurve = new Proxy({}, {
|
|
|
585
585
|
},
|
|
586
586
|
});
|
|
587
587
|
const curveMap = {
|
|
588
|
-
[
|
|
589
|
-
[
|
|
588
|
+
[Ecdsa.Secp256k1]: 'secp256k1',
|
|
589
|
+
[Ecdsa.Secp256r1]: 'p256',
|
|
590
590
|
};
|
|
591
591
|
|
|
592
592
|
class GlobalData {
|
|
@@ -1778,7 +1778,7 @@ const addw = (a, b) => {
|
|
|
1778
1778
|
return toUint128(sum);
|
|
1779
1779
|
};
|
|
1780
1780
|
const base64Decode = (e, a) => {
|
|
1781
|
-
const encoding = e ===
|
|
1781
|
+
const encoding = e === Base64.StdEncoding ? 'base64' : 'base64url';
|
|
1782
1782
|
const bytesValue = internal.primitives.BytesCls.fromCompat(a);
|
|
1783
1783
|
const stringValue = bytesValue.toString();
|
|
1784
1784
|
const bufferResult = Buffer.from(stringValue, encoding);
|