@tonappchain/sdk 0.9.0-rc1 → 0.9.0-rc3
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/dist/artifacts/mainnet/ton/internal/wrappers/NFTCollection.d.ts +4 -4
- package/dist/artifacts/testnet/ton/internal/wrappers/NFTCollection.d.ts +4 -4
- package/dist/esm/src/index.mjs +1119 -245
- package/dist/src/accountAbstraction/BaseAccountAPI.d.ts +62 -0
- package/dist/src/accountAbstraction/BaseAccountAPI.js +163 -0
- package/dist/src/accountAbstraction/Ed25519.d.ts +47 -0
- package/dist/src/accountAbstraction/Ed25519.js +100 -0
- package/dist/src/accountAbstraction/HttpRpcClient.d.ts +26 -0
- package/dist/src/accountAbstraction/HttpRpcClient.js +45 -0
- package/dist/src/accountAbstraction/PaymasterAPI.d.ts +21 -0
- package/dist/src/accountAbstraction/PaymasterAPI.js +18 -0
- package/dist/src/accountAbstraction/Permit2.d.ts +37 -0
- package/dist/src/accountAbstraction/Permit2.js +41 -0
- package/dist/src/accountAbstraction/PermitFlow.d.ts +43 -0
- package/dist/src/accountAbstraction/PermitFlow.js +80 -0
- package/dist/src/accountAbstraction/TacAccountAPI.d.ts +53 -0
- package/dist/src/accountAbstraction/TacAccountAPI.js +84 -0
- package/dist/src/accountAbstraction/TacAccountSdk.d.ts +101 -0
- package/dist/src/accountAbstraction/TacAccountSdk.js +163 -0
- package/dist/src/accountAbstraction/TacERC20PaymasterAPI.d.ts +59 -0
- package/dist/src/accountAbstraction/TacERC20PaymasterAPI.js +88 -0
- package/dist/src/accountAbstraction/TransactionDetailsForUserOp.d.ts +10 -0
- package/dist/src/accountAbstraction/TransactionDetailsForUserOp.js +2 -0
- package/dist/src/accountAbstraction/abi.d.ts +3 -0
- package/dist/src/accountAbstraction/abi.js +32 -0
- package/dist/src/accountAbstraction/index.d.ts +24 -0
- package/dist/src/accountAbstraction/index.js +44 -0
- package/dist/src/accountAbstraction/internal/entryPointAbi.d.ts +1 -0
- package/dist/src/accountAbstraction/internal/entryPointAbi.js +16 -0
- package/dist/src/accountAbstraction/internal/userOp.d.ts +54 -0
- package/dist/src/accountAbstraction/internal/userOp.js +72 -0
- package/dist/src/accountAbstraction/networks.d.ts +22 -0
- package/dist/src/accountAbstraction/networks.js +20 -0
- package/dist/src/accountAbstraction/signer.d.ts +12 -0
- package/dist/src/accountAbstraction/signer.js +14 -0
- package/dist/src/adapters/LiteClientOpener.js +12 -1
- package/dist/src/adapters/SandboxOpener.d.ts +1 -1
- package/dist/src/adapters/SandboxOpener.js +20 -1
- package/dist/src/adapters/TonClient4Opener.js +15 -1
- package/dist/src/adapters/TonClientOpener.js +14 -1
- package/dist/src/assets/FT.d.ts +4 -2
- package/dist/src/assets/FT.js +26 -13
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.js +1 -0
- package/dist/src/interfaces/ContractOpener.d.ts +1 -0
- package/dist/src/sender/BatchSender.js +2 -1
- package/dist/src/structs/InternalStruct.d.ts +5 -0
- package/dist/src/wrappers/HighloadQueryId.d.ts +2 -0
- package/dist/src/wrappers/HighloadQueryId.js +7 -6
- package/dist/src/wrappers/HighloadWalletV3.d.ts +6 -0
- package/dist/src/wrappers/HighloadWalletV3.js +16 -2
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Minimal human-readable ABIs for TAC account-abstraction contracts. Kept in sync
|
|
3
|
+
// with aa-contracts#tac:
|
|
4
|
+
// contracts/accounts/TacAccount.sol
|
|
5
|
+
// contracts/accounts/TacAccountFactory.sol
|
|
6
|
+
// contracts/accounts/TacBaseAccount.sol (execute / executeBatch surface)
|
|
7
|
+
// contracts/paymaster/TacERC20Paymaster.sol (read surface for SDK clients)
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.TacERC20PaymasterABI = exports.TacAccountABI = exports.TacAccountFactoryABI = void 0;
|
|
10
|
+
exports.TacAccountFactoryABI = [
|
|
11
|
+
'function getOrCreateAccount(bytes32 publicKey) external returns (address)',
|
|
12
|
+
'function getAccountAddress(bytes32 publicKey) public view returns (address)',
|
|
13
|
+
];
|
|
14
|
+
exports.TacAccountABI = [
|
|
15
|
+
// From TacBaseAccount (execute surface)
|
|
16
|
+
'function execute(address target, uint256 value, bytes calldata data) external',
|
|
17
|
+
'function executeBatch(tuple(address target, uint256 value, bytes data)[] calls) external',
|
|
18
|
+
// From IAccount + TacBaseAccount
|
|
19
|
+
'function getNonce() public view returns (uint256)',
|
|
20
|
+
'function getNonce(uint192 key) public view returns (uint256)',
|
|
21
|
+
// From TacAccount
|
|
22
|
+
'function publicKey() public view returns (bytes32)',
|
|
23
|
+
'function entryPoint() public view returns (address)',
|
|
24
|
+
];
|
|
25
|
+
exports.TacERC20PaymasterABI = [
|
|
26
|
+
'function token() public view returns (address)',
|
|
27
|
+
'function tacPermit2() public view returns (address)',
|
|
28
|
+
'function priceMarkup() public view returns (uint32)',
|
|
29
|
+
'function refundPostOpCost() public view returns (uint256)',
|
|
30
|
+
'function internalBalance(address account) public view returns (uint256)',
|
|
31
|
+
'function getPrice() public view returns (uint192)',
|
|
32
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export { TacAccountABI, TacAccountFactoryABI, TacERC20PaymasterABI } from './abi';
|
|
2
|
+
export type { BaseApiParams, UserOpResult } from './BaseAccountAPI';
|
|
3
|
+
export { BaseAccountAPI } from './BaseAccountAPI';
|
|
4
|
+
export type { Ed25519Signature, Ed25519Signer, TonConnectSignedParts, TonConnectSigner } from './Ed25519';
|
|
5
|
+
export { buildPermitBinding, ed25519SignerFromSecretKey, packPermit2InnerSignature, packPermitBoundUserOpSignature, packRawEd25519Signature, packTonConnectPermit2InnerSignature, packTonConnectUserOpSignature, } from './Ed25519';
|
|
6
|
+
export { HttpRpcClient } from './HttpRpcClient';
|
|
7
|
+
export type { UserOperation } from './internal/userOp';
|
|
8
|
+
export type { AaAddresses, AaNetworkConfig } from './networks';
|
|
9
|
+
export { AA_NETWORKS } from './networks';
|
|
10
|
+
export type { PaymasterParams } from './PaymasterAPI';
|
|
11
|
+
export { PaymasterAPI } from './PaymasterAPI';
|
|
12
|
+
export type { Permit2TokenPermission, PermitBatchTransferFromInput, PermitBatchTransferFromTuple } from './Permit2';
|
|
13
|
+
export { buildPermitMessage, packPermitData, packPermitPaymasterData } from './Permit2';
|
|
14
|
+
export type { BuildPermitUserOpInput, BuildPermitUserOpInputTonConnect } from './PermitFlow';
|
|
15
|
+
export { buildSignedUserOpWithPermit, buildSignedUserOpWithPermitTonConnect } from './PermitFlow';
|
|
16
|
+
export type { AaSignerResult } from './signer';
|
|
17
|
+
export { aaSignerFromMnemonic } from './signer';
|
|
18
|
+
export type { TacAccountApiParams } from './TacAccountAPI';
|
|
19
|
+
export { TacAccountAPI } from './TacAccountAPI';
|
|
20
|
+
export type { PermitOptions, SendTx, TacAccountSdkParams, UserOpReceipt, UserOpSendResult, } from './TacAccountSdk';
|
|
21
|
+
export { TacAccountSdk } from './TacAccountSdk';
|
|
22
|
+
export type { TacERC20PaymasterApiParams } from './TacERC20PaymasterAPI';
|
|
23
|
+
export { packModeByte, packPaymasterAndData, TacERC20PaymasterAPI, TacPaymasterMode } from './TacERC20PaymasterAPI';
|
|
24
|
+
export type { TransactionDetailsForUserOp } from './TransactionDetailsForUserOp';
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// TAC account-abstraction (ERC-4337) client — native ethers v6.
|
|
3
|
+
// Drive a TAC smart account from a TON Ed25519 key: build + sign UserOperations,
|
|
4
|
+
// send them to the bundler, and pay gas natively or in an ERC-20 via the paymaster.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TacPaymasterMode = exports.TacERC20PaymasterAPI = exports.packPaymasterAndData = exports.packModeByte = exports.TacAccountSdk = exports.TacAccountAPI = exports.aaSignerFromMnemonic = exports.buildSignedUserOpWithPermitTonConnect = exports.buildSignedUserOpWithPermit = exports.packPermitPaymasterData = exports.packPermitData = exports.buildPermitMessage = exports.PaymasterAPI = exports.AA_NETWORKS = exports.HttpRpcClient = exports.packTonConnectUserOpSignature = exports.packTonConnectPermit2InnerSignature = exports.packRawEd25519Signature = exports.packPermitBoundUserOpSignature = exports.packPermit2InnerSignature = exports.ed25519SignerFromSecretKey = exports.buildPermitBinding = exports.BaseAccountAPI = exports.TacERC20PaymasterABI = exports.TacAccountFactoryABI = exports.TacAccountABI = void 0;
|
|
7
|
+
var abi_1 = require("./abi");
|
|
8
|
+
Object.defineProperty(exports, "TacAccountABI", { enumerable: true, get: function () { return abi_1.TacAccountABI; } });
|
|
9
|
+
Object.defineProperty(exports, "TacAccountFactoryABI", { enumerable: true, get: function () { return abi_1.TacAccountFactoryABI; } });
|
|
10
|
+
Object.defineProperty(exports, "TacERC20PaymasterABI", { enumerable: true, get: function () { return abi_1.TacERC20PaymasterABI; } });
|
|
11
|
+
var BaseAccountAPI_1 = require("./BaseAccountAPI");
|
|
12
|
+
Object.defineProperty(exports, "BaseAccountAPI", { enumerable: true, get: function () { return BaseAccountAPI_1.BaseAccountAPI; } });
|
|
13
|
+
var Ed25519_1 = require("./Ed25519");
|
|
14
|
+
Object.defineProperty(exports, "buildPermitBinding", { enumerable: true, get: function () { return Ed25519_1.buildPermitBinding; } });
|
|
15
|
+
Object.defineProperty(exports, "ed25519SignerFromSecretKey", { enumerable: true, get: function () { return Ed25519_1.ed25519SignerFromSecretKey; } });
|
|
16
|
+
Object.defineProperty(exports, "packPermit2InnerSignature", { enumerable: true, get: function () { return Ed25519_1.packPermit2InnerSignature; } });
|
|
17
|
+
Object.defineProperty(exports, "packPermitBoundUserOpSignature", { enumerable: true, get: function () { return Ed25519_1.packPermitBoundUserOpSignature; } });
|
|
18
|
+
Object.defineProperty(exports, "packRawEd25519Signature", { enumerable: true, get: function () { return Ed25519_1.packRawEd25519Signature; } });
|
|
19
|
+
Object.defineProperty(exports, "packTonConnectPermit2InnerSignature", { enumerable: true, get: function () { return Ed25519_1.packTonConnectPermit2InnerSignature; } });
|
|
20
|
+
Object.defineProperty(exports, "packTonConnectUserOpSignature", { enumerable: true, get: function () { return Ed25519_1.packTonConnectUserOpSignature; } });
|
|
21
|
+
var HttpRpcClient_1 = require("./HttpRpcClient");
|
|
22
|
+
Object.defineProperty(exports, "HttpRpcClient", { enumerable: true, get: function () { return HttpRpcClient_1.HttpRpcClient; } });
|
|
23
|
+
var networks_1 = require("./networks");
|
|
24
|
+
Object.defineProperty(exports, "AA_NETWORKS", { enumerable: true, get: function () { return networks_1.AA_NETWORKS; } });
|
|
25
|
+
var PaymasterAPI_1 = require("./PaymasterAPI");
|
|
26
|
+
Object.defineProperty(exports, "PaymasterAPI", { enumerable: true, get: function () { return PaymasterAPI_1.PaymasterAPI; } });
|
|
27
|
+
var Permit2_1 = require("./Permit2");
|
|
28
|
+
Object.defineProperty(exports, "buildPermitMessage", { enumerable: true, get: function () { return Permit2_1.buildPermitMessage; } });
|
|
29
|
+
Object.defineProperty(exports, "packPermitData", { enumerable: true, get: function () { return Permit2_1.packPermitData; } });
|
|
30
|
+
Object.defineProperty(exports, "packPermitPaymasterData", { enumerable: true, get: function () { return Permit2_1.packPermitPaymasterData; } });
|
|
31
|
+
var PermitFlow_1 = require("./PermitFlow");
|
|
32
|
+
Object.defineProperty(exports, "buildSignedUserOpWithPermit", { enumerable: true, get: function () { return PermitFlow_1.buildSignedUserOpWithPermit; } });
|
|
33
|
+
Object.defineProperty(exports, "buildSignedUserOpWithPermitTonConnect", { enumerable: true, get: function () { return PermitFlow_1.buildSignedUserOpWithPermitTonConnect; } });
|
|
34
|
+
var signer_1 = require("./signer");
|
|
35
|
+
Object.defineProperty(exports, "aaSignerFromMnemonic", { enumerable: true, get: function () { return signer_1.aaSignerFromMnemonic; } });
|
|
36
|
+
var TacAccountAPI_1 = require("./TacAccountAPI");
|
|
37
|
+
Object.defineProperty(exports, "TacAccountAPI", { enumerable: true, get: function () { return TacAccountAPI_1.TacAccountAPI; } });
|
|
38
|
+
var TacAccountSdk_1 = require("./TacAccountSdk");
|
|
39
|
+
Object.defineProperty(exports, "TacAccountSdk", { enumerable: true, get: function () { return TacAccountSdk_1.TacAccountSdk; } });
|
|
40
|
+
var TacERC20PaymasterAPI_1 = require("./TacERC20PaymasterAPI");
|
|
41
|
+
Object.defineProperty(exports, "packModeByte", { enumerable: true, get: function () { return TacERC20PaymasterAPI_1.packModeByte; } });
|
|
42
|
+
Object.defineProperty(exports, "packPaymasterAndData", { enumerable: true, get: function () { return TacERC20PaymasterAPI_1.packPaymasterAndData; } });
|
|
43
|
+
Object.defineProperty(exports, "TacERC20PaymasterAPI", { enumerable: true, get: function () { return TacERC20PaymasterAPI_1.TacERC20PaymasterAPI; } });
|
|
44
|
+
Object.defineProperty(exports, "TacPaymasterMode", { enumerable: true, get: function () { return TacERC20PaymasterAPI_1.TacPaymasterMode; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IEntryPointABI: readonly ["function getUserOpHash((address sender,uint256 nonce,bytes initCode,bytes callData,bytes32 accountGasLimits,uint256 preVerificationGas,bytes32 gasFees,bytes paymasterAndData,bytes signature) userOp) view returns (bytes32)", "function getSenderAddress(bytes initCode)", "error SenderAddressResult(address sender)", "function senderCreator() view returns (address)", "function getNonce(address sender, uint192 key) view returns (uint256)", "event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed)"];
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Minimal human-readable ABI for the ERC-4337 v0.8 EntryPoint — only the surface
|
|
3
|
+
// the account APIs use: on-chain userOpHash, counterfactual-address probing, and
|
|
4
|
+
// the UserOperationEvent. Vendored so this module needs no @account-abstraction dep.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.IEntryPointABI = void 0;
|
|
7
|
+
exports.IEntryPointABI = [
|
|
8
|
+
// off-chain-matching userOpHash (avoids re-implementing EIP-712 packing in the SDK)
|
|
9
|
+
'function getUserOpHash((address sender,uint256 nonce,bytes initCode,bytes callData,bytes32 accountGasLimits,uint256 preVerificationGas,bytes32 gasFees,bytes paymasterAndData,bytes signature) userOp) view returns (bytes32)',
|
|
10
|
+
// reverts with SenderAddressResult(sender) — used to derive an undeployed account address
|
|
11
|
+
'function getSenderAddress(bytes initCode)',
|
|
12
|
+
'error SenderAddressResult(address sender)',
|
|
13
|
+
'function senderCreator() view returns (address)',
|
|
14
|
+
'function getNonce(address sender, uint192 key) view returns (uint256)',
|
|
15
|
+
'event UserOperationEvent(bytes32 indexed userOpHash, address indexed sender, address indexed paymaster, uint256 nonce, bool success, uint256 actualGasCost, uint256 actualGasUsed)',
|
|
16
|
+
];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { BigNumberish, BytesLike } from 'ethers';
|
|
2
|
+
/** Unpacked UserOperation as the SDK/bundler exchange it (paymaster fields split out). */
|
|
3
|
+
export interface UserOperation {
|
|
4
|
+
sender: string;
|
|
5
|
+
nonce: BigNumberish;
|
|
6
|
+
factory?: string;
|
|
7
|
+
factoryData?: BytesLike;
|
|
8
|
+
callData: BytesLike;
|
|
9
|
+
callGasLimit: BigNumberish;
|
|
10
|
+
verificationGasLimit: BigNumberish;
|
|
11
|
+
preVerificationGas: BigNumberish;
|
|
12
|
+
maxFeePerGas: BigNumberish;
|
|
13
|
+
maxPriorityFeePerGas: BigNumberish;
|
|
14
|
+
paymaster?: string;
|
|
15
|
+
paymasterData?: BytesLike;
|
|
16
|
+
paymasterVerificationGasLimit?: BigNumberish;
|
|
17
|
+
paymasterPostOpGasLimit?: BigNumberish;
|
|
18
|
+
signature: BytesLike;
|
|
19
|
+
authorizationList?: unknown[];
|
|
20
|
+
}
|
|
21
|
+
/** The on-chain PackedUserOperation tuple shape (what EntryPoint.getUserOpHash consumes). */
|
|
22
|
+
export interface PackedUserOperation {
|
|
23
|
+
sender: string;
|
|
24
|
+
nonce: string;
|
|
25
|
+
initCode: string;
|
|
26
|
+
callData: string;
|
|
27
|
+
accountGasLimits: string;
|
|
28
|
+
preVerificationGas: string;
|
|
29
|
+
gasFees: string;
|
|
30
|
+
paymasterAndData: string;
|
|
31
|
+
signature: string;
|
|
32
|
+
}
|
|
33
|
+
/** initCode split, as returned by an account API for an undeployed account. */
|
|
34
|
+
export interface FactoryParams {
|
|
35
|
+
factory: string;
|
|
36
|
+
factoryData?: BytesLike;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Coerce a bytes-like field to a hex string, treating '' / null / undefined as '0x'.
|
|
40
|
+
* `createUnsignedUserOp` returns an unsigned op with `signature: ''`, and ethers'
|
|
41
|
+
* `hexlify('')` throws — so a plain `?? '0x'` (only catches null/undefined) is not enough.
|
|
42
|
+
*/
|
|
43
|
+
export declare function toHexBytes(v: BytesLike | null | undefined): string;
|
|
44
|
+
/** Pack two 128-bit values into a single bytes32 (high128 << 128 | low128). */
|
|
45
|
+
export declare function packUint(high128: BigNumberish, low128: BigNumberish): string;
|
|
46
|
+
/** Pack the paymaster fields into the on-chain `paymasterAndData` bytes. */
|
|
47
|
+
export declare function packPaymasterData(paymaster: string, paymasterVerificationGasLimit: BigNumberish, postOpGasLimit: BigNumberish, paymasterData?: BytesLike): string;
|
|
48
|
+
/** Pack an unpacked UserOperation into the on-chain PackedUserOperation tuple. */
|
|
49
|
+
export declare function packUserOp(op: UserOperation): PackedUserOperation;
|
|
50
|
+
/**
|
|
51
|
+
* Recursively hex-encode a value for JSON-RPC: numeric values become minimal hex
|
|
52
|
+
* quantities, byte arrays become hex strings, everything else is passed through.
|
|
53
|
+
*/
|
|
54
|
+
export declare function deepHexlify(obj: unknown): unknown;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Self-contained ERC-4337 v0.8 UserOperation types + packing helpers, ported to
|
|
3
|
+
// ethers v6. Vendored from @account-abstraction/utils (which is ethers v5 and
|
|
4
|
+
// unpublished) so the accountAbstraction module has no external AA dependency.
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.toHexBytes = toHexBytes;
|
|
7
|
+
exports.packUint = packUint;
|
|
8
|
+
exports.packPaymasterData = packPaymasterData;
|
|
9
|
+
exports.packUserOp = packUserOp;
|
|
10
|
+
exports.deepHexlify = deepHexlify;
|
|
11
|
+
const ethers_1 = require("ethers");
|
|
12
|
+
/**
|
|
13
|
+
* Coerce a bytes-like field to a hex string, treating '' / null / undefined as '0x'.
|
|
14
|
+
* `createUnsignedUserOp` returns an unsigned op with `signature: ''`, and ethers'
|
|
15
|
+
* `hexlify('')` throws — so a plain `?? '0x'` (only catches null/undefined) is not enough.
|
|
16
|
+
*/
|
|
17
|
+
function toHexBytes(v) {
|
|
18
|
+
return v == null || v === '' ? '0x' : (0, ethers_1.hexlify)(v);
|
|
19
|
+
}
|
|
20
|
+
/** Pack two 128-bit values into a single bytes32 (high128 << 128 | low128). */
|
|
21
|
+
function packUint(high128, low128) {
|
|
22
|
+
return (0, ethers_1.zeroPadValue)((0, ethers_1.toBeHex)(((0, ethers_1.toBigInt)(high128) << 128n) + (0, ethers_1.toBigInt)(low128)), 32);
|
|
23
|
+
}
|
|
24
|
+
/** Pack the paymaster fields into the on-chain `paymasterAndData` bytes. */
|
|
25
|
+
function packPaymasterData(paymaster, paymasterVerificationGasLimit, postOpGasLimit, paymasterData) {
|
|
26
|
+
return (0, ethers_1.concat)([paymaster, packUint(paymasterVerificationGasLimit, postOpGasLimit), toHexBytes(paymasterData)]);
|
|
27
|
+
}
|
|
28
|
+
/** Pack an unpacked UserOperation into the on-chain PackedUserOperation tuple. */
|
|
29
|
+
function packUserOp(op) {
|
|
30
|
+
let paymasterAndData = '0x';
|
|
31
|
+
if (op.paymaster != null) {
|
|
32
|
+
if (op.paymasterVerificationGasLimit == null || op.paymasterPostOpGasLimit == null) {
|
|
33
|
+
throw new Error('paymaster with no gas limits');
|
|
34
|
+
}
|
|
35
|
+
paymasterAndData = packPaymasterData(op.paymaster, op.paymasterVerificationGasLimit, op.paymasterPostOpGasLimit, op.paymasterData);
|
|
36
|
+
}
|
|
37
|
+
const initCode = op.factory == null ? '0x' : (0, ethers_1.concat)([op.factory, toHexBytes(op.factoryData)]);
|
|
38
|
+
return {
|
|
39
|
+
sender: op.sender,
|
|
40
|
+
nonce: (0, ethers_1.toBeHex)((0, ethers_1.toBigInt)(op.nonce)),
|
|
41
|
+
initCode,
|
|
42
|
+
callData: toHexBytes(op.callData),
|
|
43
|
+
accountGasLimits: packUint(op.verificationGasLimit, op.callGasLimit),
|
|
44
|
+
preVerificationGas: (0, ethers_1.toBeHex)((0, ethers_1.toBigInt)(op.preVerificationGas)),
|
|
45
|
+
gasFees: packUint(op.maxPriorityFeePerGas, op.maxFeePerGas),
|
|
46
|
+
paymasterAndData,
|
|
47
|
+
signature: toHexBytes(op.signature),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Recursively hex-encode a value for JSON-RPC: numeric values become minimal hex
|
|
52
|
+
* quantities, byte arrays become hex strings, everything else is passed through.
|
|
53
|
+
*/
|
|
54
|
+
function deepHexlify(obj) {
|
|
55
|
+
if (typeof obj === 'function') {
|
|
56
|
+
return undefined;
|
|
57
|
+
}
|
|
58
|
+
if (obj == null || typeof obj === 'string' || typeof obj === 'boolean') {
|
|
59
|
+
return obj;
|
|
60
|
+
}
|
|
61
|
+
if (typeof obj === 'bigint' || typeof obj === 'number') {
|
|
62
|
+
return (0, ethers_1.toQuantity)(obj);
|
|
63
|
+
}
|
|
64
|
+
if (obj instanceof Uint8Array) {
|
|
65
|
+
return (0, ethers_1.hexlify)(obj);
|
|
66
|
+
}
|
|
67
|
+
if (Array.isArray(obj)) {
|
|
68
|
+
return obj.map((member) => deepHexlify(member));
|
|
69
|
+
}
|
|
70
|
+
const record = obj;
|
|
71
|
+
return Object.keys(record).reduce((set, key) => ({ ...set, [key]: deepHexlify(record[key]) }), {});
|
|
72
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Network } from '../structs/Struct';
|
|
2
|
+
/** AA contract addresses for a network. */
|
|
3
|
+
export interface AaAddresses {
|
|
4
|
+
entryPoint: string;
|
|
5
|
+
accountFactory: string;
|
|
6
|
+
paymaster: string;
|
|
7
|
+
permit2: string;
|
|
8
|
+
}
|
|
9
|
+
/** Built-in AA configuration for a network. */
|
|
10
|
+
export interface AaNetworkConfig extends AaAddresses {
|
|
11
|
+
chainId: number;
|
|
12
|
+
/**
|
|
13
|
+
* Bundler RPC URL. Intentionally left undefined in the built-in defaults — there is no
|
|
14
|
+
* public bundler endpoint to ship, so pass `bundlerUrl` to {@link TacAccountSdk.create}.
|
|
15
|
+
*/
|
|
16
|
+
bundlerUrl?: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Built-in per-network AA defaults. TESTNET is SPB (chainId 2391) — the same chain
|
|
20
|
+
* tac-sdk's TESTNET resolves to. MAINNET is not deployed yet.
|
|
21
|
+
*/
|
|
22
|
+
export declare const AA_NETWORKS: Partial<Record<Network, AaNetworkConfig>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AA_NETWORKS = void 0;
|
|
4
|
+
const Struct_1 = require("../structs/Struct");
|
|
5
|
+
/**
|
|
6
|
+
* Built-in per-network AA defaults. TESTNET is SPB (chainId 2391) — the same chain
|
|
7
|
+
* tac-sdk's TESTNET resolves to. MAINNET is not deployed yet.
|
|
8
|
+
*/
|
|
9
|
+
exports.AA_NETWORKS = {
|
|
10
|
+
[Struct_1.Network.TESTNET]: {
|
|
11
|
+
chainId: 2391,
|
|
12
|
+
entryPoint: '0x239DBD98defbad1c369034a2897bD5b8b57b468A',
|
|
13
|
+
accountFactory: '0x7879c3237811A86092E89AD94837163Ae71d6669',
|
|
14
|
+
// paymaster for token USD₮ (0xbA7E…9220, 6-dec); the fee token is read on-chain
|
|
15
|
+
paymaster: '0xD41B5AC8803bd9371c0bdB44CB95B8b1879F8865',
|
|
16
|
+
permit2: '0x36d6565DcdE4674115bBd1d86E511bebB1C425b9',
|
|
17
|
+
// bundlerUrl: undefined — provide it via TacAccountSdk.create({ bundlerUrl })
|
|
18
|
+
},
|
|
19
|
+
// MAINNET: account abstraction not deployed yet
|
|
20
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Ed25519Signer } from './Ed25519';
|
|
2
|
+
export interface AaSignerResult {
|
|
3
|
+
/** Ed25519 public key as 32-byte 0x-hex — the AA account is derived from this. */
|
|
4
|
+
publicKey: string;
|
|
5
|
+
/** Signer that produces `(r, s)` over a 32-byte message. */
|
|
6
|
+
signer: Ed25519Signer;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Build an AA signer + public key from a TON mnemonic, using the same key derivation as
|
|
10
|
+
* `SenderFactory` (`mnemonicToWalletKey`, which equals `mnemonicToPrivateKey`).
|
|
11
|
+
*/
|
|
12
|
+
export declare function aaSignerFromMnemonic(mnemonic: string): Promise<AaSignerResult>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.aaSignerFromMnemonic = aaSignerFromMnemonic;
|
|
4
|
+
const ton_crypto_1 = require("ton-crypto");
|
|
5
|
+
const Ed25519_1 = require("./Ed25519");
|
|
6
|
+
/**
|
|
7
|
+
* Build an AA signer + public key from a TON mnemonic, using the same key derivation as
|
|
8
|
+
* `SenderFactory` (`mnemonicToWalletKey`, which equals `mnemonicToPrivateKey`).
|
|
9
|
+
*/
|
|
10
|
+
async function aaSignerFromMnemonic(mnemonic) {
|
|
11
|
+
const keypair = await (0, ton_crypto_1.mnemonicToWalletKey)(mnemonic.trim().split(/\s+/));
|
|
12
|
+
const signer = (0, Ed25519_1.ed25519SignerFromSecretKey)(keypair.secretKey, (message, secretKey) => (0, ton_crypto_1.sign)(Buffer.from(message), Buffer.from(secretKey)));
|
|
13
|
+
return { publicKey: '0x' + keypair.publicKey.toString('hex'), signer };
|
|
14
|
+
}
|
|
@@ -47,7 +47,18 @@ class LiteClientOpener extends BaseContractOpener_1.BaseContractOpener {
|
|
|
47
47
|
return new LiteClientOpener(client, engine, logger, engines);
|
|
48
48
|
}
|
|
49
49
|
open(contract) {
|
|
50
|
-
return
|
|
50
|
+
return (0, ton_1.openContract)(contract, ({ address, init }) => ({
|
|
51
|
+
...this.client.provider(address, init),
|
|
52
|
+
open: (src) => this.open(src),
|
|
53
|
+
get: async (name, args) => {
|
|
54
|
+
const block = await this.client.getMasterchainInfo();
|
|
55
|
+
const result = await this.client.runMethod(address, name.toString(), (0, ton_1.serializeTuple)(args).toBoc({ idx: false, crc32: false }), block.last);
|
|
56
|
+
if (result.exitCode !== 0 && result.exitCode !== 1) {
|
|
57
|
+
throw new ton_1.ComputeError(`Exit code: ${result.exitCode}`, result.exitCode);
|
|
58
|
+
}
|
|
59
|
+
return { stack: new ton_1.TupleReader(result.result ? (0, ton_1.parseTuple)(ton_1.Cell.fromBase64(result.result)) : []) };
|
|
60
|
+
},
|
|
61
|
+
}));
|
|
51
62
|
}
|
|
52
63
|
disableReconnect(singleEngine) {
|
|
53
64
|
const engine = singleEngine;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Blockchain, SandboxContract } from '@ton/sandbox';
|
|
1
|
+
import type { Blockchain, SandboxContract } from '@ton/sandbox';
|
|
2
2
|
import { Address, Contract, Transaction } from '@ton/ton';
|
|
3
3
|
import { ContractOpener } from '../interfaces';
|
|
4
4
|
import { AddressInformation, ContractState } from '../structs/Struct';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SandboxOpener = void 0;
|
|
4
4
|
exports.sandboxOpener = sandboxOpener;
|
|
5
|
+
const ton_1 = require("@ton/ton");
|
|
5
6
|
const BaseContractOpener_1 = require("./BaseContractOpener");
|
|
6
7
|
class SandboxOpener extends BaseContractOpener_1.BaseContractOpener {
|
|
7
8
|
constructor(blockchain) {
|
|
@@ -9,7 +10,25 @@ class SandboxOpener extends BaseContractOpener_1.BaseContractOpener {
|
|
|
9
10
|
this.blockchain = blockchain;
|
|
10
11
|
}
|
|
11
12
|
open(contract) {
|
|
12
|
-
return this.blockchain.openContract(contract)
|
|
13
|
+
return new Proxy(this.blockchain.openContract(contract), {
|
|
14
|
+
get: (target, prop) => {
|
|
15
|
+
const value = Reflect.get(target, prop);
|
|
16
|
+
if (typeof prop !== 'string' || !prop.startsWith('get') || typeof value !== 'function')
|
|
17
|
+
return value;
|
|
18
|
+
return (...args) => {
|
|
19
|
+
const result = value.apply(target, args);
|
|
20
|
+
if (!(result instanceof Promise))
|
|
21
|
+
return result;
|
|
22
|
+
return result.catch((error) => {
|
|
23
|
+
if (error instanceof Error && 'exitCode' in error && typeof error.exitCode === 'number') {
|
|
24
|
+
const { vmLogs, debugLogs } = error;
|
|
25
|
+
throw new ton_1.ComputeError(error.message, error.exitCode, { logs: vmLogs, debugLogs });
|
|
26
|
+
}
|
|
27
|
+
throw error;
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
});
|
|
13
32
|
}
|
|
14
33
|
async getContractState(address) {
|
|
15
34
|
const state = await this.blockchain.provider(address).getState();
|
|
@@ -21,7 +21,21 @@ class TonClient4Opener extends BaseContractOpener_1.BaseContractOpener {
|
|
|
21
21
|
return new TonClient4Opener(client4, logger);
|
|
22
22
|
}
|
|
23
23
|
open(contract) {
|
|
24
|
-
return
|
|
24
|
+
return (0, ton_1.openContract)(contract, ({ address, init }) => ({
|
|
25
|
+
...this.client4.provider(address, init),
|
|
26
|
+
open: (src) => this.open(src),
|
|
27
|
+
get: async (name, args) => {
|
|
28
|
+
if (typeof name !== 'string') {
|
|
29
|
+
throw new Error('Method name must be a string for TonClient4 provider');
|
|
30
|
+
}
|
|
31
|
+
const block = await this.client4.getLastBlock();
|
|
32
|
+
const result = await this.client4.runMethod(block.last.seqno, address, name, args);
|
|
33
|
+
if (result.exitCode !== 0 && result.exitCode !== 1) {
|
|
34
|
+
throw new ton_1.ComputeError(`Exit code: ${result.exitCode}`, result.exitCode);
|
|
35
|
+
}
|
|
36
|
+
return { stack: result.reader };
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
25
39
|
}
|
|
26
40
|
async getContractState(address) {
|
|
27
41
|
const latestBlock = await this.client4.getLastBlock();
|
|
@@ -24,7 +24,20 @@ class TonClientOpener extends BaseContractOpener_1.BaseContractOpener {
|
|
|
24
24
|
return new TonClientOpener(client, logger);
|
|
25
25
|
}
|
|
26
26
|
open(contract) {
|
|
27
|
-
return
|
|
27
|
+
return (0, ton_1.openContract)(contract, ({ address, init }) => ({
|
|
28
|
+
...this.client.provider(address, init),
|
|
29
|
+
open: (src) => this.open(src),
|
|
30
|
+
get: async (name, args) => {
|
|
31
|
+
if (typeof name !== 'string') {
|
|
32
|
+
throw new Error('Method name must be a string for TonClient provider');
|
|
33
|
+
}
|
|
34
|
+
const result = await this.client.runMethodWithError(address, name, args);
|
|
35
|
+
if (result.exit_code !== 0 && result.exit_code !== 1) {
|
|
36
|
+
throw new ton_1.ComputeError(`Unable to execute get method. Got exit_code: ${result.exit_code}`, result.exit_code);
|
|
37
|
+
}
|
|
38
|
+
return { stack: result.stack };
|
|
39
|
+
},
|
|
40
|
+
}));
|
|
28
41
|
}
|
|
29
42
|
async getContractState(address) {
|
|
30
43
|
return this.client.getContractState(address);
|
package/dist/src/assets/FT.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { Cell, OpenedContract } from '@ton/ton';
|
|
|
3
3
|
import { JettonMinterData, JettonWallet } from '../../artifacts/tonTypes';
|
|
4
4
|
import { Asset, IConfiguration } from '../interfaces';
|
|
5
5
|
import { AssetOpType } from '../structs/InternalStruct';
|
|
6
|
-
import { AssetFeeMode, AssetType, BlockchainType, EVMAddress, FeeParams, FTOriginAndData, Origin, TVMAddress, UserWalletBalanceExtended } from '../structs/Struct';
|
|
6
|
+
import { AssetFeeMode, AssetType, BlockchainType, ContractState, EVMAddress, FeeParams, FTOriginAndData, Origin, TVMAddress, UserWalletBalanceExtended } from '../structs/Struct';
|
|
7
7
|
export declare class FT implements Asset {
|
|
8
8
|
private _tvmAddress;
|
|
9
9
|
readonly type: AssetType;
|
|
@@ -16,13 +16,14 @@ export declare class FT implements Asset {
|
|
|
16
16
|
private _evmAddress?;
|
|
17
17
|
private _displayMultiplierNumerator;
|
|
18
18
|
private _displayMultiplierDenominator;
|
|
19
|
+
private _hasDisplayMultiplier?;
|
|
19
20
|
private _displayMultiplierFetchedAt;
|
|
20
21
|
private _displayMultiplierCacheDuration;
|
|
21
22
|
get address(): string;
|
|
22
23
|
static getJettonData(configuration: IConfiguration, address: TVMAddress): Promise<JettonMinterData>;
|
|
23
24
|
getJettonData(): Promise<JettonMinterData>;
|
|
24
25
|
static getOrigin(configuration: IConfiguration, address: TVMAddress): Promise<Origin>;
|
|
25
|
-
static getOriginAndData(configuration: IConfiguration, address: TVMAddress): Promise<FTOriginAndData>;
|
|
26
|
+
static getOriginAndData(configuration: IConfiguration, address: TVMAddress, contractState?: ContractState): Promise<FTOriginAndData>;
|
|
26
27
|
static getTVMAddress(configuration: IConfiguration, address: EVMAddress): Promise<string>;
|
|
27
28
|
static getEVMAddress(configuration: IConfiguration, address: TVMAddress): Promise<string>;
|
|
28
29
|
private constructor();
|
|
@@ -36,6 +37,7 @@ export declare class FT implements Asset {
|
|
|
36
37
|
addAmount(amount: number): FT;
|
|
37
38
|
addRawAmount(rawAmount: bigint): FT;
|
|
38
39
|
getDecimals(): Promise<number>;
|
|
40
|
+
private getDisplayMultiplier;
|
|
39
41
|
refreshDisplayMultiplier(): Promise<void>;
|
|
40
42
|
private ensureFreshDisplayMultiplier;
|
|
41
43
|
setDisplayMultiplierCacheDuration(durationMs: number): void;
|
package/dist/src/assets/FT.js
CHANGED
|
@@ -26,9 +26,9 @@ class FT {
|
|
|
26
26
|
const result = await this.getOriginAndData(configuration, address);
|
|
27
27
|
return result.origin;
|
|
28
28
|
}
|
|
29
|
-
static async getOriginAndData(configuration, address) {
|
|
29
|
+
static async getOriginAndData(configuration, address, contractState) {
|
|
30
30
|
const { jettonMinterCode, crossChainLayerAddress, jettonWalletCode } = configuration.TONParams;
|
|
31
|
-
const { code: thisCodeBOC } = await configuration.TONParams.contractOpener.getContractState(ton_1.Address.parse(address));
|
|
31
|
+
const { code: thisCodeBOC } = contractState ?? (await configuration.TONParams.contractOpener.getContractState(ton_1.Address.parse(address)));
|
|
32
32
|
if (!thisCodeBOC) {
|
|
33
33
|
throw errors_1.emptyContractError;
|
|
34
34
|
}
|
|
@@ -123,7 +123,8 @@ class FT {
|
|
|
123
123
|
}
|
|
124
124
|
static async fromAddress(configuration, address) {
|
|
125
125
|
const tvmAddress = (0, ethers_1.isAddress)(address) ? await this.getTVMAddress(configuration, address) : address;
|
|
126
|
-
const
|
|
126
|
+
const contractState = await configuration.TONParams.contractOpener.getContractState(ton_1.Address.parse(tvmAddress));
|
|
127
|
+
const { origin, jettonMinter, evmAddress: cachedEvmAddress, jettonData, } = await this.getOriginAndData(configuration, tvmAddress, contractState).catch((e) => {
|
|
127
128
|
if (e instanceof errors_1.ContractError) {
|
|
128
129
|
const jettonMinter = configuration.TONParams.contractOpener.open(configuration.artifacts.ton.wrappers.JettonMinter.createFromAddress(ton_1.Address.parse(tvmAddress)));
|
|
129
130
|
return { origin: Struct_1.Origin.TAC, jettonMinter, evmAddress: undefined, jettonData: undefined };
|
|
@@ -156,7 +157,9 @@ class FT {
|
|
|
156
157
|
token._evmAddress = finalEvmAddress || address;
|
|
157
158
|
}
|
|
158
159
|
// Fetch and cache display multiplier for TEP-526 support
|
|
159
|
-
|
|
160
|
+
if (contractState.state !== 'uninitialized') {
|
|
161
|
+
await token.refreshDisplayMultiplier();
|
|
162
|
+
}
|
|
160
163
|
return token;
|
|
161
164
|
}
|
|
162
165
|
get rawAmount() {
|
|
@@ -168,6 +171,7 @@ class FT {
|
|
|
168
171
|
ft._evmAddress = this._evmAddress;
|
|
169
172
|
ft._displayMultiplierNumerator = this._displayMultiplierNumerator;
|
|
170
173
|
ft._displayMultiplierDenominator = this._displayMultiplierDenominator;
|
|
174
|
+
ft._hasDisplayMultiplier = this._hasDisplayMultiplier;
|
|
171
175
|
ft._displayMultiplierFetchedAt = this._displayMultiplierFetchedAt;
|
|
172
176
|
ft._displayMultiplierCacheDuration = this._displayMultiplierCacheDuration;
|
|
173
177
|
return ft;
|
|
@@ -205,18 +209,27 @@ class FT {
|
|
|
205
209
|
async getDecimals() {
|
|
206
210
|
return this._decimals;
|
|
207
211
|
}
|
|
208
|
-
async
|
|
212
|
+
async getDisplayMultiplier() {
|
|
209
213
|
try {
|
|
210
214
|
const multiplier = await this._jettonMinter.getDisplayMultiplier();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
215
|
+
return { hasDisplayMultiplier: true, ...multiplier };
|
|
216
|
+
}
|
|
217
|
+
catch (error) {
|
|
218
|
+
if (this._hasDisplayMultiplier || !(error instanceof ton_1.ComputeError) || error.exitCode !== 11) {
|
|
219
|
+
throw error;
|
|
220
|
+
}
|
|
221
|
+
return { hasDisplayMultiplier: false, numerator: 1n, denominator: 1n };
|
|
214
222
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
223
|
+
}
|
|
224
|
+
async refreshDisplayMultiplier() {
|
|
225
|
+
if (this._hasDisplayMultiplier === false) {
|
|
226
|
+
return;
|
|
219
227
|
}
|
|
228
|
+
const multiplier = await this.getDisplayMultiplier();
|
|
229
|
+
this._hasDisplayMultiplier = multiplier.hasDisplayMultiplier;
|
|
230
|
+
this._displayMultiplierNumerator = multiplier.numerator;
|
|
231
|
+
this._displayMultiplierDenominator = multiplier.denominator;
|
|
232
|
+
this._displayMultiplierFetchedAt = Date.now();
|
|
220
233
|
}
|
|
221
234
|
async ensureFreshDisplayMultiplier() {
|
|
222
235
|
const age = Date.now() - this._displayMultiplierFetchedAt;
|
|
@@ -285,11 +298,11 @@ class FT {
|
|
|
285
298
|
return BigInt(await wallet.getJettonBalance());
|
|
286
299
|
}
|
|
287
300
|
async getUserBalanceExtended(userAddress) {
|
|
288
|
-
await this.ensureFreshDisplayMultiplier();
|
|
289
301
|
const masterState = await this._configuration.TONParams.contractOpener.getContractState(this._tvmAddress);
|
|
290
302
|
if (masterState.state !== 'active') {
|
|
291
303
|
return { exists: false };
|
|
292
304
|
}
|
|
305
|
+
await this.ensureFreshDisplayMultiplier();
|
|
293
306
|
const wallet = await this.getWallet(userAddress);
|
|
294
307
|
const rawAmount = await wallet.getJettonBalance();
|
|
295
308
|
const decimals = await this.getDecimals();
|
package/dist/src/index.d.ts
CHANGED
package/dist/src/index.js
CHANGED
|
@@ -37,6 +37,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.TonTxFinalizer = exports.TONTransactionManager = exports.TACTransactionManager = exports.TacSdk = exports.TacExplorerClient = exports.Simulator = exports.OperationTracker = exports.NoopLogger = exports.ConsoleLogger = exports.LiteSequencerClient = exports.Configuration = exports.AxiosHttpClient = exports.getArtifacts = exports.AgnosticStructs = exports.AgnosticProxySDK = void 0;
|
|
40
|
+
__exportStar(require("./accountAbstraction"), exports);
|
|
40
41
|
__exportStar(require("./adapters"), exports);
|
|
41
42
|
var AgnosticSdk_1 = require("./agnosticSdk/AgnosticSdk");
|
|
42
43
|
Object.defineProperty(exports, "AgnosticProxySDK", { enumerable: true, get: function () { return AgnosticSdk_1.AgnosticProxySDK; } });
|
|
@@ -5,6 +5,7 @@ import { ILogger } from './ILogger';
|
|
|
5
5
|
export interface ContractOpener {
|
|
6
6
|
/**
|
|
7
7
|
* Opens a contract for interaction using the underlying client (lite client, sandbox, etc.).
|
|
8
|
+
* Getter VM failures must throw ComputeError from @ton/ton; transport errors must propagate unchanged.
|
|
8
9
|
* @param src Contract source instance to open.
|
|
9
10
|
* @returns Opened contract ready for method calls and sending messages.
|
|
10
11
|
*/
|
|
@@ -78,7 +78,7 @@ class BatchSender {
|
|
|
78
78
|
let validGroupFound = false;
|
|
79
79
|
while (groupSize > 0) {
|
|
80
80
|
const group = messages.slice(left, left + groupSize);
|
|
81
|
-
const createdAt =
|
|
81
|
+
const createdAt = HighloadWalletV3_1.HighloadWalletV3.generateCreatedAt();
|
|
82
82
|
const queryId = this.wallet.getQueryIdFromCreatedAt(createdAt);
|
|
83
83
|
const externalMsg = this.wallet.getExternalMessage(group, ton_1.SendMode.PAY_GAS_SEPARATELY, 0n, queryId);
|
|
84
84
|
const isBocSizeValid = externalMsg.body.toBoc().length <= Consts_1.MAX_EXT_MSG_SIZE;
|
|
@@ -106,6 +106,7 @@ class BatchSender {
|
|
|
106
106
|
if (createdAt <= this.lastCreatedAt) {
|
|
107
107
|
createdAt = this.lastCreatedAt + 1; // to prevent error::already_executed on highload wallet
|
|
108
108
|
}
|
|
109
|
+
createdAt = HighloadWalletV3_1.HighloadWalletV3.normalizeCreatedAt(createdAt);
|
|
109
110
|
this.lastCreatedAt = createdAt;
|
|
110
111
|
return walletContract.sendTransfer({
|
|
111
112
|
secretKey: this.secretKey,
|
|
@@ -31,6 +31,11 @@ export declare enum AssetOpType {
|
|
|
31
31
|
NFT_BURN = "NFT_BURN",
|
|
32
32
|
NFT_TRANSFER = "NFT_TRANSFER"
|
|
33
33
|
}
|
|
34
|
+
export type DisplayMultiplier = {
|
|
35
|
+
hasDisplayMultiplier: boolean;
|
|
36
|
+
numerator: bigint;
|
|
37
|
+
denominator: bigint;
|
|
38
|
+
};
|
|
34
39
|
export type RandomNumberByTimestamp = {
|
|
35
40
|
timestamp: number;
|
|
36
41
|
randomNumber: number;
|